Documentation

Folder from URL

How to define folder Data URL settings

With the Data URL dialog you can define settings for retrieving information from a URL utilizing standard URL syntax. Custom search forms for input can also be enabled by including custom syntax within the URL statement. To access the Data URL dialog create a new folder with Data URL toggled on. Then select Data URL from the Folder Popup context menu. URL connections are only available with the Elite version of this application.
  • 1) The URL Statement tab is where you will enter the URL statement for retrieving the desired data. This field accepts any standard URL statement that an HTTP Web Server supports.
  • 2) The Field Settings tab is where you will be able to configure custom search form inputs, such as checkboxes, drop down lists, and text boxes, if custom fields are detected within the defined URL Statement. A custom field is enabled by including the syntax $FIELD[Label Name] within your URL Statement text. The words Label Name surrounded by brackets can be any text you desire. Placing these within the URL statement will automatically generate a search form for the desired inputs. The field values will then replace the $FIELD[Label Name] before the URL statement is passed to the HTTP Server. Surrounding text with $ENCODE[Text] will cause the Text to be encoded to the standard URL syntax prior to being passed to the HTTP Server.
  • 3) The Advanced Mapping tab is where you will be able to define an XML Map from the return data of the URL Statement. This is not required and should be left blank when following the guidelines of Defining the HTTP Server Script below. However, if you would like to parse an existing HTTP URL, such as an RSS feed or Microsoft SharePoint you will need to define how to map the data from the desired URL to our folder File and Column syntax. You do this by creating an XML Map definition within the Advanced Mapping tab. See Defining the Advanced Mapping XML Definition below for additional details.
  • 4 & 5) The Copy and Paste buttons are utilized to copy the Data URL settings from one Data URL dialog to another.
URL Statement Example:
http://www.mywebserver.com/index.php?firstyear=$ENCODE[$FIELD[First Year]]&sortorder=$ENCODE[$FIELD[Sort Order]]&limit=$ENCODE[$FIELD[Limit]]
Field Settings:
Results:
Defining the HTTP Server Script:
The HTTP Server script side, index.php for example, must return rows in XML syntax with the following format otherwise an Advanced Mapping XML Definition must be defined to map the return data to our folder File and Column syntax requirement.
Example of returning 3 files with custom columns and formatting. The file's row height is represented by the attribute format_row_height within the File element. Foreground and Background formatting is defined by the Hexidecimal value of the intended color.
<File format_row_height='50'>
<Column name='My Column Name' value='Hello World!' settings=''>
<Format name='format_left_indent' value='5' />
</Column>
<Column name='URL Requested' value='' settings='' >
<Format name='format_right_indent' value='5' />
</Column>
<Column name='IP Address' value='' settings='' >
<Format name='format_background' value='#FF0066' />
</Column>
<Column name='Date' value='' settings='' >
<Format name='format_foreground' value='#00527A' />
</Column>
<Column name='Request Method' value='' settings='' >
<Format name='format_style' value='Bold' />
</Column>
</File>

<File>
<Column name='My Column Name' value='Hello World!' settings=''>
<Format name='format_left_indent' value='5' />
</Column>
<Column name='URL Requested' value='' settings='' >
<Format name='format_right_indent' value='5' />
</Column>
<Column name='IP Address' value='' settings='' >
<Format name='format_background' value='#FF0066' />
</Column>
<Column name='Date' value='' settings='' >
<Format name='format_foreground' value='#00527A' />
</Column>
<Column name='Request Method' value='' settings='' >
<Format name='format_style' value='Italic' />
</Column>
</File>

<File>
<Column name='My Column Name' value='Hello World!' settings=''>
<Format name='format_left_indent' value='5' />
</Column>
<Column name='URL Requested' value='' settings='' >
<Format name='format_right_indent' value='5' />
</Column>
<Column name='IP Address' value='' settings='' >
<Format name='format_background' value='#FF0066' />
</Column>
<Column name='Date' value='' settings='' >
<Format name='format_foreground' value='#00527A' />
</Column>
<Column name='Request Method' value='' settings='' >
<Format name='format_style' value='Plain' />
</Column>
</File>
Example of returning 2 files with standard system columns, formatting, and returning a popup message to the user. Popup message types can be ERROR, INFORMATION, WARNING, QUESTION or PLAIN.
<File>
<Column name='system_name' value='My File Name 1' >
<Format name='format_left_indent' value='5' />
</Column>
<Column name='system_type' value='TXT' >
<Format name='format_right_indent' value='5' />
</Column>
<Column name='system_location' value='C:\my file location\tmp' >
<Format name='format_background' value='#FF0066' />
</Column>
<Column name='system_path' value='C:\my file location\tmp\My File Name 1.txt' >
<Format name='format_foreground' value='#00527A' />
</Column>
</File>

<File>
<Column name='system_name' value='My File Name 2' >
<Format name='format_left_indent' value='5' />
</Column>
<Column name='system_type' value='TXT' >
<Format name='format_right_indent' value='5' />
</Column>
<Column name='system_location' value='C:\my file location\tmp' >
<Format name='format_background' value='#FF0066' />
</Column>
<Column name='system_path' value='C:\my file location\tmp\My File Name 2.txt' >
<Format name='format_foreground' value='#00527A' />
</Column>
</File>

<Message type='WARNING' title='Warning Message' text='Hello Warning' />
System column translation:
system_name translates to the Name column
system_type translates to the Type column
system_location translates to the Location column
system_path translates to the Path column
Note: A folder file's Path column uniquely identifies the file. Two files specified with the same Path are handled as a replacement of the defined columns for that Path.
Defining the Advanced Mapping XML Definition:
Select the Advanced Mapping tab, then select the gear icon next to the XML Definition label to insert the default XML map. You should see the following entered in the XML Definition text area.
<XMLMap includeXMLDeclaration="true" includeDocumentElement="true">
<File xpath="/FolderItems/File" format_row_height="xpath:@format_row_height">
<Column xpath="Column" name="xpath:@name" value="xpath:@value" settings="xpath:@settings" />
</File>
</XMLMap>
XML Map Definition:
  • 1) includeXMLDeclaration within the XMLMap element defined as true will include <?xml version='1.0' encoding='UTF-8'?> at the beginning of the parsed return data. This is a standard XML syntax requirement. If the return data already contains this at the start of the data you will need to change this value to false.
  • 2) includeDocumentElement within the XMLMap element defined as true will include <FolderItems> at the start and </FolderItems> at the end of the return data to define the XML document element. All XML Return data must contain a document element. If the data returned from the URL Statement already contains a document element, such as <rss> or <html> you will need to change this value to false.
  • 3) The File element contains the xpath and format_row_height attributes. The xpath attribute will define the xpath of the return data that will represent your Files list; in the example above it would be <FolderFiles><File>. The format_row_height attribute can be defined as a number, 50 for example, or can be defined with an xpath to the return data attribute that contains the row height value by including the term xpath: at the start of the attribute; in the example above it would define the format_row_height attribute from the mapped File elements attribute called format_row_height.
  • 4) The Column element contains the xpath, name, value, and settings attributes. The xpath attribute will define the xpath of the return data that will represent your Columns list from its parent File element; in the example above it would be <Column>. This can be left blank to define a specific column name. The name attribute must be defined and can be text, My Column Name for example, or can be defined with an xpath to the return data attribute that contains the name value by including the term xpath: at the start of the attribute; in the example above it would define the name attribute from the returned data column elements attribute called name. The value attribute can be defined as text, My Value for example, or can be defined with an xpath to the return data attribute that contains the name value by including the term xpath: at the start of the attribute; in the example above it would define the value attribute from the returned data column element attribute called value. The same applies for the settings attribute.
  • 5) If you are not familiar with xpath, it is strongly recommended that you review the java xpath api and the W3 Xpath 1.0 specification to understand how to use xpath to obtain the desired results.
Example of how to parse You Tube RSS video feed:
  • 1) URL Statement: http://gdata.youtube.com/feeds/api/videos?alt=rss&q=$FIELD[Search For]&max-results=$FIELD[Max Results]$FIELD[Order By View]
  • 2) Order By View Field Setting would be set to Checkbox and have the Value If Checked variable set to &orderby=viewCount
  • 3) The File element contains the xpath and format_row_height attributes. The xpath attribute will define the xpath of the return data that will represent your Files list; in the example above it would be <FolderFiles><File>. The format_row_height attribute can be defined as a number, 50 for example, or can be defined with an xpath to the return data attribute that contains the row height value by including the term xpath: at the start of the attribute; in the example above it would define the format_row_height attribute from the mapped File elements attribute called format_row_height.
  • 4) The XML Map Definition would be defined as the following:

    <XMLMap includeXMLDeclaration="false" includeDocumentElement="false">
    <File xpath="/rss/channel/item" format_row_height="135">
    <Column xpath="" name="Video" value="xpath:title/text()" settings="xpath:group/thumbnail[2]/@url">
    <Format name="format_foreground" value="#0000FF" />
    </Column>
    <Column xpath="" name="system_type" value="YouTube" />
    <Column xpath="" name="system_path" value="xpath:link/text()" />
    <Column xpath="" name="Favorited" value="xpath:*[name()='yt:statistics']/@favoriteCount" />
    <Column xpath="" name="Viewed" value="xpath:statistics/@viewCount" />
    <Column xpath="" name="Published On" value="xpath:pubDate/text()" />
    <Column xpath="" name="Duration (Seconds)" value="xpath:group/duration/@seconds" />
    <Column xpath="" name="Description" value="xpath:description/text()" />
    <Column xpath="" name="Author" value="xpath:author/text()" />
    </File>
    </XMLMap>
  • 5) The folder for this would be defined with the colums and data types as follows. Video as Image data type, Favorited as Number data type, Viewed as Number data type, Published On as Text data type, Duration (Seconds) as Text data type, Description as Text data type, Author as Text data type.
Results from parsing You Tube RSS video feed as defined above