Resolve editor variables in string parameter default values of refactoring operations
Are you missing a feature? Request its implementation here.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Resolve editor variables in string parameter default values of refactoring operations
Post by chrispitude »
In an XSLT refactoring operation, I would like the default value of a string parameter to default to the current user ID by using an Oxygen editor variable:
However, currently editor variables are not resolved:
It would be great if this were supported. (It would be nice if they also resolved in the descriptions, but this is not necessary as the default value will make itself obvious.)
A testcase is included:
Code: Select all
<parameter type="TEXT" name="my-string-user" label="my-string-user">
<description>my-string-user, defaults to ${author.name}</description>
<possibleValues>
<value name="string-default" default="true">${author.name}</value>
</possibleValues>
</parameter>
image.png
It would be great if this were supported. (It would be nice if they also resolved in the descriptions, but this is not necessary as the default value will make itself obvious.)
A testcase is included:
oxygen_refactoring_string_default_vars.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Resolve editor variables in string parameter default values of refactoring operations
Hi Chris,
I added your comment on an already opened internal issue:
EXM-33203 XML Refactoring operations should be able to use and expand editor variables
So ideally we should expand editor variables in parameter values before they are passed to the XML refactoring stylesheets.
But you do have an uglier workaround, call a static Java method we provide directly in the XSLT code to expand editor variables:
So if for example the end user leaves the author name parameter empty, you could expand in the XSLT stylesheet the ${author.name} editor variable and use that instead.
Regards,
Radu
I added your comment on an already opened internal issue:
EXM-33203 XML Refactoring operations should be able to use and expand editor variables
So ideally we should expand editor variables in parameter values before they are passed to the XML refactoring stylesheets.
But you do have an uglier workaround, call a static Java method we provide directly in the XSLT code to expand editor variables:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.0"
xmlns:edVars="java:ro.sync.util.editorvars.EditorVariables">
<xsl:template match="node() | @*">
<xsl:message><xsl:value-of select="edVars:expandEditorVariables('${author.name}', '')"/></xsl:message>
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Resolve editor variables in string parameter default values of refactoring operations
Post by chrispitude »
Thanks Radu!
In my testcase, TEXT parameters do not accept empty values; the Next and Finish buttons are disabled until text is present in every TEXT field.
Some TEXT parameters might require values while others are optional and can be blank. Is there a way to specify this in the descriptor file?
In my testcase, TEXT parameters do not accept empty values; the Next and Finish buttons are disabled until text is present in every TEXT field.
Some TEXT parameters might require values while others are optional and can be blank. Is there a way to specify this in the descriptor file?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Resolve editor variables in string parameter default values of refactoring operations
Hi Chris,
I think specifying optional=true on it should work:
Regards,
Radu
I think specifying optional=true on it should work:
Code: Select all
<parameter type="TEXT" name="my-string-user" label="my-string-user" optional="true">
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)
- ↳ 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