Class CometdOnlyofficeService.CometdService
java.lang.Object
org.exoplatform.onlyoffice.cometd.CometdOnlyofficeService.CometdService
- Enclosing class:
CometdOnlyofficeService
The CometService is responsible for sending messages to Cometd channels
when a document is saved.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleDocumentChangeEvent(Map<String, Object> data, String docId) Handle document change event.protected voidhandleDocumentLinkEvent(Map<String, Object> data, String docId) Handle document link event.protected voidhandleDocumentTitleUpdatedEvent(Map<String, Object> data, String docId) Handle document title updated.protected voidhandleDocumentUsersavedEvent(Map<String, Object> data, String docId) Handles document usersaved event.protected voidhandleDocumentVersionEvent(Map<String, Object> data, String docId) Handle document version event.protected voidhandleEditorClosedEvent(Map<String, Object> data, String docId) Handle editor closed event.voidPost construct.protected voidpublishContentUpdatedEvent(String workspace, String docId, String userId) Publish saved event.protected voidpublishDeletedEvent(String docId) Publish deleted event.protected voidpublishSavedEvent(String docId, String userId, String comment) Publish saved event.protected voidpublishUpdatedOutsideEvent(String docId, String writingKey) Publish the event that tells the open editors of a document that its content was written outside them.voidsubscribeDocuments(org.cometd.bayeux.server.ServerSession sender, org.cometd.bayeux.server.ServerMessage.Mutable message, String docId) Handles the document events a client publishes.
-
Constructor Details
-
CometdService
public CometdService()
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct()Post construct. -
subscribeDocuments
@Listener("/eXo/Application/Onlyoffice/editor/{docId}") public void subscribeDocuments(org.cometd.bayeux.server.ServerSession sender, org.cometd.bayeux.server.ServerMessage.Mutable message, @Param("docId") String docId) throws OnlyofficeEditorException, javax.jcr.RepositoryException Handles the document events a client publishes. The event is handled only when its user is the one the sender's session was handshaken with; the message is still delivered to the channel's subscribers.- Parameters:
sender- the sender's session.message- the message.docId- the docId.- Throws:
OnlyofficeEditorException- the onlyoffice editor exceptionjavax.jcr.RepositoryException- the repository exception
-
handleDocumentLinkEvent
-
handleDocumentTitleUpdatedEvent
-
handleEditorClosedEvent
-
handleDocumentVersionEvent
-
handleDocumentChangeEvent
-
handleDocumentUsersavedEvent
-
publishSavedEvent
-
publishContentUpdatedEvent
-
publishUpdatedOutsideEvent
Publish the event that tells the open editors of a document that its content was written outside them.- Parameters:
docId- the doc idwritingKey- the key of the editor session that wrote the content, whose editors hold it, null for a write outside any editor
-
publishDeletedEvent
Publish deleted event.- Parameters:
docId- the doc id
-