jwma Development - JwmaController Specification
 
Main | Deployment | Configuration | Architecture | Development | Screenshots | SF Project Site
Index | Overview | Building | API Docs | Credits & Contributors

General Remarks


This document represents a specification of the JwmaController, which is a servlet based implementation of jwma's abstract main controller. It describes the controller targets and tasks in detail.
Related information can be found in the HtmlHelper API documentation, as well as in the preferences/settings documentation.

Controller Targets

acton=<target> Description
session Actions will be related to the session
folder Actions will be related to folders
message Actions will be related to messages
preferences Actions will be related to preferences

The following sections will specify all valid tasks for each of these targets.

session


login 
Description Tries to start a mail client session, and redirects to the root folder view.
Parameters username: String
password: String
hostname: String
Redirects To Folder view
Method doLogin()
URL example <URI prefix>?acton=session&todo=login&username=some&password=body

logout
Description Ends a webmail client session and redirects to the logout view.
Parameters  
Redirects To Logout view
Method doLogout()
URL example <URI prefix>?acton=session&todo=logout

redirect
Description Redirects a request to a given view, the last view or to the main view (root folder) otherwise.
Note: the model instances are updated!
Parameters view: String ("last" | "actual" | "folder" | "message")
Redirects To  
Method doRedirect()
URL example <URI prefix>?acton=session&todo=redirect&view=last
<URI prefix>?acton=session&todo=redirect&view=actual


folder


display
Description Prepares a given folder for display and redirects to the folder view.
Parameters path:String
Redirects To Folder view
Method doDisplayFolder()
URL examples <URI prefix>?acton=folder&todo=display&path=INBOX.Trash
<URI prefix>?acton=folder&todo=display&path=/mail/Test
HtmlHelper getFolderDisplayAction()

sortmessages
Description Sorts the messages in the actual folder according to a given criteria and redirects to the folder view.
Parameters criteria: int (as String; see HtmlHelper)
Redirects To Folder view
Method doSortFolderMessages()
URL example <URI prefix>?acton=folder&todo=sortmessages&criteria=1
HtmlHelper getSortCriteriaSelect()

move
Description Moves the given folders to a given destination folder and redirects to the folder view.
Parameters paths: String (usually obtained from folder.getPath())
destination: String (see HtmlHelper)
Redirects To Folder view
Method doMoveFolders()
URL example <URI prefix>?acton=folder&todo=move&paths=/mail/test/test1&destination=/mail/test2
HtmlHelper getDestinationsSelect()

create
Description Tries to create a new folder with the given name and type in the actual folder and redirects to the folder view.
Parameters aname: String
type: int (as String; see JwmaFolder)
Redirects To Folder view
Method doCreateFolder()
URL example <URI prefix>?acton=folder&todo=create&aname=test3&type=3

delete
Description Tries to delete the given folders in the actual folder and redirects to the folder view.
Parameters paths: String (usually obtained from folder.getPath())
Redirects To Folder view
Method doDeleteFolders()
URL example <URI prefix>?acton=folder&todo=delete&paths=INBOX.test1.test2


message


display
Description Prepares a given message from the actual folder for display and redirects to the message view.
Parameters number: int (as String; should be obtained from messageinfo.getMessageNumber())
There are two "magic numbers":
  • prev:
    will display the previous message if it exists, or forward to the folder view if not.
  • next:
    will display the next message if it exists, or forward to the folder view if not.
Redirects To Message view (or with prev/next, probably to the Folder view)
Method doDisplayMessage() respectively doDisplayNextMessage() and doDisplayPreviousMessage()
URL examples <URI prefix>?acton=message&todo=display&number=1
<URI prefix>?acton=message&todo=display&number=prev
<URI prefix>?acton=message&todo=display&number=next

displaypart
Description Returns a stream of data representing the requested message part.
Parameters number: int (as String; URL usually generated by HtmlHelper methods)
Redirects To N.A.
Method doDisplayMessagePart()
URL example <URI prefix>?acton=message&todo=displaypart&number=1
HtmlHelper displayPartInlined()
getPartDescription()

move
Description Tries to move the given messages from the actual folder to the given destination folder.
Parameters numbers: int (as String; usually obtained from message.getMessageNumber())
destination: String (see HtmlHelper)
There is a "magic number":
  • actual:
    will move the actual message and forward to the next message, or to the folder view if no there are no more messages.
Redirects To Folder view (or with actual, probably to the Message view)
Method doMoveMessages() respectively doMoveActualMessage()
URL examples <URI prefix>?acton=message&todo=move&numbers=1&destination=INBOX.test1
<URI prefix>?acton=message&todo=move&numbers=actual&destination=INBOX.test1
HtmlHelper getDestinationsSelect()

delete
Description Tries to delete the given messages in the actual folder and redirects to the folder view. Note that a trash folder for messages can be activated through the preferences/settings.
Parameters numbers: int (as String; usually obtained from message.getMessageNumber())
There is a "magic number":
  • actual:
    will delete the actual message and forward to the next message, or to the folder view if no there are no more messages.
Redirects To Folder view (or with actual, probably to the Message view)
Method doDeleteMessages() respectively doDeleteActualMessage()
URL examples <URI prefix>?acton=message&todo=move&numbers=1&destination=INBOX.test1
<URI prefix>?acton=message&todo=move&numbers=actual&destination=INBOX.test1
HtmlHelper getDestinationsSelect()

compose
Description Prepares an editable message instance according to given parametes and redirects to compose view.
Parameters [to]: String (Recipients or group, optional)
[reply]: boolean (as String "true"/"false", optional)
[toall]: boolean (as String "true"/"false", optional)
[togglequote]: boolean (as String "true"/"false", optional)
[forward]: boolean (as String "true"/"false", optional)
[withattachments]: boolean (as String "true"/"false", optional)
Redirects To Compose view
Method doComposeMessage()
URL examples <URI prefix>?acton=message&todo=compose&to=somebody@aol.com&togglequote=true
<URI prefix>?acton=message&todo=compose&reply=true&toall=true
<URI prefix>?acton=message&todo=compose&forward=true&withattachments=true

composedraft
Description Loads a given draft message and redirects to the compose view.
Parameters number: int (as String; usually obtained from message.getMessageNumber())
Redirects To Compose view
Method doComposeDraft()
URL example <URI prefix>?acton=message&todo=composedraft&tnumber=1


preferences

update
Description Updates the user's preferences for system settings and redirects to the preferences view. If the user is not using the expert option, the default mail identity will be updated from the given data.
Parameters firstname: String
lastname: String
quotechar: String (only the first character)
sentmailarchive: String (path of folder)
readmailarchive: String (path of folder)
language: String (see HtmlHelper)
msgprocessor: String (see HtmlHelper)
dfpattern: String (see HtmlHelper)
style: String
autoquote: boolean (as String "true"/"false")
autoempty: boolean (as String "true"/"false")
automoveread: boolean (as String "true"/"false")
autoarchivesent: boolean (as String "true"/"false")
expert: boolean (as String "true"/"false")
inline: boolean (as String "true"/"false")

mid.name: String
mid.from: String
mid.replyto: String
mid.signature: String
mid.note: String
mid.rndappend: String (see HtmlHelper)
mid.relcontact: String (unused at the moment)
mid.autosigning: boolean (as String "true"/"false")
Redirects To Preferences view
Method doUpdatePreferences()
URL example <URI prefix>?acton=preferences&todo=update&firstname=Dieter&lastname=Wimberger&.......
HtmlHelper

getLanguageSelect()
getMessageProcessorSelect()
getDateFormatSelect()
getRandomAppendTypesSelect()


addmailid
Description Tries to add a new mail identity to the user's preferences and redirects to the preferences view.
Parameters mid.name: String
mid.from: String
mid.default: boolean (as String "true"/"false")
Redirects To Preferences view
Method doAddMailIdentity()
URL example <URI prefix>?acton=preferences&todo=addmailid&mid.name=Work&mid.from=at@work.com&mid.default=true

removemailid
Description Tries to remove a mail identity from the user's preferences and redirects to the preferences view.
Parameters mid.uid: String (obtained from identity.getUID())
Redirects To Preferences view
Method doRemoveMailIdentity()
URL example <URI prefix>?acton=preferences&todo=removemailid&mid.uid=182643d3896we38269e

updatemailid
Description Updates the given mail identity and redirects to the preferences view.
Parameters mid.uid: String (obtained from identity.getUID())
mid.name: String
mid.from: String
mid.replyto: String
mid.signature: String
mid.note: String
mid.rndappend: String (see HtmlHelper)
mid.relcontact: String (unused at the moment)
mid.autosigning: boolean (as String "true"/"false")
mid.default: boolean (as String "true"/"false")
Redirects To Preferences view
Method doUpdateMailIdentity()
URL example <URI prefix>?acton=preferences&todo=updatemailid&mid.uid=182643d3896we38269e&.....
HtmlHelper

getRandomAppendTypesSelect()



© 2000-2003 jwma team