Portals Bridges
  1. Portals Bridges
  2. PB-30

Documentation of Configuration in Pluto

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: None
    • Component/s: struts
    • Labels:
      None
    • Environment:
      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>

        Activity

        Edgar P. Dollin created issue -
        Hide
        Edgar P. Dollin added a comment -

        Servlet Context Provider for Pluto

        Show
        Edgar P. Dollin added a comment - Servlet Context Provider for Pluto
        Edgar P. Dollin made changes -
        Field Original Value New Value
        Attachment ServletContextProviderImpl.java [ 12320515 ]
        Hide
        Ate Douma added a comment -

        Thanks for the documentation

        All or most of this information is now also available on the Pluto and Struts Bridge site:
        http://portals.apache.org/pluto/v101/userguide/portal.html
        http://portals.apache.org/bridges/multiproject/portals-bridges-struts/features.html

        Show
        Ate Douma added a comment - Thanks for the documentation All or most of this information is now also available on the Pluto and Struts Bridge site: http://portals.apache.org/pluto/v101/userguide/portal.html http://portals.apache.org/bridges/multiproject/portals-bridges-struts/features.html
        Ate Douma made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Edgar P. Dollin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development