Applications

Built-in Applications

XML Import

class xmlimport.XmlImport(instance_name=None)

XML + Media Importer using the Unmanaged File API.

  • If an XML file comes in, it will be read as an Import/Export payload and a Placeholder will be created (or updated if id is given and an asset with that id exists).
  • If a non-XML file comes in, it will be considered “media”.
  • If this “media” is mentioned by some read Import/Export payload, it will be imported to it’s Placeholder.
  • If this “media” is not mentioned yet, it will be remembered (server-side, using the Client Config API).
  • If an XML file comes in and mentiones a “media” that is “remembered”, it will be imported to the Placeholder directly.
  • If an XML file comes in and references an Asset Entry that is no longer a Placeholder, the Metadata will be updated if changed.
  • If a non-XML comes in, and there is an occupied Asset Entry pointing to it, the import will fail.

Example ini file for using this importer:

[Flow]
class = xmlimport.XmlImport

[Source]
location = xmlimport
skip empty files = no

Note that the “skip empty files” option has the following effect:

  • yes means Tail mode
  • no means No tail mode
[Xml]
format = default|custom

If you choose default here, the daemon will do a default Viz One XML Import based on the standard Import/Export format.

On the other hand, if you want a custom XML to be imported you can choose custom and it will be parsed and mapped according to the following rules specified by these sections in the INI:

[Namespaces]
short = http://long/name
# ...

Namespaces are optional. You will need to specify only the once used in the fields you want to parse.

[Field:NAME]
xpath = /path/to/value
type = string|integer|date|time|datetime|dictionary
format = formatstring for parsing dates

For each field you want to parse, create one of these. For string fields, you only need the xpath, since type defaults to string. The value will be stored under the name NAME for later use with the mapper. Fields of type dictionary will require a source argument, being an http link to the dictionary feed. Field of type datetime support a default timezone argument, which should be parsable by python; for instance Europe/Stockholm or GMT.

[Transform]
NAME = EXPR
compound_field = field1 + ':' + field2

The Transform section allows for simple data transformation. The left-hand side denotes the name to store under and the right-hand side should contain a valid python expression using the names from Field directives and previous Transform operations. They will be carried out in the order they are written.

[Vdf]
form = FORM
asset.title = FIELD1
asset.alternativeTitle = FIELD2
# ...

Last is the actual mapping taking place, where you can put the stored data into VDF fields. Remember to specify the form here. The current revision is always used, you should not try to specify a revision.

SOURCE

alias of UnmanagedFilesListener

XML Export

class xmlexport.XmlExportArdFTP(instance_name=None)

XML + Media Export Transfer Plugin using ArdFTP SITE commands.

class xmlexport.XmlExportFXP(instance_name=None)

XML + Media Export Transfer Plugin using FXP.

Metadata Mapper

class metadatamapper.MetadataMapper(instance_name=None)

Metadata-mapping daemon that reacts on Asset Entry updates.

Example ini file:

[Flow]
class = metadatamapper.MetadataMapper

[Source]
# AssetEntryListener has no configurable parameters

[Mappings]
asset.alternateTitle = metadata.get('asset.title') + ' alternative'
SOURCE

alias of AssetEntryListener