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 classJPortalManager.JPortalComponentIndexComparatorstatic classJPortalManager.JPortalComponentNameComparator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJPORTAL_MAPPING_EXTRA_INFO_KEYstatic JPortalActionResultOK_ACTION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactivateTypeInWorkspace(Workspace workspace, java.lang.String applicationClass, Member author)Active the given application class type in the given workspacebooleancanUpdateJPortalJavascriptAndCss(Member member)ControllerStatusduplicateJPortal(AbstractJPortal jportal, WizardContext context, boolean updateIds)Duplicate aJPortalJPortalMappingduplicateJPortalMapping(JPortalMapping jPortalMapping, boolean updateids, WizardContext context)Duplicate a JPortalMapping, iterate throughJBlockMappingand duplicate themjava.util.List<Portlet>getAllPortlets(AbstractJPortal jPortal, JPortalMapping mapping)static JPortalManagergetInstance()java.util.Set<JPortalComponent>getJPortalComponentSet(java.lang.String userLang, java.lang.String search)JPortalMappinggetJPortalMapping(AbstractJPortal jPortal, boolean isDraftStructure)GetJPortalMappingand save if as extra infoJPortalMappinggetJPortalMapping(JPortalStructure structure)JPortalStructuregetJPortalStructure(AbstractJPortal jPortal, boolean isDraftStructure)JPortalStructuregetJPortalStructure(java.lang.String structureId)RetrieveJPortalStructurejava.util.List<JPortalStructure>getJPortalStructures(AbstractJPortal jportal, int firstResult, int maxResults)Retrieve a list ofJPortalStructurefor the givenAbstractJPortalJPortalTemplategetJPortalTemplate(java.lang.String templateName)java.util.List<JPortalTemplate>getJPortalTemplateList()JPortalStructuregetLastPublishedJPortalStructureFromDatabase(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()booleanisCompatibleType(Portlet portlet)booleanisCompatibleType(java.lang.Class portletClass)Return true if given class is a JPortal compatible type, by searching in blacklistbooleanisHideEditFieldsEnabled()JPortalActionResultmoveBlockOrAddPortletAndUpdateSizes(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)voidpropertiesChange(JProperties properties)Invoked after properties have been modified in JCMS and save on disk.JPortalActionResultpublishJPortal(AbstractJPortal jportal, Member author)Publish a jportal with the latest structureControllerStatuspublishJPortal(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 JPortalJPortalActionResultremoveBlockFromStructure(AbstractJPortal jportal, java.lang.String blockId, Member author)Remove the given blockId from the current JPortal structure Save the tructure and publish the JPortalvoidresetJPortalHistory(AbstractJPortal jPortal)Reset the history of a given JPortal (remove all entries in database)JPortalMappingrevertJPortalStructure(AbstractJPortal jPortal, JPortalStructure structure, Member mbr)ControllerStatussaveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr)Saves the givenJPortalMappingfor givenAbstractJPortalControllerStatussaveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr, boolean published)JPortalActionResultsaveJPortalStructure(AbstractJPortal jPortal, java.lang.String jPortalMappingJSon, Member mbr)Saves the givenJPortalMappingfor givenAbstractJPortalJPortalActionResultupdateJPortalBlocksAndSize(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: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
-
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)
GetJPortalMappingand save if as extra info- Parameters:
jPortal-isDraftStructure-- Returns:
JPortalMappingmapping
-
getJPortalMapping
public JPortalMapping getJPortalMapping(JPortalStructure structure)
-
saveJPortalStructure
public ControllerStatus saveJPortalStructure(AbstractJPortal jPortal, JPortalMapping jPortalMapping, Member mbr)
Saves the givenJPortalMappingfor givenAbstractJPortal- Parameters:
jPortal- theAbstractJPortaljPortalMapping- theJPortalMappingmbr- 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 givenJPortalMappingfor givenAbstractJPortal- Parameters:
jPortal- theAbstractJPortaljPortalMappingJSon- JSon structure of Portalmbr- theMember- Returns:
JPortalActionResult
-
getJPortalStructures
public java.util.List<JPortalStructure> getJPortalStructures(AbstractJPortal jportal, int firstResult, int maxResults)
Retrieve a list ofJPortalStructurefor the givenAbstractJPortal- Parameters:
jportal-firstResult-maxResults-- Returns:
- List of
JPortalStructurewith the given parameters
-
getLastPublishedJPortalStructureFromDatabase
public JPortalStructure getLastPublishedJPortalStructureFromDatabase(AbstractJPortal jPortal)
- Parameters:
jPortal-- Returns:
-
getJPortalStructure
public JPortalStructure getJPortalStructure(AbstractJPortal jPortal, boolean isDraftStructure)
- Parameters:
jPortal- theAbstractJPortalisDraftStructure- if true, will search for not published structure- Returns:
- the
JPortalStructurefor givenAbstractJPortal
-
getJPortalStructure
public JPortalStructure getJPortalStructure(java.lang.String structureId)
RetrieveJPortalStructure- Parameters:
structureId-- Returns:
JPortalStructurewith 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- theAbstractJPortaljPortalName- the JPortal namembr- theMemberperforming the actioncontext- for update contextpstatus- the workflow statuscategories- theCategoryarray of this JPortalpdate- the date of publication- Returns:
- a
ControllerStatusbased 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- theJPortalto duplicatecontext- Wizardcontext from the duplicate() method onAbstractJPortalupdateIds- 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 throughJBlockMappingand duplicate them- Parameters:
jPortalMapping-JPortalMappingto 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- thePortletmbr- theMemberto 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.WorkspaceAclSelectorapplicationClass- classNameauthor-Member- Returns:
- true if the type is activate
-
-