Page 1 of 1

AuthorDocumentController isEditable method

Posted: Fri Jun 08, 2012 11:33 am
by SSC
Hello,

Your JavaDoc says the following about the isEditable method in the AuthorDocumentController:

Code: Select all

boolean isEditable(AuthorNode node)

Test if a node is editable or not. A node is not editable for one of the following cases:

the CSS property 'editable' is to 'false';
the node is entirely included into a DELETED change marker.

Parameters:
node - The node to test if is editable.
Returns:
True if the node is editable, false otherwise.
Is it maybe possible to also return false, when the XML file itself is readonly in the filesystem?

Currently I get the readonly state from the IEditorInput, which I pass to the Oxygen Editor, but I´d like to get this information also by using the isEditable method.
If this is a low-hanging fruit to implement this little feature, I would appreciate to have it. Otherwise we also can live with the current solution.

Regards,

Simon

Re: AuthorDocumentController isEditable method

Posted: Fri Jun 08, 2012 11:57 am
by Radu
Hi Simon,

I think that the method is clear in what it does, indeed if the resource is read-only or if the API is used to mark the editor's contents as read-only the node might report that it is editable although you cannot edit in it.
We'll probably maintain the current implementation of the method.

Maybe you could create your own utility method which looks either if the URL of the edited document is read-only or if the edited node is read-only.

Regards,
Radu

Re: AuthorDocumentController isEditable method

Posted: Fri Jun 08, 2012 12:13 pm
by SSC
Hello Radu,

currently I use such an utility method, that you suggested. While was implementing this utility method, I came up with the idea that your isEditable method of the AuthorDocumentController could also offer this information.
So take this post just as an impluse... :wink:

I wish you a nice weekend :)

Best regards,

Simon

Re: AuthorDocumentController isEditable method

Posted: Fri Jun 08, 2012 3:29 pm
by Radu
Hi Simon,

We really appreciate the feedback.
It's really hard to say how API methods should behave in certain circumstances.
Have a nice weekend too.

Regards,
Radu