Package org.opencms.ade.sitemap.client
Class CmsSitemapView
- java.lang.Object
-
- org.opencms.gwt.client.A_CmsEntryPoint
-
- org.opencms.ade.sitemap.client.CmsSitemapView
-
- All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint
,com.google.gwt.event.shared.EventHandler
,I_CmsSitemapChangeHandler
,I_CmsSitemapLoadHandler
public final class CmsSitemapView extends A_CmsEntryPoint implements I_CmsSitemapChangeHandler, I_CmsSitemapLoadHandler
Sitemap editor.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CmsSitemapView.TreeOpenHandler
The sitemap tree open handler.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DOWNLOAD_GALLERY_TYPE
The download gallery type name.static java.lang.String
IMAGE_GALLERY_TYPE
The image gallery type name.protected CmsLazyTree<CmsSitemapTreeItem>
m_tree
The displayed sitemap tree.
-
Constructor Summary
Constructors Constructor Description CmsSitemapView()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsSitemapTreeItem
create(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Creates a new tree item from the given sitemap entry.CmsSitemapTreeItem
createSitemapItem(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Creates a sitemap tree item from a client sitemap entry.void
displayCategoryData(org.opencms.ade.sitemap.shared.CmsSitemapCategoryData categoryData, boolean openLocalCategories, org.opencms.util.CmsUUID openItemId)
Displays the category data.void
displayGalleries(java.util.Map<org.opencms.ade.sitemap.shared.CmsGalleryType,java.util.List<org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry>> galleries)
Displays the gallery view.void
displayModelPages(org.opencms.ade.sitemap.shared.CmsModelInfo modelPageData)
Displays the model page data in a tree.void
displayNewGallery(org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry galleryFolder)
Displays a newly created gallery folder.void
displayNewModelPage(org.opencms.ade.sitemap.shared.CmsModelPageEntry modelPageData, boolean isModelGroup)
Adds a new model page to the model page view.protected void
ensureEntriesLoaded(CmsGalleryTreeItem parent)
Makes sure corresponding sitemap entries are loaded when the gallery tree is opened.void
ensureVisible(CmsSitemapTreeItem item)
Ensures the given item is visible in the viewport.CmsSitemapController
getController()
Returns the controller.org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode
getEditorMode()
Returns the editor mode.java.lang.String
getIconForEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Returns the icon class for the given entry depending on the editor mode.static CmsSitemapView
getInstance()
Returns the instance.org.opencms.ade.sitemap.shared.CmsModelPageEntry
getModelPageEntry(org.opencms.util.CmsUUID id)
Gets the model page bean with the given structure id.org.opencms.util.CmsPair<java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>,java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>>
getOpenAndClosedDescendants(java.lang.String path)
Gets the list of descendants of a path and splits it into two lists, one containing the sitemap entries whose children have already been loaded, and those whose children haven't been loaded.protected CmsSitemapTreeItem
getRootItem()
Gets the sitemap tree item widget which represents the root of the current sitemap.CmsSitemapToolbar
getToolbar()
Gets the sitemap toolbar.CmsLazyTree<CmsSitemapTreeItem>
getTree()
Returns the tree.CmsSitemapTreeItem
getTreeItem(java.lang.String path)
Returns the tree entry with the given path.CmsSitemapTreeItem
getTreeItem(org.opencms.util.CmsUUID entryId)
Returns the tree entry with the given path.void
highlightPath(java.lang.String sitePath)
Highlights the sitemap entry with the given path.boolean
isDisabledModelPageEntry(org.opencms.util.CmsUUID id)
Returns the disabled state of the given model page entry.boolean
isGalleryMode()
Returns if the current sitemap editor mode is galleries.boolean
isModelGroupEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a model group page.boolean
isModelPageEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a template model page.boolean
isModelPageMode()
Checks if the sitemap editor is in 'model page mode'.boolean
isNavigationMode()
Returns if the current sitemap editor mode is navigation.boolean
isParentModelPageEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a template model page inherited from the parent configuration.boolean
isSpecialMode()
Returns true if we are not currently displaying the navigation or VFS tree.void
onBeforeSetEditorMode(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode mode)
Performs necessary async actions before actually setting the mode.void
onChange(CmsSitemapChangeEvent changeEvent)
Will be triggered when something has changed.void
onLoad(CmsSitemapLoadEvent event)
Will be triggered when an entry loads its children.void
onModuleLoad()
void
removeDeleted(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Removes deleted entry widget reference.protected void
setCategoriesVisible(boolean visible)
Shows/hides the category view.void
setEditorMode(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode)
Sets the editor mode.protected void
setElementVisible(com.google.gwt.user.client.ui.Widget widget, boolean visible)
Shows or hides the element for a widget.protected void
setGalleriesVisible(boolean visible)
Shows or hides the tree for the gallery mode.void
setHeaderVisible(boolean visible)
Sets the visibility of the normal siteamp header (the header can be hidden so that the Vaadin code can display its own header).protected void
setModelPagesVisible(boolean visible)
Shows or hides the tree for the model page mode.void
updateDetailPageView(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Updates the detail page view for a given changed entry.void
updateEntriesById(java.util.Collection<org.opencms.util.CmsUUID> ids)
Updates the entries whose id is in the given list of ids.void
updateModelPageDisabledState(org.opencms.util.CmsUUID entryId, boolean disabled)
Updates the disabled state for the given model page.-
Methods inherited from class org.opencms.gwt.client.A_CmsEntryPoint
enableRemoteExceptionHandler
-
-
-
-
Field Detail
-
DOWNLOAD_GALLERY_TYPE
public static final java.lang.String DOWNLOAD_GALLERY_TYPE
The download gallery type name.- See Also:
- Constant Field Values
-
IMAGE_GALLERY_TYPE
public static final java.lang.String IMAGE_GALLERY_TYPE
The image gallery type name.- See Also:
- Constant Field Values
-
m_tree
protected CmsLazyTree<CmsSitemapTreeItem> m_tree
The displayed sitemap tree.
-
-
Constructor Detail
-
CmsSitemapView
public CmsSitemapView()
-
-
Method Detail
-
getInstance
public static CmsSitemapView getInstance()
Returns the instance.- Returns:
- the instance
-
create
public CmsSitemapTreeItem create(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Creates a new tree item from the given sitemap entry.- Parameters:
entry
- the sitemap entry- Returns:
- the new created (still orphan) tree item
-
createSitemapItem
public CmsSitemapTreeItem createSitemapItem(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Creates a sitemap tree item from a client sitemap entry.- Parameters:
entry
- the entry from which the sitemap tree item should be created- Returns:
- the new sitemap tree item
-
displayCategoryData
public void displayCategoryData(org.opencms.ade.sitemap.shared.CmsSitemapCategoryData categoryData, boolean openLocalCategories, org.opencms.util.CmsUUID openItemId)
Displays the category data.- Parameters:
categoryData
- the category dataopenLocalCategories
- true if the local category tree should be openedopenItemId
- the id of the item to open
-
displayGalleries
public void displayGalleries(java.util.Map<org.opencms.ade.sitemap.shared.CmsGalleryType,java.util.List<org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry>> galleries)
Displays the gallery view.- Parameters:
galleries
- the gallery data
-
displayModelPages
public void displayModelPages(org.opencms.ade.sitemap.shared.CmsModelInfo modelPageData)
Displays the model page data in a tree.- Parameters:
modelPageData
- the model page data
-
displayNewGallery
public void displayNewGallery(org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry galleryFolder)
Displays a newly created gallery folder.- Parameters:
galleryFolder
- the gallery folder
-
displayNewModelPage
public void displayNewModelPage(org.opencms.ade.sitemap.shared.CmsModelPageEntry modelPageData, boolean isModelGroup)
Adds a new model page to the model page view.- Parameters:
modelPageData
- the data for the new model pageisModelGroup
- in case of a model group page
-
ensureVisible
public void ensureVisible(CmsSitemapTreeItem item)
Ensures the given item is visible in the viewport.- Parameters:
item
- the item to see
-
getController
public CmsSitemapController getController()
Returns the controller.- Returns:
- the controller
-
getEditorMode
public org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode getEditorMode()
Returns the editor mode.- Returns:
- the editor mode
-
getIconForEntry
public java.lang.String getIconForEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Returns the icon class for the given entry depending on the editor mode.- Parameters:
entry
- the entry to get the icon for- Returns:
- the icon CSS class
-
getModelPageEntry
public org.opencms.ade.sitemap.shared.CmsModelPageEntry getModelPageEntry(org.opencms.util.CmsUUID id)
Gets the model page bean with the given structure id.- Parameters:
id
- a structure id- Returns:
- the model page bean with the given id
-
getOpenAndClosedDescendants
public org.opencms.util.CmsPair<java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>,java.util.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>> getOpenAndClosedDescendants(java.lang.String path)
Gets the list of descendants of a path and splits it into two lists, one containing the sitemap entries whose children have already been loaded, and those whose children haven't been loaded.- Parameters:
path
- the path for which the open and closed descendants should be returned- Returns:
- a pair whose first and second components are lists of open and closed descendant entries of the path, respectively
-
getToolbar
public CmsSitemapToolbar getToolbar()
Gets the sitemap toolbar.- Returns:
- the sitemap toolbar
-
getTree
public CmsLazyTree<CmsSitemapTreeItem> getTree()
Returns the tree.- Returns:
- the tree
-
getTreeItem
public CmsSitemapTreeItem getTreeItem(org.opencms.util.CmsUUID entryId)
Returns the tree entry with the given path.- Parameters:
entryId
- the id of the sitemap entry- Returns:
- the tree entry with the given path, or
null
if not found
-
getTreeItem
public CmsSitemapTreeItem getTreeItem(java.lang.String path)
Returns the tree entry with the given path.- Parameters:
path
- the path to look for- Returns:
- the tree entry with the given path, or
null
if not found
-
highlightPath
public void highlightPath(java.lang.String sitePath)
Highlights the sitemap entry with the given path.- Parameters:
sitePath
- the sitemap path of the entry to highlight
-
isDisabledModelPageEntry
public boolean isDisabledModelPageEntry(org.opencms.util.CmsUUID id)
Returns the disabled state of the given model page entry.- Parameters:
id
- the entry id- Returns:
- the disabled state
-
isGalleryMode
public boolean isGalleryMode()
Returns if the current sitemap editor mode is galleries.- Returns:
true
if the current sitemap editor mode is galleries
-
isModelGroupEntry
public boolean isModelGroupEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a model group page.- Parameters:
entryId
- the entry id- Returns:
true
if the given entry is a model group page
-
isModelPageEntry
public boolean isModelPageEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a template model page.- Parameters:
entryId
- the entry id- Returns:
true
if the given entry is a template model page
-
isModelPageMode
public boolean isModelPageMode()
Checks if the sitemap editor is in 'model page mode'.- Returns:
- true if we are in model page view
-
isNavigationMode
public boolean isNavigationMode()
Returns if the current sitemap editor mode is navigation.- Returns:
true
if the current sitemap editor mode is navigation
-
isParentModelPageEntry
public boolean isParentModelPageEntry(org.opencms.util.CmsUUID entryId)
Returns if the given entry is a template model page inherited from the parent configuration.- Parameters:
entryId
- the entry id- Returns:
true
if the given entry is a template model page
-
isSpecialMode
public boolean isSpecialMode()
Returns true if we are not currently displaying the navigation or VFS tree.- Returns:
- true if we are not currently in navigation or VFS mode
-
onBeforeSetEditorMode
public void onBeforeSetEditorMode(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode mode)
Performs necessary async actions before actually setting the mode.- Parameters:
mode
- the mode
-
onChange
public void onChange(CmsSitemapChangeEvent changeEvent)
Description copied from interface:I_CmsSitemapChangeHandler
Will be triggered when something has changed.- Specified by:
onChange
in interfaceI_CmsSitemapChangeHandler
- Parameters:
changeEvent
- the specific change event- See Also:
I_CmsSitemapChangeHandler.onChange(org.opencms.ade.sitemap.client.control.CmsSitemapChangeEvent)
-
onLoad
public void onLoad(CmsSitemapLoadEvent event)
Description copied from interface:I_CmsSitemapLoadHandler
Will be triggered when an entry loads its children.- Specified by:
onLoad
in interfaceI_CmsSitemapLoadHandler
- Parameters:
event
- the event- See Also:
I_CmsSitemapLoadHandler.onLoad(org.opencms.ade.sitemap.client.control.CmsSitemapLoadEvent)
-
onModuleLoad
public void onModuleLoad()
- Specified by:
onModuleLoad
in interfacecom.google.gwt.core.client.EntryPoint
- Overrides:
onModuleLoad
in classA_CmsEntryPoint
- See Also:
EntryPoint.onModuleLoad()
-
removeDeleted
public void removeDeleted(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Removes deleted entry widget reference.- Parameters:
entry
- the entry being deleted
-
setEditorMode
public void setEditorMode(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode)
Sets the editor mode.- Parameters:
editorMode
- the editor mode to set
-
setHeaderVisible
public void setHeaderVisible(boolean visible)
Sets the visibility of the normal siteamp header (the header can be hidden so that the Vaadin code can display its own header).- Parameters:
visible
- true if the normal header should be visible
-
updateDetailPageView
public void updateDetailPageView(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
Updates the detail page view for a given changed entry.- Parameters:
entry
- the entry which was changed
-
updateEntriesById
public void updateEntriesById(java.util.Collection<org.opencms.util.CmsUUID> ids)
Updates the entries whose id is in the given list of ids.- Parameters:
ids
- a list of sitemap entry ids
-
updateModelPageDisabledState
public void updateModelPageDisabledState(org.opencms.util.CmsUUID entryId, boolean disabled)
Updates the disabled state for the given model page.- Parameters:
entryId
- the model page iddisabled
- the disabled state
-
ensureEntriesLoaded
protected void ensureEntriesLoaded(CmsGalleryTreeItem parent)
Makes sure corresponding sitemap entries are loaded when the gallery tree is opened.- Parameters:
parent
- the parent gallery tree item
-
getRootItem
protected CmsSitemapTreeItem getRootItem()
Gets the sitemap tree item widget which represents the root of the current sitemap.- Returns:
- the root sitemap tree item widget
-
setCategoriesVisible
protected void setCategoriesVisible(boolean visible)
Shows/hides the category view.- Parameters:
visible
- true if the categories should be made visible
-
setElementVisible
protected void setElementVisible(com.google.gwt.user.client.ui.Widget widget, boolean visible)
Shows or hides the element for a widget.- Parameters:
widget
- the widget to show or hidevisible
- true if the widget should be shown
-
setGalleriesVisible
protected void setGalleriesVisible(boolean visible)
Shows or hides the tree for the gallery mode.- Parameters:
visible
- true if the tree should be shown
-
setModelPagesVisible
protected void setModelPagesVisible(boolean visible)
Shows or hides the tree for the model page mode.- Parameters:
visible
- true if the model pages should be shown
-
-