Edit online

Opening a File as Read-Only in Web Author

By opening the file as read-only, Oxygen XML Web Author is instructed to visually warn users that the content of the document cannot be edited. This is an alternative to having them edit the content and then receive an error when trying to check it in or save it.

You can instruct the Oxygen XML Web Author to open a file as read-only by using one of the following methods:
  • If you are implementing a URLStreamHandler plugin, you can implement the java.net.URLConnection.getHeaderField(String) method to return the value of true for the oxygen_read_only header name. Also, the following headers can be used to give Oxygen XML Web Author more details about the reason why the document is opened as read-only:

    oxygen_read_only_reason
    Provides a reason why a document is opened as read-only and the reason will be presented when the user tries to edit a read-only document.
    oxygen_read_only_reason_code
    Provides a code that identifies the reason why the document is opened as read-only. This code should be unique across user interface languages. It will not be presented to the user but can be received using the API.
  • Use the JavaScript API editor.setReadOnlyState().
  • Use the Java API ro.sync.ecss.extensions.api.access.AuthorEditorAccess#setReadOnly().

Once in read-only mode, Web Author will present a warning stripe that presents the reason for the document being read-only. You can customize the content of this stripe using the editor.setReadOnlyStripeRenderer() JavaScript API.