public final class CmsCoreProvider extends CmsCoreData
CmsGwtActionElement
CmsCoreData.AdeContext, CmsCoreData.UserInfo
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
VFS_PATH_SYSTEM
Path to system folder.
|
DICT_NAME, KEY_GWT_BUILDID, m_serverTime, m_userInfo, PARAM_PATH, PARAM_RETURNCODE
限定符 | 构造器和说明 |
---|---|
protected |
CmsCoreProvider()
Prevent instantiation.
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
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<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 I_CmsCoreServiceAsync |
getService()
Returns the core service instance.
|
static 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.
|
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.
|
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.
|
getAdeParameters, getContentEditorBacklinkUrl, getContentEditorDeleteLinkUrl, getContentEditorUrl, getDefaultWorkplaceLink, getExtensionMapping, getLocale, getLoginURL, getNavigationUri, getServerTime, getSiteRoot, getStructureId, getUploadFileSizeLimit, getUri, getUserInfo, getVfsPrefix, 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 I_CmsCoreServiceAsync getService()
public static 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 void getResourceState(CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<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 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 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