This section describes BEA AquaLogic Service Registry from the developer's point of view. It describes the BEA AquaLogic Service Registry Framework architecture and configuration.
The framework uses the Jasper engine, a part of the server. It is able to run on Jasper1 (Servlet API 2.3/JSP spec 1.2) or Jasper2 (Servlet API 2.4/JSP spec 2.0). It also uses a customized JSTL 1.0 tag library implementation which is based on Apache tag libraries from the Jakarta project.
Applications using the Systinet Web Framework are composed of pages. Every page of the web has a URI where it can be accessed. In the Systinet Web Framework, we call each page of the web as a task.
The Systinet Web Framework uses a component model to build up the web application. Every task is assigned to a component which is the real entity behind the process that generates the resulting HTML page displayed to the user. Thus, every task references a component, but components need not be associated with tasks, as we will see later.
Each component is built from two parts:
The JSP part serves as a template and takes care of parsing and visualization of the data that comes in a session, or in a request to which they are stored in the Java part of a component.
The framework functionality is accessible from the JSP parts of components through the Systinet custom JSP tag library. This library contains tags for creating references to tasks, nesting components, and tags for creating HTML form elements that support dynamic behavior.
Sometimes, a component is purely JSP-based as the one associated with this documentation page. But when the page must process user-entered information, or when data must be modified before presentation, you must use the Java part of the component.
To switch from one page to a another, use the syswf:control custom tag in the JSP part of the source task component. The syswf:control tag's targetTask attribute defines the task (that is, the page) the user should be transferred to. The custom tag is translated into a piece of JavaScript code responsible for correct page submitting.
Tasks can be accessed directly using a web browser. For example, if the registry's web interface runs on the address http://localhost:8080/uddi/web, a task with the URI /findBusiness can be accessed directly from the client browser at http://localhost:8080/uddi/web/findBusiness.
The Java part of the component must implement the com.systinet.webfw.Component interface from the Web Framework library. However, it usually extends its default implementation: com.systinet.webfw.ComponentImpl. For those components that do not declare their Java part, this default implementation is automatically used.
The interface consists of two methods:
void process(String action, Map params)
void populate(String action, Map params)
The process() method is called just before the translation of the component's JSP part is started, so it should take care of data preparation and it should also handle the actions requested by the user (react to pressed buttons, etc.).
The populate() method is called only when the POST request to the URI comes from the same URI , so it's a perfect place to modify the way data from a web page is populated back into objects. Actually, the target objects are always Java Beans which simplify their handling quite a bit.
The diagram shown in Figure 12 demonstrates how requests for the page are handled by the Web Framework:
The request is sent by the client browser from a different page than the page requested.
The process() method is called on taskA component's Java part. This method should perform actions triggered by controls in the web page and/or prepare data for taskA component's JSP part.
Processing of taskA component's JSP part is initialized.
While taskA component's JSP part is being processed, the resulting HTML is generated.
Processing of taskA component's JSP part finishes; the response is returned to the client's browser.
Note | |
---|---|
If the request is sent by the client browser from the same page as the page requested (meaning the source and target tasks are the same), then the populate() method is called on the task component's Java part before the process() method. |
As we noted above, the component JSP part can include other components using the syswf:component custom tag right in the JSP code. The diagram shown in Figure 13 presents how a request is handled when there are such nested components. Note that now the request comes from the same task it is targeted to:
The request is sent by the client browser from the same page as the page requested.
The populate() method is called on taskA component's Java part. This method is responsible for the transfer of data from web page form elements (input fields, radio buttons, etc.) to JavaBeans objects on the server.
The process() method is called on taskA component's Java part. This method should perform actions triggered by controls in the web page and/or prepare data for taskA component's JSP part.
Processing of taskA component's JSP part is initialized.
Request for insertion of component A is found.
The process() method is called on the Java part of component A. This method should prepare data for component presentation.
Processing of the JSP part of component A is performed. Once finished, the result is included in the parent JSP page.
Request for insertion of component B is found.
The process() method is called on the Java part of component B. This method should prepare data for component presentation.
Processing of the JSP part of component B is performed. Once finished, the result is included in the parent JSP page.
Processing of taskA component's JSP part finishes. The response is returned in the client's browser.
Example 17. Skeleton of the JSP Page
The following example displays the WSDL URL for a WSDL service.
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix="syswf" uri="http://systinet.com/jsp/syswf" %> <syswf:page headerTemplate="pageHeader.jsp" footerTemplate="pageFooter.jsp"> <syswf:wrap headerTemplate="design/pageHeader.jsp" footerTemplate="design/pageFooter.jsp"> ... </syswf:wrap> </syswf:page>
The core of the JSTL (standard tag library) together with the Registry Web Framework custom tag library are imported. The beginning of the page is declared ( syswf:page tag); page header and footer represented as JSP pages are passed as attributes. These pages contain the basic HTML tags and declaration of Java Scripts that will be used in the page.
To enable automatic wrapping and resizing, all of the page's content is packed into the syswf:wrap tag to which page header and footer JSP pages are passed as attributes. The header and footer pages contain:
The design part - the logo and menu, such as the labels at the top of this page under the product name
The navigation path - shown in the top right corner of this page
Text that should be displayed in the bottom of the page, such as copyright information.
Implicit objects allow you to interact with various framework parts, from Java code or JSP pages. A reference to an implicit object should be obtained from the com.systinet.uddi.util.CallContext class, or by using simple getter methods from com.systinet.webfw.ComponentImpl.
request HTTP request interface; here you can read, for example, http headers included in user's request. Using request attributes is the preferred way to transfer data from Java to JSP pages.
response HTTP response interface; can be used, for example, to set content type and other response header data or to send binary data back to client.
localSession Contains the java.util.Map object, which is accessible from the current task only. For example, when you have tasks A and B in navigation history, each has a separate local session. When you return from task B to task A, the whole local session content of task B is discarded.
globalSession Contains the java.util.Map object, which is shared among all tasks; this session can be used, for example, to store the current user's authToken, or other application-wide data.
Data type classes are responsible for converting values between web page HTML form fields and underlying Java Beans objects. The Data type class must implement the simple interface com.systinet.webfw.datatype.DataType with two methods:
String objectToWeb(Object value) provides conversion from arbitrary Java type to String usable in web pages.
Object webToObject(String value) provides conversion in the opposite direction.
There are predefined implementations of this object for converting the simple Java data types string, int, long, and boolean.
Validators can be used to validate user input before a web page is submitted to a server. The validation is invoked by a specific page control (a button or a link). There is a predefined set of validators for common input field checks.
Table 54. Predefined Validators
Name | Description |
---|---|
required | Checks if the field is not empty. |
uddiKey | Checks if the field content starts with the uddi: prefix. |
length50, length80, length255, length4096, length8192 | Checks if the field contains no more than the specified number of characters. |
Checks if the field contains an email address. | |
long | Checks if the field contains a number of type long. |
int | Checks if the field contains a number of type int. |
To add a validator to an input field or a text area, use the sysfw:checker tag. To trigger the validation control, use the syswf:validate tag.
Example 18. Validators Usage
<syswf:input name="businessKey" value=""> <syswf:checker name="required" action="viewBusinessV3"/> <syswf:checker name="uddiKey" action="viewBusinessV3"/> </syswf:input> ... <syswf:control action="viewBusiness" caption="View business" mode="button"> <syswf:validate action="viewBusinessV3"/> </syswf:control>
The Example 18 shows an input field with two checkers, the first one checks if the field is not empty and the second one checks if the field contains a string starting with the prefix uddi: (uddi key). Both checkers are invoked when a user clicks the View business button.
Validation is performed using a JavaScript function. The validator name is required to be defined in the JavaScript function with the name check_required. The return value from the validator is of the boolean type: true when the field content is valid, and false when content is invalid. In case of error, the validator displays an error message with the description of the allowed field content. This validator is also responsible for transferring the focus to the field with an error.
Example 19. Required Validator Implementation
// is required checker function check_required (formID, fieldID) { var value = getFieldValue(formID, fieldID); if (isEmpty(value)) { alertRequired(); setFocus(formID, fieldID); return false; } return true; }
Custom validators should be can be added to the file REGISTRY_HOME/app/uddi/web.jar/webroot/script/uddi.js. Many functions for validation are defined in the file REGISTRY_HOME/app/uddi/web.jar/webroot/script/wf.js.
JSP pages for the BEA AquaLogic Service Registry user interface are placed in the REGISTRY_HOME/app/uddi/web.jar/jsp directory. Static content, such as scripts and images, is stored in the REGISTRY_HOME/app/uddi/web.jar/webroot directory.
Table 55. Root Files
File | Description |
---|---|
error.jsp | skeleton for error page |
home.jsp | main page with welcome text |
login.jsp | login page |
management.jsp | page with buttons for all registry management tasks |
pageFooter.jsp | page header containing required JavaScripts and HTML form. Do not write any design here; use design/pageFooter.jsp instead |
pageHeader.jsp | contains mainly page hidden fields. Do not write any design here; use design/pageHeader.jsp instead |
uddiErrorComponent.jsp | component responsible for displaying error messages |
Table 56. Content of Page Directories
Directory | Description |
---|---|
account | All pages related to account management |
admin | Administration tools for tModel deletion and key replacement |
approval | Pages for approval process |
configuration | Registry and web configuration pages |
custody | User interface for custody transfer |
design | Contains various design elements such as frames and tabs |
group | Group management |
inquiry | UDDI inquiry pages |
permission | Permission management |
publishing | UDDI publishing pages |
replication | Replication management |
statistics | Shows registry statistics |
subscription | UDDI subscription pages |
taxonomy | Taxonomy browsing and management |
util | Various page components |
wsdl2uddi | WSDL-to-UDDI mapping pages |
xml2uddi | Inquiry and publishing pages for mapping of XML files to UDDI |
xsd2uddi | Inquiry and publishing pages for mapping of XML schemas to UDDI |
xslt2uddi | Inquiry and publishing pages for mapping of XSLT style sheets to UDDI |
All needed configuration settings are stored in the file REGISTRY_HOME/app/uddi/conf/web.xml
Specifies configuration of page components.
Table 57. Component Attributes
Attribute | Description | Required |
---|---|---|
name | Unique component identification | yes |
className | Fully qualified class name of the component implementation class | no |
page | Path to JSP page with component design; path is relative to root JSP directory. | no |
Contains definition of tasks.
Table 58. Task Attributes
Attribute | Description | Required |
---|---|---|
URI | Unique string used to call a task from controls or directly using http URL; the URI must start with a forward slash (/) character. | yes |
caption | task description to be displayed, for example as page title | no |
component | Name of task root component | yes |
Table 59. Subelement
Element | Description | Required |
---|---|---|
param | Additional parameters to be passed to the root component; each parameter is specified as name-value pair. | no |
Contains the definition of the data types.
Table 60. Data Type Attributes
Attribute | Description | Required |
---|---|---|
typeName | Unique name of the data type; this name is used to reference a data type, for example from the syswf:input tag. | yes |
className | Name of data type implementation class | yes |
Table 61. Configuration Elements
Element | Description |
---|---|
url | First part of the URL used to access BEA AquaLogic Service Registry without encryption (plain HTTP); this part should contain the http protocol prefix, hostname, and port. |
secureUrl | First part of the URL used to access BEA AquaLogic Service Registry using encryption. This part should contain https protocol prefix, hostname and port. |
context | Context part of the URL, used to access BEA AquaLogic Service Registry tasks; the default value is uddi/web for standalone registries and wasp/uddi/web for registries ported to an application server. |
dataContext | Context part of the URL, used to access BEA AquaLogic Service Registry's static content, for example, images and cascading style sheets. The default value is uddi/webdata for standalone registries and wasp/uddi/webdata for registries ported to an application server. |
serverSessionTimeout | Default timeout of server-side sessions (measured in seconds). |
uploadTempDir | Directory used to store temporary files during the upload process; this path should be relative to service context directory. |
maxUploadSize | Maximum size of uploaded files; larger files are rejected. |
jspDir | Directory with JSP pages; the path should be relative to service context directory. |
jspEngine | Contains JSP engine initialization parameters and the compilation classpath. A complete list of available Jasper initialization parameters can be found below. |
Table 62. Jasper init Configuration Parameters
Parameter name | Default value | Description |
---|---|---|
checkInterval | 300 | If the development parameter is false and reloading parameter is true, background compiles are enabled. checkInterval is the time in seconds between checks to see if a JSP page needs to be recompiled. |
compiler | javac | Which compiler Ant should be used to compile JSP pages. See the Ant documentation for more information. |
classdebuginfo | true | Indicates whether the class file should be compiled with debugging information |
development | true | Indicates whether Jasper is used in development mode; checks for JSP modification on every access. |
enablePooling | true | Determines whether tag handler pooling is enabled |
ieClassId | clsid:8AD9C840-044E-11D1-B3E9-00805F499D93 | The class-id value sent to Internet Explorer when using >jsp:plugin< tags. |
fork | true | Tells Ant to fork compiles of JSP pages so that a separate JVM is used for JSP page compiles from the JVM. |
javaEncoding | UTF8 | Java file encoding to use for generating java source files. |
keepgenerated | true | Indicates whether generated Java source code for each page is kept or deleted. |
logVerbosityLevel | WARNING | The level of detailed messages to be produced by this servlet. Increasing levels cause the generation of more messages. Valid values are FATAL, ERROR, WARNING, INFORMATION, and DEBUG. |
mappedfile | false | Indicates whether the static content is generated with one print statement per input line, to ease debugging. |
reloading | true | Indicates whether Jasper checks for modified JSPs. |
A JSP page using the syswf tag library must include this header <%@ taglib prefix="syswf" uri="http://systinet.com/jsp/syswf" %>
Includes the component with specified parameters.
Table 63. syswf:component Attributes
Attribute | Description | Required |
---|---|---|
prefix | All parameter names in component will be prefixed with this prefix; the prefix must be unique within each JSP page. | yes |
name | Name of component, as written in the config file. | yes |
Table 64. syswf:component Subelements
Element | Description | Required |
---|---|---|
param | When this parameter value is passed into a component, it will be accessible in the request scope in the component Java class and in the JSP page. | optional |
The value of the parameter should be specified in two ways: As a value attribute or as a content of the value tag.
Example 20. Component Parameters
<syswf:component prefix="names" name="nameList"> <syswf:param name="color1" value="white"/> <syswf:param name="color2">black</syswf:param> </syswf:component>
Creates an HTML page form with all required internal fields. This must be the root element of all components used as tasks.
Table 65. syswf:page Attributes
Attribute | Description | Required |
---|---|---|
headerTemplate | The filename of the JSP page containing the page header, this file is designed to create elements required for framework functionality. Note that there should be no graphic design. | yes |
footerTemplate | The filename of the JSP page containing the page footer, this file is designed to create elements required for framework functionality. Note that there should be no graphic design. | yes |
This tag helps you to separate page functionality from its design. It includes specified header and footer templates before and after the body element. Header and footer templates should be parametrized using syswf:param tags.
Table 66. syswf:wrap Attributes
Attribute | Description | Required |
---|---|---|
headerTemplate | File name of JSP page containing the header. | no |
footerTemplate | File name of JSP page containing the footer. | no |
Table 67. syswf:wrap Subelements
Element | Description | Required |
---|---|---|
param | When you pass the parameter value into a component, this parameter will be accessible in the request scope in the component Java class and JSP page. | no |
Creates a button or link, which should be used to trigger actions and transfers to other tasks.
Table 68. syswf:control Attributes
Attribute | Description | Required |
---|---|---|
action | Action to be passed to a control's parent component. | no |
mode | Allowed values are button, anchor, script, or image. The script generates the submit JavaScript command, which can be used, for example, as a value for the HTML onClick attribute. Image is a graphic button. | yes |
targetTask | URI of task to be called. | no |
targetDepth | Specifies level in navigation path to be used. | no |
targetUrl | Specifies the URL to be used to submit data; usable, for example, when you need to switch from http to https. | no |
caption | control caption | required in anchor and button mode |
hint | Help text, displayed as tooltip. | no |
disabled | If set to true, button is disabled and link cannot be clicked. | no |
redirect | If set to true, the task is only redirected to another task. This means that task data stored in a local session will also be accessible from the target task. Normal behavior is that a local session is not transferred between tasks. | no |
src | Path to the image file used as graphic button. | required in image mode |
Table 69. syswf:control Subelements
Element | Description | Required |
---|---|---|
param | Adds action parameters. | no |
attribute | Adds attributes to created input or an HTML tag. | no |
Inserts input field into JSP page.
Table 70. syswf:input Attributes
Attribute | Description | Required |
---|---|---|
name | Specifies the name of the accessible value of this input field. | yes |
value | Specifies a value which appears in the input field, or a base object for the property attribute. | yes |
property | Contains the property name of the object specified by the expression in the value attribute. | no |
hint | Help text, displayed as a tooltip. | no |
dataType | Data type which will be used to transform values between the underlying Java Bean object and the input field. | no |
disabled | If set to true, the input field will be disabled. | no |
mode | A possible value is password, used for password fields. | no |
Table 71. syswf:input Subelements
Element | Description | Required |
---|---|---|
attribute | Appends a name and value pair as attribute to the resulting HTML tag; usable, for example, for the CSS class specification for an input field. | no |
Displays controls which enable the user to select one value from a list of available values.
Table 72. syswf:selectOne Attributes
Attribute | Description | Required |
---|---|---|
name | Specifies the name under which this value will be accessible; select one element. | yes |
mode | Specifies visual style; possible values are radio, check box, and menu. | no |
value | Specifies a value which will be selected, or a base object for the property attribute. | yes |
property | Contains the property name of the object specified by expression in the value attribute. | no |
optionValues | Specifies a comma-delimited list of available values, the expression of which evaluates either to String[], or to an array of object for the optionValuesProperty attribute. | yes |
optionValuesProperty | Contains property name of objects specified by expression in the optionValues attribute. | no |
optionCaptions | Specifies a comma-delimited list of available captions, the expression of which evaluates either to String[], or to an array of object for the optionCaptionsProperty attribute. | no |
optionCaptionsProperty | Contains property name of objects specified by expression in the optionCaptions attribute. | no |
hint | Help text, displayed as tooltip. | no |
dataType | Data type which will be used to transform values between the underlying Java Bean object and the selected element. | no |
Table 73. syswf:selectOne Subelements
Element | Description | Required |
---|---|---|
attribute | Appends a name/value pair as an attribute to resulting HTML tags. | no |
Displays controls which enable the user to select multiple values from list of available values.
Table 74. syswf:selectMany Attributes
Attribute | Description | Required |
---|---|---|
name | Specifies the name under which the value of this selectMany element will be accessible. | yes |
mode | Specifies visual style possible values check, box and menu. | no |
value | Specifies an array of values which will be selected, or base objects, for the property attribute. | yes |
property | Contains property name of objects specified by expression in the value attribute. | no |
optionValues | Specifies a comma-delimited list of available values the expression of which evaluates to String[], or to an array of object for the optionValuesProperty attribute. | yes |
optionValuesProperty | Contains the property name of objects specified by expression in the optionValues attribute. | no |
optionCaptions | Specifies a comma-delimited list of available captions, the expression of which evaluates to either String[], or to an array of object for the optionCaptionsProperty attribute. | no |
optionCaptionsProperty | Contains a property name for objects specified by expression in the optionCaptions attribute. | no |
hint | Help text, displayed as tooltip. | no |
Table 75. syswf:selectMany Subelements
Element | Description | Required |
---|---|---|
attribute | Appends a name/value pair as an attribute to result HTML tags. | no |
Creates a text area HTML component.
Table 76. syswf:textArea Attributes
Attribute | Description | Required |
---|---|---|
name | Specifies the name under which the value of this text area will be accessible. | yes |
value | Specifies a value which appears in the text area, or a base object for the property attribute. | yes |
property | Contains a property name of an object specified by expression in the value attribute. | no |
hint | Help text, displayed as tooltip. | no |
dataType | Data type which will be used to transform values between underlying the Java Bean object and the text area. | no |
disabled | If set to true, the text area will be disabled. | optional |
Table 77. syswf:textArea Subelements
Element | Description | Required |
---|---|---|
attribute | Appends a name/value pair as an attribute to the result HTML tag; usable, for example, for CSS class specification for the text area. | no |
Evaluates the given expression and transform result using data type.
Table 78. syswf:value Attributes
Attribute | Description | Required |
---|---|---|
value | Specifies the expression which will be evaluated. | yes |
hint | Help text, displayed as tooltip. | no |
dataType | Data type which will be used to transform value. | no |
This tag will fill the page attribute with size of given List, UDDIList, StringArrayList or Array.
Table 79. syswf:size Attributes
Attribute | Description | Required |
---|---|---|
var | Name of variable to store the size of a given list or array. | yes |
value | Specifies an expression to be evaluated; the result must be List, UDDIList, StringArrayList or Array. | yes |
scope | Scope of the variable to store the size of a given list or array. Allowed values are request, session, application, or default. | no |
This component renders the history path (bread crumbs links)
navigationPath component in action
Q: Where can I find the code which generates the page header? A: It is defined in the file design/pageHeader.jsp.
Q: How do I change the text displayed on a page's title bar? A: Modify content of <title> tag in the file pageHeader.jsp.
Q: Where is the right place to include my own JavaScript files? A: Reference to your files should be placed in pageHeader.jsp. Place your script files in the REGISTRY_HOME/app/uddi/web.jar/webroot/script directory.
Q: Where is it possible to change the text displayed in the page footer? A: The page footer is defined in the file design/pageFooter.jsp.