Class TopbarManager
- java.lang.Object
-
- com.jalios.jcms.uicomponent.topbar.TopbarManager
-
- All Implemented Interfaces:
JPropertiesListener
public class TopbarManager extends java.lang.Object implements JPropertiesListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTopbarManager.ApplicationSelectorDeprecated.since jcms-10.0.3.classTopbarManager.TopbarApplicationItemComparatorCompares TopbarApplicationItem based following order : - Firstly, items from user preferences - Secondly, items from ShortCut ordered by label - Thirdly, items from properties ordered randomly since they have no labelclassTopbarManager.TopbarItemIndexComparatorCompares TopbarItem based on their indexclassTopbarManager.TopbarItemNameComparatorCompares TopbarItem based on their label and the userlangclassTopbarManager.TopbarSearchItemIndexComparatorCompares TopbarItem based on their index
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACL_CAN_USE_PUBLISH_MENUstatic java.lang.StringALWAYS_WRAP_LOGO_WITH_H1static java.lang.StringORDER_PROP_SUFFIXstatic java.lang.StringTOPBAR_APPLICATION_MEMBERPREFS_KEYstatic java.lang.StringTOPBAR_APPLICATION_PROP_PREFIXstatic java.lang.StringTOPBAR_HANDLER_REQUEST_ATTRstatic java.lang.StringTOPBAR_ITEM_PREFIX_PROPstatic java.lang.StringTOPBAR_SEARCH_ITEM_PROP_PREFIXstatic java.lang.StringWRAP_LOGO_WITH_H1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanalwaysWrapLogoWithH1()booleancanUsePublishMenu(Member mbr)Returns true if the given member can use the Publish menu.protected java.util.List<TopbarApplicationItem>getApplicationsFromPreferences(Member mbr, java.util.Map<java.lang.String,TopbarApplicationItem> allAppMap, java.lang.String preferenceKey)Deprecated.since jcms-10.0.3.protected java.util.Map<java.lang.String,java.lang.String[]>getApplicationsFromPreferencesMap(java.lang.String preference)Deprecated.since jcms-10.0.3.java.util.Set<TopbarApplicationItem>getFavoriteApplicationSet(Member mbr, java.lang.String lang)Deprecated.since jcms-10.0.3.java.util.Set<TopbarApplicationItem>getGlobalApplicationSet(Member mbr, java.lang.String lang)Deprecated.since jcms-10.0.3.static TopbarManagergetInstance()java.util.Set<TopbarItem>getSortedTopbarItemSet(java.lang.String lang)java.util.Set<TopbarSearchItem>getTopbarSearchItemSet()java.util.List<TopbarApplicationItem>getUnorderedFavoriteApplicationList(Member mbr)Deprecated.since jcms-10.0.3.booleanisFirstLevelApp(Member mbr, AbstractShortcut shortcut)Deprecated.since jcms-10.0.3.voidpropertiesChange(JProperties properties)Invoked after properties have been modified in JCMS and save on disk.booleanwrapLogoWithH1()
-
-
-
Field Detail
-
TOPBAR_HANDLER_REQUEST_ATTR
public static final java.lang.String TOPBAR_HANDLER_REQUEST_ATTR
- See Also:
- Constant Field Values
-
TOPBAR_APPLICATION_MEMBERPREFS_KEY
public static final java.lang.String TOPBAR_APPLICATION_MEMBERPREFS_KEY
- See Also:
- Constant Field Values
-
TOPBAR_APPLICATION_PROP_PREFIX
public static final java.lang.String TOPBAR_APPLICATION_PROP_PREFIX
- See Also:
- Constant Field Values
-
TOPBAR_ITEM_PREFIX_PROP
public static final java.lang.String TOPBAR_ITEM_PREFIX_PROP
- See Also:
- Constant Field Values
-
ORDER_PROP_SUFFIX
public static final java.lang.String ORDER_PROP_SUFFIX
- See Also:
- Constant Field Values
-
WRAP_LOGO_WITH_H1
public static final java.lang.String WRAP_LOGO_WITH_H1
- See Also:
- Constant Field Values
-
ALWAYS_WRAP_LOGO_WITH_H1
public static final java.lang.String ALWAYS_WRAP_LOGO_WITH_H1
- See Also:
- Constant Field Values
-
TOPBAR_SEARCH_ITEM_PROP_PREFIX
public static final java.lang.String TOPBAR_SEARCH_ITEM_PROP_PREFIX
- See Also:
- Constant Field Values
-
ACL_CAN_USE_PUBLISH_MENU
public static final java.lang.String ACL_CAN_USE_PUBLISH_MENU
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static TopbarManager getInstance()
-
propertiesChange
public void propertiesChange(JProperties properties)
Description copied from interface:JPropertiesListenerInvoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
wrapLogoWithH1
public boolean wrapLogoWithH1()
- Returns:
- true if logo should be wrapped in some cases with an H1
- Since:
- 10.0.5
-
alwaysWrapLogoWithH1
public boolean alwaysWrapLogoWithH1()
- Returns:
- true if logo should be always be wrapped in some cases with an H1 (Depends on
alwaysWrapLogoWithH1() - Since:
- 10.0.5
-
getSortedTopbarItemSet
public java.util.Set<TopbarItem> getSortedTopbarItemSet(java.lang.String lang)
- Parameters:
lang- the language- Returns:
- the set of TopbarItem, ordered by index
-
getTopbarSearchItemSet
public java.util.Set<TopbarSearchItem> getTopbarSearchItemSet()
-
isFirstLevelApp
public boolean isFirstLevelApp(Member mbr, AbstractShortcut shortcut)
Deprecated.since jcms-10.0.3. UseApplicationManagerinstead- Parameters:
mbr- theMembershortcut- theAbstractShortcut- Returns:
- true if given shortcut is at first level for given
Member
-
getFavoriteApplicationSet
public java.util.Set<TopbarApplicationItem> getFavoriteApplicationSet(Member mbr, java.lang.String lang)
Deprecated.since jcms-10.0.3. UseApplicationManagerinstead- Parameters:
mbr- theMemberlang- the language- Returns:
- the set of TopbarApplicationItem the user can read, ordered by his preferences
-
getUnorderedFavoriteApplicationList
public java.util.List<TopbarApplicationItem> getUnorderedFavoriteApplicationList(Member mbr)
Deprecated.since jcms-10.0.3. UseApplicationManagerinstead- Parameters:
mbr- the member- Returns:
- the set of TopbarApplicationItem the user can read, ordered by his preferences
-
getGlobalApplicationSet
public java.util.Set<TopbarApplicationItem> getGlobalApplicationSet(Member mbr, java.lang.String lang)
Deprecated.since jcms-10.0.3. UseApplicationManagerinstead- Parameters:
mbr- theMemberlang- the language- Returns:
- the set of TopbarApplicationItem the user can read, ordered by his preferences
-
getApplicationsFromPreferences
protected java.util.List<TopbarApplicationItem> getApplicationsFromPreferences(Member mbr, java.util.Map<java.lang.String,TopbarApplicationItem> allAppMap, java.lang.String preferenceKey)
Deprecated.since jcms-10.0.3. UseApplicationManagerinstead- Parameters:
mbr- theMemberallAppMap- the map ofTopbarApplicationItemthe mbr can readpreferenceKey- the preference key available in the member preference property- Returns:
- a List of
TopbarApplicationItemfrom memberPreferences (DB or properties)
-
getApplicationsFromPreferencesMap
protected java.util.Map<java.lang.String,java.lang.String[]> getApplicationsFromPreferencesMap(java.lang.String preference) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOExceptionDeprecated.since jcms-10.0.3. UseApplicationManagerinstead- Throws:
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionjava.io.IOException
-
canUsePublishMenu
public boolean canUsePublishMenu(Member mbr)
Returns true if the given member can use the Publish menu.- Parameters:
mbr- the member- Returns:
- true if the given member can use the Publish menu.
- Since:
- jcms-10.0.3
-
-