How to allow/block content save ?

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Vince
Posts: 66
Joined: Wed Dec 03, 2014 11:25 am

How to allow/block content save ?

Post 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
mircea_b
Posts: 5
Joined: Fri Dec 08, 2023 12:51 pm

Re: How to allow/block content save ?

Post by mircea_b »

Hello,

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

Regards,
Mircea
Vince
Posts: 66
Joined: Wed Dec 03, 2014 11:25 am

Re: How to allow/block content save ?

Post 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
mircea_b
Posts: 5
Joined: Fri Dec 08, 2023 12:51 pm

Re: How to allow/block content save ?

Post 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
Post Reply