public class CmsFileExplorer extends java.lang.Object implements I_CmsWorkplaceApp, I_CmsCachableApp, com.vaadin.navigator.ViewChangeListener, I_CmsWindowCloseListener, I_CmsHasShortcutActions, I_CmsContextProvider, CmsFileTable.I_FolderSelectHandler
| Modifier and Type | Class and Description |
|---|---|
class |
CmsFileExplorer.ExplorerDropHandler
The drop handler for copy/move operations.
|
class |
CmsFileExplorer.TreeExpandListener
File tree expand listener.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_KEY
The file explorer attribute key.
|
static java.util.Collection<CmsResourceTableProperty> |
INLINE_EDIT_PROPERTIES
The in line editable resource properties.
|
static int |
LAYOUT_SPLIT_POSITION
The initial split position between folder tree and file table.
|
protected I_CmsAppUIContext |
m_appContext
The UI context.
|
protected java.lang.String |
m_savedExplorerState
Saved explorer state used by dialogs after they have finished.
|
static java.lang.String |
OPENED_PATHS
The opened paths session attribute name.
|
static java.lang.String |
SITE_CAPTION
Site selector caption property.
|
static java.lang.String |
SITE_ROOT
Site selector site root property.
|
static java.lang.String |
STATE_SEPARATOR
The state separator string.
|
static int |
UPDATE_FOLDER_THRESHOLD
Threshold for updating the complete folder after file changes.
|
| Constructor and Description |
|---|
CmsFileExplorer()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) |
boolean |
beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) |
void |
changeSite(java.lang.String siteRoot,
java.lang.String path)
Changes to the given site and path.
|
void |
changeSite(java.lang.String siteRoot,
java.lang.String path,
boolean force)
Switches to the requested site.
|
protected void |
clearTreeLevel(CmsUUID parentId)
Clears the given tree level.
|
java.util.List<CmsUUID> |
getAllIds()
Gets all ids of resources in current folder.
|
CmsUUID |
getCurrentFolder()
Returns the current folder id.
|
CmsExplorerDialogContext |
getDialogContext()
Returns the dialog context for dialogs opened from the context menu.
|
java.util.Map<com.vaadin.event.Action,java.lang.Runnable> |
getShortcutActions()
Returns the shortcut actions.
|
void |
initUI(I_CmsAppUIContext context)
Within this method the app UI should be initialized.
|
boolean |
isCachable()
Returns whether this app should be cached within the user session.
|
void |
onFolderSelect(CmsUUID itemId)
Called when the folder name is left clicked.
|
void |
onRestoreFromCache()
Called after the view is fetched from the cache.
|
void |
onSiteOrProjectChange(CmsProject project,
java.lang.String siteRoot)
Call if site and or project have been changed.
|
void |
onStateChange(java.lang.String state)
Called on navigation events.
|
void |
onWindowClose()
Executed on window close.
|
void |
populateFileTable(java.lang.String sitePath)
Fills the file table with the resources from the given path.
|
protected void |
readFolder(CmsUUID folderId)
Reads the given folder.
|
protected void |
readFolder(CmsUUID folderId,
boolean clearFilter)
Reads the given folder.
|
void |
update(java.util.Collection<CmsUUID> ids)
Updates the table entries with the given ids.
|
void |
updateAll(boolean clearFilter)
Updates display for all contents of the current folder.
|
protected void |
updateCurrentFolder(java.util.Collection<CmsUUID> removeIds)
Updates the current folder and removes the given resource items.
|
void |
updateResourceInTree(CmsObject cms,
CmsUUID id)
Updates the give tree item.
|
void |
updateTree(CmsUUID id)
Updates the tree items with the given ids.
|
public static final java.lang.String ATTR_KEY
public static final java.util.Collection<CmsResourceTableProperty> INLINE_EDIT_PROPERTIES
public static final int LAYOUT_SPLIT_POSITION
public static final java.lang.String OPENED_PATHS
public static final java.lang.String SITE_CAPTION
public static final java.lang.String SITE_ROOT
public static final java.lang.String STATE_SEPARATOR
public static final int UPDATE_FOLDER_THRESHOLD
protected I_CmsAppUIContext m_appContext
protected java.lang.String m_savedExplorerState
public CmsFileExplorer()
public void afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
afterViewChange in interface com.vaadin.navigator.ViewChangeListenerViewChangeListener.afterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)public boolean beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
beforeViewChange in interface com.vaadin.navigator.ViewChangeListenerViewChangeListener.beforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent)public void changeSite(java.lang.String siteRoot, java.lang.String path)
siteRoot - the site rootpath - the path inside the sitepublic void changeSite(java.lang.String siteRoot, java.lang.String path, boolean force)
siteRoot - the site rootpath - the folder path to openforce - force the path change, even if we are currently in the same sitepublic java.util.List<CmsUUID> getAllIds()
public CmsUUID getCurrentFolder()
public CmsExplorerDialogContext getDialogContext()
I_CmsContextProvidergetDialogContext in interface I_CmsContextProviderI_CmsContextProvider.getDialogContext()public java.util.Map<com.vaadin.event.Action,java.lang.Runnable> getShortcutActions()
I_CmsHasShortcutActionsgetShortcutActions in interface I_CmsHasShortcutActionsI_CmsHasShortcutActions.getShortcutActions()public void initUI(I_CmsAppUIContext context)
I_CmsWorkplaceAppUse the context to add the app's components to the UI.
initUI in interface I_CmsWorkplaceAppcontext - the UI contextI_CmsWorkplaceApp.initUI(org.opencms.ui.apps.I_CmsAppUIContext)public boolean isCachable()
I_CmsCachableAppisCachable in interface I_CmsCachableApptrue if the app is cachableI_CmsCachableApp.isCachable()public void onFolderSelect(CmsUUID itemId)
CmsFileTable.I_FolderSelectHandleronFolderSelect in interface CmsFileTable.I_FolderSelectHandleritemId - the selected folder idCmsFileTable.I_FolderSelectHandler.onFolderSelect(org.opencms.util.CmsUUID)public void onRestoreFromCache()
I_CmsCachableApponRestoreFromCache in interface I_CmsCachableAppI_CmsCachableApp.onRestoreFromCache()public void onSiteOrProjectChange(CmsProject project, java.lang.String siteRoot)
project - the projectsiteRoot - the site rootpublic void onStateChange(java.lang.String state)
I_CmsWorkplaceApponStateChange in interface I_CmsWorkplaceAppstate - the app state to showI_CmsWorkplaceApp.onStateChange(java.lang.String)public void onWindowClose()
I_CmsWindowCloseListeneronWindowClose in interface I_CmsWindowCloseListenerI_CmsWindowCloseListener.onWindowClose()public void populateFileTable(java.lang.String sitePath)
sitePath - a folder site pathpublic void update(java.util.Collection<CmsUUID> ids)
ids - the ids of the table entries to updatepublic void updateAll(boolean clearFilter)
clearFilter - true to clear the search filterpublic void updateResourceInTree(CmsObject cms, CmsUUID id)
cms - the cms contextid - the item idpublic void updateTree(CmsUUID id)
id - theprotected void clearTreeLevel(CmsUUID parentId)
parentId - the parent idprotected void readFolder(CmsUUID folderId) throws CmsException
folderId - the folder idCmsException - in case reading the folder failsprotected void readFolder(CmsUUID folderId, boolean clearFilter) throws CmsException
folderId - the folder idclearFilter - true to clear the search filterCmsException - in case reading the folder failsprotected void updateCurrentFolder(java.util.Collection<CmsUUID> removeIds)
removeIds - the resource item ids to remove