Adding a "SPAM" Button to Communications Express

Sun Java(tm) Systems Communication Express has a wonderful interface. 
One of the most requested enhancement to our web interface is to add a
"Spam" button to the Message List View Screen. 

In this case, we will demonstrate two functionalities.  First we will mark the message with an IMAP flag as a "spam".  The second would actually move the message into a "SPAM_FOLDER" and expunge it from the INBOX.

Edit one of the following files to match the release of your software:

  • mbox_fs_lr.jsp ( JES5)
  • mbox_fs_lr.jsp (JES4)


function submitSpam ( ) {

 mark(\\'+\\', \\'spam\\')"; 
 // if you want to mark spam mail with an imap flag 'spam'

 var list = selected_uids()

 main.exec('move', mboxFrame.mbox, list, 'SPAM_FOLDER', 'expunge',
'mailFrame.refreshMbox()');

 // if you want to move the emails out to a folder named SPAM_FOLDER
and make it disappeared

}


Next add a button to the UI file, some thing like
<input type=button value="Spam"
onClick="submitSpam()">



That's it.  Thanks and credit to Bill Wang for showing me this.

Comments:

Post a Comment:
Comments are closed for this entry.
About

I'll be writing about topics that would interest users and developers of Sun Java Communication Suite.

Search

Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today