DXF (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

What are Dynamic XML Forms? (DXF)

DXF is a method for quickly creating user interface pages for editing metadata. It's called "dynamic" because the HTML editing form is generated dynamically in JavaScript based on XML specification (a template) which identifies how the editing page is generated.

Each DXF Template specifies:

  • Every GUI element to be displayed on the page, including:
    • The type of GUI element (string, boolean, textarea, multi-valued entry, etc.)
    • The user-friendly label for the element (the @display) attribute)
    • The order of elements
      • The order in the template is the same as the order they are displayed on the user interface page.
    • Help text for the element for pop-up help for the user (the <dxf:help> tag)
    • Validations for textareas, passwords, strings, etc.
    • How elements are grouped together into sets
      • For example, a number of nested elements which all pertain to the same structure or object (e.g. a structure User could have (name - string, id - integer, domain - string, access - pulldown)).
    • Other GUI Element attributes, like the number of columns / size of a textarea, etc.
    • Some elements can be simply for display, like headers and embedded text.
  • The XML tags which are to be generated to represent the data entered by the user.

Who Needs to Use DXF?

You will need to use DXF if you are:

  • Creating an App Bundle which requires property settings.
    • For example, suppose you create an App Bundle which needs to talk to a database. You may want to let the user specify the JDBC URL of the database. You would specify this as a property setting specified with ${property} in your configuration file.
    • Now suppose you want to use the Aspire Admin interface to load the app bundle? You will need to specify a DXF template so that the Aspire UI can present an HTML form for editing the properties of your App Bundle.


App Bundles are used for:

  1. Connectors for the Aspire connector framework which requires properties for content sources that it processes.
    • Connectors in Aspire receive their data from content sources which are configured by the Aspire UI. These connectors will use DXF templates so that the user can specify properties for the content source which is to be processed, such as the source URL, whether or not to scan sub directories, file patterns to allow, file patterns to exclude, etc.
  2. Publishers for Aspire which requires properties to publish to a search engine.
    • Publishers in Aspire receive their data from the connector. These publishers will use DXF templates so that the user can specify properties to connect to the search engine to which the data is going to be published.
  3. Applications for the Aspire workflow which requires properties to process the jobs.
    • Applications in Aspire Workflow receive their data from the connector after the scan. These applications will use DXF templates so that the user can specify properties process the jobs in the Workflow.

DXF Controls

String

A simple text-entry box.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @style - Additional CSS styling to apply to the text control.
  • @allowEmptyString - When "true", the element is created (with an empty string) when there's no text data entered by the user. If "false", the XML element will be entirely removed from output XML when there's no string entered. (default: false)
  • @placeholder - Adds a placeholder to the text field to show the user what is expected on this field. If no placeholder is specified, the default will be the placeholder
  • @validations - Indicates which validations are going to be applied to this field. All the validations must be separated by a comma (,) without spaces.
    • @protocols - Indicates which protocols can be used for this field. This attribute only can be used with the url validation.
    • @regex - Indicates what regex is going to be used as a validation for this field. This attribute can only be used with the regex validation.
    • @min - Sets a minimum value for a integer value. This attribute can only be used with the integer validation.
    • @max - Sets a maximumvalue for a integer value. This attribute can only be used with the integer validation.


Use the nested <dxf:help> tag to provide pop-up help for the element.


DXF Template Example

  <example display="String" type="string" placeholder="placeholder">
    <dxf:help>Help for the string control.</dxf:help>
  </example>

Display

Dxf-String.png

XML Output Example

 <example>my text</example>

Integer

A box with increasing and decreasing options for number ranges. If something that it is not a number is inserted in this control, it will return empty.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @style - Additional CSS styling to apply to the text control.
  • @min - Sets a minimum limit for the control. This attribute can also be used with the integer validation.
  • @max - Sets a maximum limit for the control. This attribute can also be used with the integer validation.
  • @validations - Indicates which validations are going to be applied to this field. All the validations must be separated by a comma (,) without spaces.
    • @regex - Indicates what regex is going to be used as a validation for this field. This attribute can only be used with the regex validation.


Use the nested <dxf:help> tag to provide pop-up help for the element.


DXF Template Example

  <example type="integer" default="10" min="0" max="100" display="Integer">
    <dxf:help>Help for the integer control.</dxf:help>
  </example >

Display

Dxf-Integer.png

XML Output Example

  <example>10</example>

Password

A string entry control for entering and encrypting passwords. Text entered into this control is automatically sent to Aspire to be encrypted using the master password.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @style - Additional CSS styling to apply to the control.
  • @placeholder - Adds a placeholder to the passwordfield to show the user what is expected on this field. If no placeholder is specified, the default will be the placeholder
  • @validations - Indicates which validations are going to be applied to this field. All the validations must be separated by a comma (,) without spaces.
    • @regex - Indicates what regex is going to be used as a validation for this field. This attribute can only be used with the regex validation.


Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example display="Password" type="password" placeholder="placeholder">
    <dxf:help>Help for the password control.</dxf:help>
  </example>

Display

Dxf-Password.png

XML Output Example

<example>encrypted:BCB2E1399239A551A9E363915BCA7545</example>

Boolean

A check box control for true/false boolean data.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data. Either "true" or "false". (if not provided, @default is assumed to be "false")

Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example display="Boolean" type="boolean">
    <dxf:help>Help for the boolean control.</dxf:help>
  </example>

Display

Dxf-Boolean.png

XML Output Example

 <example>true</example>

Checklist  (2.0.3 Release)  

A list of check box controls for true/false boolean data.

Attributes:

  • @display - The default label to display as the legend of the list.
  • @default - The default value for all the checkboxes in the list.
  • @itemValues - The list of values that are going to be checkboxes separated by comma e.g. ("one,two,three,...")
  • @itemNames (Optional) - The list of names to display before each checkbox e.g. ("A,B,C,D,E,F,G,H,I,J") *The names must be in the same order as the values.
  • @itemTagName - The name of the tag for the checkboxes.


DXF Template Example

  <example type="checklist" itemValues="1,2,3,4,5,6,7" itemNames="One,Two,Three,Four,Five,Six,Seven" itemTagName="item" default="true" display="Check List"/>

Display

Dxf-Checklist.png

XML Output Example

 <example>
   <item value="1">true</item>
   <item value="2">false</item>
   <item value="3">true</item>
   <item value="4">false</item>
   <item value="5">true</item>
   <item value="6">false</item>
   <item value="7">true</item>
 </example>

Pulldown

Allows the user to select a single item from a list of alternatives using a single selection pull-down control. Options in the pull-down can map what is displayed to the user to a different value stored in the output XML.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data. This must be one of the "values" specified on one of the nested <dxf:option> tags.
  • @style - Additional CSS styling to apply to the control.

Use the nested <dxf:help> tag to provide pop-up help for the element.

The pulldown type must have nested <dxf:option> tags to specify the enumerated list of options which will be displayed to the user. Attributes for this tag include:

  • @display - The value to display to the user for the option. If @display is missing, then @value will be used for @display.
  • @value - The value to be output in the result XML for the item.

DXF Template Example

  <example display="Pulldown" type="pulldown">
   <dxf:help>Help for the pulldown control.</dxf:help>
  
   <dxf:option display="Option 1">Option A</dxf:option>
   <dxf:option display="Option 2">Option B</dxf:option>
   <dxf:option display="Option 3">Option C</dxf:option>
 </example>

Display

Dxf-Pulldown.png

XML Output Example

 <example>Option A</example>

Textarea

A multi-line text entry control good for entering large blocks of text such as SQL statements, scripts, etc.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @style - Additional CSS styling to apply to the control.
  • @rows - The height of the text area control, in rows.
  • @placeholder - Adds a placeholder to the textarea field to show the user what is expected on this field. If no placeholder is specified, the default will be the placeholder
  • @validations - Indicates which validations are going to be applied to this field. All the validations must be separated by a comma (,) without spaces.
    • @protocols - Indicates which protocols can be used for this field. This attribute only can be used with the listurls validation.
    • @regex - Indicates what regex is going to be used as a validation for this field. This attribute can only be used with the regex validation.

Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example display="Textarea" type="textarea" rows="5" placeholder="placeholder">
    <dxf:help>Help for the textarea control.</dxf:help>
  </example>

Display

Dxf-Textarea.png

XML Output Example

  <example>
    <![CDATA[println("Hello world");]]>
  </example>

Fieldset  (2.2 Release)  

Groups a set of components in a same category

Attributes:

  • @legend- (Optional) The label to be displayed for the user before the control.

DXF Template Example

   <example>
	 <dxf:fieldset legend="Legend">
	   <snapshotDir display="Snapshot Directory" type="string" default="${dist.data.dir}/${app.name}/snapshots" placeholder="${dist.data.dir}/${app.name}/snapshots">
		 <dxf:help>Directory where content snapshots will be placed.</dxf:help>
	   </snapshotDir>
	   <debug display="Debug" type="boolean">
		 <dxf:help>Check if you want debug messages enabled.</dxf:help>
	   </debug>
	 </dxf:fieldset>
   </example>

Display

Dxf-Fieldset.png

XML Output Example

  <example>
    <snapshotDir>${dist.data.dir}/${app.name}/snapshots</snapshotDir>
    <debug>false</debug>
  </example>

Scheduler

A pull-down control which has four (4) options to do scheduling.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @defaultType - Select the type of scheduler you want to show by default, if non is selected it uses the best one according to the default value.
  • @useNone - Enables the use of the option None.

Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example type="scheduler" default="0 0 0 ? * *"  display="Scheduler" useNone="true">
			<dxf:help>Help for the scheduler  control..</dxf:help>
		</example>

Display

Dxf-Scheduler.png

XML Output Example

  <example >0 0 12 ? * MON,THU,FRI</example>

Application

A pull-down control which is automatically filled out with the names of all installed applications that match a specified set of type flags. This is useful for creating routing tables or branching destinations for jobs.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @style - Additional CSS styling to apply to the control.
  • @typeFlag - The type of application to display in the pull-down. Only applications with an application.xml which has the specified type flag will be displayed in the pull-down. See Application Type Flags for more details.

Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example display="Application" type="application" typeFlag="scheduled">
    <dxf:help>Help for the application control.</dxf:help>
  </example >

Display

Dxf-Application.png

XML Output Example

 <example>/Amazon_S3</example>

Component

A pull-down control which is automatically filled out with the names of all installed components that match a specified set of flags. The list of components returned to the control is only guaranteed to be valid when the form is created.

Attributes:

  • @display - The label to be displayed for the user before the control.
  • @style - Additional CSS styling to apply to the control.
  • @factory- The Aspire factory name of the components required (mandatory)
  • @subType- The sub-type of the required components (optional - returns all components from the factory if not given)

Use the nested <dxf:help> tag to provide pop-up help for the element.

DXF Template Example

  <example type="component" factory="aspire-post-http" subType="default" display="Component">
    <dxf:help>Help for the component control.</dxf:help>
  </example >

Display

Dxf-Component.png

XML Output Example

 <example>/Publish to solr/Main/PostHTTP</example>

Test Connection

Displays a button that test the connection of the current connector. This DXF must only be used at the end of DXF for connectors.

Attributes:

  • @style - Adds CSS styling to apply to the horizontal rule.

DXF Template Example

   <dxf:testconnection />

Display

Dxf-Testconnection.png

Headers: <dxf:h1>, <dxf:h2>

These headers display header text in the form. They are for display only, they have no affect on the XML output.

Attributes:

  • @style - Adds CSS styling to apply to the header style.

DXF Template Example

  <dxf:h1>Header 1</dxf:h1>
  <dxf:h2>Header 2</dxf:h2>

Display

Dxf-H1-H2.png

Horizontal Rule: <dxf:hr>

Displays a horizontal rule in the form. This is for display only, it has no affect on the XML output.

Attributes:

  • @style - Adds CSS styling to apply to the horizontal rule.

DXF Template Example

   <dxf:hr/>

Display

Dxf-HR.png

Line Break: <dxf:br>

Copies an HTML <br/> tag to the output. This may be useful for adding space after other UI widgets.

DXF Template Example

   <dxf:br/>

Constant

The "constant" type displays no user interface control at all, but merely copies it's data directly to the XML output. It is primarily useful inside the "dxf:alternatives" tag below, so that different alternatives can copy different constant values to the output.

DXF Template Example

 <example type="constant">ABCD</example>

Alternatives / Alternative

The alternatives control allows the user to make a choice, and then based on that choice to fill out a set of nested form items.

There are currently two supported "alternative" methods. The first is "accordion", which allows the user to choose an alternative based on a set of radio buttons. Once the radio is chosen, nested controls are revealed which the user can then fill out.

The second supported method is "checkbox". When checked or unchecked, a different set of nested input controls are revealed.

The basic structure of alternatives is shown below:


    <dxf:alternatives subType="accordion" display="Header for the Options" key="choiceOutputKey">

      <dxf:alternative display="First Alternative" value="firstValue">
        ** nested controls for first alternative go here **
      </dxf:alternative>

      <dxf:alternative display="Second Alternative" value="secondValue">
        ** nested controls for second alternative go here **
      </dxf:alternative>
      
      ** Any number of alternatives can go here
      .
      .
      .
    </dxf:alternatives>

Attributes for <dxf:alternatives>:

  • @display - The label to be displayed for the user before the control.
  • @default - The default value to display if none is provided in the initialization data.
  • @subType - The type of alternatives to show, either "checkbox" or "accordion"
  • @key - The XML tag which will be output as the key value
Note that the top-level accordion value must be output as an XML tag, it can not be output into an XML attribute.

<dxf:alternatives> can have a nested <dxf:help> tag for top level help, but this is only shown when subType="checkbox".

Attributes for <dxf:alternative>:

  • @display - What label to display to the user for this alternative.
  • @value - The value for the resulting XML tag to be output if this alternative is selected.

Note that <dxf:alternative> can have a nested <dxf:help> tag which provides help on each of the nested alternatives. This only shown when subType="accordion".

Alternatives: Accordion

The "accordion" alternatives type presents a set of radio buttons, each one with a banner. Additional form entry controls will be revealed underneath the selected radio button.

DXF Template Example

  <dxf:alternatives subType="accordion" display="Alternavite Accordion" key="example" default="Option B">
    <dxf:help>Help for the alternatives control.</dxf:help>

    <dxf:alternative value="Option A" display="Option 1">
      <option1 display="Boolean 1" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option1>
    </dxf:alternative>
    
    <dxf:alternative value="Option B" display="Option 2">
      <option2 display="Boolean 2" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option2>
    </dxf:alternative>
    
    <dxf:alternative value="Option C" display="Option 3">
      <option3 display="Boolean 3" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option3>
    </dxf:alternative>
  </dxf:alternatives>

Display

Dxf-Alternative-Accordion.png

XML Output Example

  <example>Option B</example>
  <option2>false</option2>

Alternatives: Pulldown  (2.2 Release)  

The "pulldown" alternatives type presents a pulldown with all the options. Additional form entry controls will be revealed underneath the pulldown once an option is selected.

DXF Template Example

</example>
  <dxf:alternatives subType="pulldown" display="Alternavite Accordion" key="example" default="Option B">
    <dxf:help>Help for the alternatives control.</dxf:help>

    <dxf:alternative value="Option A" display="Option 1">
      <option1 display="Boolean 1" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option1>
    </dxf:alternative>
    
    <dxf:alternative value="Option B" display="Option 2">
      <option2 display="Boolean 2" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option2>
    </dxf:alternative>
    
    <dxf:alternative value="Option C" display="Option 3">
      <option3 display="Boolean 3" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </option3>
    </dxf:alternative>
  </dxf:alternatives>
</example>

Display

Dxf-Alternative-Pulldown.png

XML Output Example

  <example>Option B</example>
  <option2>false</option2>

Alternatives: Checkbox

The "checkbox" type shows a checkbox. Based on the state of the checkbox (true or false), a different set of nested controls will be displayed. In the example below, only the "true" condition displays nested form controls.

DXF Template Example

    <dxf:alternatives subType="checkbox" display="Alternavite Checkbox" key="alternativeCheckboxn" default="false">
    	<dxf:help>Help for the alternatives control.</dxf:help>

    	<dxf:alternative value="false">
      		<option1 display="Boolean 1" type="boolean">
        		<dxf:help>Help for the boolean control.</dxf:help>
      		</option1>
    	</dxf:alternative>
    
    	<dxf:alternative value="true">
		  <option2 display="Boolean 2" type="boolean">
			<dxf:help>Help for the Option 2..</dxf:help>
		  </option2>
    	</dxf:alternative>
    </dxf:alternatives>

Display

Dxf-Alternative-Checkbox1.png
Dxf-Alternative-Checkbox2.png

XML Output Example

<example>true</example>
<option2>false</option2>

Multi-Valued Entry

This control is used to wrap multiple entries which need to be replicated.

Attributes:

  • @multiple - when added to a parent(and set to true), will enable replication of all entries contained in such parent. Notice that not all parents support the multiple attribute, in which cases, you should wrap everything inside a DXF parent type.
  • @minCount - Tells the minimum amount of times entries should appear replicated. If zero, none will show.
  • @maxCount - Tells the maximum amount of times entries should appear replicated. If zero, there will be no limit.

For example, if the target XML looks like:


  <examples>

    <example option="XXX" check="XXX">
      <optionType>XXX</optionType>
    </example>

    <example option="XXX" check="XXX">
      <optionType>XXX</optionType>
    </example>
    
    .
    .
    .

  </examples>

The multi-valued entry control allows to configure a template for the 'user' element once, and automatically add new sets as necessary.

DXF Template Example

As an attribute of a parent DXF type:

<examples>
  <dxf:parent multiple="true" minCount="1" maxCount="4">
    <example>

      <dxf:attribute name="option" display="Option" type="string" placeholder="placeholder">
        <dxf:help>Help for the string control.</dxf:help>
      </dxf:attribute>

      <dxf:attribute name="check" display="Check" type="boolean">
        <dxf:help>Help for the boolean control.</dxf:help>
      </dxf:attribute>

      <optionType type="pulldown" display="Type" default="A">
        <dxf:help>Help for the pulldown control.</dxf:help>
        <dxf:option display="Type A">A</dxf:option>
        <dxf:option display="Type B">B</dxf:option>
        <dxf:option display="Type C">C</dxf:option>
      </optionType>

    </example >
  </dxf:parent>
</examples>

As an attribute of a simple container:

<examples>
  <example multiple="true" minCount="1" maxCount="4">

    <dxf:attribute name="option" display="Option" type="string" placeholder="placeholder">
      <dxf:help>Help for the string control.</dxf:help>
    </dxf:attribute>
    
    <dxf:attribute name="check" display="Check" type="boolean">
      <dxf:help>Help for the boolean control.</dxf:help>
    </dxf:attribute>

    <optionType type="pulldown" display="Type" default="A">
      <dxf:help>Help for the pulldown control.</dxf:help>
      <dxf:option display="Type A">A</dxf:option>
      <dxf:option display="Type B">B</dxf:option>
      <dxf:option display="Type C">C</dxf:option>
    </optionType>

  </example >
</examples>

Both examples will have exactly the same output (as shown in the XML above).

Display

Dxf-Multiple1.png

XML Output Example

 <examples>
   <example option="One" check="true">
     <optionType>A</optionType>
   </example>
   <example option="Two" check="false">
     <optionType>C</optionType>
   </example>
 </examples>

Special Case

DXF Template Example

The following is an example in which case you must use the parent DXF type:

  <examples>
    <dxf:parent multiple="true" minCount="0" maxCount="4">
      <app type="application" typeFlag="scheduled" display="Pipeline"/>
    </dxf:parent>
  </examples>

Notice that you cannot add the "multiple" attribute directly to the "app" entry. DXF type application is not compatible with the multiple attribute, so you need to wrap it with a DXF parent. A sample XML generated by the above template looks like:

Display

Dxf-Multiple2.png

XML Output Example

 <examples>
   <app>/Amazon_S3</app>
   <app>/Confluence</app>
   <app>/Documentum</app>
 </examples>

Notice the Dxf-MultipleX.png on the top right corner of each entry. If clicked, it will delete the selected value. Similarly, Add new will create a new empty set which can then be configured.

Validations

The validations is a new feature introduced with Aspire 2.0. You can only use validations for the controls String, Password, Integer, and Textarea. This validations can be used in the validation attribute, by listing the name of the validations and separate them with a comma (,).

Required

Indicates that the current field must not be empty. To use this validation use the name "required".

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="required"/>

Display

Dxf-Required.png

*Only use this validation with String, Integer, Password and Textarea controls.

Url

Use this when the expected string is a url, it validates the format of the url to be <something>://<something>. To use this validation use the name "url".

DXF Template Example

 <example type="string" display="Example" placeholder="placeholder" validations="url"/>

Display

Dxf-Url.png

*Only use this validation with the String control.

Protocols

You can specify the allowed protocols in a url using the "protocols" attribute. To use this validation you must have the validation "url" and add the attribute "protocols" with the list of the protocols separated by a comma (,).

DXF Template Example

 <example type="string" display="Example" placeholder="placeholder" validations="url" protocols="http,https"/>

Display

Dxf-Protocols.png

*Only use this validation with the String control.

Integer

Use this validation when the expected string is a number without commas or dots and can be negative or positive, without limits. To use this validation use the name "integer".

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="integer"/>

Display

Dxf-Integer-Val.png

*Only use this validation with String and Integer controls.

Min

You can specify a minimum limit to the inserted string using the "min" attribute. To use this validation you must have the validation "integer" and add the attribute "min" with minimum value allowed.

DXF Template Example

 <example type="string" display="Example" placeholder="placeholder" validations="integer" min="0"/>

Display

Dxf-Min.png

*Only use this validation with String and Integer controls.

Max

You can specify a maximum limit to the inserted string using the "max" attribute. To use this validation you must have the validation "integer" and add the attribute "max" with maximum value allowed.

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="integer" max="10"/>

Display

Dxf-Max.png

*Only use this validation with String and Integer controls.

Float

Use this validation if the expected string is a number with or without decimal. To use this validation use the name "float".

Float Validated Formats

  • 1
  • 1.0
  • 1.1
  • -1.0
  • +1.0
  • 1.2E3
  • 1.2e3
  • 1.2E+3
  • 1.2E-3
  • 1.2e+3
  • 1.2e-3
  • -1.2E3
  • -1.2e3
  • -1.2E+3
  • -1.2E-3
  • -1.2e+3
  • -1.2e-3
  • +1.2E3
  • +1.2e3
  • +1.2E+3
  • +1.2E-3
  • +1.2e+3
  • +1.2e-3

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="float"/>

Display

Dxf-Float.png

*Only use this validation with the String control.

Path

Use this validation when the expected string is a relative path or an absolute path which starts with "[a-z]:\" or "\\" for windows, or "/" for linux. It also checks for invalid characters. To use this validation use the name "path".

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="path"/>

Display

Dxf-Path1.png
Dxf-Path2.png

*Only use this validation with the String control.

Time Period

Use this validation when the expected string is a time period. To use this validation use the name "timeperiod".

Time Period Validated Formats

  • 1ms (milliseconds)
  • 1s (seconds)
  • 1m (minutes)
  • 1h (hours)
  • 1d (days)

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="timeperiod"/>

Display

Dxf-Time-Period.png

*Only use this validation with the String control.

List Urls

Use this validation when the expected string from a textarea is a list of urls, it validates the format per line of the url to be <something>://<something>. To use this validation use the name "listurls".

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="listurls"/>

Display

Dxf-List-Urls1.png

*Only use this validation with the Textarea control.

Protocols

You can specify the allowed protocols in a url using the "protocols" attribute. To use this validation you must have the validation "listurls" and add the attribute "protocols" with the list of the protocols separated by a comma (,).

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="listurls" protocols="ftp"/>

Display

Dxf-List-Urls2.png

*Only use this validation with the Textarea control.

Regex

Use this validation when none of the previus validations could work for the expected string. With this validation you can use a regex to validate the string. To use this validation use the name "regex" nd add the attribute "regex" with the regex you want to use to validated the string.

DXF Template Example

  <example type="string" display="Example" placeholder="placeholder" validations="regex" regex="hello"/>

Display

Dxf-Regex.png

*Only use this validation with String, Integer, Password and Textarea controls.


DXF Escape Content

In some cases the content of a tag needs to be in a string format, but this content has more xml children. For this cases you can use the escapeValue attribute, this will escape the xml children of the tag with the attribute, into string. For example:

Using this dxf.

<examples>
  <example multiple="true" minCount="1" maxCount="4">

    <dxf:attribute name="option" display="Option" type="string" placeholder="placeholder">
      <dxf:help>Help for the string control.</dxf:help>
    </dxf:attribute>
    
    <dxf:attribute name="check" display="Check" type="boolean">
      <dxf:help>Help for the boolean control.</dxf:help>
    </dxf:attribute>

    <optionType type="pulldown" display="Type" default="A">
      <dxf:help>Help for the pulldown control.</dxf:help>
      <dxf:option display="Type A">A</dxf:option>
      <dxf:option display="Type B">B</dxf:option>
      <dxf:option display="Type C">C</dxf:option>
    </optionType>

  </example >
</examples>  

You would get the information like this

 <examples>
   <example option="Alfa" check="true">
     <optionType>A</optionType>
   </example>
 </examples>

But adding the escapeValue attribute to examples tag

<examples escapeValue="true">
 .
 .
 .
</examples>  

The information would be generated like this

 <examples>
   <![CDATA[    <example option="Alfa" check="true">
     <optionType>A</optionType>
   </example>]]>
 </examples>



This is helpful for Publishers and Applications of the Workflow, where the information is parse into a property format, where only the first level tag matters

<property name="examples">&lt;pre&gt; &lt;examples&gt;   &lt;example option="Alfa" check="true"&gt;     &lt;optionType&gt;A&lt;/optionType&gt;   &lt;/example&gt; &lt;/examples&gt;&lt;/pre&gt;</property>

DXF Development Tool

The DXF Development Tool allows you to enter DXF templates and properties in to a web page, and click a button to render the template. You can then modify the code/properties iteratively to construct the form you want. Once you've got things looking and functioning how you want, then take the DXF and use it in your application.

Accessing the DXF development tool

Too use the development tool, you must be running Aspire. The tool is accessed using a web browser, by navigating to

http://localhost:50505/aspire/files/testdxf.html

This should display the following page:

Dxf-Test1.png

Entering the DXF & properties

You can enter DXF & properties by typing or cutting and pasting in to the text areas on the page. If you need more space, you can resize the text areas or minimise the text area using the - icon next to the label.

You don't need to enter the properties. If you don't, or the XML structure does not match the structure of your template, the template will still display, but will not be populated and will use any default values you have used. You must put the same Root Node as the template in order to display the DXF.

Dxf-Test2.png

Rendering the DXF

When you have entered the template and properties you want, click the Render DXF button. This will cause a dialog to be displayed, using your DXF template. If you've entered properties, these will be used to initialise the template, and the form will appear populated.

You can then use the form as you would in an application and all selection/pull down/input elements should function. You can now test that your template looks and functions are you require.

Dxf-Render.png

Writing Data

When the form is displayed, you'll notice a Write Data button at the bottom right of the dialog. If you click this, the dialog will close, and the data contained on the form will be written to the Properties text area.

*One side effect of this is that the next time you render the form, it will be initialise with this data

Closing the form

If you don't want to write the data, you can close the form by clicking the X icon on the top right of the dialog.

Errors

If your template or properties are invalid, you'll see an error alert explaining the problem with the DXF.

Dxf-Test3.png

If it's not obvious what the issue is, please get in touch for support.