Blogger

/
0 Comments
The requirement of the project is to create a blogging platform that allows users (admins) to create & manage content,
approve public comments and track site statistics

Design
The major specifications were:

  • Admin is able to register/create new users/admins
  • Links to the most recent posts (10 or so) are shown in the homepage
  • Admin can create and edit posts
  • A post contains a title, post text and a unique id, which corresponds to its direct URL
  • The comments added by the public and approved by any admin will be shown in the post
The Design


We used JSON files for each post to store their titles, text, comments, author names and view counts. These were
accessed and viewed (and changed) through servlets and JSPs as needed.
The required core functions were completed. Also the statistics for each post can be viewed.
Form based authentication (instead of Basic auth at its simplest level) was used so that it would be easier to the user
and can be changed to fit the appearance of the site while the credentials can be accessed through JavaScript.

Implementation
Workflow

URL Handler Auth Functionality
/ index.jsp None Shows the posts (10 max) in reverse order. Has buttons for logging-in, adding posts, viewing statistics
/ClickedPost?id=19 ClickedPost (servlet) None Shows the plaintext (or HTML) of the post with title and a comment box
/PendingComments PendingComments (servlet) None Stores the new comment in the corresponding JSON file but does not show it yet in the post
/newpost/approval.jsp approval.jsp FORM Shows the list of posts which point to the comments-approval page
/newpost/Approval?id=19 Approval (servlet) FORM (above) Shows the authoring admin name, a button to view the pending comments and a link to edit the post
/ index.jsp None Shows the posts (10 max) in reverse order. Has buttons for logging-in, adding posts, viewing statistics
/ index.jsp None Shows the posts (10 max) in reverse order. Has buttons for logging-in, adding posts, viewing statistics
/newpost/commentsApproval commentsApproval (servlet) FORM (above) Shows the list of approval-pending comments with checkboxes to approve and a submit button
/newpost/edit editPost (servlet) FORM(above) Shows textboxes to edit the current title and text of the post with a submit button
/newpost/commentsApproval commentsApproval (servlet) FORM (above) Shows the list of approval-pending comments with checkboxes to approve and a submit button
/statPost?id=19 statPost (servlet) None Shows the corresponding post’s title, its total view count and the number of comments
Security


Authentication
We used form authentication to authorize the admins/writers at the loggin-in page (see above). The admins need to

add the entry for the users at tomcat-users.xml.

Non-standard Libraries Used

  • json-simple/simple-json was used for accessing (change & read) post JSONs
  • As the name suggests and with similar requirements of the system, this seemed sufficient
  • Plaintext or CSV files and even XML formats were considered, but eventually this was selected becuase it seemedmuch more simpler

GIT- https://github.com/tharinda221/BloggingSystem



You may also like

No comments :

Powered by Blogger.