Web Application Code Components

Intro
Installation
SysAdmin
Objects
Transfer
Access
Directory
Data Files
Clusters
WebApp 
WSSP 
AppCodes
WebMail
Miscellaneous
Licensing
HowTo
HelpMe

The CommuniGate Pro Web Application module processes a request for a WSSP file by calling a code component that produces a dataset - a dictionary containing text string keys and values, associated with those keys. Values can be text strings, arrays of values, or dictionaries.

For example, when a Domain default page is requested, the code component called and it produces a dictionary that contains keys such as canAutoSignup, hasMailLists, hasCertificate.

The Web Application module then uses the script code from a WSSP file to convert this data into into an HTML or other markup language page.

This section lists the available CommuniGate Pro code components, specifies when those components are called, explains how the code components process the <FORM> parameters, and specifies the content of the dataset produced by each code component.

Code Components for Stateless Requests

The Web Application module places certain data into datasets produced with all Stateless Requests code components. The following list specifies these "generic" dataset elements that can be used with all Stateless WSSP pages:

filesRef
This element value is a string that can be used to form a URL that refers to a file (image, style sheet, data, etc.) from the same Skin in the same Domain. The <IMG SRC="%%filesRef%%Logo.jpeg"> HTML element will display the Logo.jpg file "visible" in the current Skin.

serverName
This element value is a string with this CommuniGate Pro server name (its Main Domain Name).

skin
This optional element value is the current Skin name string.

domainName   type:string
This element value is a string with the name of the CommuniGate Pro Domain. This element exists only if the Server has succeeded to direct the Stateless Request to one of the server Domains.

charset
This element value is the value of the charset element from the Domain Skin Text Dataset. Individual code components may specify other values for the charset element (see below).

secureChannel
This element exists and has the YES string value if the request has been received via a secure (HTTPS) connection.

isWML
This element exists and has the YES string value if the request has been received from a WML browser.

The following sections specify the Stateless URLs, the name of the code component called, the actions taken by the component, the dataset produced with that component, and the name of the WSSP file used to produce the HTTP response.


URLs: /, /default.html

these URLs are used to process Login operations.

Actions
If the HTTP request has the username and password parameters, the code tries to authenticate the client using these parameter values. If the supplied credentials are correct, a new WebUser Session is created, and a request for the "entry page" is sent to the Session. This request usually returns an HTML "jump page" that is sent back to the user browser. It forces the browser to enter the "Session realm".

Result Dataset
If username or password parameter has not been specified, or a WebUser Session could not be created, the component generates the following dataset:

autoSignup
this element (with the string YES as the value) is added to the dataset if the addressed Domain provides the Auto-Signup operation.

clientAddress
this string element contains the IP address of the user browser.

errorCode
this element is added to the dataset if the Login operation has failed. The value is a string with the error code.

forgotPassword
this element (with the string YES as the value) is added to the dataset is the errorCode value is "Incorrect Password" or "Unknown Account".

hasCertificate
this element (with the string YES as the value) is added to the dataset if the addressed Domain has a custom Certificate.

hasDirectory
this element (with the string YES as the value) is added to the dataset if the default Skin for the addressed Domain has an array element GuestDirectoryFields in its Text Dataset, and that array is not empty.

hasLists
this element (with the string YES as the value) is added to the dataset if the addressed Domain has at least one Mailing List. This element is always added if the addressed Domain is a Shared Domain.

loginName
this string element is added to the dataset if the user has tried to log in, but failed. The value specified in the username parameter becomes the loginName element value.

WSSP page:
the login.wssp page is used to generate the HTTP response.


URL: /RecoveryPassword.wssp

this URL is used to process Password Recovery operations.

Action
If the HTTP request has the username and Send parameters, the component tries to find the specified Account, retrieves the Account password, and the RecoverPassword Account Setting. If the password can be decrypted and the RecoverPassword is specified, an E-mail message containing the password is composed and sent to the RecoverPassword E-mail address.

Result Dataset

errorCode
this element is added to the dataset if the Password Recovery operation has failed. The value is a string with the error code.

messageCode
this element is added to the dataset if the Password Recovery operation has succeeded. The value is the PasswordSent string.

WSSP page:
the recoverypassword.wssp page is used to generate the HTTP response.


URL: /Signup.wssp

this URL is used to process Auto-Signup operations.

Action
If the HTTP request has the username, password1, password2, and the realName parameters, the component tries to create the specified Account. Before it tries to create an Account, it checks if the password1 and password2 strings are the same. If a new Account is created, its UseAppPassword setting is set to YES, the Password and RealName settings are set to the specified values. If the HTTP request contains a non-empty ForgotPassword parameter, it is used as the RecoverPassword Account Setting.

The component checks if the request contains one or more PublicInfo string parameters. The value of the parameter must be one of the Public Info Attributes specified in the Directory Integration settings. The component than checks if there is a non-empty request parameter with this name, and adds the parameter value to the initial Account settings.
Example: to provide a City field on the Auto-Signup page, include the <INPUT type="hidden" name="PublicInfo" value="City"> control and the <INPUT type="text" name="City" value="" size=30 maxLength=255> control into the Signup.wssp HTML code.

If an Account has been created, a new WebUser Session is created, and a request for the "entry page" is sent to the Session (see above).

Result Dataset
If username, password1, password2, or the realName parameter has not been specified in the HTTP request, or a new Account could not be created, the component generates the following dataset:

errorCode
this element is added to the dataset if the Auto-Signup operation has failed. The value is a string with the error code.

userName
this element is added to the dataset if HTTP request contained a non-empty userName parameter. The element value is the value of the parameter.

realName
this element is added to the dataset if HTTP request contained a non-empty realName parameter. The element value is the value of the parameter.

recoverPassword
this element is added to the dataset if HTTP request contained a non-empty recoverPassword parameter. The element value is the value of the parameter.

WSSP page:
the signup.wssp page is used to generate the HTTP response.


URL: /List/, /List/default.html

this URL is used to retrieve the list of the browsable Domain Mailing Lists.

Action
The HTTP request parameters are not processed.

Result Dataset
The component generates the following dataset:

errorCode
this element is added to the dataset if the list retrieval operation has failed. The value is a string with the error code.

lists
this element contains an array of mailing list descriptors. Each descriptor is a dictionary with the following keys and values:
name
a string with the mailing list name
realName
the mailing list "description" string.
browse
the string describing the mailing list archive browsing policies. The string value can be anyone or subscribers.

WSSP page:
the listlist.wssp page is used to generate the HTTP response.


URL: /List/listname/, /List/listname/List.html
this URL is used to retrieve a portion of the mailing list records for the listname Mailing List.

The code component actually uses the generic Mailbox Code Component.

Action
The component checks if the HTTP request contains the NextMessage parameter with a numeric value. If it exists, the value is interpreted as the unique message ID (UID) in the list archive mailbox, and the component tries to find this message in the selected mailbox "view", and tries to find the next message in the view.

The component checks if the HTTP request contains the PrevMessage parameter with a numeric value. If it exists, the value is interpreted as the unique message ID in the list archive mailbox, and the component tries to find this message in the selected mailbox "view", and tries to find the previous message in the view.

If the next or previous message is found, its UID is added to the dataset (see below) and the generic Mailbox component is not used for processing.

If no next/previous message is found, the generic Mailbox component is used to process the HTTP request parameters and to compose the resulting dataset.

Result Dataset

listName
a string with the Mailing List name.

If a next or previous message is found:

messageJump
a string with the found message UID.

If a next or previous message was not requested in the HTTP request parameters or it was not found:

realName
the Mailing List Description string

charset
the Mailing List Preferred charset string
the generic Mailbox code component is used to generate the rest of the resulting dataset.

WSSP page:
the listmailbox.wssp page is used to generate the HTTP response.


URL: /List/listname/Message/uid.html
this URL is used to retrieve the message with uid unique ID from the listname mailing list archive.

The code component actually uses the generic Message Code Component.

Action

The generic Message component is used to process the HTTP request parameters and to compose the resulting dataset.

Result Dataset

listName
a string with the Mailing List name.

nextMsg
this element is added if there is a next message in the archive mailbox view. The element value is a string with the next message UID.

prevMsg
this element is added if there is a previous message in the archive mailbox view. The element value is a string with the previous message UID.
the generic Message code component is used to generate the rest of the resulting dataset.

WSSP page:
the listmessage.wssp page is used to generate the HTTP response.


Error Pages

The WSSP mechanism is used to generate HTTP response body for error responses. The following table lists the HTTP error codes, the situations when this error code is generated, and the WSSP file used to product the HTTP error response body.
CodeError conditionsWSSP file used
301the requested resource has been movedmoved.wssp
404the requested resource does not existnotfound.wssp
401the requested page requires the HTTP Authorization (request header)unauthorized.wssp
401the credentials in the HTTP Authorization request header are incorrectdenied.wssp
500generic system errorfailure.wssp
501generic system errorerror.wssp

These WSSP pages are processed using datasets generated for all Stateless requests, with the following additional elements:

errorCode
this element is added to the dataset if there is an error code to be reported to the user.

hostName
this element is added to the dataset if the HTTP request contained the Host: field. The element value is that request field parameter.

The disconnected.wssp page is used when an HTTP request was sent to a WebUser Session, but the session has not been found. The page is processed using a dataset generated for all Stateless requests.


Code Components for Session Requests

When a new WebUser Session is created, the Skin specified in the account WebUser Preferences is opened and is used as the "Session Skin". The string StartPage is retreived from that Skin Text Dataset, and a jump page is composed and sent to the user browser. The jump page redirects the user browser into the "Session Realm", to the page specified with the StartPage string.

HTTP requests to the "Session realm" (requests with URLs started with /Session/) are processed as Session Requests. The second component of the Session Request URL is a unique Session ID, the HTTP module uses it to find the WebUser session.

If the specified session is not found, or the Session has the Fixed Network Address option set, and the HTTP request did not come from the same IP address as the Login request that started the session, the disconnected.wssp page is displayed (see above).

After the Session is found, the Web Application module processes the rest of the request URL as the "request inside this session realm". If the request URL specifies a regular file, that file is retrieved from the Session Skin, and it is sent back to the user browser.

For each .wssp request a code component is called. It processes the HTTP request parameters and generates a result dataset. Then the .wssp file is retreived from the Skin, and it is used to compose the HTTP response.

If the result dataset does not contain the blockAlerts element, the Web Application module checks if there is a pending Alert for the session user. If one or several pending alerts are found, the Alerts code component is called, and the Alerts.wssp file is used to compose the HTTP response.

The Web Application module checks for certain HTTP request parameters and processes them for all .wssp page requests. The following list specifies these "generic" actions:

EmptyTrashNow
If the HTTP request contains this parameter, and the mailbox or mailbox alias with the name Trash can be opened with the "Can Delete" Mailbox Access Right, then the code component removes all messages from that mailbox. If this operation fails, the error code is placed into the resulting dataset as the errorCode string element.

SMIMEUnlock
If the HTTP request contains this parameter and the session does not have an Active Private Key, and the encrypted Private Key exists in the Account Settings, and the HTTP request contains the SMIMEPassword parameter, the module tries to activate ("unlock") the Private Key using the supplied password. If the operation fails, the error code is placed into the resulting dataset as the SMIMEError string element.

The Web Application module places certain data into datasets produced with all Session Requests code components. The following list specifies these "generic" dataset elements that can be used with all Session WSSP pages:

messageText
This string element is added if the HTTP request contains the messageText parameter. The element value is the same as the HTTP parameter value.

messageCode
This string element is added if the HTTP request contains the messageCode parameter. The element value is the same as the HTTP parameter value.

secureChannel
This element exists and has the YES string value if the request has been received via a secure (HTTPS) connection.

isWML
This element exists and has the YES string value if the request has been received from a WML browser.

charset
This string element contains the Preferred Charset selected in the User Preferences, if the Use UTF8 mode is set to Never. Otherwise, this element contains the utf-8 string.
Note: it's just a default value, individual code components can specify different values for this dataset element.

SMIMEActive
This element exists and has the YES string value if the session has an unlocked (Active) SMIME Private Key.

SMIMEInactive
This element exists and has the YES string value if the session does not have an unlocked (Active) SMIME Private Key, but the user has the Private Key in the Account Settings, and the Key can be unlocked.

If a .wssp request specifies an unknown code component, but the .wssp file with the specified name can be retrieved from the Session Skin, that .wssp file is processed using the dataset with the "generic" elements only, and the result is sent back to the user browser.

Example: The Stock Skin uses Hello.wssp requests. There is no code component with this name, so a dataset with the generic values is composed, and the Hello.wssp file is used to process this dataset.

The following sections specify the names of existing code components (names for .wssp requests), the actions taken by these component, and the dataset produced with these components.

The code component results are processed using the .wssp files with the same names as the code component names.


Name: Mailboxes

Actions

If the HTTP request contains the Create parameter and the NewName parameter is a non-empty string, the component tries to create a mailbox with the specified name. If this operation fails, the errorCode element with the error code text is added to the result dataset. If the mailbox is created, the messageCode element with MailboxCreated string value is added to the result dataset, and the created mailbox name is added to the list of subscribed mailboxes, if the Show Subscribed Mailboxes option is selected in the Account WebUser Preferences.

Result Dataset

The code component creates a list of all account mailboxes and aliases (if the Show All Account Mailboxes option is selected in the Account WebUser Preferences), or the list of all subscribed mailboxes (if the Show Subscribed Mailboxes option is selected). If both options are selected, these two lists are merged into one.

If the HTTP request contains the Filter parameter, only the mailboxes with names containing this parameter value are included into the list.

filter
this string element contains the current value of the HTTP Filter parameter.

newName
this string element contains the current value of the HTTP NewName parameter.

mailboxList
this element is an array with one dictionary-type element for each mailbox in the composed mailbox list. Each dictionary contains the following elements:

mailboxName
this string element contains the mailbox name.

parent
this string element exists if the mailbox is a submailbox of some other mailbox. The string contains the name of that parent mailbox.

nonSelectable
this string element with the value Yes is added if the mailbox is not selectable. If it is added, none of the following elements is added to the dictionary.

isList
this element is added to the element if the mailbox is the main mailbox (archive) for a mailing list (this also means that there is a mailing list with the same name).

nMessages
this string element contains the number of messages in the mailbox. If the number cannot be retrieved, the element value is the ??? string.

nRecent
this string element contains the number of "Recent" messages in the mailbox.

nunUnread
this string element contains the number of "Unseen" messages in the mailbox.

size
this string element contains the "rounded" size of the mailbox. If the mailbox size cannot be retrieved, the element element value is the ??? string.

nSelected
this string element contains the number of elements in the mailboxList array.

trashSize
this string element is added only if the account has the Trash mailbox. It contains the Trash mailbox size.

currentStorage
this string element contains the "rounded-up" total size of account mailboxes.

storageLimit
this string element contains the "rounded-up" account total mailbox size limit. If account does not have the total mailbox size limit, this element contains the unlimited string.


Name: Mailbox

The HTTP request must contain the Mailbox parameter - the name of the mailbox to be displayed.

Actions

For each mailbox, the module creates a session object that contains the mailbox view parameters. When the module is created, these parameters are initiated with the Web User Preferences values.

The HTTP request Msg parameters are interpreted as "message set elements". A request can contain several parameters, and each parameter should have a numeric value - the Unique ID of a mailbox message.

If the HTTP request contains the Forward or Redirect parameter and the RedirectAddresses parameter is not empty, a "message set" is composed using the Msg parameters, and the message set messages are forwarded or redirected to the specified addresses.
If the operation has been successful, the messageCode element with the MessagesForwardedInfo or MessagesRedirectedInfo string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the Copy or Move parameter and the MailboxName parameter contains a name of some selectable mailbox, a "message set" is composed using the Msg parameters, and the message set messages are copied to the specified mailbox. If the Move parameter was specified, the message set messages are marked as Deleted, deleted, or moved to Trash - depending on the WebUser Preferences.
If the operation has been successful, the messageCode element with the MessagesCopiedInfo string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the WebUser Preferences DeleteMethod option is set to Move To Trash, and the HTTP request contains the Delete parameter, a "message set" is composed using the Msg parameters, the message set messages are copied to the Trash mailbox and deleted. If the Trash mailbox did not exist, it is created.

If the HTTP request contains the read, unread, flag, unflag, delete, or undelete parameters, a "message set" is composed using the Msg parameters, and the flags for the message set messages are modified. The delete and undelete parameters are processed in this way only if the WebUser Preferences DeleteMethod option is not set to Move To Trash.
If the operation has not been successful, the errorCode element with the operation error code string value is added to the result dataset.

If the WebUser Preferences DeleteMethod option is not set to Move To Trash, and the HTTP request contains the Purge parameter, all mailbox messages with the Deleted flag are deleted.
If the operation has not been successful, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the NextUnread parameter and the mailbox contains an unread message, the messageJump element is added to the result dataset, and the code component stops request processing. The element string value contains the Unique ID of the first unread message.

Then the code component use the generic Mailbox component to process the HTTP request parameters and the compose the resulting dataset.

Result Dataset

mailbox
a string with the mailbox name.

If a next unread, next, or previous message is found:

messageJump
a string with the found message UID.

If a next unread, next, or previous message was not requested in the HTTP request parameters or it was not found:

refreshTime
the mailbox view refresh time (in seconds), retreived from the WebUser Preferences.
the generic Mailbox code component is used to generate the rest of the resulting dataset.


Name: Message

The HTTP request must contain the Mailbox parameter (the name of the mailbox containing the messages to be displayed), and the MSG parameter - the Unique ID of that message in the mailbox.

Actions

If the HTTP request contains the Copy or Move parameter and the MailboxName parameter contains a name of some selectable mailbox, the message is copied to the specified mailbox. If the Move parameter was specified, the message is marked as Deleted, or it is deleted - depending on the WebUser Preferences.
If the operation has been successful, the messageCode element with the MessageCopied string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.
If the Move operation has removed the message, the backToMailbox element with the Yes value is added to the result dataset, and the code component stops request processing.

If the HTTP request contains the Redirect parameter and the RedirectAddresses parameter is not empty,the message is redirected to the specified addresses.
If the operation has been successful, the messageCode element with the MessageRedirected string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the TakeAddress parameter the message From: address is added to the Account address book.

If the HTTP request contains the TakeCertificate parameter the certificate from the message digital signature is added to the Account address book.

If the HTTP request contains the StoreFiles parameter and the selectedWebFolder parameter contains a name of a Personal Web Site folder, the file parts of the message (attachments, images) are stored in the specified Web Site folder.
If the operation has been successful, the messageCode element with the FilesCopied string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the read, unread, flag, unflag, delete, or undelete parameters, the message flags are modified.
If the operation has not been successful, the errorCode element with the operation error code string value is added to the result dataset.

Then the code component use the generic Message component to process the HTTP request parameters and the compose the resulting dataset.

Result Dataset

mailbox
A string with the mailbox name.

If the message has not been removed:

MSG
A string with the message UID.

flagged, recent, deleted, flagged, isDraft
These elements with the Yes value are added based if the message has the corresponding flags.

status
This string element has the follwing values:
  • Deleted - if the message has the Deleted flag set, otherwise
  • Draft - if the message has the Draft flag set, otherwise
  • Redirected - if the message has the Redirected flag set, otherwise
  • Unread - if the message does not have the Seen flag set, otherwise
  • Answered - if the message has the Answered flag set, otherwise
  • Read

messageBody
A string with HTML presentation of the message, generated using the generic Message code component.

charset
The charset to use for message display. This element can be set with the generic Message code component.

nextMsg
this element is added if there is a next message in the mailbox view. The element value is a string with the next message UID.

prevMsg
this element is added if there is a previous message in the mailbox view. The element value is a string with the previous message UID.

hasFiles
this YES string element is added if there is the message contains a file part.


Name: Compose

Actions

If the HTTP request contains the charset parameter, the parameter value is used as the desired charset - the charset to be used in the composed message.

The optional Operation HTTP request parameter specifies the type of the Compose operation and it can have the Reply, ReplyAll, Forward, or EditDraft value.
If this parameter is specified, the OrigMessage parameter (with the UID of the original message) and the OrigMailbox parameter (with the name of the mailbox containing the original message) must be specified.

If the HTTP request contains the Operation parameter and it does not contain the filled parameter, the original message header fields are used to compose the Subject, To, Cc, and the message body data for the new message.
Otherwise, the Subject, To, Cc, Bcc, and Body HTTP request parameters are used as the new message data.

If the HTTP request contains the AddressBook parameter and it does not contain the CloseBook parameter, or if HTTP request contains the OpenBook parameter the generic AddressBook code component is used to process the request parameters and to form some result dataset elements.

If the HTTP request contains the Send parameter, the composed message is submitted to the Server Queue. If the HTTP request contains the Save parameter, the composed message is stored as a Draft in the selected Drafts mailbox.
In both cases all HTTP request Attachment parameters are added to the message as attachments.

Result Dataset

operation
This string element is added to the result dataset if the HTTP request contains the Operation parameter. The element value equals the request parameter value.

origMessage
This element containing the UID of the original message is added to the result dataset if the HTTP request contains the OrigMessage parameter.

origMailbox
This element with the name of the mailbox containing the original message is added to the result dataset if the HTTP request contains the OrigMailbox parameter.

sentOrSaved
This element with Yes value is added to the result dataset if the Send or SaveDraft operation has completed successfully. If this element is added:
  • The sent element with the TT>Yes value is added if the operation was the Send operation.
  • The messageCode element with the MessageSent or MessageSaved value is added to dataset.
  • No other element listed below is added to the result dataset.

Subject, To, Cc, Bcc
These elements contain strings with the current header fields data.

From
This element contains a string with the From address specified in the WebUser Preferences.

addressBook
This element with the Yes value is added to the result dataset if the HTTP request contains the AddressBook parameter and does not contain the CloseBook parameter or if the HTTP request contains the OpenBook parameter.

body
This string element contains the current message body text.

mailerWidth
This string element contains the MailerWidth WebUser Preferences option value.

forwardedMessage
This optional string element contains the HTML represenation of the original message. This element is added to the result dataset if the HTTP request Operation parameter is Forward.

DSN
This element with the Yes value is added to the result dataset if the HTTP request contains the DSN parameter.

SaveSent
This element with the Yes value is added to the result dataset if the WebUser Preferences contain a non-empty SentBox option and the HTTP does not contain the Filled parameter or the HTTP request contains the SaveSent parameter.

desiredCharset
This string element contains the name of charset to be used in the composed message.

charset
This element is the UTF-8 string if the Use UTF8 WebUser Preferences option is set to "for Reading and Composing". Otherwise, this element contains the same value as the desiredCharset result dataset element.


Name: MailboxSettings

The HTTP request must contain the Mailbox parameter - the name of the mailbox to manage.

Actions

If the HTTP request contains the Remove parameter, the mailbox is removed. If the HTTP request also contains the RemoveSub parameter, all mailbox submailboxes are removed, too.
If the operation has been successful and the Show Subscribed Mailboxes option is selected in the WebUser Preferences, the deleted mailbox(es) are removed from the account subscription list.
If the operation has been successful, the removed element with the Yes string value is added to the result data set and the code component stops request processing. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the Rename parameter and the NewName parameters is not empty, the mailbox is renamed. The NewName parameter value is converted into the "UTF-7 Mailbox Name encoding" format and is used as the new mailbox name.
If the HTTP request also contains the RenameSub parameter, all mailbox submailboxes are renamed, too.
If the operation has been successful and the Show Subscribed Mailboxes option is selected in the WebUser Preferences, the renamed mailbox(es) are renamed in the account subscription list.
If the operation has been successful, the removed element with the Yes string value is added to the result data set and the code component stops request processing. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

If the HTTP request contains the Update parameter, the code component retreieves all Acc parameters from the request. Each Acc parameter should have a numeric value. For each retreieved Acc parameter value nnn, the Znnn parameter is retrieved. If it contains a non-empty string, all Knnn request parameters are retrieved, where K is a mailbox access right letter.
The list of Znnn name strings with their Knnn parameter sets are used to form and set the new ACL list for the selected mailbox.
If the ACL update operation has been successful, the messageCode element with the Updated string value is added to the result dataset. Otherwise, the errorCode element with the operation error code string value is added to the result dataset.

Result Dataset

renamed
This element with the Yes string value is added to the dataset if the mailbox has been renamed. In this case no other element is added to the result dataset.

removed
This element with the Yes string value is added to the dataset if the mailbox has been removed. In this case no other element is added to the result dataset.

rights
This array element contains the mailbox ACL (Access Control List) elements. Each array element is a dictionary with the following elements:

ident
this string element contains the ACL element name.

index
this string element contains the element number in the ACL set.

lookup, select, seen, flags, insert, post, create, delete, admin
these elements with Yes string values are added when the ACL element includes these mailbox access rights.


Name: Alerts
This code component can be called implicitly, if the Web Application module has detected a pending Alert message.

Actions

If the HTTP request contains the AlertTime parameter, that parameter should contain a time stamp in the ACAP format. The code component confirms all Alerts older than the specified time.

Result Dataset

alerts
This element is added to the result dataset if there are pending Alerts for the session user. The element value is an array of dictionary elements, each element describing one alert message. Each dictionary contains the following elements:

time
A string element containing the time when the alert was posted.

text
A string element containing the alert message text.

currentTime
This element is added to the result dataset if there are pending Alerts for the session user. Its string value contains the current time in the ACAP format.


Name: Subscription

Actions

If the HTTP request contains the Open parameter, the MailboxName parameter value is converted into the "UTF-7 Mailbox Name encoding" format, the converted string is added to the result dataset as the jump element, and the request processing ends.

If the HTTP request contains the Update parameter:

  • All Elem request parameters are retrieved, converted into the "UTF-7 Mailbox Name encoding" format, and form the new Account Subscription list.
  • All AliasName request are retreived, they should contain numeric values. For each retrieved numeric value nnn, the parameters pairs annn and mnnn are retrieved. If both parameters exist and contain non-empty strings, the strings are converted into the "UTF-7 Mailbox Name encoding" format, and are used to form the new set of Account Mailbox Aliases.
  • If the Subscription or Mailbox Aliases update operation fails, the errorCode element is added to the result dataset. Otherwise the messageCode element with the Updated string value is added to the result dataset.

Result Dataset

jump
The name of the mailbox to open ("to jump to"). If this element exists, none of the following elements is added to the result dataset.

subscription
This array element contains the Account subscription list. Each array element is a string with some mailbox name.

aliases
This array element contains the Account Mailboix Aliases list. Each array element is a dictionary with the following elements:

index
A string with this Mailbox Alias element index.

name
A string with the Mailbox Alias name.

ref
A string with the name of the Mailbox this Alias points to.


Name: Password

Actions

If the HTTP request contains the ModifyPassword parameter, the request should also contain the OldPassword parameter, and that parameter should match the current Account password. If the OldPassword parameter value is correct:

  • The RecoverPassword request parameter value is set as the new RecoverPassword account setting. The messageCode element with the Updated string value is added to the result dataset.
  • If the Account user is allowed to modify the Account password, the NewPassword1 and NewPassword2 parameters are checked. If they are non-empty and match each other, then the Account password is updated using these parameters value.

    If the password has been updated successfully, the messageCode element with the PasswordChanged string value is added to the result dataset. If the password update operation failed, the errorCode element is added to the result dataset.

Result Dataset

RecoverPassword
This string element contains the Account RecoverPassword setting value.


Name: PublicInfo

Actions

If the HTTP request contains the Update parameter, the request should also contain zero, one, or several ID parameters, each with a numeric value. For each ID parameter, its numeric value nnn is used to retrieve the pair of Nnnn and Vnnn string parameters. The value of the Nnnn parameter specifies the name of the Account Public Info setting, the value of the Vnnn parameter specifies the setting value. These pairs are used to set the new Account Public Info settings. If an empty string is specified as a setting value, the setting is removed from the Account Settings.

If the Public Info settings have been updated successfully, the messageCode element with the Updated string value is added to the result dataset. If the password update operation failed, the errorCode element is added to the result dataset.

Result Dataset

publicInfo
This array element contains a set Public Info elements. It contains one element for each Public Info Setting specified with the Directory Integration settings. Each array element is a dictionary with the following elements:

id
this string element contains the element number in the set.

name
this string element contains the Public Info setting name.

value
this string element contains the current Public Info setting value. This element exists only if the Account contains this Public Info setting.


Name: WebSite

The code component uses the generic WebSite component to process the HTTP parameters and to form the result dataset. Before the generic component is called, the following elements are added to the result dataset:

Result Dataset

fileRef
The WebFile/ string.

pageRef
The website.wssp string.


Name: Bye

Actions

The code component can delete old messages from the Trash (as specified in the WebUser preferences) and closes the session. The session will be destroyed as soon as this HTTP request is processed, so the bye.wssp code can use session data, but the prpduced HTML code should not contain references to session objects.

Result Dataset

blockAlerts
This element has the Yes string value. It is added to the result dataset to prevent Alert processing.


Generic Code Components

The Web Application module has several generic components used to process both stateless and session requests.


Generic Mailbox component

Actions

If the HTTP request contains Filter, Search, Limit parameters, these parameter values are used to modify the mailbox "viewer" current Filter, Search, Limit values.

If the HTTP request parameter Skip exists, it should have a numeric value. This number is used to set the current first message index - the number of the first message to be displayed on this page.

If the HTTP request contains the parameter Next, then the current first message index is increased by the current Limit value.

If the HTTP request contains the parameter Prev, then the current first message index is decreased by the current Limit value.

If the HTTP request contains the parameter Sort, its numeric value specifies the number of "sorting" column (to sort the mailbox view by the first column, the Sort parameter should be 0).

If the HTTP request contains the parameter SDir, its numeric value specifies the sorting order: the value 1 requests ascending order, the value 0 - descending order, the value -1 reverses the current sorting order.

Result Dataset

checkAll
This element has the CHECKED string value. It is added to the result dataset if the HTTP request contains the MarkAll parameters.

filter
The string value of this element is the current Filter string.

search
The string value of this element is the current Search string.

limit
The string value of this element is the current Limit value (a number).

sentBox
This element has the YES string value and exists only if this mailbox is a Sent-type mailbox.

headers
The array value of this element contains mailbox view column headers. Each array element is a dictionary with the following elements:

index
This string element contains the column number.

name
This string element contains the column name.

hilited
This element has the YES string value and exists only if this column is the sorting column.

sdir
If this column is not the sorting column, this element contains the current sorting order (0 or 1) If this column is the sorting column, this element contains the reversed current sorting order (1 - current sorting order).

align
This element contains the string LEFT for text columns (From, Subject, Sender, etc.), and the string RIGHT for date- and size-type columns.

messages
The array value of this element contains the mailbox view data. Each array element is a dictionary with message data, and it contains the following elements:

id
this element contains the message Unique ID (UID)

fields
this array element contains message column data. The columns are stored in the same order as columns in the headers result dataset element. Each element is a dictionary. It contains the following elements:

hilited
This element has the YES string value and exists only if this column is the sorting column.

sdir
If this column is not the sorting column, this element contains the current sorting order (0 or 1) If this column is the sorting column, this element contains the reversed current sorting order (1 - current sorting order).

align
This element exists for date- and size-type columns. It contains the string RIGHT.

isRef
This element exists for the selected column and for the first "clickable" column. If it exists, it contains the string YES.

value
This element contains the column data. It exists for all columns except for the Status column. For the Sent and Received columns the element contains the "date" value - values of that type can be displayed using the DATE:, DATETIMESHORT and similar prefices.

isStatus
This element exists if the column is the Status column. If it exists, it contains the string YES.

isDate
This element exists if the column is a Sent or Recieved column and the value element contains the "date"-type value.

status
This element exists if the column is the Status column. If it exists, it contains the one of the follwing strings:
  • If the message has the Deleted flag - Deleted, otherwise
  • If the message has the Draft flag - Draft, otherwise
  • If the message has the Redirected flag - Redirected, otherwise
  • If the message does not have the Seen flag - Unread, otherwise
  • If the message has the Answered flag - Answered, otherwise
  • Read

flagged
This element exists if the column is the Status column and the message has the Flagged flag. If it exists, it contains the string YES.

recent
This element exists if the column is the Status column and the message has the Recent flag. If it exists, it contains the string YES.

firstNumber
This string element contains the number of the first message in the view.

firstNumber1
This string element contains the number of the first message in the view increased by 1.

lastNumber
This string element contains the number of the first message in the view increased by the number of the messages array elements if this array is not empty, or increased by 1 if the messages array is empty.

numTotal
The total number of messages in this mailbox.

numUnread
The total number of unread messages (messages without the Seen flag) in this mailbox.

numSelected
The total number of mailbox messages that can be displayed with the current Filter and Search values.

multiPage
This element with the YES string value is added if the nSelected value is not equal to the number of the messages array elements.

sortColumn
This element contains the number of the currently selected sorting column.

sortAscending
This element contains 1 is the currently selected sorting order is ascending, and 0 if it is descending.


Generic Message component

The generic Message component is used to convert the an RFC822 message into an HTML text. It processes simple and multi-part messages, attachements, digests, inline images and other letter components. To build a HTML presentation, the component uses strings from the Skin Text Dataset.


Code Components for Message Rendering

The Web Application module can render messages, converting them into a markup (HTML) text. This process is controlled by the Application module itself. It detects the MIME structure of the message, and processes each part recursively. For each part, a dataset is produced and a .wssp file is used to produce a markup language presentation.

Message Rendering code components do not perform any actions.

A Result Dataset produced by every Message Rendering code component includes the following fields:

MIMEPart
this string element contains a URL reference for the message or the message part that is being rendered.

filesRef
this string element contains the URL prefix needed to retrieve files from the proper Skin. When a message is being rendered withing some WebUser Session, this string is the same as the SESSION(filesRef) string.

The following Message Rendering code components are implemented:


Name: RFC822Message

This code component is used to render a mail message - a message stored in a mailbox or a message/rfc822 MIME subpart of some other message.

Result Dataset

RFC822Header
this string element contains the rendered markup presentation of the message RFC822 header.

RFC822Body
this string element contains the rendered markup presentation of the message RFC822/MIME body.

isSubPart
this optional element exists and has the YES string value if the message is a MIME subpart of some other message.


Name: RFC822Header

This code component is used to render an RFC822 mail message header.

Result Dataset

RFC822Fields
this element is an array with one dictionary-type element for each "visible" field in the header. Each dictionary contains the following elements:

name
this string element contains the header field name.

value
this string element contains the MIME-decoded field value.


Name: AttachmentPart, ImagePart

This code component is used to render an image or an attachment. Images and attachments can be separate MIME parts, or can be embedded into text parts using UUENCODE encoding.

Result Dataset

attachmentName
this string contains the file name as it is stored in the message data.

fileName
this string contains the "cleaned" file name (with all path components removed and image file name suffix added if necessary).

embeddedPart
if this string parameter exists, the file is an "embedded" UUENCODE data, and the string specifies the embedded component number inside the MIME part.

decodedSize
this string element contains the approximate size of the decoded file data.

decodedSize
this string element contains the approximate size of the decoded file data.


Name: DeliveryReportPart

This code component is used to render a message/report MIME subpart.

Result Dataset

MessageFields
this array element contains one dictionary element for each message-level report field. Each dictionary element contains the following elements:

name
this string element contains the report field name.

value
this string element contains the MIME-decoded report field value.

Reports
this array element contains one array element for each recipient report. Each recipient report is an array containing one dictionary element for each recipient-level report field. Each dictionary element contains the following elements:

name
this string element contains the report field name.

value
this string element contains the MIME-decoded report field value.


Name: DispositionReportPart

This code component is used to render a message/disposition-notification MIME subpart.

Result Dataset

fields
this array element contains one dictionary element for each message-level report field. Each dictionary element contains the following elements:

name
this string element contains the report field name.

value
this string element contains the MIME-decoded report field value.


Name: EncryptedPart

This code component is used to render an encrypted MIME subpart.

Result Dataset

decryptedPart
this array element contains the rendered markup presentation of the decrypted content. The element exists only if decryption was successful.

decryptionErrorCode
if this string element exists, it contains the error message explaining why content decryption has failed.

cipherName
This string element contains the name of the cipher used for content encryption.

keyLength
This string element contains the size of the encryption cipher key (in bits).


Name: SignedPart

This code component is used to render an signed MIME subpart.

Result Dataset

signedPart
this array element contains the rendered markup presentation of the signed content. The element exists only if decoding was successful (for binary-type signed messages).

encoding
this string element contains words "Binary" or "Text" depending on the format of the signed subpart.

decryptionErrorCode
if this string element exists, it contains the error message explaining why binary content decoding has failed.

digesterName
This string element contains the name of the digester used for digital signing.

signatures
If this array element exists, then the signed content was verified by at least one digital signature. Each element of this array is a dictionary with signature data. These dictionaries contain the following elements:

contact
this string element contains the E-mail address of the signer

commonName
this string element contains the "real name" of the signer

Country, Province, Organization, Unit
these optional string elements contain additional information about the signer.

CommuniGate® Pro Guide. Copyright © 1998-2003, Stalker Software, Inc.