Package com.jalios.jcms.jportal
Class JPortalManager
- java.lang.Object
-
- com.jalios.jcms.jportal.JPortalManager
-
- All Implemented Interfaces:
JPropertiesListener
public class JPortalManager extends java.lang.Object implements JPropertiesListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JPortalManager.JPortalComponentIndexComparator
static class
JPortalManager.JPortalComponentNameComparator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JPORTAL_MAPPING_EXTRA_INFO_KEY
static JPortalActionResult
OK_ACTION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
activateTypeInWorkspace(Workspace workspace, java.lang.String applicationClass, Member author)
Active the given application class type in the given workspaceboolean
canUpdateJPortalJavascriptAndCss(Member member)
ControllerStatus
duplicateJPortal(AbstractJPortal jportal, WizardContext context, boolean updateIds)
Duplicate aJPortal
JPortalMapping
duplicateJPortalMapping(JPortalMapping jPortalMapping, boolean updateids, WizardContext context)
Duplicate a JPortalMapping, iterate throughJBlockMapping
and duplicate themjava.util.List<Portlet>
getAllPortlets(AbstractJPortal jPortal, JPortalMapping mapping)
static JPortalManager
getInstance()
java.util.Set<JPortalComponent>
getJPortalComponentSet(java.lang.String userLang, java.lang.String search)
JPortalMapping
getJPortalMapping(AbstractJPortal jPortal, boolean isDraftStructure)
GetJPortalMapping
and save if as extra infoJPortalMapping
getJPortalMapping(JPortalStructure structure)
JPortalStructure
getJPortalStructure(AbstractJPortal jPortal, boolean isDraftStructure)
JPortalStructure
getJPortalStructure(java.lang.String structureId)
RetrieveJPortalStructure
java.util.List<JPortalStructure>
getJPortalStructures(AbstractJPortal jportal, int firstResult, int maxResults)
Retrieve a list ofJPortalStructure
for the givenAbstractJPortal
JPortalTemplate
getJPortalTemplate(java.lang.String templateName)
java.util.List<JPortalTemplate>
getJPortalTemplateList()
JPortalStructure
getLastPublishedJPortalStructureFromDatabase(AbstractJPortal jPortal)
java.util.Set<PortalInterface>
getPortletPortalSet(Portlet portlet, Member mbr, AbstractJPortal currentJPortal)
Returns the set of PortalInterface where the given Portlet is usedjava.util.Set<PortalElement>
getPortletSet(AbstractJPortal jportal, java.lang.Class selectedPortletType, java.lang.String search, java.lang.String userLang)
java.util.Map<java.lang.String,java.util.List<JPortalComponent>>
getPortletTypeMap()
boolean
isCompatibleType(Portlet portlet)
boolean
isCompatibleType(java.lang.Class portletClass)
Return true if given class is a JPortal compatible type, by searching in blacklistboolean
isHideEditFieldsEnabled()
JPortalActionResult
moveBlockOrAddPortletAndUpdateSizes(AbstractJPortal jportal, java.lang.String blocksAndSize, java.lang.String blockToMoveId, java.lang.String targetBlockId, JPortalConstants.BlockDropPositions dropPosition, java.lang.String newBlockId, Member author, java.lang.String portletId)
void
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.JPortalActionResult
publishJPortal(AbstractJPortal jportal, Member author)
Publish a jportal with the latest structureControllerStatus
publishJPortal(AbstractJPortal jPortal, java.lang.String jPortalName, Member mbr, java.util.Map<java.lang.String,java.lang.Object> context, int pstatus, Category[] categories, java.util.Date pdate, java.lang.String title, java.util.HashMap<java.lang.String,java.lang.String> titleML)
Publish the JPortalJPortalActionResult
removeBlockFromStructure(AbstractJPortal jportal, java.lang.String blockId, Member author)
Remove the given blockId from the current JPortal structure Save the tructure and publish the JPortalvoid
resetJPortalHistory(AbstractJPortal jPortal)
Reset the history of a given JPortal (remove all entries in database)JPortalMapping
revertJPortalStructure(AbstractJPortal jPortal, JPortalStructure structure, Member mbr)
ControllerStatus
saveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr)
Saves the givenJPortalMapping
for givenAbstractJPortal
ControllerStatus
saveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr, boolean published)
JPortalActionResult
saveJPortalStructure(AbstractJPortal jPortal, java.lang.String jPortalMappingJSon, Member mbr)
Saves the givenJPortalMapping
for givenAbstractJPortal
JPortalActionResult
updateJPortalBlocksAndSize(AbstractJPortal jportal, java.lang.String blocksAndSize, Member author)
Iterate through all blocks of the jportal Remove block not present in the blocksAndSize map Update all blocks size
-
-
-
Field Detail
-
JPORTAL_MAPPING_EXTRA_INFO_KEY
public static final java.lang.String JPORTAL_MAPPING_EXTRA_INFO_KEY
- See Also:
- Constant Field Values
-
OK_ACTION
public static final JPortalActionResult OK_ACTION
-
-
Method Detail
-
getInstance
public static JPortalManager 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
-
isHideEditFieldsEnabled
public boolean isHideEditFieldsEnabled()
-
canUpdateJPortalJavascriptAndCss
public boolean canUpdateJPortalJavascriptAndCss(Member member)
-
getPortletTypeMap
public java.util.Map<java.lang.String,java.util.List<JPortalComponent>> getPortletTypeMap()
-
getJPortalComponentSet
public java.util.Set<JPortalComponent> getJPortalComponentSet(java.lang.String userLang, java.lang.String search)
-
revertJPortalStructure
public JPortalMapping revertJPortalStructure(AbstractJPortal jPortal, JPortalStructure structure, Member mbr)
-
getJPortalMapping
public JPortalMapping getJPortalMapping(AbstractJPortal jPortal, boolean isDraftStructure)
GetJPortalMapping
and save if as extra info- Parameters:
jPortal
-isDraftStructure
-- Returns:
JPortalMapping
mapping
-
getJPortalMapping
public JPortalMapping getJPortalMapping(JPortalStructure structure)
-
saveJPortalStructure
public ControllerStatus saveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr)
Saves the givenJPortalMapping
for givenAbstractJPortal
- Parameters:
jPortal
- theAbstractJPortal
jPortalMapping
- theJPortalMapping
mbr
- theMember
- Returns:
ControllerStatus
-
saveJPortalStructure
public ControllerStatus saveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr, boolean published)
-
saveJPortalStructure
public JPortalActionResult saveJPortalStructure(AbstractJPortal jPortal, java.lang.String jPortalMappingJSon, Member mbr)
Saves the givenJPortalMapping
for givenAbstractJPortal
- Parameters:
jPortal
- theAbstractJPortal
jPortalMappingJSon
- JSon structure of Portalmbr
- theMember
- Returns:
JPortalActionResult
-
getJPortalStructures
public java.util.List<JPortalStructure> getJPortalStructures(AbstractJPortal jportal, int firstResult, int maxResults)
Retrieve a list ofJPortalStructure
for the givenAbstractJPortal
- Parameters:
jportal
-firstResult
-maxResults
-- Returns:
- List of
JPortalStructure
with the given parameters
-
getLastPublishedJPortalStructureFromDatabase
public JPortalStructure getLastPublishedJPortalStructureFromDatabase(AbstractJPortal jPortal)
- Parameters:
jPortal
-- Returns:
-
getJPortalStructure
public JPortalStructure getJPortalStructure(AbstractJPortal jPortal, boolean isDraftStructure)
- Parameters:
jPortal
- theAbstractJPortal
isDraftStructure
- if true, will search for not published structure- Returns:
- the
JPortalStructure
for givenAbstractJPortal
-
getJPortalStructure
public JPortalStructure getJPortalStructure(java.lang.String structureId)
RetrieveJPortalStructure
- Parameters:
structureId
-- Returns:
JPortalStructure
with the given ID
-
publishJPortal
public ControllerStatus publishJPortal(AbstractJPortal jPortal, java.lang.String jPortalName, Member mbr, java.util.Map<java.lang.String,java.lang.Object> context, int pstatus, Category[] categories, java.util.Date pdate, java.lang.String title, java.util.HashMap<java.lang.String,java.lang.String> titleML)
Publish the JPortal- Parameters:
jPortal
- theAbstractJPortal
jPortalName
- the JPortal namembr
- theMember
performing the actioncontext
- for update contextpstatus
- the workflow statuscategories
- theCategory
array of this JPortalpdate
- the date of publication- Returns:
- a
ControllerStatus
based on result of the performed action
-
resetJPortalHistory
public void resetJPortalHistory(AbstractJPortal jPortal)
Reset the history of a given JPortal (remove all entries in database)- Parameters:
jPortal
-
-
getAllPortlets
public java.util.List<Portlet> getAllPortlets(AbstractJPortal jPortal, JPortalMapping mapping)
-
isCompatibleType
public boolean isCompatibleType(Portlet portlet)
-
isCompatibleType
public boolean isCompatibleType(java.lang.Class portletClass)
Return true if given class is a JPortal compatible type, by searching in blacklist- Parameters:
portletClass
- the Portlet class- Returns:
- true if given class is a JPortal compatible type
- Since:
- jcms-10.0.7
-
getPortletSet
public java.util.Set<PortalElement> getPortletSet(AbstractJPortal jportal, java.lang.Class selectedPortletType, java.lang.String search, java.lang.String userLang)
-
duplicateJPortal
public ControllerStatus duplicateJPortal(AbstractJPortal jportal, WizardContext context, boolean updateIds)
Duplicate aJPortal
- Parameters:
jportal
- theJPortal
to duplicatecontext
- Wizardcontext from the duplicate() method onAbstractJPortal
updateIds
- if true, will only update the portlet ids from the jportalMapping and update store structure, if false, will duplicate the portlet- Returns:
ControllerStatus
-
duplicateJPortalMapping
public JPortalMapping duplicateJPortalMapping(JPortalMapping jPortalMapping, boolean updateids, WizardContext context)
Duplicate a JPortalMapping, iterate throughJBlockMapping
and duplicate them- Parameters:
jPortalMapping
-JPortalMapping
to be duplicatedupdateids
- if true, will only update the portlet ids from the jportalMapping, if false, will duplicate the portletcontext
-WizardContext
- Returns:
- a new
JPortalMapping
-
getJPortalTemplateList
public java.util.List<JPortalTemplate> getJPortalTemplateList()
-
getJPortalTemplate
public JPortalTemplate getJPortalTemplate(java.lang.String templateName)
-
getPortletPortalSet
public java.util.Set<PortalInterface> getPortletPortalSet(Portlet portlet, Member mbr, AbstractJPortal currentJPortal)
Returns the set of PortalInterface where the given Portlet is used- Parameters:
portlet
- thePortlet
mbr
- theMember
to check read rights- Returns:
- a Set of
PortalInterface
-
moveBlockOrAddPortletAndUpdateSizes
public JPortalActionResult moveBlockOrAddPortletAndUpdateSizes(AbstractJPortal jportal, java.lang.String blocksAndSize, java.lang.String blockToMoveId, java.lang.String targetBlockId, JPortalConstants.BlockDropPositions dropPosition, java.lang.String newBlockId, Member author, java.lang.String portletId)
-
updateJPortalBlocksAndSize
public JPortalActionResult updateJPortalBlocksAndSize(AbstractJPortal jportal, java.lang.String blocksAndSize, Member author)
Iterate through all blocks of the jportal Remove block not present in the blocksAndSize map Update all blocks size- Parameters:
jportal
-blocksAndSize
-author
-- Returns:
JPortalActionResult
-
removeBlockFromStructure
public JPortalActionResult removeBlockFromStructure(AbstractJPortal jportal, java.lang.String blockId, Member author)
Remove the given blockId from the current JPortal structure Save the tructure and publish the JPortal- Parameters:
jportal
-blockId
-author
-- Returns:
- a
JPortalActionResult
-
publishJPortal
public JPortalActionResult publishJPortal(AbstractJPortal jportal, Member author)
Publish a jportal with the latest structure- Parameters:
jportal
-author
-- Returns:
JPortalActionResult
-
activateTypeInWorkspace
public boolean activateTypeInWorkspace(Workspace workspace, java.lang.String applicationClass, Member author)
Active the given application class type in the given workspace- Parameters:
workspace
-AccessControlList.WorkspaceAclSelector
applicationClass
- classNameauthor
-Member
- Returns:
- true if the type is activate
-
-