The CentraSite Business user interface must anticipate runtime errors and attempt to recover from them.
This document contains information for the CentraSite user who wants to extend CentraSite's message handling by adding email notifications.
The content is organized under the following sections:
The CentraSite Business UI provides user-friendly error messages that can be tailored to the requirements. In the CentraSite Business UI, these error messages are displayed using a dialog box. The dialog box contains a title, a short explanation of the error, and the possible action(s) a user can do. Additionally, the dialog box includes a
button that offers diagnostic information and help.The diagnostic information and help includes:
Full stack trace of an error.
User action that caused an error to happen.
Screenshot of an error.
Tokenization support.
You can use the diagnostic email notifications to alert users whenever an error occurs in CentraSite Business UI.
Use the following procedure to configure the diagnostic email notification settings:
To configure the diagnostic email notification settings
Create an XML diagnostics configuration as shown in the example below:
<DiagnosticsConfiguration> <EmailAddresses> <EmailAddress id="defaultEmail">admin@softwareag.com</EmailAddress> </EmailAddresses> <EmailTemplate id="defaultDiagnosticTemplate" name="DefaultDiagnostics.html" mimetype="html" /> <EmailPreSubject id="defaultSubject">Diagnostic from ${system.user.name}</EmailPreSubject> </DiagnosticsConfiguration>
Append the XML configuration to the centrasite.xml file. The centrasite.xml file is located in the cast\cswebapps\BusinessUI\custom\conf folder under the CentraSite installation directory.
The diagnostics snippet would look like the following:
<GUIConfiguration> <DiagnosticsConfiguration> <EmailAddresses> <EmailAddress id="defaultEmail">admin@softwareag.com</EmailAddress> </EmailAddresses> <EmailTemplate id="defaultDiagnosticTemplate" name="DefaultDiagnostics.html" mimetype="html" /> <EmailPreSubject id="defaultSubject">Diagnostic from ${system.user.name}</EmailPreSubject> </DiagnosticsConfiguration> </GUIConfiguration>
Specify the following parameters:
Parameter | Description |
---|---|
EmailAddress |
The email address of the users to whom the email message is to be sent. |
EmailTemplate name |
The email template represents the body of the message. You can
specify substitution tokens in the body of the email message. Substitution
tokens enable you to incorporate run-time information into the email. For
example, you can use the |
EmailPreSubject |
The text that will appear on the subject line of the email. You can specify the text of the email by typing a message directly into the EmailPreSubject parameter or by using an email template. For more information about these options, see Using a Custom Message in Diagnostic Email Notification . |
The following list describes substitution tokens that you can use to incorporate data from the runtime errors into the email. For example, you can use tokens to return information about the object on which the error occurred, identify the user who caused the error, and/or indicate what type of action caused the error to occur.
This token... | Inserts the following information into the parameter value at execution time... |
---|---|
${error.id} |
The unique identifier of the error. |
${error.message} |
A short message text describing the error. |
${error.action} |
An action that a user can perform to resolve the error. |
${error.explanation} |
A description of the error. |
${error.stacktrace} |
The stack trace of the error. |
${entity.name} |
The object's name (in the user's locale). |
${entity.description} |
The object's description. |
${entity.owner} |
The name of the user who owns the object on which the error occurred. |
${entity.organization} |
The organization to which the object on which the error occurred belongs. |
${entity.state} |
The state of the object on which the error occurred. |
${entity.type} |
The type of object on which the error occurred. |
${entity.XML} |
XML of the object on which the error occurred. |
${entity.URL} |
The URL for the object on which the error occurred. |
${entity.version} |
The object's user-assigned version identifier. |
${system.repository.url} |
The fully qualified URL for the CentraSite registry/repository (http://localhost:53305/CentraSite/CentraSite). |
${system.user.name} |
The name of the user who caused the error. |
${user.locale} |
The locale of the user who caused the error. |
${diagnostic.all.properties} |
Renders all custom properties provided during diagnostics. |
One way to specify the body of the email message is to simply type the
message directly into the EmailTemplate name
parameter.
<EmailPreSubject/> Error occurred while creating the service ${entity.name}. The operation was executed by the customer ${system.user.name}<EmailPreSubject/>