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:

  • URL parameters specified in the web brosers
  • JavaScript LoadingOptions set on the sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED event handler.
  • The WebappEditingSessionLifecycleListener.editingSessionAboutToBeStarted(String, String, java.net.URL, java.util.Map) callback.
  • Since:
    15.2
    • Constructor Details

      • EditingSessionContext

        public EditingSessionContext()
    • Method Details

      • setAttribute

        public abstract void setAttribute(String attr, Object value)
        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

        public abstract Object getAttribute(String attr)
        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

        public abstract Set<String> getAttributes()
        Returns the set of all attributes.
        Returns:
        The set of all attributes.