| java.lang.Object com.nabhinc.portlet.portletadmin.PortletUtil
PortletUtil | public class PortletUtil (Code) | | author: Padmanabh Dabke
author: (c) 2003 Nabh Information Systems, Inc. All Rights Reserved. |
Method Summary | |
public static PortletType | createPortletType(String portletName, String className) Create PortletType of specified portlet class and name. | public static String | getDescription(PortletConfigInfo pcInfo) Returns a default description from PortletConfigInfo, if provided. | public static HashMap | getDescriptionMap(PortletType pType) Return a map of locale language code and description value. | public static String | getDisplayName(PortletConfigInfo pcInfo) Returns a default display name from PortletConfigInfo, if provided. | public static HashMap | getDisplayNameMap(PortletType pType) Returns a map of locale language code(s) and display name(s).
Default language has empty language code. | public static String | getErrorStackTrace(Throwable ex) | public static Hashtable | getInitParams(PortletType pType) Sets init parameters. | public static Hashtable | getInitParams(PortletConfigInfo pcInfo) | public static String | getPortletParameter(String paramName, PortletRequest rReq, PortletSession pSession) | public static Hashtable | getPreferenceMap(PortletType pType) Returns a Hashtable that maps preference's name and a list (java.util.List)
of preference values. | public static String[] | getPreferenceValues(PortletType pType, String prefName) Returns an array of values of the specified preference name. | public static String[] | getSupportedMimeTypes(PortletType pType) Returns all supported mime types. | public static Hashtable | getSupportsMap(PortletType pType) Returns a Hashtable that maps a mime-type to an array (of String) of
supported modes. | public static boolean | isPreferenceReadOnly(PortletType pType, String prefName) Checks if the specified preference is read only. | public static void | setDescription(String descr, PortletType pType) Sets descriptions of default language (empty language code). | public static void | setDescription(HashMap descrs, PortletType pType) Sets descriptions of multiple languages. | public static void | setDisplayName(String displayName, PortletType pType) | public static void | setDisplayName(HashMap displayNameMap, PortletType pType) Sets display names of multiple languages. | public static void | setExpirationCache(int exp, PortletType pType) Sets the expiration cache. | public static void | setInitParams(Hashtable initParamsMap, PortletType pType) Sets init parameters. | public static void | setKeywords(String keywords, PortletType pType) | public static void | setPreferences(Hashtable prefMap, PortletType pType) Sets the portlet preferences. | public static void | setPreferences(List prefNames, List prefValues, List readOnly, String validatorName, PortletType pType) Sets the preferences. | public static void | setResourceBundle(String resourceBundleName, PortletType pType) | public static void | setSecurityConstraint(PortletApp portletApp, Set portletNames, String transportGuarantee, String displayName) Parameters: portletApp - Portlet configuration. Parameters: portletNames - Array of portlet names. | public static void | setSecurityRoleReference(HashMap securityRoles, PortletType pType) | public static void | setShortTitle(String portletShortTitle, PortletType pType) | public static void | setSupportedLocales(String[] locales, PortletType pType) Sets supported locales. | public static void | setSupports(String[] modes, String[] mimeTypes, PortletType pType) Sets supported mime types and portlet modes.
Possible supported portlet modes are "edit" and "help".
The mime types can be any mime-types supported by http's accept header,
e.g. | public static void | setSupports(String[] modes, String mimeType, PortletType pType) Sets a supported mime type and portlet modes.
Possible supported portlet modes are "edit" and "help".
The mime type can be any mime-types supported by http's accept header,
e.g. | public static void | setTitle(String portletTitle, PortletType pType) |
createPortletType | public static PortletType createPortletType(String portletName, String className)(Code) | | Create PortletType of specified portlet class and name.
Parameters: portletName - The portlet's name. Parameters: className - The portlet class name. |
getDescription | public static String getDescription(PortletConfigInfo pcInfo)(Code) | | Returns a default description from PortletConfigInfo, if provided.
Otherwise, try to get a localized description.
If none of them is defined, empty
string is returned. The order of localized description might not be preserved,
if more than one are defined.
Parameters: pcInfo - |
getDescriptionMap | public static HashMap getDescriptionMap(PortletType pType)(Code) | | Return a map of locale language code and description value.
Default language has empty language code.
Parameters: descrs - A map of locale language code (String) and description (String). Parameters: pType - |
getDisplayName | public static String getDisplayName(PortletConfigInfo pcInfo)(Code) | | Returns a default display name from PortletConfigInfo, if provided. Otherwise,
returns to get a localized display name. If none of them defined, empty
string is returned. The order of localized display name might not be preserved,
if more than one are defined.
Parameters: pcInfo - |
getDisplayNameMap | public static HashMap getDisplayNameMap(PortletType pType)(Code) | | Returns a map of locale language code(s) and display name(s).
Default language has empty language code.
Parameters: pType - |
getInitParams | public static Hashtable getInitParams(PortletType pType)(Code) | | Sets init parameters.
Parameters: initParamsMap - Init param name/value pair map. Parameters: pType - |
getPortletParameter | public static String getPortletParameter(String paramName, PortletRequest rReq, PortletSession pSession)(Code) | | |
getPreferenceMap | public static Hashtable getPreferenceMap(PortletType pType)(Code) | | Returns a Hashtable that maps preference's name and a list (java.util.List)
of preference values.
Parameters: portletApp - Parameters: portletNames - Parameters: transportGuarantee - Parameters: displayName - |
getPreferenceValues | public static String[] getPreferenceValues(PortletType pType, String prefName)(Code) | | Returns an array of values of the specified preference name.
Parameters: pType - Parameters: prefName - The preference of interest. |
getSupportedMimeTypes | public static String[] getSupportedMimeTypes(PortletType pType)(Code) | | Returns all supported mime types.
Parameters: pType - |
getSupportsMap | public static Hashtable getSupportsMap(PortletType pType)(Code) | | Returns a Hashtable that maps a mime-type to an array (of String) of
supported modes.
Parameters: pType - |
isPreferenceReadOnly | public static boolean isPreferenceReadOnly(PortletType pType, String prefName)(Code) | | Checks if the specified preference is read only.
Parameters: pType - Parameters: prefName - true if the preference is read only (not modifiable). |
setDescription | public static void setDescription(String descr, PortletType pType)(Code) | | Sets descriptions of default language (empty language code).
Parameters: descr - The descriptions. Parameters: pType - |
setDescription | public static void setDescription(HashMap descrs, PortletType pType)(Code) | | Sets descriptions of multiple languages.
Parameters: descrs - A map of locale language code (String) and description (String). Parameters: pType - |
setDisplayName | public static void setDisplayName(String displayName, PortletType pType)(Code) | | Sets display name of default language (empty language code)
Parameters: displayName - Parameters: pType - |
setDisplayName | public static void setDisplayName(HashMap displayNameMap, PortletType pType)(Code) | | Sets display names of multiple languages.
Parameters: displayNameMap - A map of locale language codes (String) and display names (String). Parameters: pType - |
setExpirationCache | public static void setExpirationCache(int exp, PortletType pType)(Code) | | Sets the expiration cache.
Parameters: exp - Parameters: pType - |
setInitParams | public static void setInitParams(Hashtable initParamsMap, PortletType pType)(Code) | | Sets init parameters.
Parameters: initParamsMap - Init param name/value pair map. Parameters: pType - |
setKeywords | public static void setKeywords(String keywords, PortletType pType)(Code) | | Sets portlets Category or keywords
Parameters: keywords - A comma separated category keywords. |
setPreferences | public static void setPreferences(Hashtable prefMap, PortletType pType)(Code) | | Sets the portlet preferences. A preference can have a list of values (more than one values).
Note read only field is ignored (false by default) using this method.
Parameters: prefMap - A table that map a preference name with a list (java.util.List) of preference value. Parameters: pType - |
setPreferences | public static void setPreferences(List prefNames, List prefValues, List readOnly, String validatorName, PortletType pType)(Code) | | Sets the preferences. Note that the size of the names, values and readonly list
must be the same.
Parameters: prefNames - List of Preference names. Parameters: prefValues - List of Preference value vectors. Parameters: readOnly - List of Preference read only flags (String). Parameters: validatorName - The preference validator class name. Optional. Parameters: pType - |
setResourceBundle | public static void setResourceBundle(String resourceBundleName, PortletType pType)(Code) | | Sets resource bundle
Parameters: resourceBundleName - Parameters: pType - |
setSecurityConstraint | public static void setSecurityConstraint(PortletApp portletApp, Set portletNames, String transportGuarantee, String displayName)(Code) | | Parameters: portletApp - Portlet configuration. Parameters: portletNames - Array of portlet names. Set to null will remove the security constraint. Parameters: transportGuarantee - Transport layer describes the user data constraint for the portlets collection.Possible values: CONFIDENTIAL , INTEGRAL . Default is CONFIDENTIAL . Parameters: displayname - Name of the security constraint. Default name: Secure Portlets. |
setSecurityRoleReference | public static void setSecurityRoleReference(HashMap securityRoles, PortletType pType)(Code) | | Sets Security Role Reference
Parameters: securityRoles - A map of Role name (String) and Role Link (String) Parameters: pType - |
setShortTitle | public static void setShortTitle(String portletShortTitle, PortletType pType)(Code) | | Sets portlet short title
Parameters: portletShortTitle - Parameters: pType - |
setSupportedLocales | public static void setSupportedLocales(String[] locales, PortletType pType)(Code) | | Sets supported locales.
Parameters: locales - Parameters: pType - |
setSupports | public static void setSupports(String[] modes, String[] mimeTypes, PortletType pType)(Code) | | Sets supported mime types and portlet modes.
Possible supported portlet modes are "edit" and "help".
The mime types can be any mime-types supported by http's accept header,
e.g. text/html, application/vnd.wap.xhtml+xml
Note that this method will set all mime types have the same modes. Use
PortletUtil.setSupports(String[],String,PortletType) setSupports(String[], String, PortletType) method instead.
Parameters: modes - Portlet modes. Possible values: "edit" and "help". Parameters: mimeTypes - Mime types supported by HTTP accept header. Parameters: pType - PortletType |
setSupports | public static void setSupports(String[] modes, String mimeType, PortletType pType)(Code) | | Sets a supported mime type and portlet modes.
Possible supported portlet modes are "edit" and "help".
The mime type can be any mime-types supported by http's accept header,
e.g. text/html, application/vnd.wap.xhtml+xml
Note that this method will set a mime-type with its supported portlet modes at a time.
Parameters: modes - Portlet modes. Possible values: "edit" and "help". Parameters: mimeType - Mime type supported by HTTP accept header. Parameters: pType - PortletType |
setTitle | public static void setTitle(String portletTitle, PortletType pType)(Code) | | Sets portlet title
Parameters: portletTitle - Parameters: pType - |
|
|