org.opencms.ade.galleries
Class CmsGalleryService

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.galleries.CmsGalleryService
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_CmsGalleryService

public class CmsGalleryService
extends CmsGwtService
implements I_CmsGalleryService

Handles all RPC services related to the gallery dialog.

Since:
8.0.0
See Also:
CmsGalleryService, I_CmsGalleryService, I_CmsGalleryServiceAsync, Serialized Form

Nested Class Summary
protected  class CmsGalleryService.CmsGalleryTypeInfo
          Gallery info object.
 
Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
CmsGalleryService()
           
 
Method Summary
 void deleteResource(java.lang.String resourcePath)
          Deletes the given resource.
 java.util.List<CmsGalleryFolderBean> getGalleries(java.util.List<java.lang.String> resourceTypes)
          Returns the available galleries depending on the given resource types.
 CmsResultItemBean getInfoForResource(java.lang.String linkPath, java.lang.String locale)
          Returns the resource info for a single resource.
 CmsGalleryDataBean getInitialSettings(CmsGalleryConfiguration conf)
          Returns the initial data for the given gallery mode.
static CmsGalleryDataBean getInitialSettings(javax.servlet.http.HttpServletRequest request, CmsGalleryConfiguration config)
          Returns the initial gallery settings.
 CmsGallerySearchBean getSearch(CmsGalleryDataBean data)
          Performs an initial search based on the given data bean and the available parameters of the request.
 CmsGallerySearchBean getSearch(CmsGallerySearchBean searchObj)
          Returns the gallery search object containing search results and the currant search parameter.
static CmsGallerySearchBean getSearch(javax.servlet.http.HttpServletRequest request, CmsGalleryDataBean config)
          Returns the initial search data.
protected  java.util.List<CmsResource> getSitemapSubEntryResources(java.lang.String rootPath)
          Gets the sitemap sub entries for a given path as resources.
 java.util.List<CmsSitemapEntryBean> getSubEntries(java.lang.String rootPath, boolean isRoot)
          Returns the sub entries to the given sitemap path.
protected  java.util.List<CmsSitemapEntryBean> getSubEntriesInternal(java.lang.String rootPath, boolean isRoot)
          Internal method for getting sitemap sub entries for a given root path.
 java.util.List<CmsVfsEntryBean> getSubFolders(java.lang.String rootPath)
          Gets the sub-folders of a folder.
protected  boolean isSitemapEntry(CmsObject cms, CmsResource resource)
          Checks whether a given resource is a sitemap entry.
 CmsVfsEntryBean loadVfsEntryBean(java.lang.String path)
          Loads the root VFS entry bean for the given site root.
protected  java.util.List<CmsResource> readAll(java.util.Collection<CmsUUID> structureIds, CmsResourceFilter filter)
          Reads the resources for a collection of structure ids and returns the list of resources which could be read.
 void saveTreeOpenState(java.lang.String treeName, java.lang.String treeToken, java.lang.String siteRoot, java.util.Set<CmsUUID> openItems)
          Saves the tree open state for a tree tab.
 void updateIndex()
          Updates the offline indices.
 
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

CmsGalleryService

public CmsGalleryService()
Method Detail

getInitialSettings

public static CmsGalleryDataBean getInitialSettings(javax.servlet.http.HttpServletRequest request,
                                                    CmsGalleryConfiguration config)
                                             throws CmsRpcException
Returns the initial gallery settings.

Parameters:
request - the current request
config - the gallery configuration
Returns:
the initial gallery settings
Throws:
CmsRpcException - if something goes wrong

getSearch

public static CmsGallerySearchBean getSearch(javax.servlet.http.HttpServletRequest request,
                                             CmsGalleryDataBean config)
Returns the initial search data.

Parameters:
request - the current request
config - the gallery configuration
Returns:
the initial search data

deleteResource

public void deleteResource(java.lang.String resourcePath)
                    throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Deletes the given resource.

Specified by:
deleteResource in interface I_CmsGalleryService
Parameters:
resourcePath - the resource path of the resource to delete
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.deleteResource(java.lang.String)

getGalleries

public java.util.List<CmsGalleryFolderBean> getGalleries(java.util.List<java.lang.String> resourceTypes)
Description copied from interface: I_CmsGalleryService
Returns the available galleries depending on the given resource types.

Specified by:
getGalleries in interface I_CmsGalleryService
Parameters:
resourceTypes - the resource types
Returns:
the galleries
See Also:
I_CmsGalleryService.getGalleries(java.util.List)

getInfoForResource

public CmsResultItemBean getInfoForResource(java.lang.String linkPath,
                                            java.lang.String locale)
                                     throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Returns the resource info for a single resource.

Specified by:
getInfoForResource in interface I_CmsGalleryService
Parameters:
linkPath - the resource path
locale - the content locale
Returns:
the resource info
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.getInfoForResource(java.lang.String, java.lang.String)

getInitialSettings

public CmsGalleryDataBean getInitialSettings(CmsGalleryConfiguration conf)
                                      throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Returns the initial data for the given gallery mode.

Specified by:
getInitialSettings in interface I_CmsGalleryService
Parameters:
conf - the gallery configuration
Returns:
the data bean
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.getInitialSettings(org.opencms.ade.galleries.shared.CmsGalleryConfiguration)

getSearch

public CmsGallerySearchBean getSearch(CmsGalleryDataBean data)
Description copied from interface: I_CmsGalleryService
Performs an initial search based on the given data bean and the available parameters of the request.

Specified by:
getSearch in interface I_CmsGalleryService
Parameters:
data - the data bean
Returns:
the search result
See Also:
I_CmsGalleryService.getSearch(org.opencms.ade.galleries.shared.CmsGalleryDataBean)

getSearch

public CmsGallerySearchBean getSearch(CmsGallerySearchBean searchObj)
                               throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Returns the gallery search object containing search results and the currant search parameter.

Specified by:
getSearch in interface I_CmsGalleryService
Parameters:
searchObj - the current search object
Returns:
the search object containing search results
Throws:
CmsRpcException - is something goes wrong
See Also:
I_CmsGalleryService.getSearch(CmsGallerySearchBean)

getSubEntries

public java.util.List<CmsSitemapEntryBean> getSubEntries(java.lang.String rootPath,
                                                         boolean isRoot)
                                                  throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Returns the sub entries to the given sitemap path.

Specified by:
getSubEntries in interface I_CmsGalleryService
Parameters:
rootPath - the root path
isRoot - true if the requested entry is the root entry
Returns:
the sub entries
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.getSubEntries(java.lang.String, boolean)

getSubFolders

public java.util.List<CmsVfsEntryBean> getSubFolders(java.lang.String rootPath)
                                              throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Gets the sub-folders of a folder.

Specified by:
getSubFolders in interface I_CmsGalleryService
Parameters:
rootPath - the path of a folder
Returns:
beans representing the sub-folders of the folder
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.getSubFolders(java.lang.String)

loadVfsEntryBean

public CmsVfsEntryBean loadVfsEntryBean(java.lang.String path)
                                 throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Loads the root VFS entry bean for the given site root.

Specified by:
loadVfsEntryBean in interface I_CmsGalleryService
Parameters:
path - the site root
Returns:
the root VFS entry bean for the given site root
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.loadVfsEntryBean(java.lang.String)

saveTreeOpenState

public void saveTreeOpenState(java.lang.String treeName,
                              java.lang.String treeToken,
                              java.lang.String siteRoot,
                              java.util.Set<CmsUUID> openItems)
                       throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Saves the tree open state for a tree tab.

Specified by:
saveTreeOpenState in interface I_CmsGalleryService
Parameters:
treeName - the tree name for which to save the tree state
treeToken - the tree token for which to save the tree state
siteRoot - the site root
openItems - the set of structure ids of open tree items
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.saveTreeOpenState(java.lang.String, java.lang.String, java.lang.String, java.util.Set)

updateIndex

public void updateIndex()
                 throws CmsRpcException
Description copied from interface: I_CmsGalleryService
Updates the offline indices.

Specified by:
updateIndex in interface I_CmsGalleryService
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsGalleryService.updateIndex()

getSitemapSubEntryResources

protected java.util.List<CmsResource> getSitemapSubEntryResources(java.lang.String rootPath)
                                                           throws CmsException
Gets the sitemap sub entries for a given path as resources.

Parameters:
rootPath - the root path
Returns:
the sitemap sub entry resources
Throws:
CmsException - if something goes wrong

getSubEntriesInternal

protected java.util.List<CmsSitemapEntryBean> getSubEntriesInternal(java.lang.String rootPath,
                                                                    boolean isRoot)
                                                             throws CmsException
Internal method for getting sitemap sub entries for a given root path.

Parameters:
rootPath - the root path
isRoot - true if this method is used to get the root entries of a sitemap
Returns:
the list of sitemap sub-entry beans
Throws:
CmsException - if something goes wrong

isSitemapEntry

protected boolean isSitemapEntry(CmsObject cms,
                                 CmsResource resource)
                          throws CmsException
Checks whether a given resource is a sitemap entry.

This is used for preselected entries in the gallery widget.

Parameters:
cms - the current CMS context
resource - the resource to check
Returns:
true if the resource is a sitemap entry
Throws:
CmsException - if something goes wrong

readAll

protected java.util.List<CmsResource> readAll(java.util.Collection<CmsUUID> structureIds,
                                              CmsResourceFilter filter)
Reads the resources for a collection of structure ids and returns the list of resources which could be read.

Parameters:
structureIds - the structure ids for which we want to read the resources
filter - the filter used to read the resource
Returns:
the list of resources for the given structure id