Exemple #1
0
             funded as a Virtual Laboratory by the Australian National eResearch Collaboration Tools and Resources Project 
            (<a href="http://nectar.org.au">NeCTAR</a>, has built a central searchable aggregate of metadata harvested from 28 Australian 
            cultural datasets, including AusStage, AusLit, Dictionary of Art and Architecture Online, Australian Dictionary of Biography, 
            Circus Oz and Paradisec</p>

        <p style="margin-top: 1em;">
            Heurist provides a database-on-demand function for HuNI. Databases created using the HuNI Core Metadata template can be immediately
            exported to a HuNI harvestable format. Other databases can be made available for harvesting by mapping fields to the HuNI Core naming conventions.
        </p>
                
                </td>
            </tr>
        </table>
        <?php 
        // remove all files form  HEURIST_HML_DIR
        delFolderTree(HEURIST_HML_DIR, false);
        copy(HEURIST_DIR . 'admin/setup/.htaccess_via_url', HEURIST_HML_DIR . '/.htaccess');
        // write out all records as separate files
        $resout = outputRecords($result);
        if (count($resout) < 1) {
            print '<h3>There are no results to export</h3>';
            print '</body></html>';
        } else {
            // create HuNI manifest
            $huni_resources = fopen(HEURIST_HML_DIR . "resources.xml", "w");
            fwrite($huni_resources, "<?xml version='1.0' encoding='UTF-8'?>\n");
            fwrite($huni_resources, '<resources recordCount="' . count($resout) . "\">\n");
            // dbID set at start of script
            if (isset($dbID) && $dbID != 0) {
                fwrite($huni_resources, "<dbID>" . $dbID . "</dbID>\n");
            } else {
Exemple #2
0
 }
 $folder = HEURIST_FILESTORE_DIR . "faims/import";
 //.;
 $folder_proj = $folder . "/" . $project_name;
 //"/module";
 //create export folder
 if (!file_exists($folder)) {
     $old_umask = umask(0);
     if (!mkdir($folder, 0777, true)) {
         umask($old_umask);
         die("Failed to create folder: " . $folder);
     }
     umask($old_umask);
 } else {
     //clear folder
     delFolderTree($folder, false);
 }
 if ($upload["name"] == "db.sqlite3") {
     $dbname_faims = $folder . "/" . $upload["name"];
     if (copy($tmp_name, $dbname_faims)) {
         unlink($tmp_name);
     } else {
         die('Cannot copy file ' . $upload["name"] . ' to ' . $folder);
     }
 } else {
     $tarfile_orig = $upload["name"];
     $tarfile = $folder . "/project." . (strpos($upload["name"], ".tar.bz") > 0 ? "bz2" : "gz");
     /*debug print "<br>temp :".$tmp_name;
       print "<br>".$upload["name"]."   ".$tarfile."<br>";
       */
     print "<h3>Extracting FAIMS database from tarball to<br />" . $folder_proj . "/db.sqlite3</h3><br>";
 //flag that backup in progress
 if (file_exists($progress_flag)) {
     print 'It appears that backup opearation has been started already. Please try this function later';
     if (file_exists($progress_flag)) {
         unlink($progress_flag);
     }
     exit;
 }
 $fp = fopen($progress_flag, 'w');
 fwrite($fp, '1');
 fclose($fp);
 set_time_limit(0);
 //no limit
 if (file_exists($folder)) {
     //clean folder
     $res = delFolderTree($folder, true);
     if (!$res) {
         print 'It appears that backup opearation has been started already. Please try this function later';
         if (file_exists($progress_flag)) {
             unlink($progress_flag);
         }
         exit;
     }
 }
 if (!mkdir($folder, 0777, true)) {
     if (file_exists($progress_flag)) {
         unlink($progress_flag);
     }
     die('Failed to create folder ' . $folder . '<br/> in which to create the backup. Please consult your sysadmin.');
 }
 ?>