Jwma

dtw.webmail.model
Class JwmaHtmlHelperImpl

java.lang.Object
  |
  +--dtw.webmail.model.JwmaHtmlHelperImpl
All Implemented Interfaces:
JwmaHtmlHelper

public class JwmaHtmlHelperImpl
extends java.lang.Object
implements JwmaHtmlHelper

Class implementing the JwmaHtmlHelper.

Actually represents an utility class that helps to keep complex logic out of the views.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Constructor Summary
JwmaHtmlHelperImpl()
           
 
Method Summary
 java.lang.String displayPartInlined(javax.servlet.http.HttpSession session, JwmaMessagePart part, JwmaPreferences prefs, java.util.ResourceBundle viewcontent)
          Returns a String representing a HTML tag for embedding the message parts into the view.
 java.lang.String getAlphabeticFilter(JwmaContacts contacts, java.util.ResourceBundle viewcontent)
          Returns a String representing a HTML list of all first characters of the contact's lastnames.
 java.lang.String getCategoriesSelect(JwmaContact ct, java.lang.String[] categories, java.util.ResourceBundle viewcontent)
          Returns a String representing a category select in HTML.
 java.lang.String getCategoryFilterSelect(JwmaContacts ctdb, java.lang.String eventhandler, java.util.ResourceBundle viewcontent)
          Returns a String representing a category filter select in HTML.
 java.lang.String getContactsControllerUrl()
          Returns a String representing the URL of the ContactsController.
 java.lang.String getControllerUrl()
          Returns a String representing the URL of the main controller.
 java.lang.String getDateFormatSelect(JwmaPreferences prefs)
          Returns a String representing a DateFormat select in HTML.
 java.lang.String getDestinationsSelect(JwmaFolder[] folders)
          Returns a JwmaFolder[]containing a destination select in HTML.
 java.lang.String getFolderDisplayAction(JwmaFolder folder)
          Returns a String representing the installation specific reference URL for displaying the given folder.
 java.lang.String getFolderDisplayAction(JwmaInboxInfo info)
          Convenience method returning the URL for displaying the inbox folder.
 java.lang.String getFolderDisplayAction(JwmaTrashInfo info)
          Convenience method returning the URL for displaying the trash folder.
 java.lang.String getFrequentSelect(JwmaContacts contacts, java.lang.String eventhandler)
          Returns a String representing a frequent recipient select in HTML.
 java.lang.String getGroupMembersSelect(JwmaContactGroup group)
          Returns a String representing a group members select in HTML.
 java.lang.String getLanguageSelect(JwmaPreferences prefs)
          Returns a String representing a proper language select in HTML.
 java.lang.String getMailIdentitySelect(JwmaPreferences prefs)
          Returns a String representing a MailIdentity select in HTML.
 java.lang.String getMessageProcessorSelect(JwmaPreferences prefs)
          Returns a String representing a MessageProcessor select in HTML.
 java.lang.String getNonMembersSelect(JwmaContactGroup group, JwmaContacts ctdb)
          Returns a String representing a non group members select in HTML.
 java.lang.String getPartDescription(JwmaMessagePart part, java.util.ResourceBundle viewcontent)
          Returns a String representing a message part description in HTML.
 java.lang.String getPathHierarchyNavigator(JwmaStoreInfo info, JwmaFolder folder)
          Returns a String representing a path navigator in HTML.
 java.lang.String getPostOfficeSelect(java.lang.String postoffice)
          Returns a selection of configured post offices.
 java.lang.String getRandomAppendTypesSelect(JwmaPreferences prefs, JwmaMailIdentity mid)
          Returns a String representing a random append types select in HTML.
 java.lang.String getSendMailControllerUrl()
          Returns a String representing the URL of the SendMailController.
 java.lang.String getSizeString(int size)
          Returns a String representing the size in human readable form.
 java.lang.String getSortCriteriaSelect(JwmaPreferences prefs, java.lang.String eventhandler, java.util.ResourceBundle viewcontent)
          Returns a String representing a proper sorting criteria select in HTML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JwmaHtmlHelperImpl

public JwmaHtmlHelperImpl()
Method Detail

getControllerUrl

public java.lang.String getControllerUrl()
Description copied from interface: JwmaHtmlHelper
Returns a String representing the URL of the main controller.

The URL is installation specific, this helper method allows to make views more "portable".

Specified by:
getControllerUrl in interface JwmaHtmlHelper
Returns:
the URL of the main controller as String.

getSendMailControllerUrl

public java.lang.String getSendMailControllerUrl()
Description copied from interface: JwmaHtmlHelper
Returns a String representing the URL of the SendMailController.

The URL is installation specific, this helper method allows to make views more "portable".

Specified by:
getSendMailControllerUrl in interface JwmaHtmlHelper
Returns:
the URL of the SendMailController as String.

getContactsControllerUrl

public java.lang.String getContactsControllerUrl()
Description copied from interface: JwmaHtmlHelper
Returns a String representing the URL of the ContactsController.

The URL is installation specific, this helper method allows to make views more "portable".

Specified by:
getContactsControllerUrl in interface JwmaHtmlHelper
Returns:
the URL of the ContactsController as String.

getPostOfficeSelect

public java.lang.String getPostOfficeSelect(java.lang.String postoffice)
Description copied from interface: JwmaHtmlHelper
Returns a selection of configured post offices.

This routine constructs a select with all given post office names for the view programmer, and is supposed to be used for selecting a post office on login.

Specified by:
getPostOfficeSelect in interface JwmaHtmlHelper
Returns:
a post offices select (HTML) as String.
See Also:
JwmaConfiguration, PostOffice

getPathHierarchyNavigator

public java.lang.String getPathHierarchyNavigator(JwmaStoreInfo info,
                                                  JwmaFolder folder)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a path navigator in HTML.

This routine allows to navigate a more complex folder tree very fast and efficient. It handles the path using the actual folder separator char.

Specified by:
getPathHierarchyNavigator in interface JwmaHtmlHelper
Parameters:
info - a reference to the actual store info instance.
Returns:
a path navigator (HTML) as String.

getFolderDisplayAction

public java.lang.String getFolderDisplayAction(JwmaFolder folder)
Description copied from interface: JwmaHtmlHelper
Returns a String representing the installation specific reference URL for displaying the given folder.

The String will not include the anchor tag, but represent the href attribute value.
This method is supposed to help making views more portable and simple to write.

Specified by:
getFolderDisplayAction in interface JwmaHtmlHelper
Parameters:
folder - the JwmaFolder to be used for the display action.
Returns:
the URL for displaying the folder as String.
See Also:
JwmaFolder

getFolderDisplayAction

public java.lang.String getFolderDisplayAction(JwmaInboxInfo info)
Description copied from interface: JwmaHtmlHelper
Convenience method returning the URL for displaying the inbox folder.

Specified by:
getFolderDisplayAction in interface JwmaHtmlHelper
Returns:
the URL for displaying the folder as String.
See Also:
JwmaHtmlHelper.getFolderDisplayAction(JwmaFolder), JwmaInboxInfo

getFolderDisplayAction

public java.lang.String getFolderDisplayAction(JwmaTrashInfo info)
Description copied from interface: JwmaHtmlHelper
Convenience method returning the URL for displaying the trash folder.

Specified by:
getFolderDisplayAction in interface JwmaHtmlHelper
Returns:
the URL for displaying the folder as String.
See Also:
JwmaHtmlHelper.getFolderDisplayAction(JwmaFolder), JwmaInboxInfo

getDestinationsSelect

public java.lang.String getDestinationsSelect(JwmaFolder[] folders)
Description copied from interface: JwmaHtmlHelper
Returns a JwmaFolder[]containing a destination select in HTML.

This routine constructs a select with all given paths for the view programmer, and is supposed to be used for selecting a destination for certain folder, mailbox or message move operations.
Lists of paths of move targets can be obtained from JwmaStoreInfo.

Specified by:
getDestinationsSelect in interface JwmaHtmlHelper
Parameters:
folders - a JwmaFolder[] to be used as options for the select.
Returns:
a destinations select (HTML) as String.
See Also:
JwmaFolder, JwmaStoreInfo.listFolderMoveTargets(), JwmaStoreInfo.listMessageMoveTargets()

getLanguageSelect

public java.lang.String getLanguageSelect(JwmaPreferences prefs)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a proper language select in HTML.

This routine constructs a select with all available languages.

Specified by:
getLanguageSelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
Returns:
a language select (HTML) as String.

getSortCriteriaSelect

public java.lang.String getSortCriteriaSelect(JwmaPreferences prefs,
                                              java.lang.String eventhandler,
                                              java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a proper sorting criteria select in HTML.

This routine constructs a select with all available message sorting criterias.

Specified by:
getSortCriteriaSelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
eventhandler - added to the select.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
a sorting criteria select (HTML) as String.

getFrequentSelect

public java.lang.String getFrequentSelect(JwmaContacts contacts,
                                          java.lang.String eventhandler)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a frequent recipient select in HTML.

This routine constructs a select with all given frequent recipient nicks for the view programmer, and is supposed to be used for selecting a frequent recipient very quick.

Specified by:
getFrequentSelect in interface JwmaHtmlHelper
Parameters:
contacts - the JwmaContacts instance.
eventhandler - added to the select.
Returns:
a frequent recipient select (HTML) as String.
See Also:
JwmaContacts

getCategoriesSelect

public java.lang.String getCategoriesSelect(JwmaContact ct,
                                            java.lang.String[] categories,
                                            java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a category select in HTML.

This routine constructs a select with all given categories for the view programmer, and is supposed to be used for selecting a (user defined) category for a contact.
If the user did not define any category, the select will only have the new category option.

Specified by:
getCategoriesSelect in interface JwmaHtmlHelper
Parameters:
categories - the categories to be listed as options.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
a categories select (HTML) as String.
See Also:
JwmaContacts

getMessageProcessorSelect

public java.lang.String getMessageProcessorSelect(JwmaPreferences prefs)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a MessageProcessor select in HTML.

This routine constructs a select with the available message processors, with the user's one selected.

Specified by:
getMessageProcessorSelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
Returns:
a message processor select (HTML) as String.

getRandomAppendTypesSelect

public java.lang.String getRandomAppendTypesSelect(JwmaPreferences prefs,
                                                   JwmaMailIdentity mid)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a random append types select in HTML.

This routine constructs a select with the available random append types, with the user's one selected.

Specified by:
getRandomAppendTypesSelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
mid - a JwmaMailIdentity instance.
Returns:
a random append type select (HTML) as String.

getDateFormatSelect

public java.lang.String getDateFormatSelect(JwmaPreferences prefs)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a DateFormat select in HTML.

This routine constructs a select with date format patterns, with the user's one selected.

Specified by:
getDateFormatSelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
Returns:
a date format select (HTML) as String.

getMailIdentitySelect

public java.lang.String getMailIdentitySelect(JwmaPreferences prefs)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a MailIdentity select in HTML.

This routine constructs a select with the users available mail identities, the default selected.

Specified by:
getMailIdentitySelect in interface JwmaHtmlHelper
Parameters:
prefs - the users preferences as JwmaPreferences.
Returns:
a mail identity select (HTML) as String.

getGroupMembersSelect

public java.lang.String getGroupMembersSelect(JwmaContactGroup group)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a group members select in HTML.

This routine constructs a select with all contacts which are in the given contact group.

Specified by:
getGroupMembersSelect in interface JwmaHtmlHelper
Parameters:
group - the JwmaContactGroup instance.
Returns:
a group members select (HTML) as String.
See Also:
JwmaContactGroup

getNonMembersSelect

public java.lang.String getNonMembersSelect(JwmaContactGroup group,
                                            JwmaContacts ctdb)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a non group members select in HTML.

This routine constructs a select with all contacts which are not in the given contact group.

Specified by:
getNonMembersSelect in interface JwmaHtmlHelper
Parameters:
group - the JwmaContactGroup instance.
ctdb - the contact database.
Returns:
a non members contact select (HTML) as String.
See Also:
JwmaContactGroup, JwmaContacts

displayPartInlined

public java.lang.String displayPartInlined(javax.servlet.http.HttpSession session,
                                           JwmaMessagePart part,
                                           JwmaPreferences prefs,
                                           java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a HTML tag for embedding the message parts into the view.

This routine constructs an inline view of all given message parts in HTML. Unknown content types will be output in form of a description, others inlined by adding a proper HTML tag.

Specified by:
displayPartInlined in interface JwmaHtmlHelper
Parameters:
session - the session to store possible contact import.
prefs - the user's preferences.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
a HTML document part inlining the parts as String.
See Also:
JwmaHtmlHelper.getPartDescription(JwmaMessagePart part, ResourceBundle viewcontent), JwmaMessagePart

getPartDescription

public java.lang.String getPartDescription(JwmaMessagePart part,
                                           java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a message part description in HTML.

This routine constructs a description with all given information about the part for the view programmer, and is supposed to simplify writing a view.

Specified by:
getPartDescription in interface JwmaHtmlHelper
Parameters:
part - the part to be described in HTML.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
a message part description (HTML) as String.
See Also:
JwmaMessagePart

getSizeString

public java.lang.String getSizeString(int size)
Description copied from interface: JwmaHtmlHelper
Returns a String representing the size in human readable form.

Specified by:
getSizeString in interface JwmaHtmlHelper
Parameters:
size - the size (in bytes) to be described in human readable form.
Returns:
the human readable size as String.

getAlphabeticFilter

public java.lang.String getAlphabeticFilter(JwmaContacts contacts,
                                            java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a HTML list of all first characters of the contact's lastnames. The selected character will be used for the filter, as well as displayed non-selectable; an option to remove the filter is appended (ALL).

Specified by:
getAlphabeticFilter in interface JwmaHtmlHelper
Parameters:
contacts - the actual session's contact database as JwmaContacts.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
the filter list as String (HTML).

getCategoryFilterSelect

public java.lang.String getCategoryFilterSelect(JwmaContacts ctdb,
                                                java.lang.String eventhandler,
                                                java.util.ResourceBundle viewcontent)
Description copied from interface: JwmaHtmlHelper
Returns a String representing a category filter select in HTML.

This routine constructs a select with all used categories.

Specified by:
getCategoryFilterSelect in interface JwmaHtmlHelper
Parameters:
eventhandler - added to the select.
viewcontent - the ResourceBundle containing the localized view content strings.
Returns:
a sorting criteria select (HTML) as String.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)