Package com.jalios.jcms.jportal
Class JPortalUtils
java.lang.Object
com.jalios.jcms.jportal.JPortalUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidIterates over a list ofJPortalMappingblocks and ensures that at least one block is selection.static voidassignRandomIdsIfMissing(List<JBlockMapping> jBlocks) static StringassignRandomIdsToStructure(String structure) static voidcomputeBlockSizes(List<JBlockMapping> blocks) Recalculates the size of a list of blocks and its child blocksstatic booleandisplayBlock(JBlockMapping jBlock, boolean isPublicationDisplayed, Member loggedMember) static booleanCheck if the headers/footers of a selected Publication should be displayed in a selection blockstatic StringGenerate a random block IDstatic JBlockMappinggetJBlockByPortletId(AbstractJPortal jportal, String portletId) static JBlockMappinggetJBlockByPortletId(List<JBlockMapping> jblocks, String portletId) static StringgetJBlockCssClass(JBlockMapping jBlock) static StringgetJBlockCustomClass(JBlockMapping jblock) Compute jblock custom classstatic DataAttributegetJBlockDataAttributes(JBlockMapping jblock) Compute jblock data attributesstatic Stringstatic StringgetJPortalCss(AbstractJPortal jPortal, boolean isDraftStructure) static StringgetJPortalEditionUrl(AbstractJPortal jPortal) static StringgetJPortalEditionUrl(AbstractJPortal jPortal, PortletCollection collaborativeSpace) static StringgetJPortalJS(AbstractJPortal jPortal, boolean isDraftStructure) static StringgetJPortalMappingCss(JPortalMapping jPortalMapping) static StringgetJPortalMappingJs(JPortalMapping jPortalMapping) static StringgetJPortalStructureCss(JPortalStructure structure) static StringgetJPortalStructureJS(JPortalStructure structure) static StringgetPortletTitle(JPortletMapping portletMapping, String lang) Get the title of a portlet in the user langstatic StringgetPrettyPrintJPortalStructure(JPortalStructure structure) static StringgetSkinUsage(AbstractJPortal jPortal) Returns the matching skin usage depending on JPortal usage (Portal vs CollaborativeSpace)static booleanhasPortlet(JBlockMapping jblock) static booleanhasSelectionInBlocks(List<JBlockMapping> blocks) static booleanisBlockSelection(JBlockMapping jBlock) Is the block a selection blockstatic booleanCheck if a jportal belongs to a CollaborativeSpacestatic booleanCheck if a jportal is a CollaborativeSpace pagePortal (not the dashboard portal)static booleanisEmpty(JBlockMapping jBlock) Returns true if givenJBlockMappingis empty, and if all of its children are emptystatic Stringstatic StringjPortalMappingToJson(JPortalMapping jPortal) static JPortalMappingjsonToJPortalMapping(String json) static ControllerStatusupdateJPortletUIMapping(AbstractJPortal jportal, PortalElement portalElement, Map<String, String> cssMap, Member member)
-
Field Details
-
JPORTAL_EDITOR_URL
- See Also:
-
GRID_SIZE
public static final int GRID_SIZE- See Also:
-
-
Method Details
-
jPortalMappingToJson
- Parameters:
jPortal- theJPortalMapping- Returns:
- a json String from the given JPortalMapping
-
jsonToJPortalMapping
- Parameters:
json- the json String representing the JPortalMapping- Returns:
- a
JPortalMappingfrom the given json String
-
jPortalActionToJSon
- Parameters:
action- theJPortalActionResult- Returns:
- the
JPortalActionResultas json
-
getJBlockCustomClass
Compute jblock custom class- Parameters:
jblock- theJBlockMapping- Returns:
- all custom class of the jblock
-
getJBlockCssClass
-
getJBlockDataAttributes
Compute jblock data attributes- Parameters:
jblock- theJBlockMapping- Returns:
- all custom data of the jblock
-
isEmpty
Returns true if givenJBlockMappingis empty, and if all of its children are empty- Parameters:
jBlock- theJBlockMappingtheJBlockMapping- Returns:
- true if given
JBlockMappingis empty
-
updateJPortletUIMapping
public static ControllerStatus updateJPortletUIMapping(AbstractJPortal jportal, PortalElement portalElement, Map<String, String> cssMap, Member member) -
getJBlockByPortletId
-
getJBlockByPortletId
-
getJBlockDisplayConditionCssClass
-
hasPortlet
-
getJPortalCss
-
getJPortalJS
-
getJPortalMappingJs
-
getJPortalStructureCss
-
getJPortalStructureJS
-
getJPortalMappingCss
-
displayBlock
public static boolean displayBlock(JBlockMapping jBlock, boolean isPublicationDisplayed, Member loggedMember) -
isBlockSelection
Is the block a selection block- Parameters:
jBlock- theJBlockMapping- Returns:
- true if the selection option on the block is checked (old portlet selection from
Portal)
-
displayPublicationHeadersInSelectionBlock
Check if the headers/footers of a selected Publication should be displayed in a selection block- Parameters:
jBlock-JBlockMapping- Returns:
Boolean
-
getJPortalEditionUrl
- Parameters:
jPortal- theAbstractJPortal- Returns:
- the jportal edition url
-
getJPortalEditionUrl
public static String getJPortalEditionUrl(AbstractJPortal jPortal, PortletCollection collaborativeSpace) - Parameters:
jPortal- theAbstractJPortalcollaborativeSpace- thePortletCollection- Returns:
- the jportal edition url
- Since:
- jcms-10.0.7
-
getPrettyPrintJPortalStructure
- Parameters:
structure- theJPortalStructure- Returns:
- the JPortalStructure json pretty printed
-
isCollaborativeSpaceJPortal
Check if a jportal belongs to a CollaborativeSpace- Parameters:
jPortal- theAbstractJPortal- Returns:
- true if the jportal belongs to a collaborative space
- Since:
- jcms-10.0.7
-
isCollaborativeSpacePagePortal
Check if a jportal is a CollaborativeSpace pagePortal (not the dashboard portal)- Parameters:
jPortal- theAbstractJPortal- Returns:
- true if the jportal belongs to a collaborative space and is not the dashboard portal
- Since:
- jcms-10.0.9 / JCMS-11419
-
getSkinUsage
Returns the matching skin usage depending on JPortal usage (Portal vs CollaborativeSpace)- Parameters:
jPortal- theAbstractJPortalp- Returns:
- the matching skin usage depending on JPortal usage (Portal vs CollaborativeSpace)
- Since:
- jcms-10.0.7
-
computeBlockSizes
Recalculates the size of a list of blocks and its child blocks- Parameters:
blocks- a list ofJBlockMapping
-
getPortletTitle
Get the title of a portlet in the user lang- Parameters:
portletMapping- theJPortletMappinglang- the user lang- Returns:
- the title
-
generateRandomBlockID
Generate a random block ID- Returns:
- random block id
-
assignRandomIdsToStructure
-
assignRandomIdsIfMissing
-
addFirstBlockAsSelectionIfNone
Iterates over a list ofJPortalMappingblocks and ensures that at least one block is selection. If no block is currently selection, the first block will be added as selection.- Parameters:
mapping-JPortalMapping
-
hasSelectionInBlocks
-