public class CmsGalleryController extends java.lang.Object implements com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsGallerySearchBean>
This class handles the communication between gallery dialog and the server. It contains the gallery data, but no references to the gallery dialog widget.
限定符和类型 | 字段和说明 |
---|---|
protected int |
m_currentCallId
The current load results call id.
|
protected CmsGalleryDataBean |
m_dialogBean
The gallery dialog bean.
|
protected I_CmsGalleryProviderConstants.GalleryMode |
m_dialogMode
The gallery dialog mode.
|
protected com.google.gwt.event.shared.SimpleEventBus |
m_eventBus
The event bus.
|
protected CmsGalleryControllerHandler |
m_handler
The gallery controller handler.
|
protected boolean |
m_loading
Flag to indicate that a load results request is currently running.
|
protected CmsGallerySearchBean |
m_searchObject
The gallery search object.
|
构造器和说明 |
---|
CmsGalleryController(CmsGalleryControllerHandler handler)
Constructor.
|
CmsGalleryController(CmsGalleryControllerHandler handler,
I_CmsGalleryConfiguration conf)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addCategory(java.lang.String categoryPath)
Add category to search object.
|
void |
addDateCreatedEnd(long end)
Sets the created until date to the search object.
|
void |
addDateCreatedStart(long start)
Sets the created since date to the search object.
|
void |
addDateModifiedEnd(long end)
Sets the modified until date to the search object.
|
void |
addDateModifiedStart(long start)
Sets the modified since date to the search object.
|
void |
addFolder(java.lang.String folder)
Adds a folder to the current search object.
|
void |
addGallery(java.lang.String galleryPath)
Add gallery to search object.
|
void |
addLocale(java.lang.String locale)
Sets the locale to the search object.
|
void |
addScope(CmsGallerySearchScope scope)
Sets the search scope in the search object.
|
void |
addSearchQuery(java.lang.String searchQuery)
Adds the search query from the search tab.
|
void |
addType(java.lang.String resourceType)
Add type to search object.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsGallerySearchBean> handler) |
void |
clearCategories()
Removes all selected categories from the search object.
|
void |
clearFolders(boolean searchChanged)
Removes all selected folders from the search object.
|
void |
clearGalleries()
Removes all selected galleries from the search object.
|
void |
clearTextSearch()
Removes all full text search criteria from the search object.
|
void |
clearTypes()
Removes all selected types from the search object.
|
static I_CmsGalleryServiceAsync |
createGalleryService()
Creates a gallery service instance.
|
void |
deleteResource(java.lang.String resourcePath)
Checks for broken links, ask for confirmation and finally deletes the given resource.
|
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> event) |
java.util.List<CmsGalleryFolderBean> |
getAvailableGalleries()
Gets the available galleries.
|
java.util.Map<java.lang.String,java.lang.String> |
getAvailableLocales()
Returns the available locales.
|
CmsGallerySearchScope |
getDefaultScope()
Gets the default search scope.
|
java.lang.String |
getDefaultSitemapTabSiteRoot()
Gets the default site root for the sitemap tab.
|
java.lang.String |
getDefaultVfsTabSiteRoot()
Gets the default site root for the VFS tab.
|
I_CmsGalleryProviderConstants.GalleryMode |
getDialogMode()
Returns the gallery dialog mode.
|
protected I_CmsGalleryServiceAsync |
getGalleryService()
Returns the gallery service instance.
|
static java.lang.String |
getLastSelectedGallery(I_CmsGalleryConfiguration config)
Returns the last selecte gallery for the given configuration or
null . |
java.lang.String |
getPreselectOption(java.lang.String siteRoot,
java.util.List<CmsSiteSelectorOption> options)
Gets the option which should be preselected for the site selector, or null.
|
java.lang.String |
getSearchLocale()
Returns the search locale.
|
CmsGallerySearchScope |
getSearchScope()
Returns the gallery search scope.
|
java.util.List<CmsResourceTypeBean> |
getSearchTypes()
Returns the searchable resource types.
|
java.util.List<CmsSiteSelectorOption> |
getSitemapSiteSelectorOptions()
Gets the sitemap site selector options.
|
java.lang.String |
getStartLocale()
Returns the start locale.
|
java.lang.String |
getStartSiteRoot()
Gets the start site root.
|
void |
getSubEntries(java.lang.String rootPath,
boolean isRoot,
I_CmsSimpleCallback<java.util.List<CmsSitemapEntryBean>> callback)
Loads the sub entries for the given path.
|
void |
getSubFolders(java.lang.String folder,
com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<CmsVfsEntryBean>> callback)
Retrieves the sub-folders of a given folder.
|
I_CmsGalleryProviderConstants.GalleryTabId[] |
getTabIds()
Returns the configured tab id's.
|
java.lang.String |
getTreeToken()
Gets the tree token, which is used to determine which tree state is loaded/saved for the VFS and sitemap tabs.
|
protected I_CmsVfsServiceAsync |
getVfsService()
Returns the sitemap service instance.
|
java.util.List<CmsSiteSelectorOption> |
getVfsSiteSelectorOptions()
Gets the site selector options.
|
boolean |
hasPreview(java.lang.String resourceType)
Returns if a preview is available for the given resource type.
|
boolean |
hasSelectFolder()
Returns if folders should be selectable.
|
boolean |
hasSelectResource()
Returns if resource entries in the search result are selectable.
|
protected void |
internalDeleteResource(java.lang.String resourcePath) |
boolean |
isIncludeFiles()
Returns if files are included.
|
boolean |
isLoading()
Returns if a load results request is currently running.
|
boolean |
isOpenInResults()
Checks if the gallery is first opened in results tab.
|
boolean |
isSearchObjectChanged()
Returns
true , if the search object was manipulated by the controller
false otherwise. |
boolean |
isSearchObjectEmpty()
Checks if any search parameter are selected.
|
boolean |
isShowSiteSelector()
Returns true if the site selector should be shown.
|
void |
loadVfsEntryBean(java.lang.String siteRoot,
com.google.gwt.user.client.rpc.AsyncCallback<CmsVfsEntryBean> asyncCallback)
Loads the root VFS entry bean for a given site selector option.
|
void |
openPreview(java.lang.String resourcePath,
java.lang.String resourceType)
Opens the preview for the given resource by the given resource type.
|
static void |
registerPreviewFactory(java.lang.String previewProviderName,
I_CmsPreviewFactory factory)
Registers a preview factory for the given name.
|
void |
removeCategory(java.lang.String categoryPath)
Remove the category from the search object.
|
void |
removeCategoryParam(java.lang.String key)
Removes the category from the search object.
|
void |
removeFolder(java.lang.String folder)
Removes a folder from the current search object.
|
void |
removeFolderParam(java.lang.String key)
Removes the folder from the search object.
|
void |
removeGallery(java.lang.String galleryPath)
Remove the gallery from the search object.
|
void |
removeGalleryParam(java.lang.String key)
Removes a selected gallery from the search object.
|
protected void |
removeTab(I_CmsGalleryProviderConstants.GalleryTabId tabId)
Removes a tab id from the internal list of tab ids.
|
void |
removeTextSearchParameter(java.lang.String key)
Removes the given full text search criteria from the search object.
|
void |
removeType(java.lang.String resourceType)
Remove the type from the search object.
|
void |
removeTypeParam(java.lang.String key)
Removes the type from the search object.
|
protected void |
removeTypesTab()
Removes the types tab from the list of configured tabs.
|
void |
saveTreeState(java.lang.String treeName,
java.lang.String siteRoot,
java.util.Set<CmsUUID> openItemIds)
Saves the tree state for a given tree on the server.
|
void |
searchElement(java.lang.String path,
java.lang.Runnable nextAction)
Searches for a specific element and opens it's preview if found.
|
void |
selectResource(java.lang.String resourcePath,
CmsUUID structureId,
java.lang.String title,
java.lang.String resourceType)
Selects the given resource and sets its path into the xml-content field or editor link.
|
void |
selectResultTab()
Selects the result tab.
|
void |
setHandler(CmsGalleryControllerHandler handler)
Sets the controller handler for gallery dialog.
|
void |
setIncludeExpired(boolean includeExpired)
Sets if the search should include expired or unreleased resources.
|
void |
setSearchObjectChanged()
Sets the search object changed flag to
true . |
void |
setShowSiteSelector(boolean isShowSiteSelector)
Sets the "Show site selector" option.
|
void |
setStartSite(java.lang.String startSite)
Sets the start site.
|
void |
sortCategories(java.lang.String sortParams,
java.lang.String filter)
Sorts the categories according to given parameters and updates the list.
|
void |
sortGalleries(java.lang.String sortParams,
java.lang.String filter)
Sorts the galleries according to given parameters and updates the list.
|
void |
sortResults(java.lang.String sortParams)
Sorts the results according to given parameters and updates the list.
|
void |
sortTypes(java.lang.String sortParams)
Sorts the types according to given parameters and updates the list.
|
void |
updateCategoriesTab()
Updates the content of the categories tab.
|
void |
updateGalleriesTab()
Updates the content of the galleries(folders) tab.
|
void |
updateIndex()
Updates the gallery index and triggers a new search afterwards.
|
void |
updateResultsTab(boolean isNextPage)
Updates the content of the results tab.
|
void |
updatesTypesTab()
Updates the content of the types tab.
|
protected int m_currentCallId
protected CmsGalleryDataBean m_dialogBean
protected I_CmsGalleryProviderConstants.GalleryMode m_dialogMode
protected com.google.gwt.event.shared.SimpleEventBus m_eventBus
protected CmsGalleryControllerHandler m_handler
protected boolean m_loading
protected CmsGallerySearchBean m_searchObject
public CmsGalleryController(CmsGalleryControllerHandler handler)
handler
- the controller handlerpublic CmsGalleryController(CmsGalleryControllerHandler handler, I_CmsGalleryConfiguration conf)
handler
- the controller handlerconf
- the gallery configurationpublic static I_CmsGalleryServiceAsync createGalleryService()
public static java.lang.String getLastSelectedGallery(I_CmsGalleryConfiguration config)
null
.config
- the gallery configurationpublic static void registerPreviewFactory(java.lang.String previewProviderName, I_CmsPreviewFactory factory)
previewProviderName
- the preview provider namefactory
- the preview factorypublic void addCategory(java.lang.String categoryPath)
categoryPath
- the id of the category to addpublic void addDateCreatedEnd(long end)
end
- the created until date as longpublic void addDateCreatedStart(long start)
start
- the created since date as longpublic void addDateModifiedEnd(long end)
end
- the modified until date as longpublic void addDateModifiedStart(long start)
start
- the modified since date as longpublic void addFolder(java.lang.String folder)
folder
- the folder to addpublic void addGallery(java.lang.String galleryPath)
galleryPath
- the id of the gallery to addpublic void addLocale(java.lang.String locale)
locale
- the locale to setpublic void addScope(CmsGallerySearchScope scope)
scope
- the search scopepublic void addSearchQuery(java.lang.String searchQuery)
searchQuery
- the search querypublic void addType(java.lang.String resourceType)
resourceType
- the id(name?) of the resource type to addpublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsGallerySearchBean> handler)
addValueChangeHandler
在接口中 com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsGallerySearchBean>
HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
public void clearCategories()
public void clearFolders(boolean searchChanged)
searchChanged
- if true, marks the search parameters as changedpublic void clearGalleries()
public void clearTextSearch()
public void clearTypes()
public void deleteResource(java.lang.String resourcePath)
resourcePath
- the resource path of the resource to deletepublic void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
fireEvent
在接口中 com.google.gwt.event.shared.HasHandlers
HasHandlers.fireEvent(com.google.gwt.event.shared.GwtEvent)
public java.util.List<CmsGalleryFolderBean> getAvailableGalleries()
public java.util.Map<java.lang.String,java.lang.String> getAvailableLocales()
public CmsGallerySearchScope getDefaultScope()
public java.lang.String getDefaultSitemapTabSiteRoot()
public java.lang.String getDefaultVfsTabSiteRoot()
public I_CmsGalleryProviderConstants.GalleryMode getDialogMode()
public java.lang.String getPreselectOption(java.lang.String siteRoot, java.util.List<CmsSiteSelectorOption> options)
siteRoot
- the site rootoptions
- the list of optionspublic java.lang.String getSearchLocale()
public CmsGallerySearchScope getSearchScope()
public java.util.List<CmsResourceTypeBean> getSearchTypes()
public java.util.List<CmsSiteSelectorOption> getSitemapSiteSelectorOptions()
public java.lang.String getStartLocale()
public java.lang.String getStartSiteRoot()
public void getSubEntries(java.lang.String rootPath, boolean isRoot, I_CmsSimpleCallback<java.util.List<CmsSitemapEntryBean>> callback)
rootPath
- the root pathisRoot
- true
if the requested entry is the root entrycallback
- the callback to execute with the resultpublic void getSubFolders(java.lang.String folder, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<CmsVfsEntryBean>> callback)
folder
- the folder whose sub-folders should be retrievedcallback
- the callback for processing the sub-folderspublic I_CmsGalleryProviderConstants.GalleryTabId[] getTabIds()
public java.lang.String getTreeToken()
public java.util.List<CmsSiteSelectorOption> getVfsSiteSelectorOptions()
public boolean hasPreview(java.lang.String resourceType)
resourceType
- the requested resource typetrue
if a preview is available for the given resource typepublic boolean hasSelectFolder()
true
if folders should be selectablepublic boolean hasSelectResource()
public boolean isIncludeFiles()
true
if files are includedpublic boolean isLoading()
true
if a load results request is currently runningpublic boolean isOpenInResults()
public boolean isSearchObjectChanged()
true
, if the search object was manipulated by the controller
false
otherwise.public boolean isSearchObjectEmpty()
false
if any search parameter is selected, true
if there are no search parameter selectedpublic boolean isShowSiteSelector()
public void loadVfsEntryBean(java.lang.String siteRoot, com.google.gwt.user.client.rpc.AsyncCallback<CmsVfsEntryBean> asyncCallback)
siteRoot
- the site root for which the VFS entry should be loadedasyncCallback
- the callback to call with the resultpublic void openPreview(java.lang.String resourcePath, java.lang.String resourceType)
resourcePath
- the resource pathresourceType
- the resource type namepublic void removeCategory(java.lang.String categoryPath)
categoryPath
- the category path as idpublic void removeCategoryParam(java.lang.String key)
key
- the categorypublic void removeFolder(java.lang.String folder)
folder
- the folder to removepublic void removeFolderParam(java.lang.String key)
key
- the folderpublic void removeGallery(java.lang.String galleryPath)
galleryPath
- the gallery path as idpublic void removeGalleryParam(java.lang.String key)
key
- the gallery keypublic void removeTextSearchParameter(java.lang.String key)
key
- the key of the parameter to removepublic void removeType(java.lang.String resourceType)
resourceType
- the resource type as idpublic void removeTypeParam(java.lang.String key)
key
- the typepublic void saveTreeState(java.lang.String treeName, java.lang.String siteRoot, java.util.Set<CmsUUID> openItemIds)
treeName
- the tree namesiteRoot
- the site rootopenItemIds
- the structure ids of opened itemspublic void searchElement(java.lang.String path, java.lang.Runnable nextAction)
path
- the element pathnextAction
- the next action to execute after the search data for the element has been loaded into the gallery dialogpublic void selectResource(java.lang.String resourcePath, CmsUUID structureId, java.lang.String title, java.lang.String resourceType)
resourcePath
- the resource pathstructureId
- the structure idtitle
- the resource titleresourceType
- the resource typepublic void selectResultTab()
public void setHandler(CmsGalleryControllerHandler handler)
handler
- the handler to setpublic void setIncludeExpired(boolean includeExpired)
includeExpired
- if the search should include expired or unreleased resourcespublic void setSearchObjectChanged()
true
.public void setShowSiteSelector(boolean isShowSiteSelector)
isShowSiteSelector
- the new value for the optionpublic void setStartSite(java.lang.String startSite)
startSite
- the start sitepublic void sortCategories(java.lang.String sortParams, java.lang.String filter)
sortParams
- the sort parametersfilter
- the filter to apply before sortingpublic void sortGalleries(java.lang.String sortParams, java.lang.String filter)
sortParams
- the sort parametersfilter
- the filter to apply before sortingpublic void sortResults(java.lang.String sortParams)
sortParams
- the sort parameterspublic void sortTypes(java.lang.String sortParams)
sortParams
- the sort parameterspublic void updateCategoriesTab()
public void updateGalleriesTab()
public void updateIndex()
public void updateResultsTab(boolean isNextPage)
isNextPage
- signals if the next page should be loadedpublic void updatesTypesTab()
protected I_CmsGalleryServiceAsync getGalleryService()
protected I_CmsVfsServiceAsync getVfsService()
protected void internalDeleteResource(java.lang.String resourcePath)
resourcePath
- protected void removeTab(I_CmsGalleryProviderConstants.GalleryTabId tabId)
tabId
- the id of the tab to removeprotected void removeTypesTab()
This will only take effect when executed before tab initialization.