Package org.opencms.ade.sitemap
Class CmsModelPageHelper
java.lang.Object
org.opencms.ade.sitemap.CmsModelPageHelper
Helper class for model page operations in the sitemap editor.
-
Constructor Summary
ConstructorDescriptionCmsModelPageHelper
(CmsObject cms, CmsResource rootResource) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addModelPageToSitemapConfiguration
(CmsResource sitemapConfig, CmsResource modelPage, boolean disabled) Adds a model page to the sitemap config.createModelGroupPage
(String name, String description, CmsUUID copyId) Creates a new model group page.createPageInModelFolder
(String name, String description, CmsUUID copyId) Creates a new potential model page in the default folder for new model pages.void
disableModelPage
(CmsResource sitemapConfig, CmsUUID structureId, boolean disabled) Disables the given model page.ensureModelFolder
(CmsResource rootResource) Tries to either read or create the default folder for model pages in the current sitemap, and returns it.Returns the local model group pages.Returns the model infos.Reads the model pages from the ADE configuration.Returns the parent model pages.void
removeModelPage
(CmsResource sitemapConfig, CmsUUID structureId) Removes a model page from the sitemap configuration.
-
Constructor Details
-
CmsModelPageHelper
Creates a new instance.- Parameters:
cms
- the CMS context to userootResource
- the root resource for the sitemap- Throws:
CmsException
- if something goes wrong
-
-
Method Details
-
addModelPageToSitemapConfiguration
public void addModelPageToSitemapConfiguration(CmsResource sitemapConfig, CmsResource modelPage, boolean disabled) throws CmsException Adds a model page to the sitemap config.- Parameters:
sitemapConfig
- the sitemap configuration resourcemodelPage
- the model page to adddisabled
- true if the model page should be added as 'disabled'- Throws:
CmsException
- if something goes wrong
-
createModelGroupPage
public CmsResource createModelGroupPage(String name, String description, CmsUUID copyId) throws CmsException Creates a new model group page.- Parameters:
name
- the page namedescription
- the page descriptioncopyId
- structure id of the resource to use as a model for the model page, if any (may be null)- Returns:
- the new resource
- Throws:
CmsException
- in case something goes wrong
-
createPageInModelFolder
public CmsResource createPageInModelFolder(String name, String description, CmsUUID copyId) throws CmsException Creates a new potential model page in the default folder for new model pages.- Parameters:
name
- the title for the model pagedescription
- the description for the model pagecopyId
- structure id of the resource to use as a model for the model page, if any (may be null)- Returns:
- the created resource
- Throws:
CmsException
- if something goes wrong
-
disableModelPage
public void disableModelPage(CmsResource sitemapConfig, CmsUUID structureId, boolean disabled) throws CmsException Disables the given model page.- Parameters:
sitemapConfig
- the configuration resourcestructureId
- the model page iddisabled
-true
to disabe the entry- Throws:
CmsException
- if something goes wrong
-
ensureModelFolder
Tries to either read or create the default folder for model pages in the current sitemap, and returns it.- Parameters:
rootResource
- the root of the sitemap- Returns:
- the folder resource
- Throws:
CmsException
- if something goes wrong
-
getModelGroups
Returns the local model group pages.- Returns:
- the model group pages
-
getModelInfo
Returns the model infos.- Returns:
- the model infos
-
getModelPages
Reads the model pages from the ADE configuration.- Returns:
- the list of model pages
-
getParentModelPages
Returns the parent model pages.- Returns:
- the parent model pages
-
removeModelPage
Removes a model page from the sitemap configuration.- Parameters:
sitemapConfig
- the sitemap configuration resourcestructureId
- the structure id of the model page to remove- Throws:
CmsException
- if something goes wrong
-