cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Opening File in Editor in Read-Only mode

unknown1
1-Newbie

Opening File in Editor in Read-Only mode

I'm opening the Arbortext Editor programmatically in Java to display an XML file, but I want to open it read-only (even though the file is editable). I'm using the following code:
Runtime.getRuntime().exec("<editor path="> <file_path>");
This opens the file for editing, but I'd like to open it read-only for viewing.
Any suggestions?
3 REPLIES 3

Hello,

The -r command line parameter opens the file as read only. See help 5717
Runtime.getRuntime().exec("<editor path="> -r <file_path>"); should do the trick.

Christophe Lefebvre
LexisNexis France

-----Message d'origine-----
De : Gary Ouzts
Envoyé : vendredi 26 janvier 2007 15:52
À : Adepters@maillist.arbortext.com
Objet : Opening File in Editor in Read-Only mode

I'm opening the Arbortext Editor programmatically in Java to display an XML file, but I want to open it read-only (even though the file is editable). I'm using the following code:
Runtime.getRuntime().exec("<editor path="> <file_path>");
This opens the file for editing, but I'd like to open it read-only for viewing.
Any suggestions? >> To unsubscribe from the list, send an email to listmanager@maillist.arbortext.com with the following in the body: unsubscribe adepters - For additional information on the adepters list (how to subscribe or unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the following in the body: info Adepters - You may also go to forums.arbortext.com, enter the Adepters folder and change your subscription options and preferences.>>

Thanks Christophe, but I have tried that, and the "-r" option does not seem to have any effect when attempting to execute the request from Java. If I enter the command in a Windows command window (epic.exe -r <file path=">) that does open it up in read-only mode. So for some reason, running the editor from Java behaves differently than running the editor command from a command line.

Gary,

I don't know if it will make any difference, but you might try using the
-C1 or -C2 options. They, like the -r option you've tried, are found at
help 5717. I was thinking along the lines of:

Runtime.getRuntime().exec("<editor path="> -C2
\"doc_read_only(current_doc(), 1)\" <file_path>");

Also, if you always want it to open read-only and the above suggestion
doesn't work, you could also try putting the
doc_read_only(current_doc(), 1) function in an instance.acl file which
will be automatically read each time an instance of a particular doc
type is opened.
--
Brian Jensen

Gary Ouzts wrote:
> Thanks Christophe, but I have tried that, and the "-r" option does not seem to
> have any effect when attempting to execute the request from Java. If I enter the
> command in a Windows command window (epic.exe -r <file path=">) that does open it
> up in read-only mode. So for some reason, running the editor from Java behaves
> differently than running the editor command from a command line.

Announcements