[JSOperation] Open a read-only file
Posted: Mon Feb 17, 2020 6:31 pm
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.