ReadOnly mode

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Konstantin
Posts: 61
Joined: Tue Oct 27, 2015 11:49 am

ReadOnly mode

Post by Konstantin » Thu Aug 18, 2016 2:19 pm

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 ?

Gabriel Titerlea
Posts: 40
Joined: Thu Jun 09, 2016 2:01 pm

Re: ReadOnly mode

Post by Gabriel Titerlea » Thu Aug 18, 2016 3:41 pm

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

Konstantin
Posts: 61
Joined: Tue Oct 27, 2015 11:49 am

Re: ReadOnly mode

Post by Konstantin » Mon Aug 22, 2016 5:56 pm

Ok Thanks

Post Reply