Collaborative Document Editing
The workflow for bootstrapping collaboration, joining the hub, editing text, and publishing revisions.
Use the same editing workflow for organization, cluster, location and Project documents. Plain text and GAEB .x86 files support live text operations. Office files support bootstrap metadata and presence; PDF and Office content editing are not part of this text editor.
Open and edit
- Load the document from its library. For a Project, use
/v1/document-libraries/project/{projectId}/documents. - Call
POST /v1/documents/{documentId}/collaboration/bootstrap. Keep the returnedcollaborativeDocumentId; checkcanEditandsupportsTextEditing. - Connect to
/hubs/document-collaborationwith the current credential and callJoinDocument(collaborativeDocumentId). - Load
GetTextState, then submit incremental edits throughSubmitTextOperationswith the observed revision number. ApplyTextOperationsAppliedbroadcasts and reload state when the response requires resynchronization. - Use
UpdatePresencefor cursor/selection activity. HandleTextStateUpdatedandPresenceUpdatedalongside operation broadcasts.
Read-only users can join and read existing text state. An editor must initialize the first snapshot, and every mutation requires current write access at the document's folder path.
Publish and reopen
Call PublishDocument while joined, or POST /v1/documents/collaboration/{collaborativeDocumentId}/publish, to create a downloadable file version. Handle DocumentPublished by refreshing the library and current file metadata while retaining the collaboration ID. Call LeaveDocument when leaving the editor.
Publishing a Project document preserves its spatialProjectId, filename, folder path and version lineage. It stays in that Project's library. Bootstrapping from the original or a previously published version returns the same logical collaboration. Checkpoints, revision history, restore and publish history use the existing collaboration endpoints.
Access changes and deletion
Project access inherits the parent location's document permissions at the Project-relative path. Project deletion makes its collaboration unavailable and schedules stored snapshots for cleanup. On SubscriptionRevoked, stop editing and discard inaccessible state. A lost write permission blocks edits even while read access remains.
Publishing does not happen automatically on leaving the session. Publish before leaving when a new downloadable file version is required.