This page is under construction until 1/11/16. While we are working on it, please Contact Us and we will be happy to help you.
The Filesystem Connector saves submissions to local or remote file systems (Windows, Linux). You can:
- Save each submission to it’s own folder
- Save all submissions to the same folder
- Choose to keep file names or generate a file name
- Generate metadata for import into your Enterprise Content Management system.
Submission form/flow XML document(s), attachments that are added by the user and the PDF snapshot of your form/flow can be saved in the configured submissions directory.
Submission from are posted using the DOC action URL in the POST data to your web application wizard. This creates files for any XML document and/or snapshot in the submission in the root folder configured for the connector.
Saving submissions to a shared directory might be an alternative if your forms/flows contain sensitive/secure information that you would rather not send via email or if you want to import the submissions into your Enterprise Content Management system.
On This Page:
Installing the Filesystem Connector
To install the Filesystem connector:
1. Stop .
2. Download the file connector zipflile from here.
3. Extract the filesystem.war file to your <frevvo-home>\tomcat\webapps directory.
Configuring the Filesystem Connector
Currently, the Filesystem Connector is configured using context parameters in a file named filesystem.xml.
Create a file named filesystem.xml. Move it to <frevvo-home>\frevvo\tomcat\conf\Catalina\localhost directory when it is completed. Refer to the table below for the configurable parameters that can be included in the filesystem.xml content:
Configuration Parameter Description connector.file.root.dir This is the location in your file system where the submission docs will be saved. If not explicitly configured, it defaults to the user home directory. Change the value to reflect the location for your file system. connector.file.name.keep This parameter determines whether the original files names will be retained. If this is set to true, then you either have to make sure that all your files have unique names or else save the documents of each submission under a separate uniquely named folder. If this parameter is not included, submission files will be named with a generated identifier as the prefix suffixed by '_' and a sequence number to make the file name unique.
The original filename extension is retained. This is the default behavior. Ex: e454fa08-9a6e-4c54-9743-18f4ba0ad0b4_1.xml instead of form.xml.connector.file.dir.submission This parameter allows you to create a unique new sub-folder for documents of every submission if true. connector.file.ignore.attachments This parameter determines whether attachments will be saved or not. If the value is false, attachments will be saved. Change the value to true and attachments will not be saved.
The submission XML does not store the names of uploaded attachments, instead it points to unique ID that is assigned to each attachment when that submission in created in . This is the as-designed.connector.file.metadata.prefix The default is "md". Change the value to the desired prefix. Field names preceded by this prefix in the Doc Url will be included in the generated metadata file. You will have to change it if the control names in your forms/flows are prefixed with "md" as a company standard. connector.file.descriptor.suffix When generating metadata, the descriptor filename is the identifier, followed by a configurable suffix. The default suffix is '.xml'. Use this parameter to change the suffix.The suffix can make identifying the metadata file easier, particularly if you save the files from all submissions into the same folder.
Here is an example of the filesystem.xml. When executed, submissions will be:- Saved on the local drive in a directory called Submissions.
- Individual file names will be retained.
- Attachments in the submisison will be saved.
- Documents of each submission will be saved under a separate folder
- Add the prefix
Add the suffix "_desc.txt" to the metadata file for eachsubmission.
<Context unpackWAR="false" path="/file" swallowOutput="true" unloadDelay="40000"> <Parameter name="connector.file.root.dir" value="C:\Submissions" override="false"/> <Parameter name="connector.file.name.keep" value="true" override="false"/> <Parameter name="connector.file.ignore.attachments" value="false" override="false"/> <Parameter name="connector.file.dir.submission" value="true" override="false"/> <Parameter name="connector.file.metadata.prefix" value="mmk." override="false"/> <Parameter name="connector.file.descriptor.suffix" value="_desc.txt" override="false"/> </Context>
- Start .
Make sure the directory where you plan to save the submissions is created and and has the appropriate access for the OS you are using. For example:
If you are using Windows, you can map a drive to a server directory, or you could use the UNC path i.e. //host-name
If you are using a Unix operating system you could mount a remote filesystem as a directory and use it as your diestination directory
To ensure interoperability across file systems, it is recommended that you follow a good naming standard such as POSIX when creating files and folders. For example, folder names can't contain slashes so a folder named '1/2/15' would not be valid.
Browse http://localhost:8082/filesystem/health (replace localhost:8082 with your frevvo server host:port) to check the status of the connector. If the connector is up and running, you will see { "status" : "UP" }.
Modify your form/flow to use the File Connector via the Doc Action wizrd:
Edit your form/flow in the appropriate designer.
Click on the what happens to my data? icon.
- Click to open the POST data to your web application wizard
Add http://localhost:8082/filesystem/submission (replace localhost:8082 with your frevvo server host:port) in the URL property.
Select PDF in the Send Snapshot dropdown.
- The Send Data checkbox is checked by default. Uncheck it if you do not want to save the .xml file
- Save your form/flow.
- Test and submit the form/flow.
The submission documents will be found in the directory specified by the connector.file.root.dir parameter or in uniquely named folders under that depending on your configuration.
If you are using v6.1.1+, it is possible to name the PDF Snapshot dynamically based on controls in your form.
How to Customize the Submission Folder Name
You can append the submission.dir Url parameter to the Doc Action Url to customize the submission folder name. The Url would look like this:
http://localhost:8082/filesystem/submission?submission.dir={DirName} - Replace localhost:8082 with your frevvo server host:port and replace DirName with the name of a field in your form/flow.
For example, if you want to save submissions in a directory reflecting the Name that is entered in a Name control in your form/flow, append ?submission.dir={Name} to the Url property in the wizard. Whatever value is entered in Name field, will be used as the name of the directory into which that submission’s documents are saved.
If the connector.file.dir.submission context parameter is true and submission.dir query parameter is not specified, then the generated submission identifier is used as the directory name
Generating Metadata
Importing the submissions into your ECM requires the generation of metadata. To do this you will need to:
- Provide the submission metadata as name-value query parameters to the DOC Action URL.
- Create a descriptor file named file-descriptor.ftl in your <frevvo-home>\tomcat\lib directory.
Submission Metadata as name-value query parameters to the DOC Action URL.
Metadata to be put in the file-descriptor.ftl file is specified by adding name-value query parameters to the DOC Action URL in your form/flow. The 'value' can be a templatized string referencing a form field. The name should be prefixed so that it can be distinguished from the form field. The default prefix is md. Parameters preceded by the configured prefix are used for metadata generation.
This can be changed using the connector.file.metadata.prefix configuration parameter. The prefix will be removed from the actual metadata.
The following example of the DOC action Url passes the name parameter with a value from a field in a form called Name to the descriptor file. The default prefix md is used to distinguish the metadata from the form field in the Url:
http://localhost:8082/filesystem/submission?md.name={Name} - Replace localhost:8082 with your frevvo server host:port and add &(your prefix).the parameter={your form field}
This example also shows how to specify multivalued metadata for a field named 'state' inside a repeat in your form:
http://localhost:8082/filesystem/submission?md.name={FirstName}&md.state={&md.state=|State!encode=false} - - Replace localhost:8082 with your frevvo server host:port and add &(your prefix).the parameter={your form field}
Create the Metadata Descriptor File Template
The metadata descriptor file template generate a descriptor file every submission using the template and the query parameters appended to the Doc URl. If a query parameter name is referenced in the descriptor, then it is replaced with its value in the metadata file. This file will vary depending on the ECM that you are using.
Since the metadata varies by form type, a typical template would just iterate over all the input name-value pairs and output them in the input sequence.
Create a file descriptor template file and name it file-descriptor.ftl.
The file-descriptor.ftl should be located in the classpath - if you are using the tomcat bundle, it should be located in the <frevvo-home>\tomcat\lib directory.
The content of the file-descriptor-ftl file uses freemarker template language v2.3.23 syntax. The input to the template is identified by the variable 'params'. This contains a map of parameter name and parameter value(s). The value is a sequence/array since a parameter can be multi-valued. If there is metadata that remains constant it should be added to the file-descriptor.ftl template.
Here is one example:<#compress> <#escape x as x?xml> <?xml version="1.0" encoding="UTF-8"?> <Records>tomcat bundle <Record> <Field id="LF__User" length="-1" type="string"> <Value>administrator</Value> </Field> <#list params?keys as key> <#assign values = (params[key]?size > 1)> <#assign doc = key?switch('submission.file.name',true,false)> <Field id="${doc?then('LF__Document',key)}" length="-1" type="${doc?then('document','string')}"> <#if values><Values></#if> <#list params[key] as value><Value>${value}</Value></#list> <#if values></Values></#if> </Field> </#list> </Record> </Records> </#escape> </#compress>
In the above sample:
- LF-User is an example of metadata that is constant for all submissions
- Full paths to all the submission files will be included in the metadata file if you put the submission.file.name parameter in the template.
- Value refers to a single parameter while Values designates a multi-valued parameter
- The descriptor filename in the submission directory is the identifier, followed by a configurable suffix. The suffix plays an important part in isolating the file. The default suffix is '.xml'. The suffix can be changed using the connector.file.descriptor.suffix context parameter. Here is what the file looks like in the submission directory when the file suffix is configured to be _desc.txt:
The values from the specified query parameters will be included in the generated metadata file. For Example; if you have fields called Name and state in your form/flow that you want to include in your metadata file and have configured the connector.file.descriptor.suffix context parameter to have a value of mmk, your Doc Action Url should look like this:
http://localhost:8082/filesystem/submission?submission.dir={Name}&mmk.name={Name}&mmk.state={State}
The metadata file would look like this:
Troubleshooting
Doc Post Failure
If the destination for saving submissions that you have specified cannot be reached, your tenant admin will receive an Doc Post Failure notification email reporting an HTTP Status error - 404. Check the connector.file.root.dir parameter in the file.xml file and the Url in the POST data to your web application wizard.
Determine the version of the Filesystem Connector you are using:
There are two ways to determine the version of the Filesystem connector that you are using:
- Type http://localhost:8082/filesystem/info into your browser. The version information is returned as shown in the image.
- Navigate to the <frevvo-home>\tomcat\webapps\file\META-INF directory on your server. You can find the version in the MANIFEST.MF file.