A portal service provides functionality to portal components, other portal services and other applications.
You are currently in the Enterprise Portal perspective.
You have created a portal application project. More information: Creating Portal Application Projects
Start the Portal Application Object wizard by right-clicking the portal application project and then selecting
.Note
You can also open the wizard by doing one of the following:
From the File menu, select
. 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.
Select the portal application project in which to add the portal service, and then click Next.
Select Portal Service, and then click Next.
In the Portal Service window, enter the following:
Name: The name of the portal service. This value is automatically added to the portalapp.xml file for the portal application.
Class Name: The name of the Java class created for this portal service. Generally, the portal name and the class are the same.
Package Name: The name of the package for the newly created Java class. This field is optional.
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.
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.
Add custom methods for the service:
Define the methods in the interface.
Implement the methods in the implementation class.