using Workspace java interface
Oxygen general issues.
-
- Posts: 6
- Joined: Sat Oct 05, 2013 4:34 pm
using Workspace java interface
Post by BrianDrian »
java.net.URL url = new java.net.URL ("file:///" +filename);
ro.sync.exml.workspace.api.Workspace.open(url);
Hi I am trying to use the Workspace interface to open a file. I am getting Cannot make a static reference to the non-static method open(URL) from the type Workspace
How is it best to do this?
ro.sync.exml.workspace.api.Workspace.open(url);
Hi I am trying to use the Workspace interface to open a file. I am getting Cannot make a static reference to the non-static method open(URL) from the type Workspace
How is it best to do this?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: using Workspace java interface
Post by alex_jitianu »
Hello,
To use this API you must implement an Workspace Access extension plugin. Such a sample implementation is available at http://oxygenxml.com/oxygen_sdk.html#Developer_Plugins. Such a plugin extension has an applicationStarted() callback that receives an instance of StandalonePluginWorkspace that you can use to invoke the open method. Since the method is not static you can't invoke it the way you tried to invoke it.
More on the Workspace Access plugin:
http://www.oxygenxml.com/doc/ug-editor/ ... lugin.html
If you are trying to invoke this code from a framework level API then you can get to an Workspace instance by using AuthorAccess#getWorkspaceAccess(). Something like: authorAccess.getWorkspaceAccess().open(url).
Best regards,
Alex
To use this API you must implement an Workspace Access extension plugin. Such a sample implementation is available at http://oxygenxml.com/oxygen_sdk.html#Developer_Plugins. Such a plugin extension has an applicationStarted() callback that receives an instance of StandalonePluginWorkspace that you can use to invoke the open method. Since the method is not static you can't invoke it the way you tried to invoke it.
More on the Workspace Access plugin:
http://www.oxygenxml.com/doc/ug-editor/ ... lugin.html
If you are trying to invoke this code from a framework level API then you can get to an Workspace instance by using AuthorAccess#getWorkspaceAccess(). Something like: authorAccess.getWorkspaceAccess().open(url).
Best regards,
Alex
-
- Posts: 6
- Joined: Sat Oct 05, 2013 4:34 pm
Re: using Workspace java interface
Post by BrianDrian »
I took a look and plugins look to be trigger from a already open oxygen editor. What I want to do is run up oxygen from my application providing a list of xml files to be opened.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: using Workspace java interface
Post by alex_jitianu »
Hi,
I see that you already got a hint for opening files from an external Java application on http://www.oxygenxml.com/forum/topic10128.html. I'm making a reference to that post so that anyone that comes to this thread sees the solution.
Alex
I see that you already got a hint for opening files from an external Java application on http://www.oxygenxml.com/forum/topic10128.html. I'm making a reference to that post so that anyone that comes to this thread sees the solution.
Alex
-
- Posts: 6
- Joined: Sat Oct 05, 2013 4:34 pm
Re: using Workspace java interface
Post by BrianDrian »
This hint works, however the set of files I want to open is variable. I had to jump through a few hoops to get it to work in all cases. I could be useful to have oxygen scan the String[] array and just ignore nulls.
Anyway it works. btw thanks for the reply. I might add some plugins for my app.
Brian
Anyway it works. btw thanks for the reply. I might add some plugins for my app.
Brian
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