The productionHandler.py script has the following usage:
productionHandler.py Version: 1.0b Build: 2011042001 Framework Version: 1.0b Build: 2011042001 Copyright (C) 2009-2011 Beau Hunter, 318 Inc. Usage: productionHandler --importFile=/file.xml --productionID=10 productionHandler --exportFile=/production_10.xml --productionID=10 productionHandler --importFile=/file.xml --createProduction productionHandler --configFile=/etc/my.conf --importFile=file.xml productionHandler [option] Options: -h, --help Displays this help message -v, --version Display version number -c pathtofile, Utilize pathtofile for configuration parameters. --configFile=pathtofile
By default, the productionHandler.py script utilizes the main transmogrifier.conf file found at /usr/local/etc. In this file, productionBuilder will queue off of a number of parameters configured under the [ProductionHandler] Section.
The following shows an example productionBuilder configuration:
[ProductionHandler] membersField=Members membershipKey=Title missingMembersKey=Missing Members exportFields=Title,Description newProductionMDset=pa_production_show tempProductionMDset=pa_production_show containerProductionTitle=New Projects containerProductionMDSet=pa_production_organizer debug=False
As shown above, there are four specific settings, all read in from the [ProductionHandler] section, which we will read in from this file.
The productionHandler.py script has fairly limited scope in regards to command line options, we will simply use it to export or import a production.
>>> productionHandler.py --exportFile='/tmp/project_10.xml' --productionID=10
In the above usage, our script will first lookup information for the provided production (production with ID 10). Provided that the production exists, it will export an XML file to the location /tmp/project_10.xml This export file will contain an additional field, designated by the setting membersField. This field will contain a string of comma separated values, one for each asset member, extracted from the field designated by our membershipKey field.
Using the above example, this XML file will contain output for fields Title and Description, and will have an additional field Members which contains the string: my asset 1,my asset 2; where my asset 1 and my asset 2 are the Title`s of the 2 asset members of our production. If we change the value of our setting membershipKey to Asset ID, the Members string would have the value: 49,50, representing the unique asset ID’s of the production’s members.
>>> productionHandler.py --importFile='/tmp/project_10.xml' --productionID=10 --createProduction
In the above usage, our script will first lookup information for the provided production (production with ID 10). Provided that the production exists, it will import all values specified in the provided XML file. This will include all fields designated in the file. In addition to this, we will lookup an additional field, designated by the setting membersField. Just like in our export scenario, this field will contain a string of comma separated values, one for each asset member, extracted from the field designated by our membershipKey field. Any assets not included in this string will be removed from the production. In the event that an entry references a non-existant asset, the asset’s entry will be recorded in the missingMembersKey field. Values specified in this field will be appended to our membership values on export, this enables us to do non-destructive pass-through between two systems, preventing assets not yet ingested into FCS from being removed from the production. The --createProduction flag designates that if the production specified in the provided XML file cannot be found, one will be created and metadata and membership will be imported.