Creating an AbstractPortalComponent

Use the Enterprise Portal wizard to create a portal component, which is essentially a Java class that extendsAbstractPortalComponent

Procedure

From the File menu, select New → Other. The New window is displayed.

Select Portal Application , and then Create a New Portal Application Object . Click Next .

Select the project to which you want to add the portal component (myPortalProject). Click Next .

Select Portal Component → AbstractPortalComponent . Click Next .

Enter the following fields:

Name:Name of component, which is defined by thenameattribute of the<component>element for this component in theportalapp.xml

By default, this is also the name of the Java class file for this component.

Location:The location of the new Java class file for this component, which determines whether other applications can reference the classes. Generally, the choice is only meaningful when defining services and the interfaces to make available to those applications the reference the service.

You can specify one of the following:

Core(default) : Places the file in thesrc.coreproject directory, and makes it private.

API:Places the file in thesrc.api, and makes it public.

Class name:The Java class file for this component.

Package name:The package name for the Java class file for this component.

Set name and class name tomyPortalComp, and set location toCore. Leave the package blank.

Click Finish .

Result

The wizard does the following:

Creates a class in thesrc.corefolder calledmyPortalCompthat extendsAbstractPortalComponent. A blankdoContentmethod is also created, which is the only method that must be implemented.

Creates an entry for the component in the application’s portalapp.xml file, as shown below:

<components>

<componentname="myPortalComp">

<component-config>

<propertyname="ClassName"value=" myPortalComp"/>

</component-config>

<component-profile/>

</component>