Page 1 of 1

How to allow/block content save ?

Posted: Wed May 14, 2025 1:05 am
by Vince
Hello,
Our web author plugin uses URLHandler and LockHandlerFactory extensions.
Our lock handler extends LockHandlerWithContext.

To put the editor in read-only mode, I can throw a lock exception from updateLock().
But if I return a false from isSaveAllowed(), nothing appends. The method isSavedAllowed is never called.

Is this method isSavedAllowed used ?

My needs is set read-only mode in case of the content is not the last version in serie. Using lock info is not relevant here.
What is the best practice do do that ?

Regards,
Vincent

Re: How to allow/block content save ?

Posted: Wed May 14, 2025 2:00 pm
by mircea_b
Hello,

Did you also override isLockEnabled() to return true? See https://www.oxygenxml.com/InstData/Edit ... rBase.html

Regards,
Mircea

Re: How to allow/block content save ?

Posted: Wed May 14, 2025 4:05 pm
by Vince
Hello,

Yes I do this override. But the method isSaveAllowed is never called even with this override.
When is this method useful?

After some search in your documentation, I found I can use oxygen_read_only [1] headers to implement my needs.

Regards,

[1] https://www.oxygenxml.com/doc/versions/ ... -only.html

Re: How to allow/block content save ?

Posted: Thu May 15, 2025 11:33 am
by mircea_b
Hello,

After some more digging in the code it appears that the isSaveAllowed method is only used by the Oxygen XML Editor’s editor, and not by Web Author’s editor. We will update the documentation to reflect this.

In regard to setting the editor's read only mode, there are multiple methods mentioned in the topic you sent above which should all work.

Regards,
Mircea