How to Open a File as Read-Only in Oxygen XML WebApp Component
This topic explains how to open a file as read-only in Oxygen XML WebApp 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 Editor uses to read the contents of the file.
By opening the file as read-only, the Oxygen XML WebApp 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 WebApp 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
truefor theoxygen_read_onlyheader 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} );