public final class CmsCoreProvider extends org.opencms.gwt.shared.CmsCoreData
CmsGwtActionElement
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VFS_PATH_SYSTEM
Path to system folder.
|
Modifier | Constructor and Description |
---|---|
protected |
CmsCoreProvider()
Prevent instantiation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addSiteRoot(java.lang.String sitePath)
Adds the current site root of this context to the given resource name.
|
void |
createUUID(com.google.gwt.user.client.rpc.AsyncCallback<CmsUUID> callback)
Creates a new CmsUUID.
|
void |
fireEvent(com.google.web.bindery.event.shared.Event<?> event)
Fires a client side event.
|
static CmsCoreProvider |
get()
Returns the client message instance.
|
java.lang.String |
getAdjustedSiteRoot(java.lang.String siteRoot,
java.lang.String resourcename)
Returns the adjusted site root for a resource using the provided site root as a base.
|
long |
getEstimatedServerTime()
Returns the approximate time on the server.
|
com.google.web.bindery.event.shared.EventBus |
getEventBus()
Gets the core event bus.
|
java.lang.String |
getExplorerLink(java.lang.String sitePath)
Returns the link to view the given resource in the file explorer.
|
CmsUniqueActiveItemContainer |
getFlyoutMenuContainer()
Gets the unique active item container which holds a reference to the currently active content element flyout menu.
|
static java.lang.String |
getMetaElementContent(java.lang.String nameToFind)
Gets the content attribute of a meta tag with a given name.
|
void |
getResourceState(CmsUUID structureId,
com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.db.CmsResourceState> callback)
Fetches the state of a resource from the server.
|
java.lang.String |
getResourceType(CmsFileInfo file)
Returns the resource type name for a given filename.
|
static org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsync |
getService()
Returns the core service instance.
|
static org.opencms.gwt.shared.rpc.I_CmsVfsServiceAsync |
getVfsService()
Returns the vfs service instance.
|
boolean |
isIe7()
Returns if the current user agent is IE7.
|
java.lang.String |
link(java.lang.String sitePath)
Returns an absolute link given a site path.
|
boolean |
lock(CmsUUID structureId)
Locks the given resource with a temporary lock, synchronously.
|
java.lang.String |
lockOrReturnError(CmsUUID structureId)
Tries to lock a resource with a given structure id and returns an error if the locking fails.
|
java.lang.String |
lockOrReturnError(java.lang.String sitePath)
Tries to lock a resource with a given site path and returns an error if the locking fails.
|
org.opencms.gwt.shared.CmsLockInfo |
lockTempAndCheckModification(CmsUUID structureId,
long modification)
Locks the given resource with a temporary lock, synchronously and additionally checking that
the given resource has not been modified after the given timestamp.
|
java.lang.String |
removeSiteRoot(java.lang.String rootPath)
Removes the current site root prefix from the given root path,
that is adjusts the resource name for the current site root.
|
void |
setShowEditorHelp(boolean show) |
java.lang.String |
substituteLinkForRootPath(java.lang.String rootPath)
Returns the absolute link to the given root path.
|
boolean |
unlock()
Unlocks the current resource.
|
boolean |
unlock(CmsUUID structureId)
Unlocks the given resource, synchronously.
|
boolean |
unlock(java.lang.String sitePath)
Unlocks the given resource, synchronously.
|
getAboutLink, getAdeParameters, getContentEditorBacklinkUrl, getContentEditorUrl, getDefaultWorkplaceLink, getEmbeddedDialogsUrl, getExtensionMapping, getFileExplorerLink, getLocale, getLoginURL, getNavigationUri, getServerTime, getSiteRoot, getStructureId, getUploadFileSizeLimit, getUri, getUserInfo, getVfsPrefix, getWorkplaceResourcesPrefix, getWpLocale, isKeepAlive, isShowEditorHelp, isToolbarVisible
public static final java.lang.String VFS_PATH_SYSTEM
protected CmsCoreProvider() throws com.google.gwt.user.client.rpc.SerializationException
com.google.gwt.user.client.rpc.SerializationException
- if deserialization failedpublic static CmsCoreProvider get()
public static java.lang.String getMetaElementContent(java.lang.String nameToFind)
nameToFind
- the name of the meta tagpublic static org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsync getService()
public static org.opencms.gwt.shared.rpc.I_CmsVfsServiceAsync getVfsService()
public java.lang.String addSiteRoot(java.lang.String sitePath)
sitePath
- the resource nameremoveSiteRoot(String)
public void createUUID(com.google.gwt.user.client.rpc.AsyncCallback<CmsUUID> callback)
callback
- the callback to executepublic void fireEvent(com.google.web.bindery.event.shared.Event<?> event)
event
- the event to firepublic java.lang.String getAdjustedSiteRoot(java.lang.String siteRoot, java.lang.String resourcename)
Usually, this would be the site root for the current site.
However, if a resource from the /system/
folder is requested,
this will be the empty String.
siteRoot
- the site root of the current siteresourcename
- the resource name to get the adjusted site root forpublic long getEstimatedServerTime()
public com.google.web.bindery.event.shared.EventBus getEventBus()
public java.lang.String getExplorerLink(java.lang.String sitePath)
sitePath
- the resource site pathpublic CmsUniqueActiveItemContainer getFlyoutMenuContainer()
public void getResourceState(CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.db.CmsResourceState> callback)
structureId
- the structure id of the resourcecallback
- the callback which should receive the resultpublic java.lang.String getResourceType(CmsFileInfo file)
file
- the file infopublic boolean isIe7()
true
if the current user agent is IE7public java.lang.String link(java.lang.String sitePath)
sitePath
- the site pathpublic boolean lock(CmsUUID structureId)
structureId
- the resource structure idtrue
if succeeded, if not a a warning is already shown to the userpublic java.lang.String lockOrReturnError(CmsUUID structureId)
structureId
- the structure id of the resource to lockpublic java.lang.String lockOrReturnError(java.lang.String sitePath)
If the resource does not exist yet, the next existing ancestor folder will be checked if it is lockable.
sitePath
- the site path of the resource to lockpublic org.opencms.gwt.shared.CmsLockInfo lockTempAndCheckModification(CmsUUID structureId, long modification)
structureId
- the resource structure idmodification
- the timestamp to checknull
if successful, else an error messagepublic java.lang.String removeSiteRoot(java.lang.String rootPath)
If the resource name does not start with the current site root, it is left untouched.
rootPath
- the resource nameaddSiteRoot(String)
public void setShowEditorHelp(boolean show)
setShowEditorHelp
in class org.opencms.gwt.shared.CmsCoreData
CmsCoreData.setShowEditorHelp(boolean)
public java.lang.String substituteLinkForRootPath(java.lang.String rootPath)
rootPath
- the root pathpublic boolean unlock()
true
if succeededunlock(CmsUUID)
public boolean unlock(CmsUUID structureId)
structureId
- the resource structure idtrue
if succeeded, if not a a warning is already shown to the userpublic boolean unlock(java.lang.String sitePath)
sitePath
- the resource site pathtrue
if succeeded, if not a a warning is already shown to the user