This DC-X command line made me smile today (I’m doing batch data imports at a customer site):

xsltproc custom_xml_to_dcx.xslt input.xml | php /opt/dcx/bin/dcx_import.php –app default – | php /opt/dcx/bin/dcx_export.php –app default -t document – -r ‚$job = new DCX_Job($obj->app); $job->setWorkflow(„recreate_previews“); $job->setStatus(DCX_Job::STATUS_TODO); $job->addDocument($obj->getId(), „input“); $job->save(); echo $obj->getId() . “ => “ . $job->getId() . „n“;‘

It may look intimidating, but it’s rather simple – an XML input file (actually coming from our old DC4 product here) is formatted as DC-X XML using XSLT. dcx_import.php creates a DC-X document record from that XML (it copies the files referenced in the XML and inserts the metadata into the DC-X database). The dcx_export.php call then runs code against the DC-X PHP API to create a job in the DC-X workflow engine for (re-)creating preview images (you can do this if there are no preview images, or – like in this case – they are too small).

Leave a Reply