<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digital Collections Blog &#187; Command line</title>
	<atom:link href="http://blog.digicol.de/tag/command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.digicol.de</link>
	<description>News for our customers, partners and friends</description>
	<lastBuildDate>Mon, 21 Nov 2011 11:49:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Command line fun, part two</title>
		<link>http://blog.digicol.de/2009/10/19/command-line-fun-part-two/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=command-line-fun-part-two</link>
		<comments>http://blog.digicol.de/2009/10/19/command-line-fun-part-two/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:17:39 +0000</pubDate>
		<dc:creator>Tim Strehle</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[DC-X]]></category>

		<guid isPermaLink="false">http://blog.digicol.de/?p=204</guid>
		<description><![CDATA[This DC-X command line made me smile today (I&#8217;m doing batch data imports at a customer site): xsltproc custom_xml_to_dcx.xslt input.xml &#124; php /opt/dcx/bin/dcx_import.php &#8211;app default &#8211; &#124; php /opt/dcx/bin/dcx_export.php &#8211;app default -t document &#8211; -r &#8216;$job = new DCX_Job($obj->app); $job->setWorkflow(&#8220;recreate_previews&#8221;); $job->setStatus(DCX_Job::STATUS_TODO); $job->addDocument($obj->getId(), &#8220;input&#8221;); $job->save(); echo $obj->getId() . &#8221; => &#8221; . $job->getId() . &#8220;\n&#8221;;&#8217; It [...]]]></description>
			<content:encoded><![CDATA[<p>This DC-X command line made me smile today (I&#8217;m doing batch data imports at a customer site):</p>
<p>xsltproc custom_xml_to_dcx.xslt input.xml | php /opt/dcx/bin/dcx_import.php &#8211;app default &#8211; | php /opt/dcx/bin/dcx_export.php &#8211;app default -t document &#8211; -r &#8216;$job = new DCX_Job($obj->app); $job->setWorkflow(&#8220;recreate_previews&#8221;); $job->setStatus(DCX_Job::STATUS_TODO); $job->addDocument($obj->getId(), &#8220;input&#8221;); $job->save(); echo $obj->getId() . &#8221; => &#8221; . $job->getId() . &#8220;\n&#8221;;&#8217;</p>
<p>It may look intimidating, but it&#8217;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). </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digicol.de/2009/10/19/command-line-fun-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command line fun with DC-X</title>
		<link>http://blog.digicol.de/2009/08/18/command-line-fun-with-dc-x/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=command-line-fun-with-dc-x</link>
		<comments>http://blog.digicol.de/2009/08/18/command-line-fun-with-dc-x/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 13:22:46 +0000</pubDate>
		<dc:creator>Tim Strehle</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[DC-X]]></category>

		<guid isPermaLink="false">http://blog.digicol.de/?p=125</guid>
		<description><![CDATA[I&#8217;m currently at a customer site, and I found that a lot of documents had data in the wrong field (&#8220;IPTC02015&#8243; instead of &#8220;Category&#8221;). An excellent opportunity to play with the DC-X command line tools: php /opt/dcx/bin/dcx_textquery.php &#8211;app default &#8216;+IPTC02015:[* TO *]&#8216; -m 1000 &#124; php /opt/dcx/bin/dcx_export.php &#8211;app default -t document &#8211; &#124; sed &#8216;s/IPTC02015&#62;/Category&#62;/g&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently at a customer site, and I found that a lot of documents had data in the wrong field (&#8220;IPTC02015&#8243; instead of &#8220;Category&#8221;). An excellent opportunity to play with the DC-X command line tools:</p>
<p>php /opt/dcx/bin/dcx_textquery.php &#8211;app default &#8216;+IPTC02015:[* TO *]&#8216; -m 1000 | php /opt/dcx/bin/dcx_export.php &#8211;app default -t document &#8211; | sed &#8216;s/IPTC02015&gt;/Category&gt;/g&#8217; | php /opt/dcx/bin/dcx_update.php &#8211;app default -</p>
<p>This invocation performs a fulltext search for all documents which have the field &#8220;IPTC02015&#8243; set, feeds the document IDs into a script that exports these documents as XML, runs &#8220;sed&#8221; to change the field name, and uses the modified XML to update the document in the DC-X database. (The fulltext index is automatically updated.) Marvellous!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digicol.de/2009/08/18/command-line-fun-with-dc-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

