Interface PortletRegistryContext
-
- All Known Implementing Classes:
PortletRegistryContextImpl
public interface PortletRegistryContext
PortletRegistryContext provides information pertaining to the portlet registry files. This includes information about portlets, portlet windows, portlet preferences
-
-
Field Summary
Fields Modifier and Type Field Description static String
USER_NAME_DEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createPortletWindow(String existingName, String newName)
Creates a new portlet window based on the existing portlet window.void
createPortletWindow(String existingName, String newName, 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 name)
Removes the specified portlet entry.void
removePortletWindow(String name)
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 name, boolean visible)
Shows or Hides the Portlet Window.
-
-
-
Field Detail
-
USER_NAME_DEFAULT
static final String USER_NAME_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(String context) throws PortletRegistryException
- Throws:
PortletRegistryException
-
getMarkupTypes
List<String> getMarkupTypes(String portletName) throws PortletRegistryException
Returns the markup types for the portlet as specified in portlet.xml- Parameters:
portletName
- the name of the portlet- Returns:
- a
List
of the markup types. - Throws:
PortletRegistryException
-
getDescription
String getDescription(String portletName, String desiredLocale) throws PortletRegistryException
Returns the description for a portlet for a locale as specified in portlet.xml- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the description - Throws:
PortletRegistryException
-
getShortTitle
String getShortTitle(String portletName, String desiredLocale) throws PortletRegistryException
Returns the short title for a portlet for a locale as specified in portlet.xml- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the short title - Throws:
PortletRegistryException
-
getTitle
String getTitle(String portletName, String desiredLocale) throws PortletRegistryException
Returns the title for a portlet for a locale as specified in portlet.xml- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the title - Throws:
PortletRegistryException
-
getKeywords
List<String> getKeywords(String portletName, String desiredLocale) throws PortletRegistryException
Returns the keywords for a portlet for a locale as specified in portlet.xml- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
List
of keywords - Throws:
PortletRegistryException
-
getDisplayName
String getDisplayName(String portletName, String desiredLocale) throws PortletRegistryException
Returns the displayname for a portlet for a locale as specified in portlet.xml- Parameters:
portletName
- the name of the portletdesiredLocale
- the locale- Returns:
- a
String
, the displayname - Throws:
PortletRegistryException
-
getRoleMap
Map<String,Object> getRoleMap(String portletName) throws PortletRegistryException
Returns the role map for a portlet specified during deploying of the portlet.- Parameters:
portletName
- the name of the portlet- Returns:
- a
Map
of the roles - Throws:
PortletRegistryException
-
getUserInfoMap
Map<String,Object> getUserInfoMap(String portletName) throws PortletRegistryException
Returns the userinfo map for a portlet specified during deploying of the portlet- Parameters:
portletName
- the name of the portlet- Returns:
- a
Map
of the user information - Throws:
PortletRegistryException
-
hasView
boolean hasView(String portletName) throws PortletRegistryException
Checks whether the portlet supports VIEW mode- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports VIEW mode
- Throws:
PortletRegistryException
-
hasEdit
boolean hasEdit(String portletName) throws PortletRegistryException
Checks whether the portlet supports EDIT mode- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports EDIT mode
- Throws:
PortletRegistryException
-
hasHelp
boolean hasHelp(String portletName) throws PortletRegistryException
Checks whether the portlet supports HELP mode- Parameters:
portletName
- the name of the portlet- Returns:
- true, if the portlet supports HELP mode
- Throws:
PortletRegistryException
-
getAvailablePortlets
List<String> getAvailablePortlets() throws PortletRegistryException
Returns all the available portlets.- Returns:
- a
List
of portlets. - Throws:
PortletRegistryException
-
getPortletName
String getPortletName(String portletWindowName) throws PortletRegistryException
Returns the portletName associated with the portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the portlet name. - Throws:
PortletRegistryException
-
getPortletWindows
List<String> getPortletWindows(String portletName) throws PortletRegistryException
Returns the portlet windows based on the portlet.- Parameters:
portletName
- the name of the portlet- Returns:
- a
List
of portlet windows. - Throws:
PortletRegistryException
-
isVisible
boolean isVisible(String portletWindowName) throws PortletRegistryException
Returns true if the Portlet Window is visible, otherwise returns false.- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- true if the portlet windows is visible
- Throws:
PortletRegistryException
-
getVisiblePortletWindows
List<String> getVisiblePortletWindows(com.sun.portal.container.PortletType portletType) throws PortletRegistryException
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.- 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
-
getAllPortletWindows
List<String> getAllPortletWindows(com.sun.portal.container.PortletType portletType) throws PortletRegistryException
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.- 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
Integer getRowNumber(String portletWindowName) throws PortletRegistryException
Returns the row number of the portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the row number. - Throws:
PortletRegistryException
-
getWidth
String getWidth(String portletWindowName) throws PortletRegistryException
Returns the width set for the the portlet window. The width can be either thin or thick.- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the width. - Throws:
PortletRegistryException
-
setWidth
void setWidth(String portletWindowName, String width, String row) throws PortletRegistryException
Sets the width of the portlet window. The width can be either thin or thick.- Parameters:
portletWindowName
- the name of the portlet windowwidth
- the width, which can be either thick or thin- Throws:
PortletRegistryException
-
movePortletWindows
void movePortletWindows(List<PortletWindowData> portletWindows) throws PortletRegistryException
- Throws:
PortletRegistryException
-
getEntityId
com.sun.portal.container.EntityID getEntityId(String portletWindowName) throws PortletRegistryException
Returns the entityID for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the entity Id. - Throws:
PortletRegistryException
-
getEntityIds
List<com.sun.portal.container.EntityID> getEntityIds() throws PortletRegistryException
Returns the entityIDs for all the portlet windows- Returns:
- a
List
of entity Ids. - Throws:
PortletRegistryException
-
getPortletWindowTitle
String getPortletWindowTitle(String portletWindowName) throws PortletRegistryException
Returns the title for a portlet window.- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the title - Throws:
PortletRegistryException
-
setPortletWindowTitle
void setPortletWindowTitle(String portletWindowName, String title) throws PortletRegistryException
Set the title for the portlet window.- Parameters:
portletWindowName
- the name of the portlet windowtitle
- the title for the portlet window- Throws:
PortletRegistryException
-
createPortletWindow
void createPortletWindow(String existingName, String newName) throws PortletRegistryException
Creates a new portlet window based on the existing portlet window.- Parameters:
newName
- the new name of the portlet windowexistingName
- the name of the portlet window- Throws:
PortletRegistryException
-
createPortletWindow
void createPortletWindow(String existingName, String newName, String title, String locale) throws PortletRegistryException
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- Parameters:
newName
- the new name of the portlet windowexistingName
- the name of the portlet window- Throws:
PortletRegistryException
-
removePortletWindow
void removePortletWindow(String name) throws PortletRegistryException
Removes the specified portlet window from the registry.- Parameters:
name
- the name of the portlet window to be removed- Throws:
PortletRegistryException
-
showPortletWindow
void showPortletWindow(String name, boolean visible) throws PortletRegistryException
Shows or Hides the Portlet Window. If visible is true, shows the Portlet Window and is false, hides the Portlet Window.- Parameters:
name
- the name of the portlet window to be shownvisible
- true or false- Throws:
PortletRegistryException
-
removePortlet
void removePortlet(String name) throws PortletRegistryException
Removes the specified portlet entry.- Parameters:
name
- the name of the portlet to be removed- Throws:
PortletRegistryException
-
getPreferences
Map<String,Object> getPreferences(String portletWindowName, String userName) throws PortletRegistryException
Returns the preferences for a portlet window and a user name- Parameters:
portletWindowName
- the name of the portlet windowuserName
- the name of the user- Returns:
- a
Map
, the preferences. - Throws:
PortletRegistryException
-
getPreferencesReadOnly
Map<String,Object> getPreferencesReadOnly(String portletWindowName, String userName) throws PortletRegistryException
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.- 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
void savePreferences(String portletName, String portletWindowName, String userName, Map<String,Object> prefMap) throws PortletRegistryException
Save the preferences for a portlet window and for a user.- 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
-
getPortletID
String getPortletID(String portletWindowName) throws PortletRegistryException
Returns the portletID for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the portlet Id. - Throws:
PortletRegistryException
-
getProducerEntityID
String getProducerEntityID(String portletWindowName) throws PortletRegistryException
Returns the producerEntityID for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the producer entity Id. - Throws:
PortletRegistryException
-
getConsumerID
String getConsumerID(String portletWindowName) throws PortletRegistryException
Returns the consumerID for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
String
, the consumer Id. - Throws:
PortletRegistryException
-
isRemote
boolean isRemote(String portletWindowName) throws PortletRegistryException
Returns the isRemote attribute for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
boolean
, the isRemote. - Throws:
PortletRegistryException
-
getPortletLang
com.sun.portal.container.PortletLang getPortletLang(String portletWindowName) throws PortletRegistryException
Returns the lang attribute for a portlet window- Parameters:
portletWindowName
- the name of the portlet window- Returns:
- a
PortletLang
, the PortletLang indicating the language of Portlet. - Throws:
PortletRegistryException
-
-