Closed josteinaj closed 8 years ago
The MTM script (https://github.com/snaekobbi/pipeline-mod-mtm/blob/master/src/main/resources/xml/dtbook-to-pef.xpl) is already putting default values in the select attributes. Is that OK as an example?
Yes.
I guess the problem then is that the web API doesn't include the default value in the output:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<script href="http://localhost:8181/ws/scripts/mtm:dtbook-to-pef" id="mtm:dtbook-to-pef" xmlns="http://www.daisy.org/ns/pipeline/data">
<nicename>DTBook to PEF (MTM)</nicename>
<description>Transforms a DTBook (DAISY 3 XML) document into a PEF.</description>
<version>1.3.0</version>
<input desc="" mediaType="application/x-dtbook+xml" name="source" nicename="" required="true" sequence="false"/>
<option desc="The identifier for the resulting PEF-file." name="identifier" nicename="Identifier" ordered="true" required="true" sequence="false" type="string"/>
<option desc="Keeps imggroup if value is true or if imagegroup contains a prodnote." name="keepCaptions" nicename="Keep imggroup without prodnote" ordered="true" required="false" sequence="false" type="boolean"/>
<option desc="Select 'No' for double line spacing." name="single-line-spacing" nicename="Single line spacing" ordered="true" required="false" sequence="false" type="boolean"/>
<option desc="Number of rows." name="rows" nicename="Rows" ordered="true" required="false" sequence="false" type="string"/>
<option desc="Number of characters on a row." name="cols" nicename="Columns" ordered="true" required="false" sequence="false" type="string"/>
<option desc="The inner margin size, counted in characters." name="inner-margin" nicename="Inner margin" ordered="true" required="false" sequence="false" type="string"/>
<option desc="The outer margin size, counted in characters." name="outer-margin" nicename="Outer margin" ordered="true" required="false" sequence="false" type="string"/>
<option desc="Keeps the intermediary OBFL-file for debugging." name="include-obfl" nicename="Include OBFL" ordered="true" required="false" sequence="false" type="boolean"/>
<option desc="Additional options using the following syntax: (name1:value1)(name2:value2)..." name="query" nicename="Advanced options" ordered="true" required="false" sequence="false" type="string"/>
</script>
(output from the engine running on the test server)
Isn't it suppsed to include default
attributes on the option
s?
Yes but we need to include the latest webservice-utils I think: https://github.com/daisy/pipeline-framework/pull/90
(planned for milestone 1.10 but I hope we can include it without much trouble)
Scripts now have default option values declared in them.
The Web UI uses "true" for booleans and the empty string for strings. Start declaring the actual desired default value in the scripts.