Package org.opencms.ui.apps
Class CmsFileExplorer
java.lang.Object
org.opencms.ui.apps.CmsFileExplorer
- All Implemented Interfaces:
com.vaadin.navigator.ViewChangeListener
,Serializable
,I_CmsCachableApp
,I_CmsContextProvider
,I_CmsHasShortcutActions
,I_CmsWorkplaceApp
,CmsFileTable.I_FolderSelectHandler
,I_CmsWindowCloseListener
public class CmsFileExplorer
extends Object
implements I_CmsWorkplaceApp, I_CmsCachableApp, com.vaadin.navigator.ViewChangeListener, I_CmsWindowCloseListener, I_CmsHasShortcutActions, I_CmsContextProvider, CmsFileTable.I_FolderSelectHandler
The file explorer app.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
The drop handler for copy/move operations.class
File tree expand listener.Nested classes/interfaces inherited from interface com.vaadin.navigator.ViewChangeListener
com.vaadin.navigator.ViewChangeListener.ViewChangeEvent
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The file explorer attribute key.static final Collection<CmsResourceTableProperty>
The in line editable resource properties.static final int
The initial split position between folder tree and file table.protected I_CmsAppUIContext
The UI context.protected String
Saved explorer state used by dialogs after they have finished.static final String
The opened paths session attribute name.static final String
Site selector caption property.static final String
Site selector site root property.static final int
Threshold for updating the complete folder after file changes. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterViewChange
(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) boolean
beforeViewChange
(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) void
changeSite
(String siteRoot, String path) Changes to the given site and path.void
changeSite
(String siteRoot, String path, boolean force) Switches to the requested site.void
Clears the file table selection.protected void
clearTreeLevel
(CmsUUID parentId) Clears the given tree level.Gets all ids of resources in current folder.Returns the current folder id.Returns the dialog context for dialogs opened from the context menu.Returns the shortcut actions.void
initUI
(I_CmsAppUIContext context) Within this method the app UI should be initialized.boolean
Returns whether this app should be cached within the user session.void
onFolderSelect
(CmsUUID itemId) Called when the folder name is left clicked.void
Called after the view is fetched from the cache.void
onSiteOrProjectChange
(CmsProject project, String siteRoot) Call if site and or project have been changed.void
onStateChange
(String state) Called on navigation events.void
Executed on window close.void
populateFileTable
(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
(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
(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.
-
Field Details
-
ATTR_KEY
The file explorer attribute key.- See Also:
-
INLINE_EDIT_PROPERTIES
The in line editable resource properties. -
LAYOUT_SPLIT_POSITION
The initial split position between folder tree and file table.- See Also:
-
OPENED_PATHS
The opened paths session attribute name.- See Also:
-
SITE_CAPTION
Site selector caption property.- See Also:
-
SITE_ROOT
Site selector site root property.- See Also:
-
UPDATE_FOLDER_THRESHOLD
Threshold for updating the complete folder after file changes.- See Also:
-
m_appContext
The UI context. -
m_savedExplorerState
Saved explorer state used by dialogs after they have finished.
-
-
Constructor Details
-
CmsFileExplorer
public CmsFileExplorer()Constructor.
-
-
Method Details
-
changeSite
Changes to the given site and path.- Parameters:
siteRoot
- the site rootpath
- the path inside the site
-
changeSite
Switches to the requested site.- Parameters:
siteRoot
- the site rootpath
- the folder path to openforce
- force the path change, even if we are currently in the same site
-
clearSelection
Clears the file table selection. -
getAllIds
Gets all ids of resources in current folder.- Returns:
- the
-
getCurrentFolder
Returns the current folder id.- Returns:
- the current folder structure id
-
getDialogContext
Description copied from interface:I_CmsContextProvider
Returns the dialog context for dialogs opened from the context menu.- Specified by:
getDialogContext
in interfaceI_CmsContextProvider
- Returns:
- the dialog context
- See Also:
-
getShortcutActions
Description copied from interface:I_CmsHasShortcutActions
Returns the shortcut actions.- Specified by:
getShortcutActions
in interfaceI_CmsHasShortcutActions
- Returns:
- the shortcut actions
- See Also:
-
initUI
Description copied from interface:I_CmsWorkplaceApp
Within this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUI
in interfaceI_CmsWorkplaceApp
- Parameters:
context
- the UI context- See Also:
-
isCachable
Description copied from interface:I_CmsCachableApp
Returns whether this app should be cached within the user session.- Specified by:
isCachable
in interfaceI_CmsCachableApp
- Returns:
true
if the app is cachable- See Also:
-
onFolderSelect
Description copied from interface:CmsFileTable.I_FolderSelectHandler
Called when the folder name is left clicked.- Specified by:
onFolderSelect
in interfaceCmsFileTable.I_FolderSelectHandler
- Parameters:
itemId
- the selected folder id- See Also:
-
onRestoreFromCache
Description copied from interface:I_CmsCachableApp
Called after the view is fetched from the cache.- Specified by:
onRestoreFromCache
in interfaceI_CmsCachableApp
- See Also:
-
onSiteOrProjectChange
Call if site and or project have been changed.- Parameters:
project
- the projectsiteRoot
- the site root
-
onStateChange
Description copied from interface:I_CmsWorkplaceApp
Called on navigation events.- Specified by:
onStateChange
in interfaceI_CmsWorkplaceApp
- Parameters:
state
- the app state to show- See Also:
-
onWindowClose
Description copied from interface:I_CmsWindowCloseListener
Executed on window close.- Specified by:
onWindowClose
in interfaceI_CmsWindowCloseListener
- See Also:
-
populateFileTable
Fills the file table with the resources from the given path.- Parameters:
sitePath
- a folder site path
-
update
Updates the table entries with the given ids.- Parameters:
ids
- the ids of the table entries to update
-
updateAll
Updates display for all contents of the current folder.- Parameters:
clearFilter
-true
to clear the search filter
-
updateResourceInTree
Updates the give tree item.- Parameters:
cms
- the cms contextid
- the item id
-
updateTree
Updates the tree items with the given ids.- Parameters:
id
- the
-
clearTreeLevel
Clears the given tree level.- Parameters:
parentId
- the parent id
-
readFolder
Reads the given folder.- Parameters:
folderId
- the folder id- Throws:
CmsException
- in case reading the folder fails
-
readFolder
Reads the given folder.- Parameters:
folderId
- the folder idclearFilter
-true
to clear the search filter- Throws:
CmsException
- in case reading the folder fails
-
updateCurrentFolder
Updates the current folder and removes the given resource items.- Parameters:
removeIds
- the resource item ids to remove