Skip to main content
Documentation & User Guides | FotoWare

Configuring FotoStation to download quicklist content from a web server

Feature Note: This feature is only available in FotoStation Client.

When creating quicklists (regular "flat" ones or hierarchical ones) with predefined metadata for FotoStation's editors, it is possible to store these on a central web server and configure "proxy" quicklists files in the FotoStation configuration that tell the metadata editors to fetch new content live from a centrally maintained quicklist repository via http.
It is also possible to make edits to the quicklists directly in FotoStation and have FotoStation update the quicklists on the web server via POST requests to a server backend.

Creating the quicklist content

The Quicklists that contain the actual content that you will use in FotoStation can be created as described in the Creating QuickLists of Predefined Metadata topic. However, the naming conventions outlined there are not important, as it's the quicklist proxy files (see below) in the FotoStation configuration that need to be named correctly to map the metadata to the correct fields.

Having created quicklists with content, put them on a web share so that FotoStation can reach them. (See below).

How the proxy quicklists files work

The proxy quicklists follow the naming conventions of regular FotoStation quicklists:

They are stored in the default location for quicklists; the actual location differs depending on the type of configuration that is used.

It is also possible to create proxy files that link fields together and populate different fields with metadata from different levels in the hierachical structure you've created.  Just make sure to include the connection string as described in the below paragraph to the first line of the file.

Setting the proxy file connection string for GET requests to the server

When creating a proxy quicklist file, it needs only contain a single line of information - the string that tells FotoStation where to fetch the quicklist content. This will be in the form of a web URL, prefixed with http://, or https:// for secure connections.

Example

This is an example of the content in the proxy file that fetches content in a flat structure for the Keywords field.

(Proxy file name: ql_025.txt)

#! HTTP_DOWNLOAD_URL=http://yourserver.com/quicklists/keywords.txt

If the file referenced above is a hierarchical structure of keywords (a thesaurus quicklist) you would simply name the proxy file 025.txt, omitting the ql_ prefix.

Context sensitive URLs

When configuring a proxy file with a connection string, you have the option to create a connection string that uses dynamically inserted content from your metadata to query a backend server.

A connection string can for example look like this:

#! HTTP_DOWNLOAD_URL=http://myserver.com/quicklists?title=#005&keyword=#025

The above request sends the query string to the server and inserts the content of fields #005 (Title field) and #025 (Keywords field).

Note that in the case of bag fields, such as Keywords (#025), FotoStation inserts the value of the currently selected keyword on the page in the metadata editor. If no entry is selected in the bag field, the first value in the bag is inserted into the query.
 

Content caching and updating

When a user opens the metadata editor, FotoStation downloads the content from the referenced URL. To avoid unnecessary downloads we recommend setting up caching on the web server - see instructions below.

FotoStation stores the downloaded content in the proxy file and updates it with new content when available. Thus, FotoStation will be able to use the locally cached quicklists even when it does not have a network connection to the server.

Providing cache header in the server response

Configure your web server with a HTTP response header to enable caching of the quicklists:

Property: Cache-control

Value: public; max-age=<seconds>

Setting the proxy file connection string for POST requests to the server

A quicklist file can also contain a string for POST requests. This way, users can update quicklists using the tools in the FotoStation metadata editor, and the new data will be sent to the web server immediately.

The POST statement in the quicklist is in the form of a web URL prefixed with http or https and reads as follows:

#! HTTP_EDIT_URL=http://www.myserver.com/quicklistbackendservice

POST request payload

Four different methods are used in the json payload delivered to the web server.

Replace method

Used when an entry in the quicklist is replaced with a new value.

POST http://www.myserver.com:7009/backend HTTP/1.1
Host: www.ovensen.com:7009
Content-Type: application/json
Content-Length: 117
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: nb-NO,en,*
User-Agent: Mozilla/5.0{"method": "replace", "path":["Architecture", "Building", "agricultural building"], "value": "Agricultural Building"}

Insert After method

Used when a new item is created in the quicklist at the same level as en existing one (sibling).

POST http://www.myserver.com:7009/backend HTTP/1.1
Host: www.ovensen.com:7009
Content-Type: application/json
Content-Length: 120
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: nb-NO,en,*
User-Agent: Mozilla/5.0{"method": "insertAfter", "path":["Architecture", "Building", "Agricultural Building"], "value": "Agricultural Machine"}

Add Child method

Used when a new item is created as a child item below an existing item.

POST http://www.myserver.com:7009/backend HTTP/1.1
Host: www.ovensen.com:7009
Content-Type: application/json
Content-Length: 103
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: nb-NO,en,*
User-Agent: Mozilla/5.0{"method": "addChild", "path":["Architecture", "Building", "Agricultural Machine"], "value": "Tractor"}

Delete method

Used to delete an item in the quicklist.

POST http://www.myserver.com:7009/backend HTTP/1.1
Host: www.ovensen.com:7009
Content-Type: application/json
Content-Length: 92
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: nb-NO,en,*
User-Agent: Mozilla/5.0{"method": "delete", "path":["Architecture", "Building", "Agricultural Machine", "Tractor"]}