public class CmsModelGroupHelper extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MODEL_GROUP_BASE_CONTAINER
The name of the container storing the groups base element.
|
Constructor and Description |
---|
CmsModelGroupHelper(CmsObject cms,
CmsADEConfigData configData,
CmsADESessionCache sessionCache,
boolean isEditingModelGroups)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static CmsResource |
createModelGroup(CmsObject cms,
CmsADEConfigData configData)
Creates a new model group resource.
|
static boolean |
isModelGroupResource(CmsResource resource)
Returns if the given resource is a model group resource.
|
CmsContainerPageBean |
prepareforModelGroupContent(java.util.Map<java.lang.String,CmsContainerElementBean> elements,
java.util.List<java.lang.String> foundGroups,
CmsContainerPageBean page,
boolean alwaysCopy,
java.util.Locale locale)
Adds the model group elements to the page.
|
CmsContainerPageBean |
readModelGroups(CmsContainerPageBean page)
Reads the present model groups and merges their containers into the page.
|
CmsContainerPageBean |
removeModelGroupContainers(CmsContainerPageBean page)
Removes the model group containers.
|
CmsContainerPageBean |
saveModelGroups(CmsContainerPageBean page,
CmsResource pageResource)
Saves the model groups of the given container page.
|
static boolean |
updateModelGroupResource(CmsObject cms,
CmsResource group,
java.lang.String baseContainerName)
Updates a model group resource to the changed data structure.
|
static void |
updateModelGroupResources(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String basePath,
java.lang.String baseContainerName)
Updates model group resources to the changed data structure.
|
public static final java.lang.String MODEL_GROUP_BASE_CONTAINER
public CmsModelGroupHelper(CmsObject cms, CmsADEConfigData configData, CmsADESessionCache sessionCache, boolean isEditingModelGroups)
cms
- the current cms contextconfigData
- the configuration datasessionCache
- the session cacheisEditingModelGroups
- the edit model groups flagpublic static CmsResource createModelGroup(CmsObject cms, CmsADEConfigData configData) throws CmsException
cms
- the current cms contextconfigData
- the configuration dataCmsException
- in case creating the resource failspublic static boolean isModelGroupResource(CmsResource resource)
resource
- the resourcetrue
if the given resource is a model group resourcepublic static boolean updateModelGroupResource(CmsObject cms, CmsResource group, java.lang.String baseContainerName)
This step is necessary when updating from version 10.0.x to 10.5.x.
cms
- the cms contextgroup
- the model group resourcebaseContainerName
- the new base container nametrue
if the resource was updatedpublic static void updateModelGroupResources(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String basePath, java.lang.String baseContainerName) throws java.io.IOException
This step is necessary when updating from version 10.0.x to 10.5.x.
request
- the requestresponse
- the responsebasePath
- the path to the model group, or the base path to search for model groupsbaseContainerName
- the new base container namejava.io.IOException
- in case writing to the response failspublic CmsContainerPageBean prepareforModelGroupContent(java.util.Map<java.lang.String,CmsContainerElementBean> elements, java.util.List<java.lang.String> foundGroups, CmsContainerPageBean page, boolean alwaysCopy, java.util.Locale locale) throws CmsException
elements
- the requested elementsfoundGroups
- list to add the found group element client ids topage
- the pagealwaysCopy
- true
to create element copies in case of non model groups and createNew is setlocale
- the content localeCmsException
- in case something goes wrongpublic CmsContainerPageBean readModelGroups(CmsContainerPageBean page)
page
- the container pagepublic CmsContainerPageBean removeModelGroupContainers(CmsContainerPageBean page)
page
- the container page statepublic CmsContainerPageBean saveModelGroups(CmsContainerPageBean page, CmsResource pageResource) throws CmsException
page
- the container pagepageResource
- the model group resourceCmsException
- in case writing the page properties fails