Show TOC

Procedure documentationCreating an AbstractPortalComponent Locate this document in the navigation structure

 

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

Procedure

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

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

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

  4. Select   Portal Component   AbstractPortalComponent  . Click Next.

  5. Enter the following fields:

    • Name: Name of component, which is defined by the name attribute of the <component> element for this component in the portalapp.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 the src.core project directory, and makes it private.

      • API: Places the file in the src.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 to myPortalComp, and set location to Core. Leave the package blank.

    Click Finish.

Result

The wizard does the following:

  • Creates a class in the src.core folder called myPortalComp that extends AbstractPortalComponent. A blank doContent method 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:

    Syntax Syntax

    1. <components>
    2.   <component name="myPortalComp">
    3.     <component-config>
    4.       <property name="ClassName" value=" myPortalComp"/>
    5.     </component-config>
    6.   <component-profile/>
    7. </component>
    End of the code.