Package org.opencms.gwt.client
Class CmsCoreProvider
java.lang.Object
org.opencms.gwt.shared.CmsCoreData
org.opencms.gwt.client.CmsCoreProvider
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
Client side core data provider.
- Since:
- 8.0.0
- See Also:
-
CmsGwtActionElement
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.gwt.shared.CmsCoreData
org.opencms.gwt.shared.CmsCoreData.AdeContext, org.opencms.gwt.shared.CmsCoreData.ModuleKey, org.opencms.gwt.shared.CmsCoreData.UserInfo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.opencms.gwt.shared.I_CmsAutoBeanFactory
AutoBean factory instance.static final CmsMediaQuery
Media query do detect device with no hover capability.static final String
The media query string to detect touch only devices.static final String
Path to system folder.Fields inherited from class org.opencms.gwt.shared.CmsCoreData
DICT_NAME, KEY_GWT_BUILDID, m_serverTime, m_userInfo, META_PARAM_MODULE_KEY, PARAM_PATH, PARAM_RETURNCODE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSiteRoot
(String sitePath) Adds the current site root of this context to the given resource name.void
createUUID
(com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.util.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.getAdjustedSiteRoot
(String siteRoot, String resourcename) Returns the adjusted site root for a resource using the provided site root as a base.long
Returns the approximate time on the server.com.google.web.bindery.event.shared.EventBus
Gets the core event bus.getExplorerLink
(String sitePath) Returns the link to view the given resource in the file explorer.Gets the unique active item container which holds a reference to the currently active content element flyout menu.org.opencms.util.CmsUUID
Gets the page id that was last stored in sessionStorage.static String
getMetaElementContent
(String nameToFind) Gets the content attribute of a meta tag with a given name.void
getResourceState
(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.db.CmsResourceState> callback) Fetches the state of a resource from the server.getResourceType
(CmsFileInfo file) Returns the resource type name for a given filename.getResourceTypeIcon
(String path) Gets the resource type icon for the given path.Returns the resource type name for a given filename.static org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsync
Returns the core service instance.static org.opencms.gwt.shared.rpc.I_CmsVfsServiceAsync
Returns the vfs service instance.boolean
isIe7()
Returns if the current user agent is IE7.static boolean
Checks if the client is touch-only.Returns an absolute link given a site path.void
lock
(String sitePath, long loadTime, I_CmsSimpleCallback<Boolean> callback) Locks the given resource with a temporary lock.void
lock
(org.opencms.util.CmsUUID structureId, long loadTime, I_CmsSimpleCallback<Boolean> callback) Locks the given resource with a temporary lock.void
lock
(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<Boolean> callback) Locks the given resource with a temporary lock.void
lockOrReturnError
(String sitePath, long loadTime, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given site path and returns an error if the locking fails.void
lockOrReturnError
(String sitePath, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given site path and returns an error if the locking fails.void
lockOrReturnError
(org.opencms.util.CmsUUID structureId, long loadTime, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given structure id and returns an error if the locking fails.void
lockOrReturnError
(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given structure id and returns an error if the locking fails.removeSiteRoot
(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) void
substituteLinkForRootPath
(String rootPath, I_CmsSimpleCallback<String> callback) Returns the absolute link to the given root path.boolean
Unlocks the given resource, synchronously.boolean
unlock
(org.opencms.util.CmsUUID structureId) Unlocks the given resource, synchronously.Methods inherited from class org.opencms.gwt.shared.CmsCoreData
getAboutLink, getAdeParameters, getCategoryBaseFolder, getContentEditorBacklinkUrl, getContentEditorUrl, getDefaultWorkplaceLink, getEmbeddedDialogsUrl, getExtensionMapping, getFileExplorerLink, getIconMapping, getLocale, getLoginURL, getNavigationUri, getProjectId, getServerTime, getSharedFolder, getSiteRoot, getStructureId, getTinymce, getUploadFileSizeLimit, getUploadRestriction, getUri, getUserInfo, getVfsPrefix, getWorkplaceResourcesPrefix, getWpLanguage, getWpLocale, isHideDisabledGalleryTypes, isKeepAlive, isShowEditorHelp, isToolbarVisible, isUploadDisabled, isWarnWhenEditingReusedElement, setTinymce, setWarnWhenEditingReusedElement
-
Field Details
-
AUTO_BEAN_FACTORY
AutoBean factory instance. -
TOUCH_ONLY_RULE
The media query string to detect touch only devices.- See Also:
-
TOUCH_ONLY
Media query do detect device with no hover capability. -
VFS_PATH_SYSTEM
Path to system folder.- See Also:
-
-
Constructor Details
-
CmsCoreProvider
Prevent instantiation.- Throws:
com.google.gwt.user.client.rpc.SerializationException
- if deserialization failed
-
-
Method Details
-
get
Returns the client message instance.- Returns:
- the client message instance
-
getMetaElementContent
Gets the content attribute of a meta tag with a given name.- Parameters:
nameToFind
- the name of the meta tag- Returns:
- the content attribute value of the found meta tag, or null if no meta tag with the given name was found
-
getService
Returns the core service instance.- Returns:
- the core service instance
-
getVfsService
Returns the vfs service instance.- Returns:
- the vfs service instance
-
isTouchOnly
Checks if the client is touch-only.This uses media queries, but the touch-only status can also be forcibly turned on with the request parameter __touchOnly=1.
- Returns:
- true if the client is touch-only
-
addSiteRoot
Adds the current site root of this context to the given resource name.- Parameters:
sitePath
- the resource name- Returns:
- the translated resource name including site root
- See Also:
-
createUUID
public void createUUID(com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.util.CmsUUID> callback) Creates a new CmsUUID.- Parameters:
callback
- the callback to execute
-
getAdjustedSiteRoot
Returns the adjusted site root for a resource using the provided site root as a base.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.- Parameters:
siteRoot
- the site root of the current siteresourcename
- the resource name to get the adjusted site root for- Returns:
- the adjusted site root for the resource
-
getEstimatedServerTime
Returns the approximate time on the server.- Returns:
- the approximate server time
-
getEventBus
Gets the core event bus.- Returns:
- the core event bus
-
getExplorerLink
Returns the link to view the given resource in the file explorer.- Parameters:
sitePath
- the resource site path- Returns:
- the link
-
getFlyoutMenuContainer
Gets the unique active item container which holds a reference to the currently active content element flyout menu.- Returns:
- the unique active item container for flyout menus
-
getLastPageId
Gets the page id that was last stored in sessionStorage.- Returns:
- the page id that was last stored in session storage
-
getResourceState
public void getResourceState(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.db.CmsResourceState> callback) Fetches the state of a resource from the server.- Parameters:
structureId
- the structure id of the resourcecallback
- the callback which should receive the result
-
getResourceType
Returns the resource type name for a given filename.- Parameters:
file
- the file info- Returns:
- the resource type name
-
getResourceTypeIcon
Returns the resource type name for a given filename.- Parameters:
file
- the file info- Returns:
- the resource type name
-
getResourceTypeIcon
Gets the resource type icon for the given path.- Parameters:
path
- a path- Returns:
- the resource type icon
-
isIe7
Returns if the current user agent is IE7.- Returns:
true
if the current user agent is IE7
-
link
Returns an absolute link given a site path.- Parameters:
sitePath
- the site path- Returns:
- the absolute link
-
lock
Locks the given resource with a temporary lock.- Parameters:
structureId
- the resource structure idcallback
- the callback to execute
-
lock
public void lock(org.opencms.util.CmsUUID structureId, long loadTime, I_CmsSimpleCallback<Boolean> callback) Locks the given resource with a temporary lock.- Parameters:
structureId
- the resource structure idloadTime
- the time when the requested resource was loadedcallback
- the callback to execute
-
lock
Locks the given resource with a temporary lock.- Parameters:
sitePath
- the site path of the resource to lockloadTime
- the time when the requested resource was loadedcallback
- the callback to execute
-
lockOrReturnError
public void lockOrReturnError(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given structure id and returns an error if the locking fails.- Parameters:
structureId
- the structure id of the resource to lockcallback
- the callback to execute
-
lockOrReturnError
public void lockOrReturnError(org.opencms.util.CmsUUID structureId, long loadTime, I_CmsSimpleCallback<String> callback) Tries to lock a resource with a given structure id and returns an error if the locking fails.- Parameters:
structureId
- the structure id of the resource to lockloadTime
- the time when the requested resource was loadedcallback
- the callback to execute
-
lockOrReturnError
Tries to lock a resource with a given site path and returns an error if the locking fails.If the resource does not exist yet, the next existing ancestor folder will be checked if it is lockable.
- Parameters:
sitePath
- the site path of the resource to lockcallback
- the callback to execute
-
lockOrReturnError
Tries to lock a resource with a given site path and returns an error if the locking fails.If the resource does not exist yet, the next existing ancestor folder will be checked if it is lockable.
- Parameters:
sitePath
- the site path of the resource to lockloadTime
- the time when the requested resource was loadedcallback
- the callback to execute
-
removeSiteRoot
Removes the current site root prefix from the given root path, that is adjusts the resource name for the current site root.If the resource name does not start with the current site root, it is left untouched.
- Parameters:
rootPath
- the resource name- Returns:
- the resource name adjusted for the current site root
- See Also:
-
setShowEditorHelp
- Overrides:
setShowEditorHelp
in classorg.opencms.gwt.shared.CmsCoreData
- See Also:
-
CmsCoreData.setShowEditorHelp(boolean)
-
substituteLinkForRootPath
Returns the absolute link to the given root path.- Parameters:
rootPath
- the root pathcallback
- the callback to execute
-
unlock
Unlocks the given resource, synchronously.- Parameters:
structureId
- the resource structure id- Returns:
true
if succeeded, if not a a warning is already shown to the user
-
unlock
Unlocks the given resource, synchronously.- Parameters:
sitePath
- the resource site path- Returns:
true
if succeeded, if not a a warning is already shown to the user
-