wiki:S2S_WEB_BOOK_MANIPULATION_R0
Last modified 16 years ago Last modified on 12/23/08 17:21:10

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=S2S_WEB_BOOK_MANIPULATION_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|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

The web interface should provide a way for editing and deleting books already existing on the server. For each book there should be separate page for manipulation.

Task requirements

  • For each book uploaded by user, should be created a page for editing.
  • The user should be able to delete his/her own books.

Task result

  • Page providing book manipulation unique for each book.

Implementation idea

  • Use BookService class and its methods.
  • Create a jso page with dynamic content different for the different books.

S2S_WEB_BOOK_MANAGEMENT_R0
S2S_WEB_COMMONS_R1
S2S_WEB_USER_RELATED_R0
S2S_CORE_MODEL_R0

How to demo

Show the newly created page for manipulating with books.

Design

  • create a page edit_book.jsp
    • the page must not be accessible from users with username different from the book author.
    • put a "Delete" button in this page - it will delete the bok entry from the database for now;
    • there must be a form with the fields, representing book properties. They will automatically fill-in on page load with the current values;
    • fields to be present: author,title,fileName,version,description,copyright,allowclone(checkbox);
    • buttons at the form bottom: Update, Cancel.
    • the "author" field must be immutable.
    • the collected data must be posted to a servlet (for example, BookEditorServlet), which will update the book entry if the data is correct, and return to the jsp with appropriate warning message is a problem occurs.
  • Add entry for the new servlet in ServerModule.java
  • Add the appropriate constant strings for the warning messages in ServerConstants.java
  • in books.jsp, add the "/edit_book.jsp" with appropriate parameters as link for the "edit" button. The resulting address for each book should look like: "/edit_book.jsp?title={title}"
  • in my_sophie.jsp(S2S_WEB_BOOK_MANAGEMENT_R0), make the links for each book title correct;

Implementation

edit_book.jsp created:

  • non-logged users, users which are not authors to a book, ot incorrect book parameters are redirected to the index.jsp
  • Delete button was created, which asks for confirmation when clicked. If confirmed, redirects to the BookDeleteServlet servlet, which actually deletes the book and returns with appropriate message.
  • The book fields are implemented as the Design.
  • two more buttons: Update, which redirects to BookEditorServlet, and Cancel, which returns to index.jsp
  • BookEditorServlet is implemented as the design says.

ServerModule was updated with the two servlet entries.
ServerConstants was updated with BOOK_DELETED and BOOK_CANNOT_DELETE.
Links in my_sophie.jsp and books.jsp were set up.
Changeset: 1075,1076,1077,1078,1079
refactoring: 1082, 1083, 1084

Testing

Comments

(Write comments for this or later revisions here.)