Task #424

Enhance the SentBox Recipient Field

Added by Tan Lee Yong about 14 years ago. Updated almost 14 years ago.

Status:Closed - End of life cycleStart date:August 23, 2010
Priority:NormalDue date:August 26, 2010
Assignee:Ngoh Chee Ping% Done:

100%

Category:-Spent time:51.00 hours
Target version:-

Description

To add a new table to handle large recipients.

New_SecuredMail_table_structure.jpg (212 KB) Ngoh Chee Ping, September 02, 2010 18:18

History

#1 Updated by Ngoh Chee Ping about 14 years ago

  • Status changed from New - Begin Life Cycle to Development / Work In Progress
  • % Done changed from 0 to 10

Table MailSentBoxRecipient is added. Added one column in MailInbox, MailSentBox, MailArchive, and MailTrashCan table. When i added MailSentBoxRecipient and delete the few columns in MailSentBox in that have recipient, got error come out. This error because MailInbox, MailSentBox, MailArchive, and MailTrashCan is implement using MailBoxTableObjectInterface. I think to make it consistent, i think we need to create MailInboxRecipient, MailArchiveRecipient, and MailTrashCanRecipient for others table.

#2 Updated by Tan Lee Yong about 14 years ago

It make sense too. If you want to archive, delete a sent mail and may be inbox need multiple recipients, then the design is covered.

#3 Updated by Ngoh Chee Ping about 14 years ago

- Added MailInboxRecipient, MailArchiveRecipient, and MailTrashCanRecipient table.
- All this is use to store the recipient for inbox, archive and trashcan.
- I also edited the MailTableObjectInterface class and added one MailTableObjectRecipient class to implement MailInboxRecipient, MailSentBoxRecipient, MailArchiveRecipient, and MailTrashcanRecipient.
- I also added some method in BaseHibernateDao, and BaseHibernateDaoImpl. These method is use to save data, delete data and get data in MailInboxRecipient, MailSentBoxRecipient, MailArchiveRecipient, and MailTrashcanRecipient table.

Problem:
When i want to save data in mailbox, how to get the messageId, because the messageId is auto generate.
For example, when i send mail, we need to store the save the data in MailInbox and MailInboxRecipient. After save in MailInbox, when want to save in MailInboxRecipient, we need to have the messageId before save.

#4 Updated by Tan Lee Yong about 14 years ago

If this is the case, we need to change the way to of insert. We can't use the auto generated id. We should create an SQL to call the sequence number (message id) to get the next number first and then use this number for both tables. That's mean there will not have auto generated id for the message.

#5 Updated by Ngoh Chee Ping about 14 years ago

  • % Done changed from 10 to 30

The auto generated id no used already, change it to .NEXTVAL. In all the method that need to insert to the MailInbox and MailSentBox, i created the query "SELECT INBOX_MESSAGEID.NEXTVAL FROM dual". Using this to increase the messageId by 1 when insert a row in database. I created a method in BaseHibernateDaoImpl to simple my work, that method is use to create this query and return the messageId. By using this method, i can get the messageId.

Problem:
Now i havent commit and push my work to the mercurial, because i change many things in the project. If i push it, the test cases for ayu and frank will got many errors and need to fix.

#6 Updated by Ngoh Chee Ping about 14 years ago

Changed the database table design. I move 4 columns in Mailbox to the recipient table, the columns i moved is LastAction, LastActionDate, LastActionUserId, and status. If the columns did not move it will facing problem when the status, last action, last action date, last action user id changed. Others recipient have the same messageId also will changed, because all share the same column. After changed the table design, i edit the BaseHibernateDao, BaseHibernateDaoImpl and SecuredMailBox class.

#7 Updated by Ngoh Chee Ping about 14 years ago

  • % Done changed from 50 to 70

Finish edited the SecuredMailBox, now doing simple testing on it to make sure it work. Now finish test sendMessage, readMessage, replyMessage, archiveMessage and restoreArchiveMessage. All this is work, after edited and fix the problems on it. All the function in BaseHibernateDaoImpl also tested. All problems in this class fixed.

#8 Updated by Ngoh Chee Ping about 14 years ago

  • % Done changed from 70 to 90

I change the database design for MailInbox, MailSentBox, MailArchive, and MailTrashCan. I add one column name sendStatus for these tables. This status is use in sentbox. When the mail in sentbox want to archive or delete, it need to save the status to archived and deleted. The new column is to store the status. I also finish test all the method using simple test. But now facing one problem, the problem is when i archive a mail from inbox, and all the recipient belong to the mail is moved to MailArchive, then the recipients in inbox for that mail will be empty, but the data for the mail will still in the inbox. I try to do checking the recipient for that mail, if the mail has no recipients, then delete the data of the mail. But now the checking got problem. Still checking what the problem.

#9 Updated by Ngoh Chee Ping about 14 years ago

  • % Done changed from 90 to 100

Finish edited and tested all the methods in securedMailBox class. The problem of delete the data of the mail when the mail dont have any recipients in the mailbox solved. Now editing the JUnit test cases.

#10 Updated by Ngoh Chee Ping about 14 years ago

  • Status changed from Development / Work In Progress to Work Completed-End life cycle

#11 Updated by Tan Lee Yong almost 14 years ago

  • Status changed from Work Completed-End life cycle to Closed - End of life cycle

Also available in: Atom PDF