Class WebappEditingSessionLifecycleListener


  • @API(type=EXTENDABLE,
         src=PUBLIC)
    public abstract class WebappEditingSessionLifecycleListener
    extends java.lang.Object
    Listener for the main lifecycle events of an editing session. The lifecycle is influenced by the fact that we cannot safely detect when the users closed the application and that the users may have a lot of instances of the application open. In order to optimize memory consumption, we serialize editing sessions to disk sometimes (after periods of inactivity or if there are too many concurrent sessions). However, the moment when the session gets serialized can be configured separately. This listener can be registered on WebappPluginWorkspace.
    Since:
    17
    • Constructor Detail

      • WebappEditingSessionLifecycleListener

        public WebappEditingSessionLifecycleListener()
    • Method Detail

      • editingSessionAboutToBeStarted

        public void editingSessionAboutToBeStarted​(java.lang.String editingSessionId,
                                                   java.lang.String licenseeId,
                                                   java.net.URL systemId,
                                                   java.util.Map<java.lang.String,​java.lang.Object> options)
                                            throws EditingSessionOpenVetoException
        Method called when a new editing session is about to be started. If it throws a EditingSessionOpenVetoException, the details in the exception will be presented to the user.
        Parameters:
        editingSessionId - The id of the editing session in which the editing of the opened document happens.
        licenseeId - The licensee id of the user that opened the document. If one user uses multiple browsers, it will have a different such id for each of the browsers.
        systemId - The system id of the XML document about to be opened.
        options - The options containing - the cookies used for the document load request - the key is the cookie name prefixed with 'cookie-' - the value is a String - the other HTTP headers - the key is the header name prefixed with "header-" - the value is a list of strings. - the session id set by the Servlet container with the key: "session-id". - options set explicitly by the client JS code, the value being a string.
        Throws:
        EditingSessionOpenVetoException - When implementation decides that the editing session should not be started.
      • editingSessionFailedToStart

        public void editingSessionFailedToStart​(java.lang.String editingSessionId,
                                                java.lang.String licenseeId,
                                                java.net.URL systemId,
                                                java.util.Map<java.lang.String,​java.lang.Object> options)
        Method called when a new editing session failed to start.
        Parameters:
        editingSessionId - The id of the editing session in which the editing was supposed to happen.
        licenseeId - The licensee id of the user that opened the document.
        systemId - The system id of the XML document about to be opened.
        options - The options passed on the editingSessionAboutToBeStarted(String, String, URL, Map) method.
        Since:
        23
      • editingSessionStarted

        public void editingSessionStarted​(java.lang.String editingSessionId,
                                          AuthorDocumentModel documentModel)
        Method called when the editing session has already started.
        Parameters:
        editingSessionId - The if of the editing session.
        documentModel - The model of the edited document. From it one can derive the URL and the options used to open it. For the URL : documentModel.getAuthorDocumentController().getAuthorDocumentNode().getSystemID() For the editing session options: documentModel.getAuthorAccess().getEditorAccess().getEditingContext() This document model may change during the lifetime of the session as it is inactivated and activated back.
      • editingSessionClosed

        public void editingSessionClosed​(java.lang.String editingSessionId,
                                         AuthorDocumentModel documentModel)
        The session was closed by the user. Note that on some platforms, the user may close the browser without triggering this event.
        Parameters:
        editingSessionId - The id of the editing session.
        documentModel - The model of the edited document.
      • editingSessionAboutToBeSerialized

        public void editingSessionAboutToBeSerialized​(java.lang.String editingSessionId,
                                                      AuthorDocumentModel documentModel)
        The editing session was serialized to disk in order to free memory space. After this method is called, the document model given as a parameter cannot be used anymore.
        Parameters:
        editingSessionId - The id of the editing session.
        documentModel - The model of edited document.
      • editingSessionDeserialized

        public void editingSessionDeserialized​(java.lang.String editingSessionId,
                                               AuthorDocumentModel documentModel)
        The editing session was deserialized because the user made some changes to it.
        Parameters:
        editingSessionId - The id of the editing session.
        documentModel - The document model may not be the same as the one created when the editing session was opened.