{"id":63,"date":"2011-08-22T02:00:57","date_gmt":"2011-08-22T06:00:57","guid":{"rendered":"http:\/\/provideotech.org\/wp\/?p=63"},"modified":"2012-02-02T01:06:09","modified_gmt":"2012-02-02T06:06:09","slug":"catdvpresstore-updates-for-catdv-9-0","status":"publish","type":"post","link":"https:\/\/provideotech.org\/?p=63","title":{"rendered":"CatDV\/PresSTORE Updates for CatDV 9.0"},"content":{"rendered":"<p>For a full overview of getting CatDV working with PresSTORE Archive, click\u00a0<a title=\"CatDV and PresSTORE Archive Integration\" href=\"https:\/\/provideotech.org\/?p=8\" target=\"_blank\">here<\/a>. \u00a0This article discusses updates due to changes in CatDV 9.0.<\/p>\n<p>After doing some work with CatDV 9.0, I discovered that the XML schema has changed slightly. \u00a0The changes are actually just a more verbose XML output and adding some additional sub-fields to the USERxX elements. \u00a0In CatDV 8.x XML, these were actually fields and therefore returned the contents. <!--more-->\u00a0CatDV 8.0 XML looks something like this:<\/p>\n<pre>...\r\n&lt;USER1&gt;This is some description info&lt;\/USER1&gt;\r\n&lt;USER2&gt;This is another metadata value&lt;\/USER2&gt;\r\n...<\/pre>\n<p>And so on and so forth. \u00a0Because of this, we were able to use generic calls to return these values in our &#8220;catdv-xml.pl&#8221; script, which looked like this:<\/p>\n<pre>...\r\n$md1value = $data-&gt;{CLIP}-&gt;{USER1}; #This returns the value for field USER1\r\n$md2value = $data-&gt;{CLIP}-&gt;{USER2}; #This returns the value for field USER2\r\n...<\/pre>\n<p>Because these were simply elements in the XML array, values were actually returned. \u00a0In CatDV 9.0, the &lt;USER&gt; field is no longer a simple element, but instead an array that has subcategories. \u00a0In CatDV 9.0, the same XML file looks like this:<\/p>\n<pre>...\r\n&lt;USER1 name=\"CatDV USER1 Description\"&gt;This is the USER1 value&lt;\/USER1&gt;\r\n&lt;USER2 name=\"CatDV USER2 Description\"&gt;This is the USER2 value&lt;\/USER2&gt;\r\n...<\/pre>\n<p>Unfortunately, our original code now breaks because when we ask just for {USER1}, we no longer return a text string, but instead a hash that relates to the values of the array that USER1 has become. \u00a0Fixing this is actually very simple. \u00a0We just need to be more explicit in our definition of what we want for the $md1value. \u00a0We would do this by adding the &#8220;contents&#8221; element to our XML request like follows:<\/p>\n<pre>...\r\n$md1value = $data-&gt;{CLIP}-&gt;{USER1}-&gt;{content}; #This returns the value for field USER1\r\n$md2value = $data-&gt;{CLIP}-&gt;{USER2}-&gt;{content}; #This returns the value for field USER2\r\n...<\/pre>\n<p>We added in the &#8220;contents&#8221; container as it is synonymous with the elements encapsulated in the &lt;USER1&gt; field. \u00a0Because this information is valid for both elements and arrays, this code change should not effect anyone using CatDV 8.0 at all.<\/p>\n<p>I have also made several improvements to the &#8220;aw-queue.pl&#8221; script. \u00a0These editions include the following:<\/p>\n<p>1) Using sockets for all communication so that aw-queue can run on any system with nsdchat installed, not just the PresSTORE server itself.<br \/>\n2) Created variables for the CatDV index on the CLI, so if there are multiple archive indexes in a facility they can be called by multiple launchd jobs without duplicating the aw-queue script file<br \/>\n3) More logging information<\/p>\n<p>If you were using the previous script set, make sure you open aw-queue.pl and input usernames\/passwords\/hostnames for your systems to allow sockets to work.<\/p>\n<p>Also, you will have to add an additional value (the Archive Index you are restoring from) to your launchd scripts. \u00a0It would look simply like this:<\/p>\n<pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\"&gt;\r\n&lt;plist version=\"1.0\"&gt;\r\n&lt;dict&gt;\r\n\t&lt;key&gt;Disabled&lt;\/key&gt;\r\n\t&lt;true\/&gt;\r\n\t&lt;key&gt;Label&lt;\/key&gt;\r\n\t&lt;string&gt;org.provideotech.aw-queue-restore&lt;\/string&gt;\r\n\t&lt;key&gt;ProgramArguments&lt;\/key&gt;\r\n\t&lt;array&gt;\r\n\t\t&lt;string&gt;\/usr\/local\/aw-scripts\/aw-queue.pl&lt;\/string&gt;\r\n\t\t&lt;string&gt;\/usr\/local\/catdv-presstore\/restore-queue.txt&lt;\/string&gt;\r\n\t\t&lt;string&gt;restore&lt;\/string&gt;\r\n\t\t&lt;string&gt;10001&lt;\/string&gt;\r\n\t\t&lt;string&gt;ArchiveIndex&lt;\/string&gt;\r\n\t&lt;\/array&gt;\r\n\t&lt;key&gt;StartInterval&lt;\/key&gt;\r\n\t&lt;integer&gt;600&lt;\/integer&gt;\r\n&lt;\/dict&gt;\r\n&lt;\/plist&gt;<\/pre>\n<p>Note the additional line after the archive plan. This is the name of the Archive Index in PresSTORE that the job is being run against.<\/p>\n<p>I have updated the files for download to reflect these changes. \u00a0You can grab them here: <a title=\"https:\/\/provideotech.org\/files\/catdv-presstore-current.zip\" href=\"https:\/\/provideotech.org\/files\/catdv-presstore-current.zip\" target=\"_blank\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a full overview of getting CatDV working with PresSTORE Archive, click\u00a0here. \u00a0This article discusses updates due to changes in CatDV 9.0. After doing some work with CatDV 9.0, I discovered that the XML schema has changed slightly. \u00a0The changes are actually just a more verbose XML output and adding some additional sub-fields to the &hellip; <a href=\"https:\/\/provideotech.org\/?p=63\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CatDV\/PresSTORE Updates for CatDV 9.0&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8,9],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-archiware-p5","category-catdv"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bwLw-11","_links":{"self":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":0,"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"wp:attachment":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}