## org.apache.portals.bridges.common
Class GenericServletPortlet

    java.lang.Object
      javax.portlet.GenericPortlet
          org.apache.portals.bridges.common.GenericServletPortlet

All Implemented Interfaces:
  javax.portlet.Portlet, javax.portlet.PortletConfig

public class GenericServletPortlet
extends javax.portlet.GenericPortlet

ServletPortlet will call a server, as defined by a xxxPage preference, for the Action, Custom, Edit, Help, and View operations. This allow the use of existing servlets or JSPs in the portlet. Since this is a very thin class, it is up to the servlet, or JSP, to return properly formated content. See the JSR 168 for more information

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

###

        <preference>
          <description>Action Servlet</description>
          <name>ActionPage</name>
          <value>/WEB-INF/action.do</value>

        </preference>
        <preference>
          <description>Custom Servlet</description>
          <name>CustomPage</name>
          <value>/WEB-INF/custom.jsp</value>

        </preference>
        <preference>
          <description>Edit Servlet</description>
          <name>EditPage</name>
          <value>/WEB-INF/edit.jsp</value>

        </preference>
        <preference>
          <description>Help Servlet</description>
          <name>HelpPage</name>
          <value>/WEB-INF/help.jsp</value>

        </preference>
        <preference>
          <description>View Servlet</description>
          <name>ViewPage</name>
          <value>/WEB-INF/view.jsp</value>

        </preference>

    Version:
      $Id: GenericServletPortlet.java 517068 2007-03-12 01:44:37Z ate $
    Author:
      paul

    Field Summary

    private  boolean
    allowPreferences

              Allow preferences to be set by preferences.

    private  String
    defaultActionPage

              Default URL for the action page.

    private  String
    defaultCustomPage

              Default URL for the custom page.

    private  String
    defaultEditPage

              Default URL for the edit page.

    private  String
    defaultHelpPage

              Default URL for the help page.

    private  String
    defaultViewPage

              Default URL for the view page.

    static String
    PARAM_ACTION_PAGE

              Name of portlet preference for Action page

    static String
    PARAM_ALLOW_PREFERENCES

              Name of portlet preference to allow the use of preferenecs to set pages

    static String
    PARAM_CUSTOM_PAGE

              Name of portlet preference for Custom page

    static String
    PARAM_EDIT_PAGE

              Name of portlet preference for Edit page

    static String
    PARAM_HELP_PAGE

              Name of portlet preference for Edit page

    static String
    PARAM_MAX_PAGE

              Name of portlet preference for View page

    static String
    PARAM_VIEW_PAGE

              Name of portlet preference for View page

    Fields inherited from class javax.portlet.GenericPortlet

    Constructor Summary

    GenericServletPortlet()

              Creates a new instance of portlet

    Method Summary

     void
    doCustom(javax.portlet.RenderRequest request,
             javax.portlet.RenderResponse response)

              Execute the servlet as define by the init parameter or preference PARAM_EDIT_PAGE.

     void
    doEdit(javax.portlet.RenderRequest request,
           javax.portlet.RenderResponse response)

              Execute the servlet as define by the init parameter or preference PARAM_EDIT_PAGE.

     void
    doHelp(javax.portlet.RenderRequest request,
           javax.portlet.RenderResponse response)

              Execute the servlet as define by the init parameter or preference PARAM_HELP_PAGE.

     void
    doView(javax.portlet.RenderRequest request,
           javax.portlet.RenderResponse response)

              Execute the servlet as define by the init parameter or preference PARAM_VIEW_PAGE.

     String
    getDefaultActionPage()

              Getter for property defaultActionPage.

     String
    getDefaultCustomPage()

              Getter for property defaultCustomPage.

     String
    getDefaultEditPage()

              Getter for property defaultEditPage.

     String
    getDefaultHelpPage()

              Getter for property defaultHelpPage.

     String
    getDefaultViewPage()

              Getter for property defaultViewPage.

     void
    init(javax.portlet.PortletConfig config)

     void
    processAction(javax.portlet.ActionRequest request,
                  javax.portlet.ActionResponse actionResponse)

              Execute the servlet as define by the init parameter or preference PARAM_ACTION_PAGE.

     void
    processPreferencesAction(javax.portlet.ActionRequest request,
                             javax.portlet.ActionResponse actionResponse)

              Save the prefs

     void
    setDefaultActionPage(String defaultActionPage)

              Setter for property defaultActionPage.

     void
    setDefaultCustomPage(String defaultCustomPage)

              Setter for property defaultCustomPage.

     void
    setDefaultEditPage(String defaultEditPage)

              Setter for property defaultEditPage.

     void
    setDefaultHelpPage(String defaultHelpPage)

              Setter for property defaultHelpPage.

     void
    setDefaultViewPage(String defaultViewPage)

              Setter for property defaultViewPage.

    Methods inherited from class javax.portlet.GenericPortlet

    destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init, render

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Field Detail

    PARAM_ACTION_PAGE

    public static final String PARAM_ACTION_PAGE

    Name of portlet preference for Action page

    See Also:Constant Field Values

    PARAM_ALLOW_PREFERENCES

    public static final String PARAM_ALLOW_PREFERENCES

    Name of portlet preference to allow the use of preferenecs to set pages

    See Also:Constant Field Values

    PARAM_CUSTOM_PAGE

    public static final String PARAM_CUSTOM_PAGE

    Name of portlet preference for Custom page

    See Also:Constant Field Values

    PARAM_EDIT_PAGE

    public static final String PARAM_EDIT_PAGE

    Name of portlet preference for Edit page

    See Also:Constant Field Values

    PARAM_HELP_PAGE

    public static final String PARAM_HELP_PAGE

    Name of portlet preference for Edit page

    See Also:Constant Field Values

    PARAM_VIEW_PAGE

    public static final String PARAM_VIEW_PAGE

    Name of portlet preference for View page

    See Also:Constant Field Values

    PARAM_MAX_PAGE

    public static final String PARAM_MAX_PAGE

    Name of portlet preference for View page

    See Also:Constant Field Values

    allowPreferences

    private boolean allowPreferences

    Allow preferences to be set by preferences.

    defaultActionPage

    private String defaultActionPage

    Default URL for the action page.

    defaultCustomPage

    private String defaultCustomPage

    Default URL for the custom page.

    defaultEditPage

    private String defaultEditPage

    Default URL for the edit page.

    defaultHelpPage

    private String defaultHelpPage

    Default URL for the help page.

    defaultViewPage

    private String defaultViewPage

    Default URL for the view page.

    Constructor Detail

    GenericServletPortlet

    public GenericServletPortlet()

    Creates a new instance of portlet

    Method Detail

    init

    public void init(javax.portlet.PortletConfig config)
              throws javax.portlet.PortletException

    Throws:
    javax.portlet.PortletException

    processAction

    public void processAction(javax.portlet.ActionRequest request,
                              javax.portlet.ActionResponse actionResponse)
                       throws javax.portlet.PortletException,
                              IOException

    Execute the servlet as define by the init parameter or preference PARAM_ACTION_PAGE.  The value
     if the parameter is a relative URL, i.e. /actionPage.jsp will execute the
     JSP editPage.jsp in the portlet application's web app.  The action should
     not generate any content.  The content will be generate by doCustom(),
     doHelp() , doEdit(), or doView().

     See section PLT.16.2 of the JSR 168 Portlet Spec for more information
     around executing a servlet or JSP in processAction()

    Throws:
    javax.portlet.PortletException
    IOExceptionSee Also:GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

    doCustom

    public void doCustom(javax.portlet.RenderRequest request,
                         javax.portlet.RenderResponse response)
                  throws javax.portlet.PortletException,
                         IOException

    Execute the servlet as define by the init parameter or preference PARAM_EDIT_PAGE.  The value
     if the parameter is a relative URL, i.e. /editPage.jsp will execute the
     JSP editPage.jsp in the portlet application's web app.

    Throws:
    javax.portlet.PortletException
    IOExceptionSee Also:javax.portlet.GenericPortlet#doCustom

    doEdit

    public void doEdit(javax.portlet.RenderRequest request,
                       javax.portlet.RenderResponse response)
                throws javax.portlet.PortletException,
                       IOException

    Execute the servlet as define by the init parameter or preference PARAM_EDIT_PAGE.
     The value if the parameter is a relative URL, i.e. /editPage.jsp will execute the
     JSP editPage.jsp in the portlet application's web app.

    Throws:
    javax.portlet.PortletException
    IOExceptionSee Also:GenericPortlet.doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

    doHelp

    public void doHelp(javax.portlet.RenderRequest request,
                       javax.portlet.RenderResponse response)
                throws javax.portlet.PortletException,
                       IOException

    Execute the servlet as define by the init parameter or preference PARAM_HELP_PAGE.
     The value if the parameter is a relative URL, i.e. /helpPage.jsp will exeute the
     JSP helpPage.jsp in the portlet application's web app.

    Throws:
    javax.portlet.PortletException
    IOExceptionSee Also:GenericPortlet.doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

    doView

    public void doView(javax.portlet.RenderRequest request,
                       javax.portlet.RenderResponse response)
                throws javax.portlet.PortletException,
                       IOException

    Execute the servlet as define by the init parameter or preference PARAM_VIEW_PAGE.
     The value if the parameter is a relative URL, i.e. /viewPage.jsp will execute the
     JSP viewPage.jsp in the portlet application's web app.

    Throws:
    javax.portlet.PortletException
    IOExceptionSee Also:GenericPortlet.doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

    getDefaultViewPage

    public String getDefaultViewPage()

    Getter for property defaultViewPage.

    Returns:Value of property defaultViewPage.

    setDefaultViewPage

    public void setDefaultViewPage(String defaultViewPage)

    Setter for property defaultViewPage.

    Parameters:defaultViewPage - New value of property defaultViewPage.

    getDefaultHelpPage

    public String getDefaultHelpPage()

    Getter for property defaultHelpPage.

    Returns:Value of property defaultHelpPage.

    setDefaultHelpPage

    public void setDefaultHelpPage(String defaultHelpPage)

    Setter for property defaultHelpPage.

    Parameters:defaultHelpPage - New value of property defaultHelpPage.

    getDefaultEditPage

    public String getDefaultEditPage()

    Getter for property defaultEditPage.

    Returns:Value of property defaultEditPage.

    setDefaultEditPage

    public void setDefaultEditPage(String defaultEditPage)

    Setter for property defaultEditPage.

    Parameters:defaultEditPage - New value of property defaultEditPage.

    getDefaultCustomPage

    public String getDefaultCustomPage()

    Getter for property defaultCustomPage.

    Returns:Value of property defaultCustomPage.

    setDefaultCustomPage

    public void setDefaultCustomPage(String defaultCustomPage)

    Setter for property defaultCustomPage.

    Parameters:defaultCustomPage - New value of property defaultCustomPage.

    getDefaultActionPage

    public String getDefaultActionPage()

    Getter for property defaultActionPage.

    Returns:Value of property defaultActionPage.

    setDefaultActionPage

    public void setDefaultActionPage(String defaultActionPage)

    Setter for property defaultActionPage.

    Parameters:defaultActionPage - New value of property defaultActionPage.

    processPreferencesAction

    public void processPreferencesAction(javax.portlet.ActionRequest request,
                                         javax.portlet.ActionResponse actionResponse)
                                  throws javax.portlet.PortletException,
                                         IOException

    Save the prefs

    Throws:
    javax.portlet.PortletException
    IOException

    Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.