Package com.jalios.jcms.portlet
Class PortletAbilitiesManager
java.lang.Object
com.jalios.jcms.portlet.PortletAbilitiesManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetAbilityLabel(String userLang, String ability) Returns the label of a given abilityString[]Returns an Array of all available abilities declared for the given class.String[]getAllAbilities(Class clazz) Returns an Array of all available abilities declared for the given classReturns a Map (key1/key2) of all available abilities declared.Retrieve all abilities in map easy to use for User Interface listing of abilities.static PortletAbilitiesManager
-
Field Details
-
allAbilities
-
allAbilityMap
-
allAbilityMapUI
-
-
Method Details
-
getInstance
-
getAllAbilityMap
Returns a Map (key1/key2) of all available abilities declared.This method uses a cached Map of abilities.
Return a map like this one :
{ "portlet.ability.virtualdesktop" : { "service" : "PortletSkinable" }, "portlet.ability.internal" : { "analytics" : "AbstractPortletAnalytics AbstractPortletAnalytics" }, "portlet.ability.jcmsplugin" : { "foobar" : "Portlet" "collaborativespace.application" : "Portlet" "collaborativespace.dashboard" : "Portlet" } }- Returns:
- Map of abilities
-
getAllAbilityMapUI
Retrieve all abilities in map easy to use for User Interface listing of abilities.Help fix bug JCMS-2653 - Bad optgroup label in ability list.
The map computed by
getAllAbilityMap()matches a complex structure not suitable for presentation purpose.In order to properly and easily list abilities without losing backward compatibility, this method converts the map returned by
getAllAbilityMap()into a simpler representation like this one :{ "portlet.ability.virtualdesktop" : [ "service" ], "portlet.ability.internal" : [ "stat" ], "portlet.ability.jcmsplugin" : [ "foobar" ], "portlet.ability.jcmsplugin.collaborativespace" : [ "application", "dashboard" ] }The key match a "parent ability" suitable for use in a optgroup label.
The values match the suffix to add to the key in order to get a full and valid ability.- Returns:
- a Map
- Since:
- jcms-7.0.3 jcms-7.1
-
getAllAbilities
Returns an Array of all available abilities declared for the given class. This methode use cached abilities.- Returns:
- String[] an array of abilities
-
getAllAbilities
Returns an Array of all available abilities declared for the given class- Parameters:
clazz- the class used to filter abilities- Returns:
- String[] an array of abilities
-
getAbilityLabel
Returns the label of a given ability- Parameters:
userLang- the user languageability- the ability- Returns:
- String the I18N ability
-