Show TOC

Creating a Portal ServiceLocate this document in the navigation structure

Prerequisites

Context

A portal service provides functionality to portal components, other portal services and other applications.

Procedure


  1. Start the Portal Application Object wizard by right-clicking the portal application project and then selecting Start of the navigation path New Next navigation step Create Portal Application Object End of the navigation path.

    Note

    You can also open the wizard by doing one of the following:

    • From the File menu, select Start of the navigation path New Next navigation step Other End of the navigation path. Under Portal Application , select Create a Portal Application Object , and then click Next .

    • From the toolbar, click Create a Portal Application Object.

    • Open the portalapp.xml file for the application, and click Create on the Services tab.

  2. Select the portal application project in which to add the portal service, and then click Next .

  3. Select Portal Service , and then click Next .

  4. In the Portal Service window, enter the following:

    1. Name: The name of the portal service. This value is automatically added to the portalapp.xml file for the portal application.

    2. Class Name: The name of the Java class created for this portal service. Generally, the portal name and the class are the same.

    3. Package Name: The name of the package for the newly created Java class. This field is optional.

  5. Click Finish . The following items are created automatically:

    • A Java interface that extends IService is created in the src.api folder. The interface defines a constant for the service key.

      The name of the interface is the name of the service, preceded by an I .

    • A Java class that extends the new Java interface is created in the src.core folder. The class contains default implementations for all the methods defined by IService .

    • A <service> element for the new service is added to the portalapp.xml file of the portal application.

  6. In the interface, set the service key constant ( KEY ) to the fully qualified name of the service, which is the name of the application, a period, and the name of the service.

    For example, if you defined an portal application called myApp and a service called myService , the fully qualified name of the service would be myApp.myService .

  7. Add custom methods for the service:

    1. Define the methods in the interface.

    2. Implement the methods in the implementation class.