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, 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(String clientId)
          Adds an element specified by it's id to the favorite list.
 void addToRecentList(String clientId)
          Adds an element specified by it's id to the recent list.
 CmsCreateElementData checkCreateNewElement(CmsUUID pageStructureId, String clientId, String resourceType, 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.
 CmsUUID convertToServerId(String id)
          Parses an element id.
 CmsContainerElement createNewElement(CmsUUID pageStructureId, String clientId, String resourceType, CmsUUID modelResourceStructureId, String locale)
          Creates a new element of the given type and returns the new element data containing structure id and site path.
 Map<String,CmsContainerElementData> getElementsData(CmsUUID pageStructureId, String reqParams, Collection<String> clientIds, Collection<CmsContainer> containers, String locale)
          Returns container element data by client id.
 CmsContainerElementData getElementWithSettings(CmsUUID pageStructureId, String uriParams, String clientId, Map<String,String> settings, Collection<CmsContainer> containers, String locale)
          Gets the element data for an id and a map of settings.
 List<CmsContainerElementData> getFavoriteList(CmsUUID pageStructureId, Collection<CmsContainer> containers, String locale)
          Returns the container element data of the favorite list.
 CmsContainerElementData getNewElementData(CmsUUID pageStructureId, String reqParams, String resourceType, Collection<CmsContainer> containers, String localeName)
          Returns new container element data for the given resource type name.
 List<CmsContainerElementData> getRecentList(CmsUUID pageStructureId, Collection<CmsContainer> containers, String locale)
          Returns the container element data of the recent list.
static CmsContainerpageService newInstance(javax.servlet.http.HttpServletRequest request)
          Returns a new configured service instance.
 CmsCntPageData prefetch()
          Returns the initialization data.
 void saveContainerpage(CmsUUID pageStructureId, List<CmsContainer> containers, String locale)
          Saves the container-page.
 void saveFavoriteList(List<String> clientIds)
          Saves the favorite list.
 Map<String,CmsContainerElementData> saveGroupContainer(CmsUUID pageStructureId, String reqParams, CmsGroupContainer groupContainer, Collection<CmsContainer> containers, String locale)
          Saves a group-container element.
 void saveRecentList(List<String> clientIds)
          Saves the recent list.
 void syncSaveContainerpage(CmsUUID pageStructureId, List<CmsContainer> containers, String locale)
          Saves the container-page in a synchronized RPC call.
 
Methods inherited from class org.opencms.gwt.CmsGwtService
checkPermissions, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, log, log, logError, service, setCms, setContext, setRequest, 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

newInstance

public static CmsContainerpageService newInstance(javax.servlet.http.HttpServletRequest request)
Returns a new configured service instance.

Parameters:
request - the current request
Returns:
a new service instance

addToFavoriteList

public void addToFavoriteList(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(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,
                                                  String clientId,
                                                  String resourceType,
                                                  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)

convertToServerId

public CmsUUID convertToServerId(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,
                                            String clientId,
                                            String resourceType,
                                            CmsUUID modelResourceStructureId,
                                            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)

getElementsData

public Map<String,CmsContainerElementData> getElementsData(CmsUUID pageStructureId,
                                                           String reqParams,
                                                           Collection<String> clientIds,
                                                           Collection<CmsContainer> containers,
                                                           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,
                                                      String uriParams,
                                                      String clientId,
                                                      Map<String,String> settings,
                                                      Collection<CmsContainer> containers,
                                                      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 List<CmsContainerElementData> getFavoriteList(CmsUUID pageStructureId,
                                                     Collection<CmsContainer> containers,
                                                     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,
                                                 String reqParams,
                                                 String resourceType,
                                                 Collection<CmsContainer> containers,
                                                 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 List<CmsContainerElementData> getRecentList(CmsUUID pageStructureId,
                                                   Collection<CmsContainer> containers,
                                                   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)

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,
                              List<CmsContainer> containers,
                              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(List<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 Map<String,CmsContainerElementData> saveGroupContainer(CmsUUID pageStructureId,
                                                              String reqParams,
                                                              CmsGroupContainer groupContainer,
                                                              Collection<CmsContainer> containers,
                                                              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)

saveRecentList

public void saveRecentList(List<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,
                                  List<CmsContainer> containers,
                                  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)