Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

parseXsltParameters #69

Open
ksdm2e opened this issue Dec 2, 2013 · 1 comment
Open

parseXsltParameters #69

ksdm2e opened this issue Dec 2, 2013 · 1 comment
Assignees
Labels

Comments

@ksdm2e
Copy link

ksdm2e commented Dec 2, 2013

xslparams are not processed

reason:
The parseXsltParameters in https://github.com/DM2E/dm2e-ws/blob/master/src/main/java/eu/dm2e/utils/XsltUtils.java expects a set of parameters separated by linebreaks (comp. line 64, str.split("\n"));

The corresponding field xslparams is a textfield, where multi-lined content is not possible.

Solution:
Either, change the split param to something like ";"
or change the textfield to textarea.

Additionally, in lines 67-70 you can use
line = line.trim()
instead of regex
line = line.replaceAll("^\\s*", ""); line = line.replaceAll("\\s*$", "");

@kba
Copy link
Member

kba commented Dec 2, 2013

To make the input field a text area the GUI needs to know about this. So we would need to adapt ParameterPojo with a boolean containsNewline (default: false ; if yes show <textarea>, if no show <input type="text>).

For now, we can also change the key-value pair delimiter to ;, this is trivial to implement.

Additionally, it should be possible to define a set of XSLT parameters (using the one-key-value-pair-per-line syntax) as a URL input parameter. The transformation engine should load the parameters (named e.g. BASE/xslt/param/xmlParamsResource), parse them and use them. The advantage of this approach is that one XSLT script configuration could be re-used and users wouldn't need to know the parameter names, as in the text input/textarea solution.

Priority should be:

  • Parameter default value defined in the XSLT script
  • Parameter value defined by referenced set of parameters
  • Parameters defined directly in the configuration

To get this running ASAP, I suggest to extend the XSLT / XSLT-ZIP service to accept and handle an additional xmlParamsResource as described above. @ksdm2e Do you think you can implement and test this?

@ghost ghost assigned ksdm2e Dec 11, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants