[JSOperation] Open a read-only file
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 6
- Joined: Tue Feb 04, 2020 10:16 am
[JSOperation] Open a read-only file
Hi,
I have this Custom JSOperation script that opens a file from a ditamap to do operations on all topics. But I'd like to be able to open files in read-only mode from the beginning, the setEditable() function works but my content manager requires a check-in/discard (not the case for file with read only permission). Is this possible?
Thanks,
Olivier Durand.
I have this Custom JSOperation script that opens a file from a ditamap to do operations on all topics. But I'd like to be able to open files in read-only mode from the beginning, the setEditable() function works but my content manager requires a check-in/discard (not the case for file with read only permission). Is this possible?
Code: Select all
authorAccess.getWorkspaceAccess().open(hRef, "Author");
controller = authorAccess.getWorkspaceAccess().getEditorAccess(hRef);
//controller.setEditable(false);
controllerPage = controller.getCurrentPage();
results = controllerPage.authorAccess.getDocumentController().findNodesByXPath("(//*/row)[last()]", true, true, true);
comp = results[0].getTextContent();
controller.close(false);
Olivier Durand.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: [JSOperation] Open a read-only file
Hi Olivier,
We do not have APIs for check in and discard. These are probably actions implemented by the CMS integration plugin installed in Oxygen. So they would probably somehow need to offer you the API to call for these actions.
Maybe you could also try this alternate API we have:
ro.sync.exml.workspace.api.standalone.S ... ], String)
The method:
ro.sync.ecss.extensions.api.component.C ... L, Reader)
would load content from the URL (or from the alternative reader) in a component which would have about the same API as an opened editor.
But the component would not show on screen.
I'm not sure though, Oxygen at some point will attempt to retrieve content from that URL, the way in which this retrieval is implemented in the CMS plugin is not controlled by us.
Regards,
Radu
We do not have APIs for check in and discard. These are probably actions implemented by the CMS integration plugin installed in Oxygen. So they would probably somehow need to offer you the API to call for these actions.
Maybe you could also try this alternate API we have:
ro.sync.exml.workspace.api.standalone.S ... ], String)
The method:
ro.sync.ecss.extensions.api.component.C ... L, Reader)
would load content from the URL (or from the alternative reader) in a component which would have about the same API as an opened editor.
But the component would not show on screen.
I'm not sure though, Oxygen at some point will attempt to retrieve content from that URL, the way in which this retrieval is implemented in the CMS plugin is not controlled by us.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service