Opening a File as Read-Only in Oxygen XML Web Author Component

Note

This topic assumes that you are using a URLStreamHandler plugin to open the files in your repository.

When a file is opened, your plugin is asked to provide a URLConnection object that Oxygen XML Developer plugin uses to read the contents of the file.

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

You can instruct the Oxygen XML Web Author Component to open a file as read-only by using one of the following methods:

  • Implement the java.net.URLConnection.getHeaderField(String) method to return a value of true for the oxygen_read_only header name.
  • Use a JavaScript extension that invokes an Author mode operation that changes the document status to read-only:
      editor.getActionsManager().invokeOperation(
        'SetReadOnlyStatusOperation',
        {'read-only': true}
      );

Was this helpful?