0 Replies Latest reply on Apr 26, 2013 1:51 PM by mlipman

    FacesRenderer in Oracle Portal?

    mlipman
      Hi all,

      I am trying to run a JSF application in Oracle Portal.
      There is a FacesRenderer (similar to the StrutsRenderer) for this purpose, but there is hardly any documentation on this class.
      [http://docs.oracle.com/cd/E12839_01/apirefs.1111/e10691/oracle/portal/provider/v2/render/http/FacesRenderer.html|http://docs.oracle.com/cd/E12839_01/apirefs.1111/e10691/oracle/portal/provider/v2/render/http/FacesRenderer.html]

      I have started with a simple JSF application from this page:
      [http://exadel.com/web/portal/jsftutorial-kickstart|http://exadel.com/web/portal/jsftutorial-kickstart]

      Then I added the PDK-specific configuration files.

      The provider.xml file:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <?providerDefinition version="3.1"?>

      <provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
      <session>true</session>
      <passAllUrlParams>true</passAllUrlParams>

      <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
      <id>1</id>
      <name>JSFPortlet</name>
      <title>JSF Portlet</title>
      <shortTitle>JSF Portlet</shortTitle>
      <description>Demonstrates a JSF application rendered by the portlet.</description>
      <timeout>20</timeout>
      <timeoutMessage>JSF Portlet timed out</timeoutMessage>
      <showEdit>false</showEdit>
      <showEditToPublic>false</showEditToPublic>
      <showEditDefault>false</showEditDefault>
      <showPreview>false</showPreview>
      <showDetails>false</showDetails>
      <hasHelp>false</hasHelp>
      <hasAbout>false</hasAbout>
      <acceptContentType>text/html</acceptContentType>
      <renderer class="oracle.portal.provider.v2.render.RenderManager">
      <contentType>text/html</contentType>
      <renderContainer>true</renderContainer>
      <autoRedirect>true</autoRedirect>
      <showPage class="oracle.portal.provider.v2.render.http.FacesRenderer">
      <defaultPage>/pages/inputname.jsf</defaultPage>
      </showPage>
      </renderer>
      </portlet>

      </provider>

      The web.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
      <display-name>JSF Sample Application</display-name>

      <context-param>
      <param-name>oracle.portal.log.LogLevel</param-name>
      <param-value>8</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
      </context-param>

      <listener>
      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
      </listener>

      <!-- Faces Servlet -->
      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <servlet>
      <servlet-name>SOAPServlet</servlet-name>
      <description>Extended Portal SOAP Server</description>
      <servlet-class>oracle.webdb.provider.v2.adapter.SOAPServlet</servlet-class>
      </servlet>

      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>SOAPServlet</servlet-name>
      <url-pattern>/providers</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>SOAPServlet</servlet-name>
      <url-pattern>/providers/*</url-pattern>
      </servlet-mapping>

      <session-config>
      <session-timeout>35</session-timeout>
      </session-config>

      <mime-mapping>
      <extension>html</extension>
      <mime-type>text/html</mime-type>
      </mime-mapping>

      <mime-mapping>
      <extension>txt</extension>
      <mime-type>text/plain</mime-type>
      </mime-mapping>

      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      </web-app>

      When registering the Faces provider in the portal, the Login Frequency must be set to ‘Once per User Session’, for the provider session to work properly.

      The JSF application renders correctly as a portlet, but actions are not handled properly. The JavaDoc contains the following statement: "The Faces application should also use the PDK phase listener which will redirect the request to the Portal page. ".
      I have not been able to find more information on the PDK phase listener.

      Any clues are welcome.

      Thanks in advance,
      Marcel.