How To: Convert from Old-Style Files to New Dataclass

From ARK
Revision as of 09:17, 23 May 2009 by Stuarteve (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You should only use this how-to if you are using pre-v0.6 files (that is files as a module rather than a dataclass).

There are two stages to the update - first you need to register the files with ARK system. Then you need to add those files to cor_tbl_file to link them to the original module.

We have created two tool files to aid in this - however they do need a bit of editing before you can use them.

First php/tools/batch_register_files.php - an extract of the code here:

 //get a list of the files to be converted
 $photo_directory = '/srv/www/htdocs/ark/data/site_photos/registered/VM07';
 processFiles($photo_directory, 'VM07', 'sph', 1, 'NOW()');
 $list = dirList($photo_directory,'jpg');
 foreach($list as $value){
   $exploded_name = explode('SPHVM07_',$value);
   $number = (int)$exploded_name[1];
 printf("
filename: $value itemkey: sph_cd itemvalue: 'VM07_$number
");

As you can see from this code - you will need to specify where the photos are that you want to be converted (bear in mind these need to have already been registered as a file module - if these are new photos you should upload them in the normal way).