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 class
TopbarManager.ApplicationSelector
Deprecated.since jcms-10.0.3.class
TopbarManager.TopbarApplicationItemComparator
Compares 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 labelclass
TopbarManager.TopbarItemIndexComparator
Compares TopbarItem based on their indexclass
TopbarManager.TopbarItemNameComparator
Compares TopbarItem based on their label and the userlangclass
TopbarManager.TopbarSearchItemIndexComparator
Compares TopbarItem based on their index
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACL_CAN_USE_PUBLISH_MENU
static java.lang.String
ALWAYS_WRAP_LOGO_WITH_H1
static java.lang.String
ORDER_PROP_SUFFIX
static java.lang.String
REVISION
static java.lang.String
TOPBAR_APPLICATION_MEMBERPREFS_KEY
static java.lang.String
TOPBAR_APPLICATION_PROP_PREFIX
static java.lang.String
TOPBAR_HANDLER_REQUEST_ATTR
static java.lang.String
TOPBAR_ITEM_PREFIX_PROP
static java.lang.String
TOPBAR_SEARCH_ITEM_PROP_PREFIX
static java.lang.String
WRAP_LOGO_WITH_H1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
alwaysWrapLogoWithH1()
boolean
canUsePublishMenu(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 TopbarManager
getInstance()
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.boolean
isFirstLevelApp(Member mbr, AbstractShortcut shortcut)
Deprecated.since jcms-10.0.3.void
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.boolean
wrapLogoWithH1()
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
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:JPropertiesListener
Invoked 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.getProperties
orchannel.getProperty
.- Specified by:
propertiesChange
in 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. UseApplicationManager
instead- Parameters:
mbr
- theMember
shortcut
- 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. UseApplicationManager
instead- Parameters:
mbr
- theMember
lang
- 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. UseApplicationManager
instead- 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. UseApplicationManager
instead- Parameters:
mbr
- theMember
lang
- 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. UseApplicationManager
instead- Parameters:
mbr
- theMember
allAppMap
- the map ofTopbarApplicationItem
the mbr can readpreferenceKey
- the preference key available in the member preference property- Returns:
- a List of
TopbarApplicationItem
from 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.IOException
Deprecated.since jcms-10.0.3. UseApplicationManager
instead- Throws:
com.fasterxml.jackson.core.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
java.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
-
-