use of environment variables in templates
Oxygen general issues.
-
- Posts: 16
- Joined: Sat Jul 28, 2012 11:41 am
use of environment variables in templates
Hi all,
I'd like to use environment variables with code templates and templates. For example : when creating a new file from a template, the name of the user is in a <user>name</user> element. Aren't the username in the system propreties or the operating sytstem properties ?
I admit I don't quite get the documentation of http://www.oxygenxml.com/doc/ug-editor/ ... ables.html
and especially this :
thanks
emma
I'd like to use environment variables with code templates and templates. For example : when creating a new file from a template, the name of the user is in a <user>name</user> element. Aren't the username in the system propreties or the operating sytstem properties ?
I admit I don't quite get the documentation of http://www.oxygenxml.com/doc/ug-editor/ ... ables.html
and especially this :
Could you provide one or two examples ?${env(VAR_NAME)} - Value of the VAR_NAME environment variable. The environment variables are managed by the operating system. If you are looking for Java System Properties, use the ${system(var.name)} editor variable;
${system(var.name)} - Value of the var.name Java System Property. The Java system properties can be specified in the command line arguments of the Java runtime as -Dvar.name=var.value. If you are looking for operating system environment variables, use the${env(VAR_NAME)} editor variable instead;
thanks
emma
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: use of environment variables in templates
Hi Emma,
System properties and environmental variables are not the same thing.
If you want to see a list of all system properties and values you can go to the Oxygen Help->About dialog and look in the System properties tab.
If you want a list of environment variables and you are on Windows you can open a command line outside of Oxygen and type SET.
Basically for your use case both of these options would work:
Regards,
Radu
System properties and environmental variables are not the same thing.
If you want to see a list of all system properties and values you can go to the Oxygen Help->About dialog and look in the System properties tab.
If you want a list of environment variables and you are on Windows you can open a command line outside of Oxygen and type SET.
Basically for your use case both of these options would work:
Code: Select all
<user>${system(user.name)}</user>
Code: Select all
<user>${env(USERNAME)}</user>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: use of environment variables in templates
Hi Emma,
Right, the environmental variables differ from one operating system to another. But most of the Java system properties do not so they are better in this regard, if you want to share your customized template with some one else who works on Windows or Linux.
Regards,
Radu
Right, the environmental variables differ from one operating system to another. But most of the Java system properties do not so they are better in this regard, if you want to share your customized template with some one else who works on Windows or Linux.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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