org.apache.pluto.driver.portlets
Class PageAdminPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.pluto.driver.portlets.GenericPlutoPortlet
          extended by org.apache.pluto.driver.portlets.PageAdminPortlet
All Implemented Interfaces:
EventPortlet, Portlet, PortletConfig, ResourceServingPortlet

public class PageAdminPortlet
extends GenericPlutoPortlet


Nested Class Summary
 class PageAdminPortlet.Page
           
 class PageAdminPortlet.Placement
           
 
Constructor Summary
PageAdminPortlet()
           
 
Method Summary
 void doAddPage(ActionRequest request)
          Adds a page to the portal via the RenderConfigService.
 void doAddPortlet(ActionRequest request)
           
 void doRemovePage(ActionRequest request)
          Removes a page from the portal ignoring any requests to remove the default page or the Pluto Admin page.
 void doRemovePortlet(ActionRequest request)
           
 void doView(RenderRequest request, RenderResponse response)
          Helper method to serve up the mandatory view mode.
 java.util.Collection getAvailablePages()
           
protected static java.lang.String getContentBeforeRenderConfig(java.lang.String contents)
          Gets the content of the config page before the render-config element (also including the default attribute of render-config - see RENDER_CONFIG_SEARCH_TOKEN above).
 java.lang.String getEditPage()
           
 java.lang.String getHelpPage(RenderRequest request)
           
 java.lang.String getViewPage()
           
protected static java.lang.String parseDefaultPage(java.lang.String configFileContents)
          Parse out default attribute value of render-config element in pluto-portal-driver-config.xml.
 void processAction(ActionRequest request, ActionResponse response)
          Called by the portlet container to allow the portlet to process an action request.
 
Methods inherited from class org.apache.pluto.driver.portlets.GenericPlutoPortlet
doEdit, doHelp
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, doHeaders, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, init, processEvent, render, serveResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageAdminPortlet

public PageAdminPortlet()
Method Detail

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
Description copied from class: GenericPortlet
Called by the portlet container to allow the portlet to process an action request. This method is called if the client request was originated by a URL created (by the portlet) with the RenderResponse.createActionURL() method.

The default implementation throws an exception.

Specified by:
processAction in interface Portlet
Overrides:
processAction in class GenericPortlet
Parameters:
request - the action request
response - the action response

doAddPortlet

public void doAddPortlet(ActionRequest request)

doAddPage

public void doAddPage(ActionRequest request)
Adds a page to the portal via the RenderConfigService. This does not add portlets to the new page. Do that when the page is created using the Add Portlet button.

Parameters:
request - The action request.

doRemovePage

public void doRemovePage(ActionRequest request)
                  throws java.io.IOException
Removes a page from the portal ignoring any requests to remove the default page or the Pluto Admin page. The page's portlets are still available, but no longer associated with the deleted page.

Parameters:
request - The action request.
Throws:
java.io.IOException - If a problem occurs accessing the config file.

doRemovePortlet

public void doRemovePortlet(ActionRequest request)

doView

public void doView(RenderRequest request,
                   RenderResponse response)
            throws PortletException,
                   java.io.IOException
Description copied from class: GenericPortlet
Helper method to serve up the mandatory view mode.

The default implementation throws an exception.

Overrides:
doView in class GenericPlutoPortlet
Parameters:
request - the portlet request
response - the render response
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
java.io.IOException - if the streaming causes an I/O problem

getViewPage

public java.lang.String getViewPage()
Specified by:
getViewPage in class GenericPlutoPortlet

getEditPage

public java.lang.String getEditPage()
Specified by:
getEditPage in class GenericPlutoPortlet

getHelpPage

public java.lang.String getHelpPage(RenderRequest request)
Specified by:
getHelpPage in class GenericPlutoPortlet

getAvailablePages

public java.util.Collection getAvailablePages()

getContentBeforeRenderConfig

protected static java.lang.String getContentBeforeRenderConfig(java.lang.String contents)
Gets the content of the config page before the render-config element (also including the default attribute of render-config - see RENDER_CONFIG_SEARCH_TOKEN above).

Parameters:
contents - pluto-portal-driver-config.xml file contents.
Returns:

parseDefaultPage

protected static java.lang.String parseDefaultPage(java.lang.String configFileContents)
Parse out default attribute value of render-config element in pluto-portal-driver-config.xml. This method is protected to allow unit testing (see PageAdminPortletTest.testParseDefaultPage().)

Parameters:
configFileContents - Contents of pluto-portal-driver-config.xml file.
Returns:
The value of the default attribute in the render-config element.


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.