Download Itufy Documentation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Itufy Documentation
Release 1.0
Team Name
December 17, 2014
Contents
1
2
User Guide
1.1 Parts Implemented by Garbi Özyıldız
1.2 Parts Implemented by Tuğçe Bilen . .
1.3 Parts Implemented by Gülnur Şafak .
1.4 Parts Implemented by Esin Ersoğan .
1.5 Parts Implemented by Eyüp Atiş . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
5
8
11
11
Developer Guide
2.1 Improving and Running Environment
2.2 Work Share . . . . . . . . . . . . . .
2.3 Database Design . . . . . . . . . . .
2.4 Code . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
13
13
13
14
14
i
ii
Itufy Documentation, Release 1.0
Team 1403
Members
• Esin Ersoğan
• Eyüp Atiş
• Garbi Özyıldız
• Tuğçe Bilen
• Gülnur Şafak
General Information about ITUFY project
Itufy is a web application system. It provide a listening music, watching video clips and reading news about artists
environment. The project which consist of two parts include in user’s interface page and admin panel page. User
part of the project can listened songs by users. This part includes in a lot of pages such as category page, artist
page, album page, playlist page and users own favorite song page. They can play songs in these pages.Users can
listen songs with spotify widget on the other hand, they wants to can watch video clips from youtube widget.
Photo page show the album and artist photos.User that is accessed to new page can read current magazine news.
The other part is admin panel which can be accessed by just admin. Basically, admin part contents of the site will
be controller over there.
.
Contents:
Contents
1
Itufy Documentation, Release 1.0
2
Contents
CHAPTER 1
User Guide
Itufy is a web application system. It provide a listening music, watching video clips and reading news about
artists environment for people. By this site a person can easily access songs for listening and video for watching
Itufy takes music from spotify music application sistem and takes video clips from youtube. Any one can register
him/her as user in the site
1.1 Parts Implemented by Garbi Özyıldız
1.1.1 Playlist page
You can choose a playlist that attracts your attention,then you will see a list of songs that included by playlist that
you have selected already. You will see information about song on list page. Then you can choose a song then
press its name to listen. Songs are taken from spotify that is an online music application system.
When you press any name of song you will see a page like below:
1.1.2 Video page
You can choose a video that attracts your attention,then you will see youtube widget that will played your video.
These video does not has long size, there are only songs’ clips, not movie or any other types.
Video clips are played by youtube widget such as below.
3
Itufy Documentation, Release 1.0
4
Chapter 1. User Guide
Itufy Documentation, Release 1.0
1.2 Parts Implemented by Tuğçe Bilen
• I implement user side of news, photo and moods class.
• User can take news very in easily and regularly way thanks to news choice.
• User can listen music according to mood thanks to mood choice. For example, user can listen sleepy music
while sleeping.
• User can reach album or songer photos thanks to photo class. New photos are showed.
This is the initial screen of the website. All choices are listed.
Mood Screen:
• From this initial screen, mood is selected. Then mood page is opened.
This is the mood page of the website. In here all moods name are listed. Like focus, sleep, party... Then user
clicked one of the mood. Then below screen will be come.
1.2. Parts Implemented by Tuğçe Bilen
5
Itufy Documentation, Release 1.0
This picture the sleep mood of the mood list. Then user select one of the song, below screen is opened.Song is
started to play. All song are categorized according to the mood. All mood have related songs. For example in
sleep mood, all songs are sleepy type.
News Screen:
• From this initial screen, news is selected. Then news page is opened.
This is the news page of the website. In here all news are listed with month of the news. Then user clicked one of
the news. Then, detail of the news are come.
In this way, user can see all news very regulary and easily way.
Photo Screen:
• From this initial screen, photo is selected. Then photo page is opened.
This is the news page of the website. In here all photos are listed. Photos can be songer or album photos. In
example, we have songer photos. In here, there are no other click choice. Photos are listed only. There aren’t
details of the photos.
6
Chapter 1. User Guide
Itufy Documentation, Release 1.0
1.2. Parts Implemented by Tuğçe Bilen
7
Itufy Documentation, Release 1.0
1.3 Parts Implemented by Gülnur Şafak
The administrative pages which is comprised by Gülnur Şafak
• Song Pages
• Artist Pages
• Favorite Pages
The object classes which is implemented by Gülnur Şafak
• Song
• Artist
• Favorite
Some extra page written by Gülnur Şafak
• Song Form
• User’s favorites page(The list of favorites which are taken by user)
1.3.1 Song Operations
Admin part includes in adding,deleting and updating songs.A screenshot of adding song page is seen below:
• Add Operation
–
According to type of song ,songs can add boh song table and other table such as playlist,
favorite and category.So admin must first TypeID and Typename.When admin want to update song,song information can change by clicking on edit button.A screenshot of updating song page is seen below:
• Update Operation
Song which is wanted to be deleted is selected via checkbox.A screenshot shows this operations as can be seen in
the figure below:
• Delete Operation
1.3.2 Artist Operations
Admin part includes in adding,deleting and updating artists.A screenshot of adding artist page is seen below:
• Add and Delete Operation
8
Chapter 1. User Guide
Itufy Documentation, Release 1.0
1.3. Parts Implemented by Gülnur Şafak
9
Itufy Documentation, Release 1.0
In this page,artist name is added, updated and deleted.Artist information take part in this page.
• Update Operation
—
1.3.3 Favorite Operations
Admin part includes in adding,deleting and updating favorites.A screenshot of adding favorite page is seen below:
• Add and Delete Operation
–
If user wants to insert his/her popular songs, these songs take part in his/her favorite pages. If admin wants to
update information of favorites,he/she click on the name of the favorite that is wanted to be
updated within favorite lists.
• Update Operation
–
1.3.4 Song Form
Song list can click on “Song Lists” link in song panel to see songs that he /she listened and this part is written by
me.
10
Chapter 1. User Guide
Itufy Documentation, Release 1.0
–
In addition to he /she click on the song name of the song lists to access list of information of song and
listen to the song.By using of spotify widget, I provide for listening song.
–
1.3.5 User’s Favorites Page
User can click on ‘Favorite Lists’ link in user panel to see favorite songs which they like.
1.4 Parts Implemented by Esin Ersoğan
1.5 Parts Implemented by Eyüp Atiş
1.4. Parts Implemented by Esin Ersoğan
11
Itufy Documentation, Release 1.0
12
Chapter 1. User Guide
CHAPTER 2
Developer Guide
Project is developed with Java EE IDE (Eclipse / Luna) as IDE and SQLite
as Database Programming Language. We used Wicket Framework for creating html pages and give
data to interface by wicked id. Project run on Apache Tomcat 7. During developing the project all tests
were done on Apache Tomcat 7 server. Connection ,between Java and SQLite database, was made
by JDBC SQLite Driver.We developed whole project with Eclipse and organize all group members
work on project with Eclipse. We use online IBM DevOps Services and Blumex to share codes. The
project can run or developed on any operation system that has Apache Tomcat 7 and SQLite database.
Finally we use CSS technology for interfaces design. Minimum system requirements for running the
Itufy project:
Developing and Running Environment:
• Java Development Kit 7
• Apache Tomcat 7
• SQLite
• CSS
• Apache Wicket 1.6
• Eclipse Luna
• SQLite Manager
• JazzHub, Bluemix
2.1 Improving and Running Environment
Project is developed with SQLite Database Programming Language and JAVA Developing Environment,To create our html pages,we used Wicket Framework.Java and SQLite database connection
was made by JDBC SQLite Driver.We developed project with Eclipse and we use online code share
site JazzHub.Our project can work SQLite works.Finally we use css technology for our interface design.System requriments for running the Information Management System project; Java Development
Kit, SQlite Manager.
2.2 Work Share
Our project group has five members.Our project has two parts.These parts is database design and software design.Our software design consist of page classes, html pages and database object classes.These
page classes comprise of two main parts; one of them is administrative pages and another of them user
pages part.
Work distribution of the administrative pages:
13
Itufy Documentation, Release 1.0
• Eyüp Atiş:Admin Pages,User Pages,Comment Pages
• Gülnur Şafak:Song Pages,Artist Pages,Favorite Pages
• Esin Ersoğan:Album Pages, Category Pages, MostPlayed Pages
• Tuğçe Bilen:Mood Pages,Photo Pages, News Pages
• Garbi Özyıldız:Playlist Pages, Message Pages, Video Pages
2.3 Database Design
2.4 Code
2.4.1 Parts Implemented by Garbi Özyıldız
Generally operation of these objects on Admin side are almost the same. Any admin can change any properties of
playlist,message and video. An admin can add new object or delete exist object.
Classes
PlayListCollectionJDBC
public class PlayListCollectionJDBC implements IPlayListCollection {
PlayListCollectionJDBC is implemented from IPlayListCollection
IPlayListCollection
IPlayListCollection is an interface:
• public interface IPlayListCollection {
– public List<PlayList> getPlayLists();
– public List<Song> getPlayListSongs(PlayList playlist);
– public void addPlayList(PlayList playlist);
– public void deletePlayList(PlayList playlist);
– public void updatePlayList(PlayList playlist);
– public int memberCount();
– public void reset();
• }
IPlayListCollection includes functions’ format that writen in PlayListCollectionJDBC class. These functions’
called from IPlayListCollection class for transportation of data between user or admin interface and database. For
example function that adds a playlist to database:
• public void addPlayList(PlayList playlist) {
• try {
• String query = “INSERT INTO PLAYLIST (NAME) VALUES (?)”;
• PreparedStatement statement = this._db.prepareStatement(query);
• statement.setString(1, playlist.getName());
• statement.executeUpdate();
14
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
• } catch (SQLException e) {
• throw new UnsupportedOperationException(e.getMessage());
• }
• }
By this function admin can add playlist to database from admin page.
Connection to the database is done in PlayListCollectionJDBC class as below:
• private Connection _db;
• public PlayListCollectionJDBC(String dbFilePath) {
• try {
• Class.forName(“org.sqlite.JDBC”);
• } catch (ClassNotFoundException e) {
• throw new UnsupportedOperationException(e.getMessage());
• }
• try {
• String jdbcURL = “jdbc:sqlite:” + dbFilePath;
• this._db = DriverManager.getConnection(jdbcURL);
• } catch (SQLException ex) {
• throw new UnsupportedOperationException(ex.getMessage());
• }
• }
PlayListCollection
This object takes playlists in a list and includes addPlayList, deletePlayList and getPlayLists function for doing
adding,deleting and getting operation on the list.
• public class PlayListCollection {
• private List<PlayList> PlayLists;
• public PlayListCollection() {
• this.PlayLists = new LinkedList<PlayList>();
• }
• public List<PlayList> getPlayLists() {
• return this.PlayLists;
• }
• public void addPlayList(PlayList aPlayList) {
• this.PlayLists.add(aPlayList);
• }
• public void deletePlayList(PlayList aPlayList) {
• this.PlayLists.remove(aPlayList);
• }
• }
2.4. Code
15
Itufy Documentation, Release 1.0
Video and message object
Video and message objects have almost the same classes with playlist classes on admin side to make CRUD
operations on objects.
2.4.2 Parts Implemented by Tuğçe Bilen
• I write mood, news and photo class for project.
• In database, there are 3 tables for these classes. Mood, news and photo tables.
All classes and tables are explained in below: All classes are implemented similar logic.
Mood:
Mood Table • In mood tables, there are 2 attributes. These are mood_name and ıd. Create statement for the mood
in the below.
CREATE TABLE MOOD( ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
MOOD_NAME VARCHAR(40) NOT NULL )
• Id is the integer and autoincrement. Also, it is the primary key.
• Mood_name define the name of the mood. Like sleep, focus. . . etc
• This table is dependent to song table.
• Song table has type_id attribute. İf type_name is mood_name then mood list is included this song.
Mood Class • Mood class consists of: o IMoodCollection.java: public interface IMoodCollection {
public List<Mood> getMood();
public void addMood(Mood mood);
public void deleteMood(Mood mood);
public void updateMood(Mood mood);
public int memberCount();
public void reset();
public List<Song> getMoodSongs(Mood mood);
} In this java file, interface is defined. addmood is used for adding new mood to table. Deletemood is used for
deleting mood from mood table. Updatemood is used for update mood. Member count is used for admin panel.
Reset is used for reseting database. List<Song> is used for song list connection.
o IMoodCollectionJDBC.java public class IMoodCollectionJDBC implements IMoodCollection {
public IMoodCollectionJDBC(String dbFilePath) {
public List<Song> getMoodSongs(Mood mood) {} public List<Mood> getMood() {} public
void addMood(Mood mood) {} public void deleteMood(Mood mood) {} public void updateMood(Mood mood) {} public int memberCount() {} public void reset() {}
} In this java file, jdbc connections are implemented. Also, it is imlepent defined interface. Addmood, deletemood, updatemood, membercount, reset is defined IMoodCollection.java. In here, body of these functions are
implemented. All database connections implemented in this file. getMoodSong is used to take song from song
table. These queries used for database operations.
“SELECT * FROM SONG WHERE ((TYPEID= ?) AND (TYPENAME=’MOOD’))”; “SELECT * FROM MOOD”; “INSERT INTO MOOD (MOOD_NAME) VALUES (?)”; “DELETE
FROM MOOD WHERE (ID = ?)”; “UPDATE MOOD SET MOOD_NAME=? WHERE (ID =
?)”; “CREATE TABLE IF NOT EXISTS MOOD(ID INTEGER PRIMARY KEY AUTOINCREMENT,MOOD_NAME VARCHAR(40) NOT NULL ));”;
o Mood.java public class Mood {
16
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
private int id; private String mood_name; List<Song> songs;
public Mood() {
}
public Mood(int id, String mood_name) { this.id = id; this.mood_name = mood_name;
}
public void setMoodName(String new_name) { this.mood_name = new_name;
}
public void setId(int id) { this.id = id;
}
public String getMoodName() { return this.mood_name;
}
public int getId() { return this.id;
}
public List<Song> getSongs() { return this.songs;
}
} In this java file, attributes and functions of the mood class is implemented. Constructor is defined. All setters
and getters are defined.
o MoodCollection.java
public class MoodCollection {
private List<Mood> mood_list;
public MoodCollection() { this.mood_list = new LinkedList<Mood>();
}
public List<Mood> getMood() { return this.mood_list;
}
public void addMood(Mood mood_list_name) { this.mood_list.add(mood_list_name);
}
public void deleteMood(Mood mood_list_name) { this.mood_list.remove(mood_list_name);
}
} In this java file, mood list is created. Get,add and delete methods are implemented with this list. Elements are
added, deleted or updated in the list.
o MoodDisplayPage.java public class MoodDisplayPage extends AdminBasePage {
Link editLink = new Link(“edit_link”) {} public Mood getMood() {}
}
In this java file, mood adding page is created. Mood_name is taken with getMoodName method. This value
assigned to mood_name variable.
o MoodDisplayPageLink.java public class MoodDisplayPageLink extends Link {
private Mood mood;
public MoodDisplayPageLink(String id, Mood mood) { }
@Override public void onClick() {
2.4. Code
17
Itufy Documentation, Release 1.0
} In this java file, link is created for mooddisplaypage.
o MoodEditForm.java public class MoodEditForm extends Form {
private boolean new_mood;
public MoodEditForm(String id, Mood mood, boolean newMood) { }
@Override public void onSubmit() { }
In this java file, form structure is updated. In onsubmit function, collection is defined. Moods are
updated or added in this collection.
o MoodEditPage.java public class MoodEditPage extends AdminBasePage {
public MoodEditPage(Mood mood) { this.add(new MoodEditForm(“mood_edit”, mood, true));
}
public MoodEditPage(Mood mood, boolean newMood) { this.add(new
Form(“mood_edit”, mood, newMood));
MoodEdit-
}
} In this java file, moodEditPage is extended from adminpage. Mood is added to moodEditForm. MoodEditForm
is called in here.
o MoodForm.java public class MoodForm extends Form {
private List<Mood> selectedMoods;
public MoodForm(String id) {
}
}; moodCheckGroup.add(moodListView);
}
@Override public void onSubmit() {
}
} In this java file, moodForm is created. Firstly, a mood list is created type of List<Mood>. New elements are
added to this list. Then a link is created. Moods are added with this link.
o MoodListPage.java public class MoodListPage extends AdminBasePage {
public MoodListPage() {
MoodForm moodform = new MoodForm(“mood_list_form”); this.add(moodform);
Link addmood = new Link(“addMood”) { @Override public void onClick() {
Mood mood = new Mood();
Page(mood));
this.setResponsePage(new MoodEdit-
}
}; this.add(addmood);
}
In this java file, new MoodForm is defined and mood_list_form is added to this form. New link is created with
addmood. Attributes of this are added to mood with addmood function.
o MoodListPageLink.java public class MoodListPageLink extends Link {
public MoodListPageLink(String id) { super(id);
}
@Override public void onClick() {
MoodListPage targetPage = new MoodListPage(); this. setResponsePage(targetPage);
18
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
}
} In this java file, there are constructor for moodlistpage and onclick method. In onclik method, targetpage is
defined type of moodlistpage.Then this target page is send to setRespondPage.
o MoodDisplayPage.html In this html file, mood_name and edit_link are showed at the screen for admin page.
Also, boxes for these attributes are showed.
o MoodEditPage.html In this html file, edit page screen is implemented. Mood_name enter box and save button
are implemented.
o MoodListPage.html In this html file, added moods are listed. name of the moods, songs in the moods, time of
the songs are listed.
Photo:
Photo Table • In photo tables, there are 4 attributes. These are type_ıd, type_name, photo and ıd. Create statement
for the photo in the below.
CREATE TABLE PHOTO ( ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
TYPE_ID INTEGER NOT NULL , TYPE_NAME VARCHAR(40) NOT NULL , PHOTO TEXT
NOT NULL )
• Id is the integer and autoincrement. Also, it is the primary key.
• photo define the photo. It is the url address of the photo.
• type_ıd and type_name are used for connection to other classes.
Photo Class • Photo class consists of: o IPhotoCollection.java: public interface IPhotoCollection {
public List<Photo> getPhoto();
public void addPhoto(Photo Photo);
public void deletePhoto(Photo Photo);
public void updatePhoto(Photo Photo);
public int memberCount();
public void reset();
} In this java file, interface is defined. addPhoto is used for adding new Photo to table. DeletePhoto is used for
deleting Photo from Photo table. UpdatePhoto is used for update Photo. Member count is used for admin panel.
Reset is used for reseting database.
o IPhotoCollectionJDBC.java public class IPhotoCollectionJDBC implements IPhotoCollection {
public IPhotoCollectionJDBC(String dbFilePath) {
public List<Song> getPhotoSongs(Photo Photo) {} public List<Photo> getPhoto() {} public
void addPhoto(Photo Photo) {} public void deletePhoto(Photo Photo) {} public void updatePhoto(Photo Photo) {} public int memberCount() {} public void reset() {}
} In this java file, jdbc connections are implemented. Also, it is imlepent defined interface. AddPhoto, deletePhoto,
updatePhoto, membercount, reset is defined IPhotoCollection.java. In here, body of these functions are implemented. All database connections implemented in this file. These queries used for database operations.
“SELECT * FROM photo”; “INSERT INTO PHOTO (TYPE_NAME, PHOTO, TYPE_ID) VALUES
(?,?,?)”; “DELETE FROM PHOTO WHERE (ID = ?)”; “UPDATE PHOTO SET TYPE_NAME=?,
PHOTO=?,TYPE_ID=? WHERE (ID = ?)”; “SELECT COUNT(*) FROM PHOTO”;
o Photo.java public class Photo {
private int id; private int type_id; private String type_name; private String photo;
public Photo() {
}
2.4. Code
19
Itufy Documentation, Release 1.0
public Photo(int id, int type_id, String type_name, String photo) { this.id = id; this.type_id =
type_id; this.type_name = type_name; this.photo = photo;
}
public void settypename(String new_name) { this.type_name = new_name;
}
public String gettypename() { return this.type_name;
}
public void settypeid(int type_id) { this.type_id = type_id;
}
public int gettypeid() { return this.type_id;
}
public void setId(int id) { this.id = id;
}
public int getId() { return this.id;
}
public void setphotos(String p) { this.photo = p;
}
public String getphotos() { return this.photo;
}
} In this java file, attributes and functions of the Photo class is implemented. Constructor is defined. All setters
and getters are defined.
o PhotoCollection.java
public class PhotoCollection {
private List<Photo> photo_list;
public PhotoCollection() { this.photo_list = new LinkedList<Photo>();
}
public List<Photo> getPhotoLists() { return this.photo_list;
}
public void addPhotoList(Photo photo_list_name) { this.photo_list.add(photo_list_name);
}
public void deletePhotoList(Photo photo_list_name) {
this.photo_list.remove(photo_list_name);
}
} In this java file, Photo list is created. Get,add and delete methods are implemented with this list. Elements are
added, deleted or updated in the list.
o PhotoDisplayPage.java public class PhotoDisplayPage extends AdminBasePage {
Link editLink = new Link(“edit_link”) {} public Photo getPhoto() {}
}
In this java file, Photo adding page is created. Photo_name is taken with getPhotoName method. This value
assigned to Photo_name variable.
o PhotoDisplayPageLink.java public class PhotoDisplayPageLink extends Link {
20
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
private Photo Photo;
public PhotoDisplayPageLink(String id, Photo Photo) { }
@Override public void onClick() {
} In this java file, link is created for Photodisplaypage.
o PhotoEditForm.java public class PhotoEditForm extends Form {
private boolean new_Photo;
public PhotoEditForm(String id, Photo Photo, boolean newPhoto) { }
@Override public void onSubmit() { }
In this java file, form structure is updated. In onsubmit function, collection is defined. Photos are updated or added
in this collection.
o PhotoEditPage.java public class PhotoEditPage extends AdminBasePage {
public PhotoEditPage(Photo Photo) { this.add(new PhotoEditForm(“Photo_edit”, Photo, true));
}
public PhotoEditPage(Photo Photo, boolean newPhoto) { this.add(new
Form(“Photo_edit”, Photo, newPhoto));
PhotoEdit-
}
} In this java file, PhotoEditPage is extended from adminpage. Photo is added to PhotoEditForm. PhotoEditForm
is called in here.
o PhotoForm.java public class PhotoForm extends Form {
private List<Photo> selectedPhotos;
public PhotoForm(String id) {
}
}; PhotoCheckGroup.add(PhotoListView);
}
@Override public void onSubmit() {
}
} In this java file, PhotoForm is created. Firstly, a Photo list is created type of List<Photo>. New elements are
added to this list. Then a link is created. Photos are added with this link.
o PhotoListPage.java public class PhotoListPage extends AdminBasePage {
public PhotoListPage() {
PhotoForm Photoform = new PhotoForm(“Photo_list_form”); this.add(Photoform);
Link addPhoto = new Link(“addPhoto”) { @Override public void onClick() {
Photo Photo = new Photo();
Page(Photo));
this.setResponsePage(new PhotoEdit-
}
}; this.add(addPhoto);
}
In this java file, new PhotoForm is defined and Photo_list_form is added to this form. New link is created with
addPhoto. Attributes of this are added to Photo with addPhoto function.
o PhotoListPageLink.java public class PhotoListPageLink extends Link {
2.4. Code
21
Itufy Documentation, Release 1.0
public PhotoListPageLink(String id) { super(id);
}
@Override public void onClick() {
PhotoListPage targetPage = new PhotoListPage(); this. setResponsePage(targetPage);
}
} In this java file, there are constructor for Photolistpage and onclick method. In onclik method, targetpage is
defined type of Photolistpage.Then this target page is send to setRespondPage.
o PhotoDisplayPage.html In this html file, Photo, photo_type, photo_photo_id and edit_link are showed at the
screen for admin page. Also, boxes for these attributes are showed.
o PhotoEditPage.html In this html file, edit page screen is implemented. Photo enter box for entering url and save
button are implemented.
o PhotoListPage.html In this html file, added Photos are listed. Photos and type of the photos are listed.
News:
News Table • In news tables, there are 3 attributes. These are news_type,news and ıd. Create statement for the
news in the below.
CREATE TABLE NEWS( ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
NEWS_TYPE VARCHAR(20) NOT NULL , NEWS VARCHAR(140) NOT NULL )
• Id is the integer and autoincrement. Also, it is the primary key.
• news defines the news. News are about songer, concert or every music information.
• new_type represents month of the news. Like january,may
News Class • News class consists of: o INewsCollection.java: public interface INewsCollection {
public List<News> getNews();
public void addNews(News News);
public void deleteNews(News News);
public void updateNews(News News);
public int memberCount();
public void reset();
} In this java file, interface is defined. addNews is used for adding new News to table. DeleteNews is used for
deleting News from News table. UpdateNews is used for update News. Member count is used for admin panel.
Reset is used for reseting database.
o INewsCollectionJDBC.java public class INewsCollectionJDBC implements INewsCollection {
public INewsCollectionJDBC(String dbFilePath) {
public List<Song> getNewsSongs(News News) {} public List<News> getNews() {} public
void addNews(News News) {} public void deleteNews(News News) {} public void updateNews(News News) {} public int memberCount() {} public void reset() {}
} In this java file, jdbc connections are implemented. Also, it is imlepent defined interface. AddNews, deleteNews, updateNews, membercount, reset is defined INewsCollection.java. In here, body of these functions are
implemented. All database connections implemented in this file. These queries used for database operations.
“SELECT * FROM NEWS”; “INSERT INTO NEWS (NEWS_TYPE, NEWS) VALUES (?,?)”;
“DELETE FROM NEWS WHERE (ID = ?)”; “UPDATE NEWS SET NEWS_TYPE=?, NEWS=?
WHERE (ID = ?)”; “SELECT COUNT(*) FROM NEWS”; “CREATE TABLE IF NOT EXISTS NEWS(ID INTEGER PRIMARY KEY AUTOINCREMENT,NEWS VARCHAR(140) NOT
NULL,NEWS_TYPE VARCHAR(20) NOT NULL));”;
o News.java public class News {
22
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
private int id; private String news_type; private String news;
public News() {
}
public News(int id, String news_type, String news) { this.id = id; this.news_type = news_type;
this.news = news;
}
public void setnewstype(String new_name) { this.news_type = new_name;
}
public String getnewstype() { return this.news_type;
}
public void setId(int id) { this.id = id;
}
public int getId() { return this.id;
}
public String getnews() { return news;
}
public void setnews(String news) { this.news = news;
}
} In this java file, attributes and functions of the Photo class is implemented. Constructor is defined. All setters
and getters are defined.
o NewsCollection.java
public class NewsCollection {
private List<News> News_list;
public NewsCollection() { this.News_list = new LinkedList<News>();
}
public List<News> getNewsLists() { return this.News_list;
}
public void addNewsList(News News_list_name) { this.News_list.add(News_list_name);
}
public void deleteNewsList(News News_list_name) { this.News_list.remove(News_list_name);
}
} In this java file, News list is created. Get,add and delete methods are implemented with this list. Elements are
added, deleted or updated in the list.
o NewsDisplayPage.java public class NewsDisplayPage extends AdminBasePage {
Link editLink = new Link(“edit_link”) {} public News getNews() {}
}
In this java file, News adding page is created. News_name is taken with getNewsName method. This value
assigned to News_name variable.
o NewsDisplayPageLink.java public class NewsDisplayPageLink extends Link {
2.4. Code
23
Itufy Documentation, Release 1.0
private News News;
public NewsDisplayPageLink(String id, News News) { }
@Override public void onClick() {
} In this java file, link is created for Newsdisplaypage.
o NewsEditForm.java public class NewsEditForm extends Form {
private boolean new_News;
public NewsEditForm(String id, News News, boolean newNews) { }
@Override public void onSubmit() { }
In this java file, form structure is updated. In onsubmit function, collection is defined. Newss are updated or added
in this collection.
o NewsEditPage.java public class NewsEditPage extends AdminBasePage {
public NewsEditPage(News News) { this.add(new NewsEditForm(“News_edit”, News, true));
}
public NewsEditPage(News News, boolean newNews) { this.add(new
Form(“News_edit”, News, newNews));
NewsEdit-
}
} In this java file, NewsEditPage is extended from adminpage. News is added to NewsEditForm. NewsEditForm
is called in here.
o NewsForm.java public class NewsForm extends Form {
private List<News> selectedNewss;
public NewsForm(String id) {
}
}; NewsCheckGroup.add(NewsListView);
}
@Override public void onSubmit() {
}
} In this java file, NewsForm is created. Firstly, a News list is created type of List<News>. New elements are
added to this list. Then a link is created. Newss are added with this link.
o NewsListPage.java public class NewsListPage extends AdminBasePage {
public NewsListPage() {
NewsForm Newsform = new NewsForm(“News_list_form”); this.add(Newsform);
Link addNews = new Link(“addNews”) { @Override public void onClick() {
News News = new News();
Page(News));
this.setResponsePage(new NewsEdit-
}
}; this.add(addNews);
}
In this java file, new NewsForm is defined and News_list_form is added to this form. New link is created with
addNews. Attributes of this are added to News with addNews function.
o NewsListPageLink.java public class NewsListPageLink extends Link {
24
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
public NewsListPageLink(String id) { super(id);
}
@Override public void onClick() {
NewsListPage targetPage = new NewsListPage(); this. setResponsePage(targetPage);
}
} In this java file, there are constructor for Newslistpage and onclick method. In onclik method, targetpage is
defined type of Newslistpage.Then this target page is send to setRespondPage.
o NewsDisplayPage.html In this html file, News, news_type and edit_link are showed at the screen for admin
page. Also, boxes for these attributes are showed.
o NewsEditPage.html In this html file, edit page screen is implemented. News enter box, news month enter box
and save button are implemented.
o NewsListPage.html In this html file, added News and month of the news are listed for admin. All news have
small boxes. In this way, news are selected for update, delete operations.
o UNewsPage.html This html file is used in user side. User sceen are implemented.News and months are listed in
user side.
o UNewsDisplayPage.html Also, this html file is used in user side.When user click the news, then news details are
come.This html file implements these details screen.
2.4.3 Parts Implemented by Gülnur Şafak
Database Design In this Pproject, there are 15 tables in the our database with their variables. We linked to some
java code.
2.4.4 Tables
Song Table
‘ID’ holds song’s id.TYPEID holds the id which belongs to TYPENAME.TYPENAME holds
mood , category of song.SONGNAME holds name of song.SONGTIME holds time of
song.PLAYEDCOUNTER holds the played counter of song.CODE holds URL of song.
CREATE TABLE SONG( ID INTEGER PRIMARY KEY AUTOINCREMENT, TYPEID INTEGER NOT
NULL, TYPENAME VARCHAR(20) NOT NULL, SONGNAME VARCHAR(30) NOT NULL, SONGTIME
DOUBLE NOT NULL, PLAYEDCOUNTER INTEGER NOT NULL, CODE VARCHAR(50) NOT NULL)
Artist Table
‘ID’ holds id of artist’s.ARTISTNAME holds name of artist.
CREATE TABLE ARTIST( ID INTEGER PRIMARY KEY AUTOINCREMENT, ARTIST_NAME VARCHAR(20)NOT NULL, UNIQUE(ID,ARTIST_NAME))
Favorite Table
‘ID’ holds id of favorite’s name.NAME holds name of favorite such as Turkish popular song,
foreign popular song etc. CREATE TABLE FAVORITE(ID INTEGER PRIMARY KEY AUTOINCREMENT,
NAME VARCHAR(40) NOT NULL , UNIQUE(ID,NAME))
2.4. Code
25
Itufy Documentation, Release 1.0
2.4.5 Software Design
Page Classes and HTML Pages Administrative Pages Admin Panel
This panel was developed by all group member.This page take part in main administrative operations.
• Mood
• Artist
• Category
• Song
• News
• Video
• Favorite
• Album
• Message
• Comment
• Photo
Song Pages
Song pages was developed by Gülnur Şafak. This pages create links for add, update and delete song operations.
Artist Pages
Artist pages was developed by Gülnur Şafak. This pages create links for add, update and delete song operations.
Favorite Pages
Favorite pages was developed by Gülnur Şafak. This pages create links for add, update and delete song operations.
2.4.6 Database Object Classes
2.4.7 Song
This class was developed by Gülnur Şafak.This object class variables are listed below:
• int id;
• int typeid;
• String typename;
• String songname;
• double songtime;
• int playedcounter;
• String code;
“id”, “typeid”, “typename”, “songname”, “songtime”, “playedcounter”, “code” variables are retrieved from
Song table. The constructors and methods of this class are given below:
Song():This constructor which is a default constructor is used by property model objects in pages classes.
Song(int id, int typeid, String typename, String songname, double songtime, int playedcounter, String code)
Setter and getter methods for all properties.
SongCollectionJava page provides for database connection of add, delete and
update operations.
26
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
ISongCollectionJava page is implemented class of SongCollectionJava by calling methods.
SongListPage page will be responsible for listing the songs in the collection.
SongListLink page is used for adding link.
USongListPage will be responsible for listing the songs in the collection by user.
USongListLinkPage is used for adding link by user.
SongDisplayPage is used for displaying detail of songs.
SongDisplayPageLink is used for controlling song links.
SongEditForm which is used for adding a line to header to give a link is derived from
Wicket Form class.
SongEditPage includes in contents of SongEditForm
2.4.8 Artist
This class was developed by Gülnur Şafak.This object class variables are listed below:
• int id;
• String artist_name
“id”, “artistname” variables are retrieved from Artist table.The constructors and methods of this
class are given below:
Artist():This constructor which is a default constructor is used by property model objects in pages classes.
Artist(int id,String artist_name)
Setter and getter methods for all properties.
ArtistCollection page provides for database connection of add, delete and update operations.
IArtistCollection page is implemented class of ArtistCollectionJava by calling methods.
ArtistListPage page will be responsible for listing the artists in the collection.
ArtistListLink page is used for adding link.
UArtistListPage will be responsible for listing the artists in the collection by user.
UArtistListLinkPage is used for adding link by user.
ArtistDisplayPage is used for displaying detail of artists.
ArtistDisplayPageLink is used for controlling artist links.
ArtistEditForm which is used for adding a line to header to give a link is derived from
Wicket Form class.
ArtistEditPage includes in contents of ArtistEditForm
2.4.9 Favorite
This class was developed by Gülnur Şafak.This object class variables are listed below:
• int id;
• String name;
• List<Song> songs;
2.4. Code
27
Itufy Documentation, Release 1.0
“id”, “name” variables are retrieved from Favorite table.The constructors and methods of this class are given
below:
Favorite():This constructor which is a default constructor is used by property model objects in pages classes.
Favorite(int id,String name)
List <Song> getSongs()
Setter and getter methods for all properties.
FavoriteCollection page provides for database connection of add, delete and update operations.
IFavoriteCollection page is implemented class of FavoriteCollectionJava by calling methods.
FavoriteListPage page will be responsible for listing the favorites in the collection.
FavoriteListLink page is used for adding link.
UFavoriteListPage will be responsible for listing the favorites in the collection by user.
UFavoriteListLinkPage is used for adding link by user.
FavoriteDisplayPage is used for displaying detail of favorites
FavoriteDisplayPageLink is used for controlling song favorites.
FavoriteEditForm which is used for adding a line to header to give a link is derived from
Wicket Form class.
FavoriteEditPage includes in contents of FavoriteEditForm
2.4.10 Parts Implemented by Esin Ersoğan
2.4.11 Parts Implemented by Eyüp Atiş
• I implemented user, admin and comment classes and as an extra work sessions and frontend implementations
• There are three tables in the database for storing informations about my classes
User
User Table Create statement of the user table:
CREATE TABLE USER ( ID INTEGER PRIMARY KEY AUTOINCREMENT , EMAIL VARCHAR(40)
UNIQUE NOT NULL , PASSWORD VARCHAR(20) NOT NULL );
User.java In this java file, attributes and functions of the user class is implemented. Constructor is defined. All
setters and getters are defined.
IUserCollection.java In this file interface of the jdbc collection implemented.
UserCollectionJDBC.java In this file necessary sql queries implemented for CRUD operations.
UserDisplayPage.java In this file one user displayed with detailed informations.
UserDisplayPageLink.java This class creates a link for the UserDisplayPage
UserEditForm.java In this file user can be edited on a form.
UserEditPage.java This file includes UserEditForm and displays it.
UserListForm.java This file includes all users on the database as a list and form for delete operation.
UserListPage.java This file includes UserListForm and displays it.
UserListPageLink.java This class creates a link for the UserListPage
28
Chapter 2. Developer Guide
Itufy Documentation, Release 1.0
Admin
Admin Table
CREATE TABLE ADMIN ( ID INTEGER PRIMARY KEY AUTOINCREMENT , EMAIL VARCHAR(40)
UNIQUE NOT NULL , PASSWORD VARCHAR(20) NOT NULL );
Admin.java In this java file, attributes and functions of the admin class is implemented. Constructor is defined.
All setters and getters are defined.
AdminBasePage.java This class contains common parts on admin pages such as navigation bar and AdminPanel.
IAdminCollection.java In this file interface of the jdbc collection implemented.
AdminCollectionJDBC.java In this file necessary sql queries implemented for CRUD operations.
AdminDisplayPage.java In this file one admin displayed with detailed informations.
AdminDisplayPageLink.java This class creates a link for the AdminDisplayPage
AdminEditForm.java In this file admin can be edited on a form.
AdminEditPage.java This file includes AdminEditForm and displays it.
AdminListForm.java This file includes all admins on the database as a list and form for delete operation.
AdminListPage.java This file includes AdminListForm and displays it.
AdminListPageLink.java This class creates a link for the AdminListPage
AdminHomePage.java This class contaion dashboard and main page of the admin panel.
AdminHomePageLink.java This class creates a link for the AdminHomePageLink
NewAdminLink.java This class is a link for the AdminEditPage for a new admin
Comment
Sessions
• Sign In
• Sign Up
2.4. Code
29