public class CmsGalleryService extends CmsGwtService implements I_CmsGalleryService
CmsGalleryService,
I_CmsGalleryService,
I_CmsGalleryServiceAsync,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
protected class |
CmsGalleryService.CmsGalleryTypeInfo
Gallery info object.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FOLDER_FILTER_ADD_INFO_KEY
Key for additional info gallery folder filter.
|
static int |
INITIAL_SEARCH_MAX_RESULTS
Limit to the number results loaded on initial search.
|
static java.lang.String |
KEY_LAST_USED_GALLERY_ADEVIEW
The key used for storing the last used gallery in adeview mode.
|
static java.lang.String |
PREF_GALLERY_SHOW_INVALID_DEFAULT
Name for the 'galleryShowInvalidDefault' preference.
|
static java.lang.String |
RESULT_VIEW_TYPE_ADD_INFO_KEY
Key for additional info gallery result view type.
|
| Constructor and Description |
|---|
CmsGalleryService() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CmsResourceTypeBean> |
buildTypesList(java.util.List<I_CmsResourceType> resourceTypes,
java.util.Set<java.lang.String> creatableTypes,
java.util.Set<java.lang.String> deactivatedTypes,
java.util.List<java.lang.String> typesForTypeTab)
Returns the resource types beans.
|
void |
deleteResource(java.lang.String resourcePath)
Deletes the given resource.
|
static CmsVfsEntryBean |
generateVfsPreloadData(CmsObject cms,
CmsTreeOpenState vfsState,
java.util.Set<java.lang.String> folders)
Generates the pre-loaded contents for the VFS tab of the gallery dialog.
|
CmsGalleryConfiguration |
getAdeViewModeConfiguration()
Loads the gallery configuration for the adeView mode.
|
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.
|
CmsGalleryDataBean |
getInitialSettingsForContainerPage(java.util.List<CmsResourceTypeBean> types,
java.lang.String uri,
java.lang.String locale)
Returns the initial gallery data for the container page editor.
|
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 CmsObject |
getSearchCms(CmsGallerySearchBean searchObj)
Gets an initialized CmsObject to be used for the actual search for a given search bean.
|
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,
java.lang.String filter)
Returns the sub entries to the given sitemap path.
|
protected java.util.List<CmsSitemapEntryBean> |
getSubEntriesInternal(java.lang.String rootPath,
boolean isRoot,
java.lang.String filter)
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.
|
static java.lang.String |
getTreeOpenStateAttributeName(java.lang.String treeName,
java.lang.String treeToken)
Gets the attribute name for a tree open state.
|
protected java.util.List<java.lang.String> |
getTypeNames(CmsGalleryDataBean data)
Gets the type names from the gallery data bean.
|
static CmsTreeOpenState |
getVfsTreeState(javax.servlet.http.HttpServletRequest request,
java.lang.String treeToken)
Convenience method for reading the saved VFS tree state from the session.
|
static CmsVfsEntryBean |
internalCreateVfsEntryBean(CmsObject cms,
CmsResource resource,
java.lang.String title,
boolean isRoot,
boolean isEditable,
java.util.List<CmsVfsEntryBean> children,
boolean isMatch)
Creates the VFS entry bean for a resource.
|
protected boolean |
isSitemapEntry(CmsObject cms,
CmsResource resource)
Checks whether a given resource is a sitemap entry.
|
CmsVfsEntryBean |
loadVfsEntryBean(java.lang.String path,
java.lang.String filter)
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 |
saveResultViewType(java.lang.String resultViewType)
Stores the result view type with the user.
|
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.
|
checkPermissions, clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, log, log, logError, service, setCms, setContext, setRequest, setResponse, tryUnlockcheckPermutationStrongName, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponsedoPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContentdoDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, servicepublic static final java.lang.String FOLDER_FILTER_ADD_INFO_KEY
public static final int INITIAL_SEARCH_MAX_RESULTS
public static final java.lang.String KEY_LAST_USED_GALLERY_ADEVIEW
public static final java.lang.String PREF_GALLERY_SHOW_INVALID_DEFAULT
public static final java.lang.String RESULT_VIEW_TYPE_ADD_INFO_KEY
public CmsGalleryService()
public static CmsVfsEntryBean generateVfsPreloadData(CmsObject cms, CmsTreeOpenState vfsState, java.util.Set<java.lang.String> folders)
cms - the current CMS contextvfsState - the saved VFS tree state (may be null)folders - the saved search folders (may be null)public static CmsGalleryDataBean getInitialSettings(javax.servlet.http.HttpServletRequest request, CmsGalleryConfiguration config) throws CmsRpcException
request - the current requestconfig - the gallery configurationCmsRpcException - if something goes wrongpublic static CmsGallerySearchBean getSearch(javax.servlet.http.HttpServletRequest request, CmsGalleryDataBean config)
request - the current requestconfig - the gallery configurationpublic static java.lang.String getTreeOpenStateAttributeName(java.lang.String treeName, java.lang.String treeToken)
treeName - the tree nametreeToken - the tree tokenpublic static CmsTreeOpenState getVfsTreeState(javax.servlet.http.HttpServletRequest request, java.lang.String treeToken)
request - the current requesttreeToken - the tree token (may be null)public static CmsVfsEntryBean internalCreateVfsEntryBean(CmsObject cms, CmsResource resource, java.lang.String title, boolean isRoot, boolean isEditable, java.util.List<CmsVfsEntryBean> children, boolean isMatch) throws CmsException
cms - the CMS context to useresource - the resource for which to create the VFS entry beantitle - the titleisRoot - true if this is a root entryisEditable - true if this entry is editablechildren - the children of the entryisMatch - true if the VFS entry bean is a match for the quick searchCmsException - if something goes wrongpublic java.util.List<CmsResourceTypeBean> buildTypesList(java.util.List<I_CmsResourceType> resourceTypes, java.util.Set<java.lang.String> creatableTypes, java.util.Set<java.lang.String> deactivatedTypes, java.util.List<java.lang.String> typesForTypeTab)
resourceTypes - the resource typescreatableTypes - the creatable typesdeactivatedTypes - the deactivated typestypesForTypeTab - the types which should be shown in the types tab according to the gallery configurationpublic void deleteResource(java.lang.String resourcePath) throws CmsRpcException
I_CmsGalleryServicedeleteResource in interface I_CmsGalleryServiceresourcePath - the resource path of the resource to deleteCmsRpcException - if something goes wrongI_CmsGalleryService.deleteResource(java.lang.String)public CmsGalleryConfiguration getAdeViewModeConfiguration()
I_CmsGalleryServicegetAdeViewModeConfiguration in interface I_CmsGalleryServiceI_CmsGalleryService.getAdeViewModeConfiguration()public java.util.List<CmsGalleryFolderBean> getGalleries(java.util.List<java.lang.String> resourceTypes)
I_CmsGalleryServicegetGalleries in interface I_CmsGalleryServiceresourceTypes - the resource typesI_CmsGalleryService.getGalleries(java.util.List)public CmsResultItemBean getInfoForResource(java.lang.String linkPath, java.lang.String locale) throws CmsRpcException
I_CmsGalleryServicegetInfoForResource in interface I_CmsGalleryServicelinkPath - the resource pathlocale - the content localeCmsRpcException - if something goes wrongI_CmsGalleryService.getInfoForResource(java.lang.String, java.lang.String)public CmsGalleryDataBean getInitialSettings(CmsGalleryConfiguration conf) throws CmsRpcException
I_CmsGalleryServicegetInitialSettings in interface I_CmsGalleryServiceconf - the gallery configurationCmsRpcException - if something goes wrongI_CmsGalleryService.getInitialSettings(org.opencms.ade.galleries.shared.CmsGalleryConfiguration)public CmsGalleryDataBean getInitialSettingsForContainerPage(java.util.List<CmsResourceTypeBean> types, java.lang.String uri, java.lang.String locale)
types - the available resource typesuri - the page URIlocale - the content localepublic CmsGallerySearchBean getSearch(CmsGalleryDataBean data)
I_CmsGalleryServicegetSearch in interface I_CmsGalleryServicedata - the data beanI_CmsGalleryService.getSearch(org.opencms.ade.galleries.shared.CmsGalleryDataBean)public CmsGallerySearchBean getSearch(CmsGallerySearchBean searchObj) throws CmsRpcException
I_CmsGalleryServicegetSearch in interface I_CmsGalleryServicesearchObj - the current search objectCmsRpcException - is something goes wrongI_CmsGalleryService.getSearch(CmsGallerySearchBean)public java.util.List<CmsSitemapEntryBean> getSubEntries(java.lang.String rootPath, boolean isRoot, java.lang.String filter) throws CmsRpcException
I_CmsGalleryServicegetSubEntries in interface I_CmsGalleryServicerootPath - the root pathisRoot - true if the requested entry is the root entryfilter - the search filter stringCmsRpcException - if something goes wrongI_CmsGalleryService.getSubEntries(java.lang.String, boolean, java.lang.String)public java.util.List<CmsVfsEntryBean> getSubFolders(java.lang.String rootPath) throws CmsRpcException
I_CmsGalleryServicegetSubFolders in interface I_CmsGalleryServicerootPath - the path of a folderCmsRpcException - if something goes wrongI_CmsGalleryService.getSubFolders(java.lang.String)public CmsVfsEntryBean loadVfsEntryBean(java.lang.String path, java.lang.String filter) throws CmsRpcException
I_CmsGalleryServiceloadVfsEntryBean in interface I_CmsGalleryServicepath - the site rootfilter - the filter stringCmsRpcException - if something goes wrongI_CmsGalleryService.loadVfsEntryBean(java.lang.String, java.lang.String)public void saveResultViewType(java.lang.String resultViewType)
I_CmsGalleryServicesaveResultViewType in interface I_CmsGalleryServiceresultViewType - the result view typeI_CmsGalleryService.saveResultViewType(java.lang.String)public void saveTreeOpenState(java.lang.String treeName, java.lang.String treeToken, java.lang.String siteRoot, java.util.Set<CmsUUID> openItems) throws CmsRpcException
I_CmsGalleryServicesaveTreeOpenState in interface I_CmsGalleryServicetreeName - the tree name for which to save the tree statetreeToken - the tree token for which to save the tree statesiteRoot - the site rootopenItems - the set of structure ids of open tree itemsCmsRpcException - if something goes wrongI_CmsGalleryService.saveTreeOpenState(java.lang.String, java.lang.String, java.lang.String, java.util.Set)public void updateIndex() throws CmsRpcException
I_CmsGalleryServiceupdateIndex in interface I_CmsGalleryServiceCmsRpcException - if something goes wrongI_CmsGalleryService.updateIndex()protected CmsObject getSearchCms(CmsGallerySearchBean searchObj) throws CmsException
searchObj - the search objectCmsException - if something goes wrongprotected java.util.List<CmsResource> getSitemapSubEntryResources(java.lang.String rootPath) throws CmsException
rootPath - the root pathCmsException - if something goes wrongprotected java.util.List<CmsSitemapEntryBean> getSubEntriesInternal(java.lang.String rootPath, boolean isRoot, java.lang.String filter) throws CmsException
rootPath - the root pathisRoot - true if this method is used to get the root entries of a sitemapfilter - the filter string (only relevant if isRoot is true)CmsException - if something goes wrongprotected java.util.List<java.lang.String> getTypeNames(CmsGalleryDataBean data)
data - the gallery data beanprotected boolean isSitemapEntry(CmsObject cms, CmsResource resource) throws CmsException
This is used for preselected entries in the gallery widget.
cms - the current CMS contextresource - the resource to checkCmsException - if something goes wrongprotected java.util.List<CmsResource> readAll(java.util.Collection<CmsUUID> structureIds, CmsResourceFilter filter)
structureIds - the structure ids for which we want to read the resourcesfilter - the filter used to read the resource