Skip to main content
Documentation & User Guides | Fotoware

Configuring FotoStation to download QuickList content from a web server

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 retrieve 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. 

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 used.

You can also create proxy files that link fields together and populate different fields with metadata from different levels in the hierarchical structure you've created.  Make sure to include the connection string (as described in the paragraph below) 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 only needs to contain a single line of information - the string that tells FotoStation where to retrieve the QuickList content. This is 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 retrieves 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) 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 look like the following example:

#! 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 the instructions below.

FotoStation stores the downloaded content in the proxy file and updates it with new content when available. Consequently, 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 is 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 method

Used when a new item is created in the QuickList at the same level as an existing item (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": "insert", "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"]}