Page 1 of 1

ReadOnly mode

Posted: Thu Aug 18, 2016 2:19 pm
by Konstantin
In Webapp I use different ways to switch ReadOnly mode:

Code: Select all


AuthorDocumentModel documentModel;
documentModel.getWSEditor().setEditable(!isReadOnly);
documentModel.getWSEditor().getCurrentPage().setEditable(!isReadOnly);
documentModel.getWSEditor().getCurrentPage().getParentEditor().setEditable(isReadOnly);
documentModel.getAuthorAccess().getEditorAccess().setEditable(!isReadOnly);
also I tried:

Code: Select all


editor.getActionsManager().invokeOperation(
'SetReadOnlyStatusOperation',
{'read-only': true}
);
In Author mode it works but in Text mode it dosn't works.
In ReadOnly I can change text in Text mode and return to Author mode.

Do you have API to make Text mode as ReadOnly ?

Re: ReadOnly mode

Posted: Thu Aug 18, 2016 3:41 pm
by Gabriel Titerlea
Hello,

This method is the API:

Code: Select all

editor.getActionsManager().invokeOperation(
'SetReadOnlyStatusOperation',
{'read-only': true}
);
It will work in text mode as well in the next release (18.1)

Regards,
Gabriel

Re: ReadOnly mode

Posted: Mon Aug 22, 2016 5:56 pm
by Konstantin
Ok Thanks