add-on frameworks location
Oxygen general issues.
-
- Posts: 2
- Joined: Thu Aug 29, 2013 2:29 am
add-on frameworks location
Post by chris.ditcher »
Hi,
I am deploying a framework as an add on to one of our web servers so that our clients can receive updates when we deploy new versions of the framework. This is a nice feature and works well. However, I am trying to resolve a reference to a file found in the frameworks directory (the schema) and having a hard time getting there.
The framework is deployed in the %APPDATA% directory (users.{username}.AppData.Roaming.etc) by default and all the editor variables in my framework seem to expand correctly (${frameworks}, etc). The problem occurs when I try to reference files in my ${frameworks} directory using the following code from an implementation of AuthorOperation:
The value of expandedVar is always the default value set for frameworks directory (ex: C:\ProgramFiles\OxygenAuthor\frameworks) instead of the frameworks directory my add-on is using (in the %APPDATA% directory).
Is there a way to access these files better?
I am deploying a framework as an add on to one of our web servers so that our clients can receive updates when we deploy new versions of the framework. This is a nice feature and works well. However, I am trying to resolve a reference to a file found in the frameworks directory (the schema) and having a hard time getting there.
The framework is deployed in the %APPDATA% directory (users.{username}.AppData.Roaming.etc) by default and all the editor variables in my framework seem to expand correctly (${frameworks}, etc). The problem occurs when I try to reference files in my ${frameworks} directory using the following code from an implementation of AuthorOperation:
Code: Select all
String frameworksDir = EditorVariables.expandEditorVariables("${frameworks}", aa.getDocumentController().getAuthorDocumentNode().getSystemID());
Is there a way to access these files better?
-
- Posts: 9472
- Joined: Fri Jul 09, 2004 5:18 pm
Re: add-on frameworks location
Hi Chris,
Indeed the ${frameworks} editor variable always expand to Oxygen's builtin frameworks folder.
Your add-on works because when it makes references it uses the editor variable ${framework} and thus refers to locations relative to the place where it is deployed in the user's home folder.
If you have access to the API ro.sync.ecss.extensions.api.AuthorAccess you can do this:
Because you are calling the code from the add-on Oxygen should expand the path to the add-on for you. Attention, the EditorVariables code will not work given the same parameters.
Or:
When you edit your document type in Oxygen's Preferences->Document Type Association page you have the "Classpath" tab in which you probably already added references to all your JAR libraries.
This list of classpath entries is used to create the individual add-on class loader in which your code gets executed. If in that list you add a reference to your schema's folder like:
then in the add-on's Java code you could probably do something like:
to obtain an URL pointing to the mySchema.xsd schema located in the schemas folder from your add-on.
Regards,
Radu
Indeed the ${frameworks} editor variable always expand to Oxygen's builtin frameworks folder.
Your add-on works because when it makes references it uses the editor variable ${framework} and thus refers to locations relative to the place where it is deployed in the user's home folder.
If you have access to the API ro.sync.ecss.extensions.api.AuthorAccess you can do this:
Code: Select all
authorAccess.getUtilAccess().expandEditorVariables("${framework}", null);
Or:
When you edit your document type in Oxygen's Preferences->Document Type Association page you have the "Classpath" tab in which you probably already added references to all your JAR libraries.
This list of classpath entries is used to create the individual add-on class loader in which your code gets executed. If in that list you add a reference to your schema's folder like:
Code: Select all
${framework}/schemas/
Code: Select all
this.getClass().getResource("/mySchema.xsd");
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Thu Aug 29, 2013 2:29 am
Re: add-on frameworks location
Post by chris.ditcher »
Thanks Radu! That did the trick. Also good to know I can get a hold of resources as you suggested. I will test this option as well.
Cheers.
Cheers.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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