org.opencms.ade.containerpage
Class CmsContainerpageService

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.opencms.gwt.CmsGwtService
                      extended by org.opencms.ade.containerpage.CmsContainerpageService
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, I_CmsContainerpageService

public class CmsContainerpageService
extends CmsGwtService
implements I_CmsContainerpageService

The RPC service used by the container-page editor.

Since:
8.0.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
CmsContainerpageService()
           
 
Method Summary
 void addToFavoriteList(java.lang.String clientId)
          Adds an element specified by it's id to the favorite list.
 void addToRecentList(java.lang.String clientId)
          Adds an element specified by it's id to the recent list.
 CmsCreateElementData checkCreateNewElement(CmsUUID pageStructureId, java.lang.String clientId, java.lang.String resourceType, java.lang.String locale)
          To create a new element of the given type this method will check if a model resource needs to be selected, otherwise creates the new element.
 boolean checkNewWidgetsAvailable(CmsUUID structureId)
          Checks whether the Acacia widgets are available for all fields of the content.
 CmsUUID convertToServerId(java.lang.String id)
          Parses an element id.
 CmsContainerElement createNewElement(CmsUUID pageStructureId, java.lang.String clientId, java.lang.String resourceType, CmsUUID modelResourceStructureId, java.lang.String locale)
          Creates a new element of the given type and returns the new element data containing structure id and site path.
static java.util.List<CmsModelResourceInfo> generateModelResourceList(CmsObject cms, java.lang.String resourceType, java.util.List<CmsResource> modelResources, java.util.Locale contentLocale)
          Generates the model resource data list.
 CmsContainerElement getElementInfo()
          This method is used for serialization purposes only.
 java.util.Map<java.lang.String,CmsContainerElementData> getElementsData(CmsUUID pageStructureId, java.lang.String reqParams, java.util.Collection<java.lang.String> clientIds, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Returns container element data by client id.
 CmsContainerElementData getElementWithSettings(CmsUUID pageStructureId, java.lang.String uriParams, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.String> settings, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Gets the element data for an id and a map of settings.
 java.util.List<CmsContainerElementData> getFavoriteList(CmsUUID pageStructureId, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Returns the container element data of the favorite list.
 CmsContainerElementData getNewElementData(CmsUUID pageStructureId, java.lang.String reqParams, java.lang.String resourceType, java.util.Collection<CmsContainer> containers, java.lang.String localeName)
          Returns new container element data for the given resource type name.
 java.util.List<CmsContainerElementData> getRecentList(CmsUUID pageStructureId, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Returns the container element data of the recent list.
 CmsRemovedElementStatus getRemovedElementStatus(java.lang.String id)
          Gets the status of a removed element.
static java.lang.String getSerializedElementInfo(CmsObject cms, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, CmsContainerElementBean elementBean)
          Returns the serialized element data.
 CmsRemovedElementStatus internalGetRemovedElementStatus(CmsUUID structureId)
          Internal helper method to get the status of a removed element.
 CmsCntPageData prefetch()
          Returns the initialization data.
static CmsCntPageData prefetch(javax.servlet.http.HttpServletRequest request)
          Fetches the container page data.
 void saveContainerpage(CmsUUID pageStructureId, java.util.List<CmsContainer> containers, java.lang.String locale)
          Saves the container-page.
 void saveFavoriteList(java.util.List<java.lang.String> clientIds)
          Saves the favorite list.
 CmsGroupContainerSaveResult saveGroupContainer(CmsUUID pageStructureId, java.lang.String reqParams, CmsGroupContainer groupContainer, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Saves a group-container element.
 java.util.Map<java.lang.String,CmsContainerElementData> saveInheritanceContainer(CmsUUID pageStructureId, CmsInheritanceContainer inheritanceContainer, java.util.Collection<CmsContainer> containers, java.lang.String locale)
          Saves an inheritance container.
 void saveRecentList(java.util.List<java.lang.String> clientIds)
          Saves the recent list.
 void syncSaveContainerpage(CmsUUID pageStructureId, java.util.List<CmsContainer> containers, java.lang.String locale)
          Saves the container-page in a synchronized RPC call.
 
Methods inherited from class org.opencms.gwt.CmsGwtService
checkPermissions, clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, log, log, logError, service, setCms, setContext, setRequest, setResponse, tryUnlock
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsContainerpageService

public CmsContainerpageService()
Method Detail

generateModelResourceList

public static java.util.List<CmsModelResourceInfo> generateModelResourceList(CmsObject cms,
                                                                             java.lang.String resourceType,
                                                                             java.util.List<CmsResource> modelResources,
                                                                             java.util.Locale contentLocale)
                                                                      throws CmsException
Generates the model resource data list.

Parameters:
cms - the cms context
resourceType - the resource type name
modelResources - the model resource
contentLocale - the content locale
Returns:
the model resources data
Throws:
CmsException - if something goes wrong reading the resource information

getSerializedElementInfo

public static java.lang.String getSerializedElementInfo(CmsObject cms,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response,
                                                        CmsContainerElementBean elementBean)
                                                 throws java.lang.Exception
Returns the serialized element data.

Parameters:
cms -
request -
response -
elementBean - the element to serialize
Returns:
the serialized element data
Throws:
java.lang.Exception - if something goes wrong

prefetch

public static CmsCntPageData prefetch(javax.servlet.http.HttpServletRequest request)
                               throws CmsRpcException
Fetches the container page data.

Parameters:
request - the current request
Returns:
the container page data
Throws:
CmsRpcException - if something goes wrong

addToFavoriteList

public void addToFavoriteList(java.lang.String clientId)
                       throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Adds an element specified by it's id to the favorite list.

Specified by:
addToFavoriteList in interface I_CmsContainerpageService
Parameters:
clientId - the element id
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.addToFavoriteList(java.lang.String)

addToRecentList

public void addToRecentList(java.lang.String clientId)
                     throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Adds an element specified by it's id to the recent list.

Specified by:
addToRecentList in interface I_CmsContainerpageService
Parameters:
clientId - the element id
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.addToRecentList(java.lang.String)

checkCreateNewElement

public CmsCreateElementData checkCreateNewElement(CmsUUID pageStructureId,
                                                  java.lang.String clientId,
                                                  java.lang.String resourceType,
                                                  java.lang.String locale)
                                           throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
To create a new element of the given type this method will check if a model resource needs to be selected, otherwise creates the new element. Returns a bean containing either the new element data or a list of model resources to select.

Specified by:
checkCreateNewElement in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
clientId - the client id of the new element (this will be the structure id of the configured new resource)
resourceType - the resource tape of the new element
locale - the content locale
Returns:
the bean containing either the new element data or a list of model resources to select
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.checkCreateNewElement(org.opencms.util.CmsUUID, java.lang.String, java.lang.String, java.lang.String)

checkNewWidgetsAvailable

public boolean checkNewWidgetsAvailable(CmsUUID structureId)
                                 throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Checks whether the Acacia widgets are available for all fields of the content.

Specified by:
checkNewWidgetsAvailable in interface I_CmsContainerpageService
Parameters:
structureId - the structure id of the content
Returns:
true if Acacia widgets are available for all fields
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsContainerpageService.checkNewWidgetsAvailable(org.opencms.util.CmsUUID)

convertToServerId

public CmsUUID convertToServerId(java.lang.String id)
                          throws CmsIllegalArgumentException
Parses an element id.

Parameters:
id - the element id
Returns:
the corresponding structure id
Throws:
CmsIllegalArgumentException - if the id has not the right format

createNewElement

public CmsContainerElement createNewElement(CmsUUID pageStructureId,
                                            java.lang.String clientId,
                                            java.lang.String resourceType,
                                            CmsUUID modelResourceStructureId,
                                            java.lang.String locale)
                                     throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Creates a new element of the given type and returns the new element data containing structure id and site path.

Specified by:
createNewElement in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
clientId - the client id of the new element (this will be the structure id of the configured new resource)
resourceType - the resource tape of the new element
modelResourceStructureId - the model resource structure id
locale - the content locale
Returns:
the new element data containing structure id and site path
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.createNewElement(org.opencms.util.CmsUUID, java.lang.String, java.lang.String, org.opencms.util.CmsUUID, java.lang.String)

getElementInfo

public CmsContainerElement getElementInfo()
Description copied from interface: I_CmsContainerpageService
This method is used for serialization purposes only.

Specified by:
getElementInfo in interface I_CmsContainerpageService
Returns:
element info
See Also:
I_CmsContainerpageService.getElementInfo()

getElementsData

public java.util.Map<java.lang.String,CmsContainerElementData> getElementsData(CmsUUID pageStructureId,
                                                                               java.lang.String reqParams,
                                                                               java.util.Collection<java.lang.String> clientIds,
                                                                               java.util.Collection<CmsContainer> containers,
                                                                               java.lang.String locale)
                                                                        throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Returns container element data by client id.

Specified by:
getElementsData in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
reqParams - optional request parameters
clientIds - the requested element id's
containers - the containers of the current page
locale - the content locale
Returns:
the element data
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.getElementsData(org.opencms.util.CmsUUID, java.lang.String, java.util.Collection, java.util.Collection, java.lang.String)

getElementWithSettings

public CmsContainerElementData getElementWithSettings(CmsUUID pageStructureId,
                                                      java.lang.String uriParams,
                                                      java.lang.String clientId,
                                                      java.util.Map<java.lang.String,java.lang.String> settings,
                                                      java.util.Collection<CmsContainer> containers,
                                                      java.lang.String locale)
                                               throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Gets the element data for an id and a map of settings.

Specified by:
getElementWithSettings in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
uriParams - optional request parameters
clientId - the requested element ids
settings - the settings for which the element data should be loaded
containers - the containers of the current page
locale - the content locale
Returns:
the element data
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.getElementWithSettings(org.opencms.util.CmsUUID, java.lang.String, java.lang.String, java.util.Map, java.util.Collection, java.lang.String)

getFavoriteList

public java.util.List<CmsContainerElementData> getFavoriteList(CmsUUID pageStructureId,
                                                               java.util.Collection<CmsContainer> containers,
                                                               java.lang.String locale)
                                                        throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Returns the container element data of the favorite list.

Specified by:
getFavoriteList in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
containers - the containers of the current page
locale - the content locale
Returns:
the favorite list element data
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.getFavoriteList(org.opencms.util.CmsUUID, java.util.Collection, java.lang.String)

getNewElementData

public CmsContainerElementData getNewElementData(CmsUUID pageStructureId,
                                                 java.lang.String reqParams,
                                                 java.lang.String resourceType,
                                                 java.util.Collection<CmsContainer> containers,
                                                 java.lang.String localeName)
                                          throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Returns new container element data for the given resource type name.

Specified by:
getNewElementData in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
reqParams - optional request parameters
resourceType - the requested element resource type name
containers - the containers of the current page
localeName - the content locale
Returns:
the element data
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.getNewElementData(org.opencms.util.CmsUUID, java.lang.String, java.lang.String, java.util.Collection, java.lang.String)

getRecentList

public java.util.List<CmsContainerElementData> getRecentList(CmsUUID pageStructureId,
                                                             java.util.Collection<CmsContainer> containers,
                                                             java.lang.String locale)
                                                      throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Returns the container element data of the recent list.

Specified by:
getRecentList in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
containers - the containers of the current page
locale - the content locale
Returns:
the recent list element data
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.getRecentList(org.opencms.util.CmsUUID, java.util.Collection, java.lang.String)

getRemovedElementStatus

public CmsRemovedElementStatus getRemovedElementStatus(java.lang.String id)
                                                throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Gets the status of a removed element.

Specified by:
getRemovedElementStatus in interface I_CmsContainerpageService
Parameters:
id - the client id of the removed element
Returns:
the status of the removed element
Throws:
CmsRpcException
See Also:
I_CmsContainerpageService.getRemovedElementStatus(java.lang.String)

internalGetRemovedElementStatus

public CmsRemovedElementStatus internalGetRemovedElementStatus(CmsUUID structureId)
                                                        throws CmsException,
                                                               CmsLoaderException
Internal helper method to get the status of a removed element.

Parameters:
structureId - the structure id of the removed element
Returns:
the status of the removed element
Throws:
CmsException
CmsLoaderException

prefetch

public CmsCntPageData prefetch()
                        throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Returns the initialization data.

Specified by:
prefetch in interface I_CmsContainerpageService
Returns:
the initialization data
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsContainerpageService.prefetch()

saveContainerpage

public void saveContainerpage(CmsUUID pageStructureId,
                              java.util.List<CmsContainer> containers,
                              java.lang.String locale)
                       throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves the container-page.

Specified by:
saveContainerpage in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
containers - the container-page's containers
locale - the content locale
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.saveContainerpage(org.opencms.util.CmsUUID, java.util.List, java.lang.String)

saveFavoriteList

public void saveFavoriteList(java.util.List<java.lang.String> clientIds)
                      throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves the favorite list.

Specified by:
saveFavoriteList in interface I_CmsContainerpageService
Parameters:
clientIds - favorite list element id's
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.saveFavoriteList(java.util.List)

saveGroupContainer

public CmsGroupContainerSaveResult saveGroupContainer(CmsUUID pageStructureId,
                                                      java.lang.String reqParams,
                                                      CmsGroupContainer groupContainer,
                                                      java.util.Collection<CmsContainer> containers,
                                                      java.lang.String locale)
                                               throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves a group-container element.

Specified by:
saveGroupContainer in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
reqParams - optional request parameters
groupContainer - the group-container to save
containers - the containers of the current page
locale - the content locale
Returns:
the data of the saved group container
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.saveGroupContainer(org.opencms.util.CmsUUID, java.lang.String, org.opencms.ade.containerpage.shared.CmsGroupContainer, java.util.Collection, java.lang.String)

saveInheritanceContainer

public java.util.Map<java.lang.String,CmsContainerElementData> saveInheritanceContainer(CmsUUID pageStructureId,
                                                                                        CmsInheritanceContainer inheritanceContainer,
                                                                                        java.util.Collection<CmsContainer> containers,
                                                                                        java.lang.String locale)
                                                                                 throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves an inheritance container.

Specified by:
saveInheritanceContainer in interface I_CmsContainerpageService
Parameters:
pageStructureId - the current page's structure id
inheritanceContainer - the inheritance container to save
containers - the containers of the current page
locale - the requested locale
Returns:
the element data of the saved container
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsContainerpageService.saveInheritanceContainer(org.opencms.util.CmsUUID, org.opencms.ade.containerpage.shared.CmsInheritanceContainer, java.util.Collection, java.lang.String)

saveRecentList

public void saveRecentList(java.util.List<java.lang.String> clientIds)
                    throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves the recent list.

Specified by:
saveRecentList in interface I_CmsContainerpageService
Parameters:
clientIds - recent list element id's
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.saveRecentList(java.util.List)

syncSaveContainerpage

public void syncSaveContainerpage(CmsUUID pageStructureId,
                                  java.util.List<CmsContainer> containers,
                                  java.lang.String locale)
                           throws CmsRpcException
Description copied from interface: I_CmsContainerpageService
Saves the container-page in a synchronized RPC call.

Specified by:
syncSaveContainerpage in interface I_CmsContainerpageService
Parameters:
pageStructureId - the container page structure id
containers - the container-page's containers
locale - the content locale
Throws:
CmsRpcException - if something goes wrong processing the request
See Also:
I_CmsContainerpageService.syncSaveContainerpage(org.opencms.util.CmsUUID, java.util.List, java.lang.String)