Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Column | |||||||||||||
Section | |||||||||||||
|
...
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:
connector.file.root.dirThis 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. included in the filesystem.xml content:Configuration Parameter Description
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 of 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, or is set to false, 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 any form fields preceded by the prefix mmk. in the Doc Action Url to the generated metadata file.
Add the suffix "_desc.txt" to the metadata file for each submission.
Code Block <Context unpackWAR="false" path="/filesystem" 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 destination directory
Warning 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 wizard:
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.
Tip |
---|
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
...
- 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. The file MUST be named file-descriptor.ftl
Submission Metadata as name-value query parameters to the Doc Action URL.
...
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 that can be used with Docushare Enterpise Content System:Code Block <#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:
Code Block http://localhost:8082/filesystem/submission?submission.dir={Name}&mmk.name={Name}&mmk.state={State}
The metadata file would look like this:
...