Class EditingSessionContext
java.lang.Object
ro.sync.ecss.extensions.api.access.EditingSessionContext
- All Implemented Interfaces:
ContextKeyManagerProvider
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public abstract class EditingSessionContext
extends Object
implements ContextKeyManagerProvider
The editing session context.
An editing session correspond to an user editing a document in the editor. Custom attributes can be registered from the API which can include information about the context of the editing, e.g. the user that performs the edit, the project in whose scope the editing session was started, etc.
The session context is serializable and it serializes only the attributes whose value is serializable. The rest of the attributes are ignored.
In Web Author, attributes can be added to the editing context by using:
LoadingOptions
set on the sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED
event handler.
WebappEditingSessionLifecycleListener.editingSessionAboutToBeStarted(String, String, java.net.URL, java.util.Map)
callback.- Since:
- 15.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
getAttribute
(String attr) Gets the value of a custom attribute.Returns the set of all attributes.abstract void
setAttribute
(String attr, Object value) Sets a custom attribute for the editing session.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ro.sync.ecss.dita.ContextKeyManagerProvider
getContextKeyManager
-
Constructor Details
-
EditingSessionContext
public EditingSessionContext()
-
-
Method Details
-
setAttribute
Sets a custom attribute for the editing session. If the attribute is already set it overrides the previous value.- Parameters:
attr
- The attribute name.value
- The attribute value.
-
getAttribute
Gets the value of a custom attribute.- Parameters:
attr
- The attribute name.- Returns:
- The attribute value or
null
if the attribute was not set.
-
getAttributes
Returns the set of all attributes.- Returns:
- The set of all attributes.
-