Registry Web Framework  Locate

This section describes Oracle Service Registry from the developer's point of view. It describes the Oracle Service Registry Framework architecture and configuration.

Architecture Description  Locate

The framework uses the Jasper engine, a part of the Tomcat server. It is able to run on Jasper1 from Tomcat version 4.1 (Servlet API 2.3/JSP spec 1.2) or Jasper2 from Tomcat version 5 (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 Web Framework are composed of pages. Every page of the web has a URI where it can be accessed. In the Web Framework, we call each page of the web as a task.

The 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 a 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:8888/registry/uddi/web, a task with the URI /findBusiness can be accessed directly from the client browser at http://localhost:8888/registry/uddi/web/findBusiness.

Component Java Interface Part  Locate

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.

Request Diagram  Locate

The diagram shown in Figure 12 demonstrates how requests for the page are handled by the Web Framework:

Figure 12. Request Diagram

Request Diagram
  1. The request is sent by the client browser from a different page than the page requested.

  2. 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.

  3. Processing of taskA component's JSP part is initialized.

  4. While taskA component's JSP part is being processed, the resulting HTML is generated.

  5. Processing of taskA component's JSP part finishes; the response is returned to the client's browser.

[Note]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.

Nesting Components  Locate

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:

Figure 13. Nesting Components Diagram

Nesting Components Diagram
  1. The request is sent by the client browser from the same page as the page requested.

  2. 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.

  3. 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.

  4. Processing of taskA component's JSP part is initialized.

  5. Request for insertion of component A is found.

  6. The process() method is called on the Java part of component A. This method should prepare data for component presentation.

  7. Processing of the JSP part of component A is performed. Once finished, the result is included in the parent JSP page.

  8. Request for insertion of component B is found.

  9. The process() method is called on the Java part of component B. This method should prepare data for component presentation.

  10. Processing of the JSP part of component B is performed. Once finished, the result is included in the parent JSP page.

  11. Processing of taskA component's JSP part finishes. The response is returned in the client's browser.

Component JSP Part  Locate

Example 16. 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  Locate

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 Types  Locate

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.

Client-side Validators  Locate

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

NameDescription
requiredChecks if the field is not empty.
uddiKeyChecks if the field content starts with the uddi: prefix.
length50, length80, length255, length4096, length8192Checks if the field contains no more than the specified number of characters.
emailChecks if the field contains an email address.
longChecks if the field contains a number of type long.
intChecks 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 17. 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 17 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 18. 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.

Directory Structure  Locate

JSP pages for the Oracle 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.

JSP Page Reference  Locate

Table 55. Root Files

FileDescription
error.jspskeleton for error page
home.jspmain page with welcome text
login.jsplogin page
management.jsppage with buttons for all registry management tasks
pageFooter.jsppage header containing required JavaScripts and HTML form. Do not write any design here; use design/pageFooter.jsp instead
pageHeader.jspcontains mainly page hidden fields. Do not write any design here; use design/pageHeader.jsp instead
uddiErrorComponent.jspcomponent responsible for displaying error messages

Table 56. Content of Page Directories

DirectoryDescription
accountAll pages related to account management
adminAdministration tools for tModel deletion and key replacement
approvalPages for approval process
configurationRegistry and web configuration pages
custodyUser interface for custody transfer
designContains various design elements such as frames and tabs
groupGroup management
inquiryUDDI inquiry pages
permissionPermission management
publishingUDDI publishing pages
replicationReplication management
statisticsShows registry statistics
subscriptionUDDI subscription pages
taxonomyTaxonomy browsing and management
utilVarious page components
wsdl2uddiWSDL-to-UDDI mapping pages
xml2uddiInquiry and publishing pages for mapping of XML files to UDDI
xsd2uddiInquiry and publishing pages for mapping of XML schemas to UDDI
xslt2uddiInquiry and publishing pages for mapping of XSLT style sheets to UDDI

Framework Configuration  Locate

All needed configuration settings are stored in the file REGISTRY_HOME/app/uddi/conf/web.xml

Component  Locate

Specifies configuration of page components.

Table 57. Component Attributes

AttributeDescriptionRequired
nameUnique component identificationyes
classNameFully qualified class name of the component implementation classno
pagePath to JSP page with component design; path is relative to root JSP directory.no

Task  Locate

Contains definition of tasks.

Table 58. Task Attributes

AttributeDescriptionRequired
URIUnique string used to call a task from controls or directly using http URL; the URI must start with a forward slash (/) character.yes
captiontask description to be displayed, for example as page titleno
componentName of task root componentyes

Table 59. Subelement

ElementDescriptionRequired
paramAdditional parameters to be passed to the root component; each parameter is specified as name-value pair.no

Data Type  Locate

Contains the definition of the data types.

Table 60. Data Type Attributes

AttributeDescriptionRequired
typeNameUnique name of the data type; this name is used to reference a data type, for example from the syswf:input tag.yes
classNameName of data type implementation classyes

Other Configuration  Locate

Table 61. Configuration Elements

ElementDescription
urlFirst part of the URL used to access Oracle Service Registry without encryption (plain HTTP); this part should contain the http protocol prefix, hostname, and port.
secureUrlFirst part of the URL used to access Oracle Service Registry using encryption. This part should contain https protocol prefix, hostname and port.
contextContext part of the URL, used to access Oracle Service Registry tasks; the default value is uddi/web for standalone registries and registry/uddi/web for registries ported to an application server.
dataContextContext part of the URL, used to access Oracle Service Registry's static content, for example, images and cascading style sheets. The default value is uddi/webdata for standalone registries and registry/uddi/webdata for registries ported to an application server.
serverSessionTimeoutDefault timeout of server-side sessions (measured in seconds).
uploadTempDirDirectory used to store temporary files during the upload process; this path should be relative to service context directory.
maxUploadSizeMaximum size of uploaded files; larger files are rejected.
jspDirDirectory with JSP pages; the path should be relative to service context directory.
jspEngineContains JSP engine initialization parameters and the compilation classpath. A complete list of available Jasper initialization parameters can be found below.

Jasper Configuration  Locate

Table 62. Jasper init Configuration Parameters

Parameter nameDefault valueDescription
checkInterval300If 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.
compilerjavacWhich compiler Ant should be used to compile JSP pages. See the Ant documentation for more information.
classdebuginfotrueIndicates whether the class file should be compiled with debugging information
developmenttrueIndicates whether Jasper is used in development mode; checks for JSP modification on every access.
enablePoolingtrueDetermines whether tag handler pooling is enabled
ieClassIdclsid:8AD9C840-044E-11D1-B3E9-00805F499D93The class-id value sent to Internet Explorer when using >jsp:plugin< tags.
forktrueTells Ant to fork compiles of JSP pages so that a separate JVM is used for JSP page compiles from the JVM in which Tomcat is running.
javaEncodingUTF8Java file encoding to use for generating java source files.
keepgeneratedtrueIndicates whether generated Java source code for each page is kept or deleted.
logVerbosityLevelWARNINGThe 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.
mappedfilefalseIndicates whether the static content is generated with one print statement per input line, to ease debugging.
reloadingtrueIndicates whether Jasper checks for modified JSPs.

syswf JSP tag library  Locate

A JSP page using the syswf tag library must include this header <%@ taglib prefix="syswf" uri="http://systinet.com/jsp/syswf" %>

syswf:component  Locate

Includes the component with specified parameters.

Table 63.  syswf:component Attributes

AttributeDescriptionRequired
prefixAll parameter names in component will be prefixed with this prefix; the prefix must be unique within each JSP page.yes
nameName of component, as written in the config file.yes

Table 64.  syswf:component Subelements

ElementDescriptionRequired
paramWhen 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 19. Component Parameters

<syswf:component prefix="names" name="nameList">
   <syswf:param name="color1" value="white"/>
   <syswf:param name="color2">black</syswf:param>
</syswf:component> 
                    

syswf:page  Locate

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

AttributeDescriptionRequired
headerTemplateThe 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
footerTemplateThe 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

syswf:wrap  Locate

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

AttributeDescriptionRequired
headerTemplateFile name of JSP page containing the header.no
footerTemplateFile name of JSP page containing the footer.no

Table 67.  syswf:wrap Subelements

ElementDescriptionRequired
paramWhen 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

syswf:control  Locate

Creates a button or link, which should be used to trigger actions and transfers to other tasks.

Table 68.  syswf:control Attributes

AttributeDescriptionRequired
actionAction to be passed to a control's parent component.no
modeAllowed 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
targetTaskURI of task to be called.no
targetDepthSpecifies level in navigation path to be used.no
targetUrlSpecifies the URL to be used to submit data; usable, for example, when you need to switch from http to https.no
captioncontrol captionrequired in anchor and button mode
hintHelp text, displayed as tooltip.no
disabledIf set to true, button is disabled and link cannot be clicked. no
redirectIf 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
srcPath to the image file used as graphic button.required in image mode

Table 69.  syswf:control Subelements

ElementDescriptionRequired
paramAdds action parameters.no
attributeAdds attributes to created input or an HTML tag. no

syswf:input  Locate

Inserts input field into JSP page.

Table 70.  syswf:input Attributes

AttributeDescriptionRequired
nameSpecifies the name of the accessible value of this input field.yes
valueSpecifies a value which appears in the input field, or a base object for the property attribute.yes
propertyContains the property name of the object specified by the expression in the value attribute.no
hintHelp text, displayed as a tooltip.no
dataTypeData type which will be used to transform values between the underlying Java Bean object and the input field.no
disabledIf set to true, the input field will be disabled. no
modeA possible value is password, used for password fields.no

Table 71.  syswf:input Subelements

ElementDescriptionRequired
attributeAppends 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

syswf:selectOne  Locate

Displays controls which enable the user to select one value from a list of available values.

Table 72.  syswf:selectOne Attributes

AttributeDescriptionRequired
nameSpecifies the name under which this value will be accessible; select one element.yes
modeSpecifies visual style; possible values are radio, check box, and menu. no
valueSpecifies a value which will be selected, or a base object for the property attribute.yes
propertyContains the property name of the object specified by expression in the value attribute.no
optionValuesSpecifies 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
optionValuesPropertyContains property name of objects specified by expression in the optionValues attribute.no
optionCaptionsSpecifies 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
optionCaptionsPropertyContains property name of objects specified by expression in the optionCaptions attribute.no
hintHelp text, displayed as tooltip.no
dataTypeData type which will be used to transform values between the underlying Java Bean object and the selected element.no

Table 73.  syswf:selectOne Subelements

ElementDescriptionRequired
attributeAppends a name/value pair as an attribute to resulting HTML tags.no

syswf:selectMany  Locate

Displays controls which enable the user to select multiple values from list of available values.

Table 74.  syswf:selectMany Attributes

AttributeDescriptionRequired
nameSpecifies the name under which the value of this selectMany element will be accessible.yes
modeSpecifies visual style possible values check, box and menu. no
valueSpecifies an array of values which will be selected, or base objects, for the property attribute.yes
propertyContains property name of objects specified by expression in the value attribute.no
optionValuesSpecifies 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
optionValuesPropertyContains the property name of objects specified by expression in the optionValues attribute.no
optionCaptionsSpecifies 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
optionCaptionsPropertyContains a property name for objects specified by expression in the optionCaptions attribute. no
hintHelp text, displayed as tooltip.no

Table 75.  syswf:selectMany Subelements

ElementDescriptionRequired
attributeAppends a name/value pair as an attribute to result HTML tags.no

syswf:textArea  Locate

Creates a text area HTML component.

Table 76.  syswf:textArea Attributes

AttributeDescriptionRequired
nameSpecifies the name under which the value of this text area will be accessible.yes
valueSpecifies a value which appears in the text area, or a base object for the property attribute.yes
propertyContains a property name of an object specified by expression in the value attribute.no
hintHelp text, displayed as tooltip.no
dataTypeData type which will be used to transform values between underlying the Java Bean object and the text area.no
disabledIf set to true, the text area will be disabled. optional

Table 77.  syswf:textArea Subelements

ElementDescriptionRequired
attributeAppends a name/value pair as an attribute to the result HTML tag; usable, for example, for CSS class specification for the text area.no

syswf:value  Locate

Evaluates the given expression and transform result using data type.

Table 78.  syswf:value Attributes

AttributeDescriptionRequired
valueSpecifies the expression which will be evaluated.yes
hintHelp text, displayed as tooltip.no
dataTypeData type which will be used to transform value.no

syswf:size  Locate

This tag will fill the page attribute with size of given List, UDDIList, StringArrayList or Array.

Table 79.  syswf:size Attributes

AttributeDescriptionRequired
varName of variable to store the size of a given list or array.yes
valueSpecifies an expression to be evaluated; the result must be List, UDDIList, StringArrayList or Array.yes
scopeScope of the variable to store the size of a given list or array. Allowed values are request, session, application, or default. no

navigationPath  Locate

This component renders the history path (bread crumbs links)

navigationPath component in action

Example 20. Component Parameters

                <syswf:component name="navigationPath" prefix="path"/>
            

Typical Customization Tasks  Locate

  • 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.