public class CmsSitemapController extends java.lang.Object implements I_CmsSitemapController
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Map<CmsUUID,CmsDetailPageInfo> |
m_allDetailPageInfos
A map of *all* detail page info beans, indexed by page id.
|
protected CmsSitemapData |
m_data
The sitemap data.
|
protected CmsDetailPageTable |
m_detailPageTable
The detail page table.
|
protected com.google.gwt.event.shared.SimpleEventBus |
m_eventBus
The event bus.
|
static java.lang.String |
NEW_ENTRY_NAME
The name to use for new entries.
|
构造器和说明 |
---|
CmsSitemapController()
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addChangeHandler(I_CmsSitemapChangeHandler handler)
Adds a new change event handler.
|
void |
addDetailPageInfo(CmsDetailPageInfo info)
Adds a new detail page information bean.
|
com.google.gwt.event.shared.HandlerRegistration |
addLoadHandler(I_CmsSitemapLoadHandler handler)
Adds a new load event handler.
|
void |
addPropertyUpdateHandler(I_CmsPropertyUpdateHandler handler)
Adds a handler for property changes caused by user edits.
|
void |
addToNavigation(CmsClientSitemapEntry entry)
Adds the entry to the navigation.
|
protected void |
applyChange(CmsSitemapChange change)
Fires a sitemap change event.
|
void |
bump(CmsClientSitemapEntry entry)
Makes the given sitemap entry the default detail page for its detail page type.
|
void |
clearDeletedList()
Clears the deleted clip-board list and commits the change.
|
void |
clearModifiedList()
Clears the modified clip-board list and commits the change.
|
protected void |
commitChange(CmsSitemapChange change,
com.google.gwt.user.client.Command callback)
Adds a change to the queue.
|
void |
create(CmsClientSitemapEntry newEntry,
CmsUUID parentId,
int resourceTypeId,
CmsUUID copyResourceId,
java.lang.String parameter,
boolean isNewSitemap)
Registers a new sitemap entry.
|
void |
createSitemapSubEntry(CmsClientSitemapEntry newEntry,
CmsUUID parentId,
java.lang.String sitemapType)
Creates a sitemap folder.
|
void |
createSitemapSubEntry(CmsClientSitemapEntry parent,
java.lang.String sitemapFolderType)
Creates a new sub-entry which is a subsitemap.
|
void |
createSubEntry(CmsClientSitemapEntry parent)
Creates a new sub-entry of an existing sitemap entry.
|
void |
createSubEntry(CmsClientSitemapEntry parent,
CmsUUID structureId)
Creates a new sub-entry of an existing sitemap entry.
|
void |
createSubEntry(CmsClientSitemapEntry newEntry,
CmsUUID parentId,
CmsUUID structureId)
Registers a new sitemap entry.
|
void |
createSubSitemap(CmsUUID entryId)
Creates a sub-sitemap from the subtree of the current sitemap starting at the given entry.
|
void |
delete(java.lang.String sitePath)
Deletes the given entry and all its descendants.
|
void |
edit(CmsClientSitemapEntry entry,
java.util.List<CmsPropertyModification> propertyChanges,
CmsReloadMode reloadStatus)
Edits the given sitemap entry.
|
void |
editAndChangeName(CmsClientSitemapEntry entry,
java.lang.String newUrlName,
java.util.List<CmsPropertyModification> propertyChanges,
boolean keepNewStatus,
CmsReloadMode reloadStatus)
Edits an entry and changes its URL name.
|
java.lang.String |
ensureUniqueName(CmsClientSitemapEntry parent,
java.lang.String newName)
Ensure the uniqueness of a given URL-name within the children of the given parent site-map entry.
|
java.lang.String |
ensureUniqueName(java.lang.String parentFolder,
java.lang.String newName)
Ensure the uniqueness of a given URL-name within the children of the given parent folder.
|
void |
executePropertyModification(CmsPropertyModification propMod)
Applies the given property modification.
|
protected CmsSitemapChange |
getChangeForEdit(CmsClientSitemapEntry entry,
java.util.List<CmsPropertyModification> propertyChanges)
Creates a change object for an edit operation.
|
void |
getChildren(CmsUUID entryId,
boolean setOpen,
com.google.gwt.user.client.rpc.AsyncCallback<CmsClientSitemapEntry> callback)
Retrieves the child entries of the given node from the server.
|
CmsSitemapData |
getData()
Returns the sitemap data.
|
CmsDetailPageInfo |
getDetailPageInfo(CmsUUID id)
Returns the detail page info for a given entry id.
|
CmsDetailPageTable |
getDetailPageTable()
Returns the detail page table.
|
java.lang.String |
getEffectiveProperty(CmsClientSitemapEntry entry,
java.lang.String name)
Gets the effective value of a property value for a sitemap entry.
|
CmsClientProperty |
getEffectivePropertyObject(CmsClientSitemapEntry entry,
java.lang.String name)
Gets the value of a property which is effective at a given sitemap entry.
|
java.util.Map<CmsUUID,CmsClientSitemapEntry> |
getEntriesById(java.util.Collection<CmsUUID> ids)
Returns all entries with an id from a given list.
|
CmsClientSitemapEntry |
getEntry(java.lang.String entryPath)
Returns the tree entry with the given path.
|
CmsClientSitemapEntry |
getEntryById(CmsUUID id)
Finds an entry by id.
|
protected java.lang.String |
getEntryPoint()
Returns the URI of the current sitemap.
|
java.lang.String |
getInheritedProperty(CmsClientSitemapEntry entry,
java.lang.String name)
Gets the value for a property which a sitemap entry would inherit if it didn't have its own properties.
|
CmsClientProperty |
getInheritedPropertyObject(CmsClientSitemapEntry entry,
java.lang.String name)
Gets the property object which would be inherited by a sitemap entry.
|
java.util.List<CmsClientSitemapEntry> |
getLoadedDescendants(java.lang.String path)
Returns a list of all descendant sitemap entries of a given path which have already been loaded on the client.
|
java.lang.String |
getNoEditReason(CmsClientSitemapEntry entry)
Returns the no edit reason or
null if editing is allowed. |
CmsClientSitemapEntry |
getParentEntry(CmsClientSitemapEntry entry)
Returns the parent entry of a sitemap entry, or null if it is the root entry.
|
protected java.lang.String |
getPath(CmsClientSitemapEntry entry,
java.lang.String newUrlName)
Helper method for getting the full path of a sitemap entry whose URL name is being edited.
|
java.util.Map<java.lang.String,CmsClientProperty> |
getPropertiesForId(CmsUUID id)
Gets the properties for a given structure id.
|
I_CmsSitemapServiceAsync |
getService()
Returns the sitemap service instance.
|
protected I_CmsVfsServiceAsync |
getVfsService()
Returns the sitemap service instance.
|
void |
gotoParentSitemap()
Leaves the current sitemap to open the parent sitemap.
|
void |
hideInNavigation(CmsUUID entryId)
Hides the entry within the site navigation.
|
protected void |
initDetailPageInfos()
Initializes the detail page information.
|
boolean |
isDetailPage(CmsClientSitemapEntry entry)
Checks whether this entry belongs to a detail page.
|
boolean |
isDetailPage(CmsUUID id)
Returns true if the id is the id of a detail page.
|
boolean |
isEditable()
Checks if the current sitemap is editable.
|
boolean |
isHiddenProperty(java.lang.String propertyName)
Checks whether a string is the name of a hidden property.
|
boolean |
isRoot(java.lang.String sitePath)
Checks if the given site path is the sitemap root.
|
void |
leaveEditor(java.lang.String target)
Ask to save the page before leaving, if necessary.
|
protected CmsClientSitemapEntry |
makeNewEntry(CmsClientSitemapEntry parent)
Creates a new client sitemap entry bean to use for the RPC call which actually creates the entry on the server side.
|
void |
mergeSubSitemap(CmsUUID entryId)
Merges a subsitemap at the given id back into this sitemap.
|
void |
move(CmsClientSitemapEntry entry,
java.lang.String toPath,
int position)
Moves the given sitemap entry with all its descendants to the new position.
|
void |
openSiteMap(java.lang.String sitePath)
Opens the site-map specified.
|
void |
recomputeProperties()
Recomputes properties for all sitemap entries.
|
protected void |
recomputeProperties(CmsClientSitemapEntry entry)
Recomputes the properties for a client sitemap entry.
|
void |
registerEntry(CmsClientSitemapEntry entry)
Registers the given entry within the data model.
|
void |
registerPathChange(CmsClientSitemapEntry entry,
java.lang.String oldPath)
Registers the change of the sitepath with the given controller.
|
void |
removeFromNavigation(CmsUUID entryId)
Removes the entry with the given site-path from navigation.
|
java.util.Map<java.lang.String,CmsClientProperty> |
replaceProperties(CmsUUID id,
java.util.Map<java.lang.String,CmsClientProperty> properties)
This method is used to establish a unique property map object for each id, but replaces the contents of the
map object with new values for each call.
|
static <A,B> B |
safeLookup(java.util.Map<A,B> map,
A key)
Helper method for looking up a value in a map which may be null.
|
void |
showInNavigation(CmsUUID entryId)
Shows a formerly hidden entry in the navigation.
|
void |
undelete(CmsUUID entryId,
java.lang.String sitePath)
Undeletes the resource with the given structure id.
|
void |
updateEntry(CmsUUID entryId)
Updates the given entry.
|
void |
updateEntry(java.lang.String sitePath)
Updates the given entry.
|
void |
updateSingleEntry(CmsUUID entryId)
Updates the given entry only, not evaluating any child changes.
|
public static final java.lang.String NEW_ENTRY_NAME
protected java.util.Map<CmsUUID,CmsDetailPageInfo> m_allDetailPageInfos
protected CmsSitemapData m_data
protected CmsDetailPageTable m_detailPageTable
protected com.google.gwt.event.shared.SimpleEventBus m_eventBus
public static <A,B> B safeLookup(java.util.Map<A,B> map, A key)
A
- the key typeB
- the value typemap
- the map (which may be null)key
- the map keypublic com.google.gwt.event.shared.HandlerRegistration addChangeHandler(I_CmsSitemapChangeHandler handler)
handler
- the handler to addpublic void addDetailPageInfo(CmsDetailPageInfo info)
info
- the detail page information bean to addpublic com.google.gwt.event.shared.HandlerRegistration addLoadHandler(I_CmsSitemapLoadHandler handler)
handler
- the handler to addpublic void addPropertyUpdateHandler(I_CmsPropertyUpdateHandler handler)
handler
- a new handler for property updates caused by the userpublic void addToNavigation(CmsClientSitemapEntry entry)
entry
- the entrypublic void bump(CmsClientSitemapEntry entry)
entry
- an entry representing a detail pagepublic void clearDeletedList()
public void clearModifiedList()
public void create(CmsClientSitemapEntry newEntry, CmsUUID parentId, int resourceTypeId, CmsUUID copyResourceId, java.lang.String parameter, boolean isNewSitemap)
newEntry
- the new entryparentId
- the parent entry idresourceTypeId
- the resource type idcopyResourceId
- the copy resource idparameter
- an additional parameter which may contain more information needed to create the new resourceisNewSitemap
- a flag controlling whether a new sitemap should be createdpublic void createSitemapSubEntry(CmsClientSitemapEntry newEntry, CmsUUID parentId, java.lang.String sitemapType)
newEntry
- the new entryparentId
- the entry parent idsitemapType
- the resource type for the subsitemap folderpublic void createSitemapSubEntry(CmsClientSitemapEntry parent, java.lang.String sitemapFolderType)
parent
- the parent entrysitemapFolderType
- the sitemap folder typepublic void createSubEntry(CmsClientSitemapEntry parent)
parent
- the entry to which a new sub-entry should be addedpublic void createSubEntry(CmsClientSitemapEntry parent, CmsUUID structureId)
parent
- the entry to which a new sub-entry should be addedstructureId
- the structure id of the model page (if null, uses default model page)public void createSubEntry(CmsClientSitemapEntry newEntry, CmsUUID parentId, CmsUUID structureId)
newEntry
- the new entryparentId
- the parent entry idstructureId
- the structure id of the model page (if null, uses default model page)public void createSubSitemap(CmsUUID entryId)
entryId
- the id of the entrypublic void delete(java.lang.String sitePath)
sitePath
- the site path of the entry to deletepublic void edit(CmsClientSitemapEntry entry, java.util.List<CmsPropertyModification> propertyChanges, CmsReloadMode reloadStatus)
entry
- the sitemap entry to updatepropertyChanges
- the property changesreloadStatus
- a value indicating which entries need to be reloaded after the changepublic void editAndChangeName(CmsClientSitemapEntry entry, java.lang.String newUrlName, java.util.List<CmsPropertyModification> propertyChanges, boolean keepNewStatus, CmsReloadMode reloadStatus)
entry
- the entry which is being editednewUrlName
- the new URL name of the entrypropertyChanges
- the property changeskeepNewStatus
- true
if the entry should keep it's new statusreloadStatus
- a value indicating which entries need to be reloaded after the changepublic java.lang.String ensureUniqueName(CmsClientSitemapEntry parent, java.lang.String newName)
parent
- the parent entrynewName
- the proposed namepublic java.lang.String ensureUniqueName(java.lang.String parentFolder, java.lang.String newName)
parentFolder
- the parent foldernewName
- the proposed namepublic void executePropertyModification(CmsPropertyModification propMod)
propMod
- the property modification to applypublic void getChildren(CmsUUID entryId, boolean setOpen, com.google.gwt.user.client.rpc.AsyncCallback<CmsClientSitemapEntry> callback)
entryId
- the entry idsetOpen
- if the entry should be openedcallback
- the callback to execute after the children have been loadedpublic CmsSitemapData getData()
public CmsDetailPageInfo getDetailPageInfo(CmsUUID id)
id
- a sitemap entry idpublic CmsDetailPageTable getDetailPageTable()
public java.lang.String getEffectiveProperty(CmsClientSitemapEntry entry, java.lang.String name)
entry
- the sitemap entryname
- the name of the propertypublic CmsClientProperty getEffectivePropertyObject(CmsClientSitemapEntry entry, java.lang.String name)
entry
- the sitemap entryname
- the name of the propertypublic java.util.Map<CmsUUID,CmsClientSitemapEntry> getEntriesById(java.util.Collection<CmsUUID> ids)
ids
- a list of sitemap entry idspublic CmsClientSitemapEntry getEntry(java.lang.String entryPath)
entryPath
- the path to look fornull
if not foundpublic CmsClientSitemapEntry getEntryById(CmsUUID id)
id
- the id of the entry to findpublic java.lang.String getInheritedProperty(CmsClientSitemapEntry entry, java.lang.String name)
entry
- the sitemap entryname
- the property namepublic CmsClientProperty getInheritedPropertyObject(CmsClientSitemapEntry entry, java.lang.String name)
entry
- the sitemap entryname
- the name of the propertypublic java.util.List<CmsClientSitemapEntry> getLoadedDescendants(java.lang.String path)
path
- the path for which the descendants should be collectedpublic java.lang.String getNoEditReason(CmsClientSitemapEntry entry)
null
if editing is allowed.entry
- the entry to get the no edit reason forpublic CmsClientSitemapEntry getParentEntry(CmsClientSitemapEntry entry)
entry
- a sitemap entrypublic java.util.Map<java.lang.String,CmsClientProperty> getPropertiesForId(CmsUUID id)
getPropertiesForId
在接口中 I_CmsSitemapController
id
- the structure id of a sitemap entrypublic I_CmsSitemapServiceAsync getService()
public void gotoParentSitemap()
public void hideInNavigation(CmsUUID entryId)
Hidden entries will still be visible in the navigation mode of the sitemap editor. They will also have a NavText and a NavPos. Only when using the NavBuilder get navigation for folder method, they will not be included.
entryId
- the entry idpublic boolean isDetailPage(CmsClientSitemapEntry entry)
entry
- the entry to checkpublic boolean isDetailPage(CmsUUID id)
id
- the sitemap entry idpublic boolean isEditable()
true
if the current sitemap is editablepublic boolean isHiddenProperty(java.lang.String propertyName)
A hidden property is a property which should not appear in the property editor because it requires special treatment.
propertyName
- the property name which should be checkedpublic boolean isRoot(java.lang.String sitePath)
sitePath
- the site path to checktrue
if the given site path is the sitemap rootpublic void leaveEditor(java.lang.String target)
target
- the leaving targetpublic void mergeSubSitemap(CmsUUID entryId)
entryId
- the id of the sub sitemap entrypublic void move(CmsClientSitemapEntry entry, java.lang.String toPath, int position)
entry
- the sitemap entry to movetoPath
- the destination pathposition
- the new position between its siblingspublic void openSiteMap(java.lang.String sitePath)
sitePath
- the site path to the site-map folderpublic void recomputeProperties()
public void registerEntry(CmsClientSitemapEntry entry)
I_CmsSitemapController
registerEntry
在接口中 I_CmsSitemapController
entry
- the entry to registerI_CmsSitemapController.registerEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry)
public void registerPathChange(CmsClientSitemapEntry entry, java.lang.String oldPath)
I_CmsSitemapController
registerPathChange
在接口中 I_CmsSitemapController
entry
- the sitemap entryoldPath
- the old pathI_CmsSitemapController.registerPathChange(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry, java.lang.String)
public void removeFromNavigation(CmsUUID entryId)
entryId
- the entry idpublic java.util.Map<java.lang.String,CmsClientProperty> replaceProperties(CmsUUID id, java.util.Map<java.lang.String,CmsClientProperty> properties)
I_CmsSitemapController
The first call to the method with a given id will just return the map passed in. The n-th call to the method with a given id will return the map object passed in with the first method call for that id, but with its contents replaced by the contents of the map passed in with the n-th call for that id.
The purpose of this is to avoid multiple redundant copies of the same logical map of properties being stored in multiple places.
replaceProperties
在接口中 I_CmsSitemapController
id
- the map identifying the resource to which the properties belongproperties
- the new properties for the given idI_CmsSitemapController.replaceProperties(org.opencms.util.CmsUUID, java.util.Map)
public void showInNavigation(CmsUUID entryId)
entryId
- the entry idhideInNavigation(CmsUUID)
public void undelete(CmsUUID entryId, java.lang.String sitePath)
entryId
- the entry idsitePath
- the site-pathpublic void updateEntry(CmsUUID entryId)
entryId
- the entry idpublic void updateEntry(java.lang.String sitePath)
sitePath
- the entry sitepathpublic void updateSingleEntry(CmsUUID entryId)
entryId
- the entry idprotected void applyChange(CmsSitemapChange change)
change
- the change event to fireprotected void commitChange(CmsSitemapChange change, com.google.gwt.user.client.Command callback)
change
- the change to commitcallback
- the callback to execute after the change has been appliedprotected CmsSitemapChange getChangeForEdit(CmsClientSitemapEntry entry, java.util.List<CmsPropertyModification> propertyChanges)
entry
- the edited sitemap entrypropertyChanges
- the list of property changesprotected java.lang.String getEntryPoint()
protected java.lang.String getPath(CmsClientSitemapEntry entry, java.lang.String newUrlName)
entry
- the sitemap entrynewUrlName
- the new url name of the sitemap entryprotected I_CmsVfsServiceAsync getVfsService()
protected void initDetailPageInfos()
protected CmsClientSitemapEntry makeNewEntry(CmsClientSitemapEntry parent)
parent
- the parent entryprotected void recomputeProperties(CmsClientSitemapEntry entry)
entry
- the entry for whose descendants the properties should be recomputed