My Messages module design document
From PTAGISWiki
Contents |
MyMessages module – Design document
version 0.2, dated 9/19/07, by Marton Nagy
Introduction
The following document captures the planned design of the MyMessages module The MyMessages module shall be a JSP replacement for a similar functionality that was earlier provided by SiteScape: it will store and display system generated messages to the user (usually about a report completion), allow the user to view and delete them.
Note that ver.0.2 of the document requires input from Doug. See the last sections…
Module Design
Functionality
- lists the messages currently stored on a user’s personal “MyMessages” area
- allow viewing a selected message
- allow deleting a selected message
Details/Assumptions
- no subfolders or folder management functions are needed
- a message will have a title, a body, a creation date and a sender
- the body of a message is assumed to contain html text
Look and Feel
- look and feel should be similar to MyFiles
- the list displays the title the sender and the creation date of the messages
- functions should be available via menu buttons
- the functions require that a message is selected first, then the function can be invoked by pressing the appropriate button
- the view function opens a new page displaying the message
- the delete function deletes a message and returns to the list (displays a status if there is a problem)
Implementation Details
- the “MyMessage” data will be stored in the database
- the module will be deployed under the ptagis web application
- web pages will be placed under ptagis/home/mymessages
- logging is done via log4j
Implementation Details – Data storage
Note: Items highlighted yellow will require input from Doug.
- the proposed database storage is the following
- one data table
- proposed tablename: wqb_messages or something similar containing the word “messages”, prefixed as you think it is appropriate
- the following table describes the proposed fields (note: that the data types need to be updated to reflect the ingres dialect)
- in addition to the obvious fields mentioned earlier in the text, a recipient and a message_id (primary key) field is also needed and listed below
| Field | Type | Description | Assumptions, notes |
| message_id | int, PK | A unique id for the message (across all the messages of all the users) | Integer; primary key; need the capability to generate this id automatically |
| recipient | varchar(50) | The userid of the recipient of the message | Should accommodate a userid (~50 characters?) |
| title | varchar(256) | The message title | Should accommodate ~256 characters |
| body | ntext | The message body | Assumed to contain html text, up to ~10,000 characters |
| sender | varchar(256) | The name of the sender (not necessary a userid, just a display name, like “QueryBuilder”) | Should accommodate ~256 characters |
| creation_date | datetime | The message creation date/time | Should accommodate a date/time |
Questions
How can we accomplish generating values for the message_id field? Can we use a method similar to that in my registered tags (i.e. for the mrt_tag_groups table)? There the next unique key for the tag_group_id field of the table is generated by invoking a stored procedure (which in turn uses a system_keys table to store the latest such id).
If this is an acceptable approach, let’s discuss some of the details: the name and arguments of the stored procedure, the value of the entity_type argument (if such an argument is used, like for registered tags) and perhaps the name and schema of the helper ~system_keys table (just as a reference).
