Uploaded image for project: 'Portals Bridges (Retired)'
  1. Portals Bridges (Retired)
  2. PB-30

Documentation of Configuration in Pluto

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.3
    • None
    • struts
    • None
    • Pluto 1.0.1 / Tomcat 5.5.9

    Description

      I got the Pluto / Struts connection working. It is a little bit tricky.

      As we already discussed, all mappings have to begin with a /. I am not sure if this is a limitation in Pluto.

      There need to be two servlets in web.xml. The first servlet is basically a servlet to run the struts portlet. All portlet based actions must run through this servlet. The portlet-class is the StrutsPortlet class and the portlet-guid is configured in the particular portlet container config files. I will give you our example later.

      <servlet>
      <servlet-name>StrutsPortlet</servlet-name>
      <display-name>StrutsPortlet Wrapper</display-name>
      <description>Struts Action Wrapper</description>
      <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
      <init-param>
      <param-name>portlet-class</param-name>
      <param-value>org.apache.portals.bridges.struts.StrutsPortlet</param-value>
      </init-param>
      <init-param>
      <param-name>portlet-guid</param-name>
      <param-value>clientrac.ClienTrac</param-value>
      </init-param>
      </servlet>

      The second servlet is the struts-bridge PortletServet servlet with the standard struts params.

      <servlet>
      <servlet-name>action</servlet-name>
      <display-name>Struts Portlet Servlet</display-name>
      <servlet-class>org.apache.portals.bridges.struts.PortletServlet</servlet-class>
      <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
      </servlet>

      The servlet mapping is the tricky part. Anything running through the portlet container needs to map to the Portlet Servlet (ctp stands for ClienTracPortlet).

      <servlet-mapping>
      <servlet-name>StrutsPortlet</servlet-name>
      <url-pattern>/ctp/*</url-pattern>
      </servlet-mapping>

      The struts action mapping is used to find the struts action servlet. This will be referenced below. (cta stands for ClienTracAction).

      <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>/cta/*</url-pattern>
      </servlet-mapping>

      The portlet.xml file must reference the struts action in the ViewPage (or edit, help pages). It is using your servlet context provider and the /cta/* mapping.
      the /cta mapping would also be used in login.jsp. I have to run some tests to determine the format of the action url's in struts jsp files.

      <portlet>
      <description>ClienTrac Rental Real-Estate Tracking System</description>
      <portlet-name>ClienTrac</portlet-name>
      <display-name>ClienTrac Rental Real-Estate Tracking System</display-name>
      <portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
      <init-param>
      <name>ServletContextProvider</name>
      <value>com.fb2corp.salamis.ui.bridges.struts.ServletContextProviderImpl</value>
      </init-param>
      <init-param>
      <name>ViewPage</name>
      <value>/cta/user</value>
      </init-param>
      <expiration-cache>0</expiration-cache>
      <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      </supports>
      </portlet>

      In pluto there are three files which determine the portlet configuration.

      The lead file is portletcontents.txt. This is a list of contexts which have registered portlets.

      /testsuite
      /pluto
      /clientrac

      Next is the pageregistry.xml. This determines the initial layout of the page of portlets. You will see references in the log to
      row_col1_p3 as this is key to access the portlet. The 7.0 is the link to the portletentityregistry.xml

      <portal>
      <fragment name="clientrac" type="page">
      <navigation>
      <title>ClienTrac</title>
      <description>Real Estate Rental Sales Tracking</description>
      </navigation>
      <fragment name="row" type="row">
      <fragment name="col1" type="column">
      <fragment name="p3" type="portlet">
      <property name="portlet" value="7.0"/>
      </fragment>
      </fragment>
      </fragment>
      </fragment>
      </portal>

      The last file is the portletentityregistry.xml. This is a full list of the portlets available to run. The definition ID is the link back to web.xml PortletServlet. Each application is made up of portlets with the pageregistry finding the portlet by the <appliction-id>.<portlet-id> reference. The definition-id is used to find which PortletServlet to run, i.e. the portlet-guid, defined in web.xml.

      <portlet-entity-registry>
      <application id="7">
      <definition-id>clientrac</definition-id>
      <portlet id="0">
      <definition-id>clientrac.ClienTrac</definition-id>
      </portlet>
      </application>
      </portlet-entity-registry>

      Attachments

        1. ServletContextProviderImpl.java
          2 kB
          Edgar P. Dollin

        Activity

          People

            Unassigned Unassigned
            edollin Edgar P. Dollin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: