Class CmsModelPageHelper

java.lang.Object
org.opencms.ade.sitemap.CmsModelPageHelper

public class CmsModelPageHelper extends Object
Helper class for model page operations in the sitemap editor.

  • Constructor Details

  • 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 resource
      modelPage - the model page to add
      disabled - 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 name
      description - the page description
      copyId - 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 page
      description - the description for the model page
      copyId - 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 resource
      structureId - the model page id
      disabled - true to disabe the entry
      Throws:
      CmsException - if something goes wrong
    • ensureModelFolder

      public CmsResource ensureModelFolder(CmsResource rootResource) throws CmsException
      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

      public void removeModelPage(CmsResource sitemapConfig, CmsUUID structureId) throws CmsException
      Removes a model page from the sitemap configuration.

      Parameters:
      sitemapConfig - the sitemap configuration resource
      structureId - the structure id of the model page to remove
      Throws:
      CmsException - if something goes wrong