org.apache.portals.bridges.common
Class GenericServletPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by 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

  
  
    
      Action Servlet
      ActionPage
      /WEB-INF/action.do
      
    
    
      Custom Servlet
      CustomPage
      /WEB-INF/custom.jsp
      
    
    
      Edit Servlet
      EditPage
      /WEB-INF/edit.jsp
      
    
    
      Help Servlet
      HelpPage
      /WEB-INF/help.jsp
      
    
    
      View Servlet
      ViewPage
      /WEB-INF/view.jsp
      
    
  

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

Field Summary
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
 
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
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
Specified by:
init in interface javax.portlet.Portlet
Overrides:
init in class javax.portlet.GenericPortlet
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()

Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See 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
IOException
See 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.

Overrides:
doEdit in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See 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.

Overrides:
doHelp in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See 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.

Overrides:
doView in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See 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 © 1999-2012 Apache Software Foundation. All Rights Reserved.