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,CmsResourceTable.ColumnSettingChangeHandler,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, CmsResourceTable.ColumnSettingChangeHandler
The file explorer app.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThe drop handler for copy/move operations.classFile tree expand listener.Nested classes/interfaces inherited from interface com.vaadin.navigator.ViewChangeListener
com.vaadin.navigator.ViewChangeListener.ViewChangeEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe file explorer attribute key.static final Collection<CmsResourceTableProperty> The in line editable resource properties.static final intThe initial split position between folder tree and file table.protected I_CmsAppUIContextThe UI context.protected StringSaved explorer state used by dialogs after they have finished.static final StringThe opened paths session attribute name.static final StringSite selector caption property.static final StringSite selector site root property.static final intThreshold for updating the complete folder after file changes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) booleanbeforeViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) voidchangeSite(String siteRoot, String path) Changes to the given site and path.voidchangeSite(String siteRoot, String path, boolean force) Switches to the requested site.voidClears the file table selection.protected voidclearTreeLevel(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.voidinitUI(I_CmsAppUIContext context) Within this method the app UI should be initialized.booleanReturns whether this app should be cached within the user session.voidCalled when column visibility or sorting is changed by the user.voidonFolderSelect(CmsUUID itemId) Called when the folder name is left clicked.voidCalled after the view is fetched from the cache.voidonSiteOrProjectChange(CmsProject project, String siteRoot) Call if site and or project have been changed.voidonStateChange(String state) Called on navigation events.voidExecuted on window close.voidpopulateFileTable(String sitePath) Fills the file table with the resources from the given path.protected voidreadFolder(CmsUUID folderId) Reads the given folder.protected voidreadFolder(CmsUUID folderId, boolean clearFilter) Reads the given folder.voidupdate(Collection<CmsUUID> ids) Updates the table entries with the given ids.voidupdateAll(boolean clearFilter) Updates display for all contents of the current folder.protected voidupdateCurrentFolder(Collection<CmsUUID> removeIds) Updates the current folder and removes the given resource items.voidupdateResourceInTree(CmsObject cms, CmsUUID id) Updates the give tree item.voidupdateTree(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_CmsContextProviderReturns the dialog context for dialogs opened from the context menu.- Specified by:
getDialogContextin interfaceI_CmsContextProvider- Returns:
- the dialog context
- See Also:
-
getShortcutActions
Description copied from interface:I_CmsHasShortcutActionsReturns the shortcut actions.- Specified by:
getShortcutActionsin interfaceI_CmsHasShortcutActions- Returns:
- the shortcut actions
- See Also:
-
initUI
Description copied from interface:I_CmsWorkplaceAppWithin this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUIin interfaceI_CmsWorkplaceApp- Parameters:
context- the UI context- See Also:
-
isCachable
Description copied from interface:I_CmsCachableAppReturns whether this app should be cached within the user session.- Specified by:
isCachablein interfaceI_CmsCachableApp- Returns:
trueif the app is cachable- See Also:
-
onColumnSettingsChanged
Description copied from interface:CmsResourceTable.ColumnSettingChangeHandlerCalled when column visibility or sorting is changed by the user.- Specified by:
onColumnSettingsChangedin interfaceCmsResourceTable.ColumnSettingChangeHandler- See Also:
-
onFolderSelect
Description copied from interface:CmsFileTable.I_FolderSelectHandlerCalled when the folder name is left clicked.- Specified by:
onFolderSelectin interfaceCmsFileTable.I_FolderSelectHandler- Parameters:
itemId- the selected folder id- See Also:
-
onRestoreFromCache
Description copied from interface:I_CmsCachableAppCalled after the view is fetched from the cache.- Specified by:
onRestoreFromCachein 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_CmsWorkplaceAppCalled on navigation events.- Specified by:
onStateChangein interfaceI_CmsWorkplaceApp- Parameters:
state- the app state to show- See Also:
-
onWindowClose
Description copied from interface:I_CmsWindowCloseListenerExecuted on window close.- Specified by:
onWindowClosein 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-trueto 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-trueto 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