## org.apache.portals.bridges.frameworks
Class GenericFrameworkPortlet

    java.lang.Object
      javax.portlet.GenericPortlet
          org.apache.portals.bridges.common.GenericServletPortlet
              org.apache.portals.bridges.velocity.GenericVelocityPortlet
                  org.apache.portals.bridges.frameworks.GenericFrameworkPortlet

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

Direct Known Subclasses:
  VelocityFrameworkPortlet

public class GenericFrameworkPortlet
extends org.apache.portals.bridges.velocity.GenericVelocityPortlet

SpringVelocityPortlet

Version:
  $Id: GenericFrameworkPortlet.java,v 1.1 2004/11/04 18:09:33 taylor Exp $
Author:
  David Sean Taylor

Field Summary
`private static String` `INITPARAM_SPRING_CONFIG` Init Parameter: default spring configuration property
`private static String` `INITPARAM_VALIDATOR_CONFIG` Init Parameter: default velocity configuration property
`private static PortletApplicationModel` `model`
`private static String` `PREFS_SUFFIX`
`private static Object` `semaphore`
`private static String` `SESSION_ERROR_MESSAGES`
`private static Class[]` `VELOCITY_PORTLET_ACTION_SIGNATURE` Action signature for calling velocity portlet actions

Fields inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
`PORTLET_BRIDGE_CONTEXT`

Fields inherited from class org.apache.portals.bridges.common.GenericServletPortlet
`PARAM_ACTION_PAGE, PARAM_ALLOW_PREFERENCES, PARAM_CUSTOM_PAGE, PARAM_EDIT_PAGE, PARAM_HELP_PAGE, PARAM_MAX_PAGE, PARAM_VIEW_PAGE`

Fields inherited from class javax.portlet.GenericPortlet
``

Constructor Summary
`GenericFrameworkPortlet()`

Method Summary
`private void` `beanToContext(javax.portlet.RenderRequest request, String view, ModelBean mb)`
`private void` `clearBeanFromSession(javax.portlet.PortletRequest request, ModelBean mb)`
`protected String` `determineLogicalView(javax.portlet.PortletRequest request)` Get the current logical view based on velocity.view request parameter If the request parameter is not found, fall back to init param
`void` `doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)`
`void` `doHelp(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)`
`protected void` `doRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)`
`void` `doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)`
`protected Object` `formToBean(javax.portlet.ActionRequest request, String view, ModelBean mb)`
`protected Object` `formToPrefs(javax.portlet.ActionRequest request, String view, ModelBean mb)`
`protected void` `forwardToView(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, String forward)`
`private Object` `getBeanFromSession(javax.portlet.PortletRequest request, ModelBean mb)`
`void` `init(javax.portlet.PortletConfig config)`
`protected String` `invokeVelocityPortletAction(String methodName, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, Object bean)` Invokes a specific Velocity Portlet Action All portlet actions must have the signature: String methodName(ActionRequest request, ActionResponse response)
`private String` `makeModelBeanKey(ModelBean mb)`
`private void` `preferencesToContext(javax.portlet.RenderRequest request, String view, ModelBean mb)`
`void` `processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)` Invoke the velocity portlet pipeline: (1) determine the logical view (2) restore state from Form to Bean (3) validate the bean -- or -- (2) restore state from Form to Prefs (4) execute the velocity action (5) forward to another view
`private void` `putBeanInSession(javax.portlet.PortletRequest request, ModelBean mb, Object bean)`
`protected void` `putRequestVariable(javax.portlet.RenderRequest request, String name, Object value)` Specific for Velocity
`void` `setExternalSupport(Map map)`
`protected void` `setLogicalView(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, String view, javax.portlet.PortletMode newMode)`
`private javax.portlet.PortletMode` `setPortletMode(javax.portlet.ActionResponse response, String forward)`
`private void` `setWindowState(javax.portlet.ActionResponse response, String forward)`
`void` `startNewRecord(javax.portlet.PortletRequest request, String view)`
`protected void` `storePreferences(javax.portlet.PortletRequest request, Map bean)`

Methods inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
`doCustom, doPreferencesEdit, getContext, getContext, render, setupPreferencesEdit`

Methods inherited from class org.apache.portals.bridges.common.GenericServletPortlet
`getDefaultActionPage, getDefaultCustomPage, getDefaultEditPage, getDefaultHelpPage, getDefaultViewPage, processPreferencesAction, setDefaultActionPage, setDefaultCustomPage, setDefaultEditPage, setDefaultHelpPage, setDefaultViewPage`

Methods inherited from class javax.portlet.GenericPortlet
`destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INITPARAM_SPRING_CONFIG

    private static final String INITPARAM_SPRING_CONFIG

  Init Parameter: default spring configuration property

  See Also:
    Constant Field Values

### INITPARAM_VALIDATOR_CONFIG

    private static final String INITPARAM_VALIDATOR_CONFIG

  Init Parameter: default velocity configuration property

  See Also:
    Constant Field Values

### PREFS_SUFFIX

    private static final String PREFS_SUFFIX

See Also:
  Constant Field Values

### SESSION_ERROR_MESSAGES

    private static final String SESSION_ERROR_MESSAGES

See Also:
  Constant Field Values

### VELOCITY_PORTLET_ACTION_SIGNATURE

    private static final Class[] VELOCITY_PORTLET_ACTION_SIGNATURE

  Action signature for calling velocity portlet actions

### model

    private static PortletApplicationModel model

### semaphore

    private static Object semaphore

Constructor Detail

### GenericFrameworkPortlet

    public GenericFrameworkPortlet()

Method Detail

### setExternalSupport

    public void setExternalSupport(Map map)

### 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 response)
                       throws javax.portlet.PortletException,
                              IOException

  Invoke the velocity portlet pipeline: (1) determine the logical view (2) restore state from Form to Bean (3) validate the bean -- or -- (2) restore state from Form to Prefs (4) execute the velocity action (5) forward to another view

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### forwardToView

    protected void forwardToView(javax.portlet.ActionRequest request,
                                 javax.portlet.ActionResponse response,
                                 String forward)

### setWindowState

    private void setWindowState(javax.portlet.ActionResponse response,
                                String forward)

### setPortletMode

    private javax.portlet.PortletMode setPortletMode(javax.portlet.ActionResponse response,
                                                     String forward)

### storePreferences

    protected void storePreferences(javax.portlet.PortletRequest request,
                                    Map bean)
                             throws IOException,
                                    javax.portlet.PortletException

  Throws:
    `IOException`
    `javax.portlet.PortletException`

### determineLogicalView

    protected String determineLogicalView(javax.portlet.PortletRequest request)
                                   throws javax.portlet.PortletException

  Get the current logical view based on velocity.view request parameter If the request parameter is not found, fall back to init param

  Parameters:
    `request` -
  Returns:
    the current view
  Throws:
    `javax.portlet.PortletException`

### setLogicalView

    protected void setLogicalView(javax.portlet.PortletRequest request,
                                  javax.portlet.PortletResponse response,
                                  String view,
                                  javax.portlet.PortletMode newMode)

### formToBean

    protected Object formToBean(javax.portlet.ActionRequest request,
                                String view,
                                ModelBean mb)
                         throws javax.portlet.PortletException

  Throws:
    `javax.portlet.PortletException`

### formToPrefs

    protected Object formToPrefs(javax.portlet.ActionRequest request,
                                 String view,
                                 ModelBean mb)
                          throws javax.portlet.PortletException

  Throws:
    `javax.portlet.PortletException`

### invokeVelocityPortletAction

    protected String invokeVelocityPortletAction(String methodName,
                                                 javax.portlet.ActionRequest request,
                                                 javax.portlet.ActionResponse response,
                                                 Object bean)
                                          throws javax.portlet.PortletException

  Invokes a specific Velocity Portlet Action All portlet actions must have the signature: String methodName(ActionRequest request, ActionResponse response)

  Parameters:
    `methodName` -
  Throws:
    `javax.portlet.PortletException`

### doView

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

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### doHelp

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

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### doEdit

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

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### doRender

    protected void doRender(javax.portlet.RenderRequest request,
                            javax.portlet.RenderResponse response)
                     throws javax.portlet.PortletException,
                            IOException

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### beanToContext

    private void beanToContext(javax.portlet.RenderRequest request,
                               String view,
                               ModelBean mb)

### preferencesToContext

    private void preferencesToContext(javax.portlet.RenderRequest request,
                                      String view,
                                      ModelBean mb)

### getBeanFromSession

    private Object getBeanFromSession(javax.portlet.PortletRequest request,
                                      ModelBean mb)

### clearBeanFromSession

    private void clearBeanFromSession(javax.portlet.PortletRequest request,
                                      ModelBean mb)

### startNewRecord

    public void startNewRecord(javax.portlet.PortletRequest request,
                               String view)

### putBeanInSession

    private void putBeanInSession(javax.portlet.PortletRequest request,
                                  ModelBean mb,
                                  Object bean)

### makeModelBeanKey

    private String makeModelBeanKey(ModelBean mb)

### putRequestVariable

    protected void putRequestVariable(javax.portlet.RenderRequest request,
                                      String name,
                                      Object value)

  Specific for Velocity

  Parameters:
    `name` -
    `value` -

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