Class PortletRegistryContextImpl
- java.lang.Object
-
- com.sun.portal.portletcontainer.admin.PortletRegistryContextImpl
-
- All Implemented Interfaces:
PortletRegistryContext
public class PortletRegistryContextImpl extends Object implements PortletRegistryContext
PortletRegistryContextImpl is a concrete implementation of the PortletRegistryContext interface. This delegates the method invocations to the appropriate objects that deal with a specific portlet registry.
-
-
Field Summary
-
Fields inherited from interface com.sun.portal.portletcontainer.context.registry.PortletRegistryContext
USER_NAME_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description PortletRegistryContextImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createPortletWindow(String portletName, String portletWindowName)
Creates a new portlet window based on the existing portlet window.void
createPortletWindow(String portletName, String portletWindowName, String title, String locale)
Creates a new portlet window based on the existing portlet window along with title and locale.The new portlet window also gets the default preferences from the existing portlet windowList<String>
getAllPortletWindows(com.sun.portal.container.PortletType portletType)
Returns the portlet windows based on the portlet type.List<String>
getAvailablePortlets()
Returns all the available portlets.String
getConsumerID(String portletWindowName)
Returns the consumerID for a portlet windowString
getDescription(String portletName, String desiredLocale)
Returns the description for a portlet for a locale as specified in portlet.xmlString
getDisplayName(String portletName, String desiredLocale)
Returns the displayname for a portlet for a locale as specified in portlet.xmlcom.sun.portal.container.EntityID
getEntityId(String portletWindowName)
Returns the entityID for a portlet windowList<com.sun.portal.container.EntityID>
getEntityIds()
Returns the entityIDs for all the portlet windowsList<String>
getKeywords(String portletName, String desiredLocale)
Returns the keywords for a portlet for a locale as specified in portlet.xmlList<String>
getMarkupTypes(String portletName)
Returns the markup types for the portlet as specified in portlet.xmlString
getPortletID(String portletWindowName)
Returns the portletID for a portlet windowcom.sun.portal.container.PortletLang
getPortletLang(String portletWindowName)
Returns the lang attribute for a portlet windowString
getPortletName(String portletWindowName)
Returns the portletName associated with the portlet windowList<String>
getPortletWindows(String portletName)
Returns the portlet windows based on the portlet.String
getPortletWindowTitle(String portletWindowName)
Returns the title for a portlet window.Map<String,Object>
getPreferences(String portletWindowName, String userName)
Returns the preferences for a portlet window and a user nameMap<String,Object>
getPreferencesReadOnly(String portletWindowName, String userName)
Returns the read only information for the preferences obtained usinggetPreferences
The key in the map is the name of the preference, while the value is either "true" or "false".String
getProducerEntityID(String portletWindowName)
Returns the producerEntityID for a portlet windowMap<String,Object>
getRoleMap(String portletName)
Returns the role map for a portlet specified during deploying of the portlet.Integer
getRowNumber(String portletWindowName)
Returns the row number of the portlet windowString
getShortTitle(String portletName, String desiredLocale)
Returns the short title for a portlet for a locale as specified in portlet.xmlString
getTitle(String portletName, String desiredLocale)
Returns the title for a portlet for a locale as specified in portlet.xmlMap<String,Object>
getUserInfoMap(String portletName)
Returns the userinfo map for a portlet specified during deploying of the portletList<String>
getVisiblePortletWindows(com.sun.portal.container.PortletType portletType)
Returns a list of visible portlet windows based on portlet type.String
getWidth(String portletWindowName)
Returns the width set for the the portlet window.boolean
hasEdit(String portletName)
Checks whether the portlet supports EDIT modeboolean
hasHelp(String portletName)
Checks whether the portlet supports HELP modeboolean
hasView(String portletName)
Checks whether the portlet supports VIEW modevoid
init(String context)
boolean
isRemote(String portletWindowName)
Returns the isRemote attribute for a portlet windowboolean
isVisible(String portletWindowName)
Returns true if the Portlet Window is visible, otherwise returns false.void
movePortletWindows(List<PortletWindowData> portletWindows)
void
removePortlet(String portletName)
Removes the specified portlet entry.void
removePortletWindow(String portletWindowName)
Removes the specified portlet window from the registry.void
savePreferences(String portletName, String portletWindowName, String userName, Map<String,Object> prefMap)
Save the preferences for a portlet window and for a user.void
setPortletWindowTitle(String portletWindowName, String title)
Set the title for the portlet window.void
setWidth(String portletWindowName, String width, String row)
Sets the width of the portlet window.void
showPortletWindow(String portletWindowName, boolean visible)
Shows or Hides the Portlet Window.
-
-
-
Method Detail
-
init
public void init(String context) throws PortletRegistryException
- Specified by:
init
in interfacePortletRegistryContext
- Throws:
PortletRegistryException
-
getMarkupTypes
public List<String> getMarkupTypes(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the markup types for the portlet as specified in portlet.xml- Specified by:
getMarkupTypes
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- a
List
of the markup types. - Throws:
PortletRegistryException
-
getDescription
public String getDescription(String portletName, String desiredLocale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the description for a portlet for a locale as specified in portlet.xml- Specified by:
getDescription
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the description - Throws:
PortletRegistryException
-
getShortTitle
public String getShortTitle(String portletName, String desiredLocale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the short title for a portlet for a locale as specified in portlet.xml- Specified by:
getShortTitle
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the short title - Throws:
PortletRegistryException
-
getTitle
public String getTitle(String portletName, String desiredLocale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the title for a portlet for a locale as specified in portlet.xml- Specified by:
getTitle
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the title - Throws:
PortletRegistryException
-
getKeywords
public List<String> getKeywords(String portletName, String desiredLocale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the keywords for a portlet for a locale as specified in portlet.xml- Specified by:
getKeywords
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
List
of keywords - Throws:
PortletRegistryException
-
getDisplayName
public String getDisplayName(String portletName, String desiredLocale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the displayname for a portlet for a locale as specified in portlet.xml- Specified by:
getDisplayName
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the displayname - Throws:
PortletRegistryException
-
getRoleMap
public Map<String,Object> getRoleMap(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the role map for a portlet specified during deploying of the portlet.- Specified by:
getRoleMap
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- a
Map
of the roles - Throws:
PortletRegistryException
-
getUserInfoMap
public Map<String,Object> getUserInfoMap(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the userinfo map for a portlet specified during deploying of the portlet- Specified by:
getUserInfoMap
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- a
Map
of the user information - Throws:
PortletRegistryException
-
hasView
public boolean hasView(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Checks whether the portlet supports VIEW mode- Specified by:
hasView
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports VIEW mode
- Throws:
PortletRegistryException
-
hasEdit
public boolean hasEdit(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Checks whether the portlet supports EDIT mode- Specified by:
hasEdit
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports EDIT mode
- Throws:
PortletRegistryException
-
hasHelp
public boolean hasHelp(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Checks whether the portlet supports HELP mode- Specified by:
hasHelp
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports HELP mode
- Throws:
PortletRegistryException
-
getAvailablePortlets
public List<String> getAvailablePortlets() throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns all the available portlets.- Specified by:
getAvailablePortlets
in interfacePortletRegistryContext
- Returns:
- a
List
of portlets. - Throws:
PortletRegistryException
-
getVisiblePortletWindows
public List<String> getVisiblePortletWindows(com.sun.portal.container.PortletType portletType) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns a list of visible portlet windows based on portlet type. The possible values for portlet type are PortletType.ALL, PortletType.LOCAL and PortletType.REMOTE.- Specified by:
getVisiblePortletWindows
in interfacePortletRegistryContext
- Parameters:
portletType
- the type of the portlet. Possible values are PortletType.ALL, PortletType.LOCAL and PortletType.REMOTE- Returns:
- a
List
of the visible portlet windows - Throws:
PortletRegistryException
-
isVisible
public boolean isVisible(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns true if the Portlet Window is visible, otherwise returns false.- Specified by:
isVisible
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- true if the portlet windows is visible
- Throws:
PortletRegistryException
-
getAllPortletWindows
public List<String> getAllPortletWindows(com.sun.portal.container.PortletType portletType) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the portlet windows based on the portlet type. This returns both hidden as well as visible portlet windows. The possible values for portlet type are PortletType.ALL, PortletType.LOCAL and PortletType.REMOTE.- Specified by:
getAllPortletWindows
in interfacePortletRegistryContext
- Parameters:
portletType
- the type of the portlet. Possible values are PortletType.ALL, PortletType.LOCAL and PortletType.REMOTE- Returns:
- a
List
of all portlet windows. - Throws:
PortletRegistryException
-
getRowNumber
public Integer getRowNumber(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the row number of the portlet window- Specified by:
getRowNumber
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the row number. - Throws:
PortletRegistryException
-
getWidth
public String getWidth(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the width set for the the portlet window. The width can be either thin or thick.- Specified by:
getWidth
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the width. - Throws:
PortletRegistryException
-
setWidth
public void setWidth(String portletWindowName, String width, String row) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Sets the width of the portlet window. The width can be either thin or thick.- Specified by:
setWidth
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet windowwidth
- the width, which can be either thick or thin- Throws:
PortletRegistryException
-
movePortletWindows
public void movePortletWindows(List<PortletWindowData> portletWindows) throws PortletRegistryException
- Specified by:
movePortletWindows
in interfacePortletRegistryContext
- Throws:
PortletRegistryException
-
getEntityId
public com.sun.portal.container.EntityID getEntityId(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the entityID for a portlet window- Specified by:
getEntityId
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the entity Id. - Throws:
PortletRegistryException
-
getEntityIds
public List<com.sun.portal.container.EntityID> getEntityIds() throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the entityIDs for all the portlet windows- Specified by:
getEntityIds
in interfacePortletRegistryContext
- Returns:
- a
List
of entity Ids. - Throws:
PortletRegistryException
-
getPortletWindowTitle
public String getPortletWindowTitle(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the title for a portlet window.- Specified by:
getPortletWindowTitle
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the title - Throws:
PortletRegistryException
-
setPortletWindowTitle
public void setPortletWindowTitle(String portletWindowName, String title) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Set the title for the portlet window.- Specified by:
setPortletWindowTitle
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet windowtitle
- the title for the portlet window- Throws:
PortletRegistryException
-
createPortletWindow
public void createPortletWindow(String portletName, String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Creates a new portlet window based on the existing portlet window.- Specified by:
createPortletWindow
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet windowportletWindowName
- the new name of the portlet window- Throws:
PortletRegistryException
-
createPortletWindow
public void createPortletWindow(String portletName, String portletWindowName, String title, String locale) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Creates a new portlet window based on the existing portlet window along with title and locale.The new portlet window also gets the default preferences from the existing portlet window- Specified by:
createPortletWindow
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet windowportletWindowName
- the new name of the portlet window- Throws:
PortletRegistryException
-
removePortletWindow
public void removePortletWindow(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Removes the specified portlet window from the registry.- Specified by:
removePortletWindow
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window to be removed- Throws:
PortletRegistryException
-
showPortletWindow
public void showPortletWindow(String portletWindowName, boolean visible) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Shows or Hides the Portlet Window. If visible is true, shows the Portlet Window and is false, hides the Portlet Window.- Specified by:
showPortletWindow
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window to be shownvisible
- true or false- Throws:
PortletRegistryException
-
removePortlet
public void removePortlet(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Removes the specified portlet entry.- Specified by:
removePortlet
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet to be removed- Throws:
PortletRegistryException
-
getPreferences
public Map<String,Object> getPreferences(String portletWindowName, String userName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the preferences for a portlet window and a user name- Specified by:
getPreferences
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet windowuserName
- the name of the user- Returns:
- a
Map
, the preferences. - Throws:
PortletRegistryException
-
getPreferencesReadOnly
public Map<String,Object> getPreferencesReadOnly(String portletWindowName, String userName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the read only information for the preferences obtained usinggetPreferences
The key in the map is the name of the preference, while the value is either "true" or "false". "true" indicates that the preference is read only, while "false" indicates the preference can be read/written.- Specified by:
getPreferencesReadOnly
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet windowuserName
- the name of the user- Returns:
- a
Map
, the read only information for preferences. - Throws:
PortletRegistryException
-
savePreferences
public void savePreferences(String portletName, String portletWindowName, String userName, Map<String,Object> prefMap) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Save the preferences for a portlet window and for a user.- Specified by:
savePreferences
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portletportletWindowName
- the name of the portlet windowuserName
- the name of the userprefMap
- the preferences to be saved- Throws:
PortletRegistryException
-
getPortletName
public String getPortletName(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the portletName associated with the portlet window- Specified by:
getPortletName
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the portlet name. - Throws:
PortletRegistryException
-
getPortletWindows
public List<String> getPortletWindows(String portletName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the portlet windows based on the portlet.- Specified by:
getPortletWindows
in interfacePortletRegistryContext
- Parameters:
portletName
- the name of the portlet- Returns:
- a
List
of portlet windows. - Throws:
PortletRegistryException
-
getPortletID
public String getPortletID(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the portletID for a portlet window- Specified by:
getPortletID
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the portlet Id. - Throws:
PortletRegistryException
-
getConsumerID
public String getConsumerID(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the consumerID for a portlet window- Specified by:
getConsumerID
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the consumer Id. - Throws:
PortletRegistryException
-
getProducerEntityID
public String getProducerEntityID(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the producerEntityID for a portlet window- Specified by:
getProducerEntityID
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the producer entity Id. - Throws:
PortletRegistryException
-
isRemote
public boolean isRemote(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the isRemote attribute for a portlet window- Specified by:
isRemote
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
boolean
, the isRemote. - Throws:
PortletRegistryException
-
getPortletLang
public com.sun.portal.container.PortletLang getPortletLang(String portletWindowName) throws PortletRegistryException
Description copied from interface:PortletRegistryContext
Returns the lang attribute for a portlet window- Specified by:
getPortletLang
in interfacePortletRegistryContext
- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
PortletLang
, the PortletLang indicating the language of Portlet. - Throws:
PortletRegistryException
-
-