org.exoplatform.frameworks.portletcontainer.portalframework
Class Helper

java.lang.Object
  extended by org.exoplatform.frameworks.portletcontainer.portalframework.Helper

public final class Helper
extends Object

Helper class that contains utility functions to use in portal framework.


Method Summary
static void appendParams(Map<String,String[]> dest, Map<String,String[]> src)
          Appends params from source to destination map so that params with the same name weren't replaced by each other but appended to a list.
static PortletInfo createPortletInfo(PortalFramework framework, String plt)
          Creates PortletInfo object for a given portlet and fills most of necessary fields.
static int getActionType(String v)
          Converts action type from string representation to an integer constant.
static javax.portlet.PortletMode getPortletMode(String v, Collection<javax.portlet.PortletMode> pms)
          Converts portlet mode from string representation to an PortletMode class instance.
static javax.portlet.WindowState getWindowState(String v, Collection<javax.portlet.WindowState> wss)
          Converts window state from string representation to an WindowState class instance.
static void parseParams(javax.servlet.http.HttpServletRequest httpRequest, String[] portalParamNames, String[] portalParamNames2, HashMap<String,String[]> portalParams, HashMap<String,String[]> portletParams, HashMap<String,String[]> propertyParams)
          Distinguishes portal service parameters from portlet parameters.
static void separatePublicParams(Map<String,String[]> portletRenderParams, Map<String,String[]> publicRenderParams, List<String> publicParams)
          Distinguishes public parameters from within all public ones basing on public parameter list.
static String string0(String[] strings)
          Returns from a string array a string with index 0, if array is null, returns null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseParams

public static void parseParams(javax.servlet.http.HttpServletRequest httpRequest,
                               String[] portalParamNames,
                               String[] portalParamNames2,
                               HashMap<String,String[]> portalParams,
                               HashMap<String,String[]> portletParams,
                               HashMap<String,String[]> propertyParams)
Distinguishes portal service parameters from portlet parameters.

Parameters:
httpRequest - http servlet request
portalParamNames - list of names of parameters that are used by the portal framework
portalParamNames2 - list of names of parameters that are used by a portal
portalParams - portal service params
portletParams - portlet params
propertyParams - property params

getActionType

public static int getActionType(String v)
Converts action type from string representation to an integer constant.

Parameters:
v - string representation of an action type
Returns:
numeric representation of an action type

getPortletMode

public static javax.portlet.PortletMode getPortletMode(String v,
                                                       Collection<javax.portlet.PortletMode> pms)
Converts portlet mode from string representation to an PortletMode class instance.

Parameters:
v - string representation of a portlet mode
pms - collection of portlet modes that are allowed at a moment
Returns:
PortletMode object

getWindowState

public static javax.portlet.WindowState getWindowState(String v,
                                                       Collection<javax.portlet.WindowState> wss)
Converts window state from string representation to an WindowState class instance.

Parameters:
v - string representation of a window state
wss - collection of window states that are allowed at a moment
Returns:
WindowState object

createPortletInfo

public static PortletInfo createPortletInfo(PortalFramework framework,
                                            String plt)
Creates PortletInfo object for a given portlet and fills most of necessary fields.

Parameters:
framework - PortalFramework instance
plt - portlet name
Returns:
created PortletInfo object

appendParams

public static void appendParams(Map<String,String[]> dest,
                                Map<String,String[]> src)
Appends params from source to destination map so that params with the same name weren't replaced by each other but appended to a list.

Parameters:
dest - destination map
src - source map

string0

public static String string0(String[] strings)
Returns from a string array a string with index 0, if array is null, returns null.

Parameters:
strings - string array
Returns:
string with index 0 or null, if array if null

separatePublicParams

public static void separatePublicParams(Map<String,String[]> portletRenderParams,
                                        Map<String,String[]> publicRenderParams,
                                        List<String> publicParams)
Distinguishes public parameters from within all public ones basing on public parameter list.

Parameters:
portletRenderParams - all params
publicRenderParams - destination map for public params
publicParams - public parameters names list


Copyright © 2009 eXo Platform SAS. All Rights Reserved.