1. Write a class that implements the org.systinet.uddi.approval.checker.v3.CheckerApi
a. Create the content checker class as shown in
Example 15, Content Checker Implementation .
b. Compile the CheckerApiImpl.java, and add jars from the directory PUBLICATION_REGISTRY_HOMEdist to
the class path.
2. Deploy the implementation class to the Oracle Service Registry.
Note
In the case of deployment to an application server, you must make the modifications in the location where they will be used. This may mean in the registry directory where registry is unpacked inside the application
server, not in the installation directory. If the registry is not yet deployed, but the WAREAR file is available, modify the WAREAR file first and then deploy it. The relative paths for files are the same but
PUBLICATION_REGISTRY_HOME
is different. a.
Copy the CheckerApiImpl.class to the file PUBLICATION_REGISTRY_HOMEappuddiservicesWASP- INFlibapproval_staging_v3.jar
to the folder comsystinetuddiapprovalv3approver inside the jar file.
b. Shutdown the Publication Registry, delete the PUBLICATION_REGISTRY_HOMEwork directory, and restart the
Publication Registry.
3. Register the implementation of the content checker class in the Oracle Service Registry data.
a. Log on to the Publication Registry as an approver. The content checker will be applicable to an approver who
follows these steps: b.
Publish the WSDL of the checker service:
Publish the WSDL located at http:host_name:http_portuddidocwsdlapproval_checker.wsdl
to a new or already existing business entity. Use the Advanced publishing mode and be sure to reuse the e x i s t i n g W S D L p o r t T y p e t M o d e l n a m e : CheckerApi , t M o d e l s k e y :
uddi:systinet.com:uddi:service:porttype:approvalchecker . The WSDL service
approval_checker_SoapService will be published under the business entity.
c. Specify the checker in the access point of a new binding template under the approval_checker_SoapService
service. Enter the value of access point which starts with the class: prefix and continue with the fully qualified class
name. For example, class:com.systinet.uddi.approval.v3.approver.CheckerApiImpl.
Page 549
3.6. Writing a Content Checker
Example 15. Content Checker Implementation
package com.systinet.uddi.approval.v3.approver; import org.systinet.uddi.InvalidParameterException;
import org.systinet.uddi.approval.checker.v3.CheckerApi; import org.systinet.uddi.approval.checker.v3.struct.CheckRequest;
import org.systinet.uddi.approval.v3.ApprovalErrorCodes; import org.systinet.uddi.approval.v3.ApprovalException;
import org.systinet.uddi.approval.v3.struct.ApprovalEntitiesDetail; import org.systinet.uddi.approval.v3.struct.EntitiesDetail;
import org.systinet.uddi.client.v3.struct.;
Checks if a BE starts with org_ public class CheckerApiImpl implements CheckerApi {
public DispositionReport checkRequestCheckRequest checkRequest throws ApprovalException {
try { ResultArrayList resultArrayList = new ResultArrayList;
ApprovalEntitiesDetail approvalEntitiesDetail = checkRequest.getApprovalEntitiesDetail;
if approvalEntitiesDetail = null { EntitiesDetail entitiesDetail4Saving =
approvalEntitiesDetail.getEntitiesDetail4Saving; BusinessEntityArrayList businessEntityArrayList =
entitiesDetail4Saving.getBusinessEntityArrayList; if businessEntityArrayList = null {
for int i = 0; i businessEntityArrayList.size; i++ { BusinessEntity businessEntity = businessEntityArrayList.geti;
if businessEntity = null { NameArrayList nameArrayList =
businessEntity.getNameArrayList; for int j = 0; j nameArrayList.size; j++ {
Name name = nameArrayList.getj; if name = null name.getValue.startsWithorg_ {
resultArrayList.add new ResultApprovalErrorCodes.INVALID_DATA,
new ErrInfoApprovalErrorCodes.getCode ApprovalErrorCodes.INVALID_DATA,
Only business entities whose name start with the + prefix \org_\ are allowed +
BE [key: + businessEntity.getBusinessKey + , name: + name.getValue + ],
KeyType.businessKey; }
} }
}
Page 550
3.6. Writing a Content Checker
} }
if resultArrayList.size 0 { return new DispositionReportresultArrayList;
} else { return DispositionReport.DISPOSITION_REPORT_SUCCESS;
} } catch InvalidParameterException e {
should not occur throw new ApprovalExceptionApprovalErrorCodes.FATAL_ERROR, e.getMessage;
}
} }
3.7. Registry Web Framework
This section describes Oracle Service Registry from the developers point of view. It describes the Oracle Service Registry Framework architecture and configuration.
• Section 3.7.1, Architecture Description
• Section 3.7.2, Directory Structure
• Section 3.7.3, Framework Configuration
• Section 3.7.4, syswf JSP tag library
• Section 3.7.5, Typical Customization Tasks
3.7.1. Architecture Description
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.3JSP spec 1.2 or Jasper2 from Tomcat version 5 Servlet API 2.4JSP 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
[http: jakarta.apache.org].
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: •
a JSP part
• a
Java part 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.
Page 551
3.7.1. Architecture Description
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 tags 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 registrys web interface runs on the address http:localhost:8888registryuddiweb
, a task with the URI findBusiness can be accessed directly from the client browser at http:localhost:8888registryuddiwebfindBusiness.
Component Java Interface Part
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 processString action, Map params •
void populateString action, Map params The process method is called just before the translation of the components 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 its 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
The diagram shown in Figure 12
demonstrates how requests for the page are handled by the Web Framework:
Figure 12. Request Diagram
1. The request is sent by the client browser from a different page than the page requested.
Page 552
Request Diagram