Custom Portlet XML File Configuration

From GroundWork Developer Kit

Jump to: navigation, search

Contents

[edit] Required Changes to XML Files

You must edit the following XML files before deploying your custom portlet:

[edit] portlet-instances.xml

Navigate to the portlet-instances.xml file located in:

/usr/local/groundwork/gdk/monitor-portal/applications/<sample-xxx>/src/main/webapp/WEB-INF/portlet-instances.xml

Example: If coding in PHP, navigate to the portlet-instances.xml file located in the sample-php directory:

/usr/local/groundwork/gdk/monitor-portal/applications/sample-php/src/main/webapp/WEB-INF/portlet-instances.xml

In the <deployment> section, edit the <instance-id> and <portlet-ref> content:

  <deployment>
    <instance>
      <instance-id>SamplePhpInstance</instance-id>
      <portlet-ref>SamplePhpPortlet</portlet-ref>
    </instance>
  </deployment>

where:

[edit] portlet.xml changes

Navigate to the portlet.xml file located in:

/usr/local/groundwork/gdk/monitor-portal/applications/<sample-xxx>/src/main/webapp/WEB-INF/portlet.xml

Example: If coding in PHP, navigate to the portlet.xml file located in:

/usr/local/groundwork/gdk/monitor-portal/applications/sample-php/src/main/webapp/WEB-INF/portlet.xml


In the <portlet> section, edit the <portlet-name>, <portlet-class>, and <portlet-info> and <init-param> sections.

   <portlet>
       <portlet-name>SamplePhpPortlet
       </portlet-name>
       <portlet-class>org.groundwork.portlet.php.GWSamplePhpPortlet
       </portlet-class>
       <supports>
           <mime-type>text/html</mime-type>
           <portlet-mode>VIEW</portlet-mode>
       </supports>
       <portlet-info>
           <title>Sample Php Portlet</title>
       </portlet-info>
       <init-param>
           <name>SCRIPT</name>
           <value>PHP</value>
       </init-param>
       <init-param>
           <name>URL</name>
           <value>php/env.php</value>
       </init-param>
   </portlet>

Where:

The figure below displays the structure of the WEB-INF Directory containing portlet-instances.xml and portlet.xml
WEB-INF directory

[edit] project.xml changes

Navigate to the project.xml file located in:

/usr/local/groundwork/gdk/monitor-portal/applications/<sample-xxx>/project.xml

Example: If coding in PHP, navigate to the project.xml file located in:

/usr/local/groundwork/gdk/monitor-portal/applications/sample-php/project.xml

Edit the <artifactId>:

    <!-- a unique name for this project -->
    <artifactId>portal-sample-php</artifactId>

Where:

[edit] More Information

Refer to:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox