[[BackLinksMenu]]

[[TicketQuery(summary=S2S_CORE_MODEL_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]]



= Analysis =

== Overview ==
The core should be able to provide functionality for managing books. Permissions for work with books and commenting them will be necessary on some stage.

== Task requirements ==
 * Design the model of the server core for basic management of books.
 * We should be able to list and search for books to add, edit and delete books.
 * May be in this revision is not necessary to have defined permissions of the users on the books and comments. So the core model should be really simple for now.  

== Task result ==
The result of this task will be basic core logic for managing books.

== Implementation idea ==
All that is needed for now is just a class that provides methods such as:

{{{
List<Book> getAllBooks();
boolean addBook(Book book);
boolean saveBook(Book editedBook);
}}}

and etc...


== Related ==
[wiki:S2S_PERSIST_MODEL_R0] [[BR]]
[wiki:S2S_WEB_BOOK_MANIPULATION_R0][[BR]]
[wiki:S2S_WEB_BOOK_MANAGEMENT_R0]

== How to demo ==
 * Add a book.
 * Edit a book.
 * Retrieve all the books.
 * Delete a book.

= Design =
 * The core security logic is implemented in [wiki:S2S_CORE_SECURITY_R0]. You can look at the design to see security class diagrams. 

 * The Book Service:
    * Will have method for adding a book. The method will check if the Book exists in the database for this user. In the other cases the logger should warn that there is already such book.
    * Will have method for saving a book. The method will receive as parameter an edited Book object.
    * Will have method for deleting a book.
    * Will have method that provides all the books an user is created. It returns list with the books.
    * Will have method that provides all the books. It returns list with all the books.
    * Will have a method that provides a book by its title.
    * Will have a method that search book by a given criteria passed as Map {book_field_name => value}.
  

 * Here is the class diagram representing the core book model:

[[Image(source:/trunk/sophie2-platform/modules/org.sophie2.server/doc/S2SCoreBookModel.png)]]

 * Here are the tests:[[BR]]
[source:trunk/sophie2-platform/modules/org.sophie2.server/src/test/java/org/sophie2/server/service/BookServiceTest.java@817]

= Implementation =
Changesets:
 * [[changeset:817]]
 * [[changeset:927]]

= Testing =

= Comments =
^(Write comments for this or later revisions here.)