Lock check
Oxygen general issues.
-
- Posts: 42
- Joined: Tue Jun 08, 2021 3:27 pm
Lock check
Post by Srinarayan »
Hi team,
I am making a java plugin for oxygen. I want to know if there is a way to check in java whether the document currently opened in oxygen author is locked or not?
Regards
Srinarayan
I am making a java plugin for oxygen. I want to know if there is a way to check in java whether the document currently opened in oxygen author is locked or not?
Regards
Srinarayan
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Lock check
Hi Srinarayan,
What do you mean by "locked"? From what storage system is the XML document loaded? If it's loaded from your own content management system you can write your own code which decides if the XML is locked or not.
If the XML document is not editable you can use the API "ro.sync.exml.workspace.api.editor.WSEditor.isEditable()" to check that.
Regards,
Radu
What do you mean by "locked"? From what storage system is the XML document loaded? If it's loaded from your own content management system you can write your own code which decides if the XML is locked or not.
If the XML document is not editable you can use the API "ro.sync.exml.workspace.api.editor.WSEditor.isEditable()" to check that.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 42
- Joined: Tue Jun 08, 2021 3:27 pm
Re: Lock check
Post by Srinarayan »
Hi Radu,
I have seen an example of using the API but I am not sure how we can get the output from the operation.
The example :
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation', {
fragment: '<' + 'xref href="' + text + '"/>'
}, callback);
Can you please tell me how to use the API "ro.sync.exml.workspace.api.editor.WSEditor.isEditable()" in a WebAuthor Plugin?
Regards,
Srinarayan
I have seen an example of using the API but I am not sure how we can get the output from the operation.
The example :
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation', {
fragment: '<' + 'xref href="' + text + '"/>'
}, callback);
Can you please tell me how to use the API "ro.sync.exml.workspace.api.editor.WSEditor.isEditable()" in a WebAuthor Plugin?
Regards,
Srinarayan
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Lock check
Post by cristi_talau »
Hello,
We have a tutorial for a similar use-case: https://www.oxygenxml.com/maven/com/oxy ... esult.html . Please let me know if you need more information.
Best,
Cristian
We have a tutorial for a similar use-case: https://www.oxygenxml.com/maven/com/oxy ... esult.html . Please let me know if you need more information.
Best,
Cristian
-
- Posts: 42
- Joined: Tue Jun 08, 2021 3:27 pm
Re: Lock check
Post by Srinarayan »
Hello,
In my Java plugin, to check if the editor is editable or not, I used a deprecated method AuthorAccess.getEditorLocation() and then used the URL I got from this in AuthorAccess.getWorkspaceAccess().getEditorAccess(URL).isEditable().
If AuthorAccess.getEditorLocation() is deprecated then is there a better alternative? This method kind of makes it easier, so what does oxygen recommend me to use if not this API?
Regards
Srinarayan
In my Java plugin, to check if the editor is editable or not, I used a deprecated method AuthorAccess.getEditorLocation() and then used the URL I got from this in AuthorAccess.getWorkspaceAccess().getEditorAccess(URL).isEditable().
If AuthorAccess.getEditorLocation() is deprecated then is there a better alternative? This method kind of makes it easier, so what does oxygen recommend me to use if not this API?
Regards
Srinarayan
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Lock check
Post by cristi_talau »
Hello,
The recommended alternative is to use authorAccess.getEditorAccess().getEditorLocation().
Best,
Cristian
The recommended alternative is to use authorAccess.getEditorAccess().getEditorLocation().
Best,
Cristian
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service