function get_specimen_pid($image_pid, $nothing, $workflow_id)
{
    $returnJSON[] = AP_Image::get_specimen_pid($image_pid);
    echo json_encode($returnJSON);
}
Example #2
0
function ROISearchResults($roi_pids)
{
    $found_result = false;
    foreach ($roi_pids as $roi_pid) {
        if (!$found_result) {
            $results_html .= "<div align='left'>";
            $results_html .= "<table id='roi_results_table' class='tablesorter' style='width:800px'><thead><tr><th>ROI</th><th>Image</th><th>Specimen</th><th>Datastream</th></tr><thead>";
            $found_result = true;
        }
        $results_html .= "<tbody><tr>";
        //$results_html .= '<td><a class="preview" href="'.$server_base.'/drupal/apiary?ref=specimenMetadata_details&pid='.$roi_pid.'">'.$roi_pid.'</a></td>';
        $results_html .= '<td><a href="#" class="preview" onclick="display_specimenMetadata_details(\'' . $roi_pid . '\');">' . $roi_pid . '</a></td>';
        $roi_ob = new AP_ROI();
        $image_pid = $roi_ob->get_image_pid($roi_pid);
        $results_html .= "<td>{$image_pid}</td>";
        $sp_pid = AP_Image::get_specimen_pid($image_pid);
        $results_html .= "<td>{$sp_pid}</td>";
        $fedora_base_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora');
        $text = shell_exec("curl -H - XGET {$fedora_base_url}/get/{$roi_pid}/specimenMetadata");
        $check = strpos($text, "404 Not Found");
        if ($check === FALSE) {
            $results_html .= "<td><a href='" . $fedora_base_url . "/get/{$roi_pid}/specimenMetadata'>specimenMetadata</a></td></tr>";
        } else {
            $results_html .= "<td>No specimenMetadata found</td></tr>";
        }
    }
    if ($found_result) {
        $server_base = variable_get('apiary_research_base_url', 'http://localhost');
        $results_html .= "</tbody></table></div>";
        $results_html .= '<div id="pager" class="pager">';
        $results_html .= '<form>';
        $results_html .= '<img src="' . variable_get('apiary_research_base_url', 'http://localhost') . '/drupal/modules/apiary_project/workflow/assets/img/first.png" class="first"/>';
        $results_html .= '<img src="' . variable_get('apiary_research_base_url', 'http://localhost') . '/drupal/modules/apiary_project/workflow/assets/img/prev.png" class="prev"/>';
        $results_html .= '<input type="text"  class="pagedisplay"/>';
        $results_html .= '<img src="' . variable_get('apiary_research_base_url', 'http://localhost') . '/drupal/modules/apiary_project/workflow/assets/img/next.png"  class="next"/>';
        $results_html .= '<img src="' . variable_get('apiary_research_base_url', 'http://localhost') . '/drupal/modules/apiary_project/workflow/assets/img/last.png"  class="last"/>';
        $results_html .= '<select class="pagesize">';
        $results_html .= '<option selected="selected"  value="10">10</option>';
        $results_html .= '<option value="20">20</option>';
        $results_html .= '<option value="30">30</option>';
        $results_html .= '<option value="40">40</option>';
        $results_html .= '</select>';
        $results_html .= '</form>';
        $results_html .= '</div><!--pager-->';
    } else {
        $results_html .= "<br/><br/><b>No Results found!</b>";
    }
    return $results_html;
}
function specimenMetadata_details_content($roi_pid = null)
{
    global $base_url;
    $fedora_base_url = variable_get("fedora_base_url", "http://localhost:8080/fedora");
    $html = '';
    $html .= '<div id="specimenMetadata_details_content">' . "\n";
    if ($roi_pid != null && $roi_pid != "0") {
        $roi = new AP_ROI();
        $image_pid = $roi->get_image_pid($roi_pid);
        $sp_pid = AP_Image::get_specimen_pid($image_pid);
        $roiMetadata_record = $roi->getroiMetadata_record($roi_pid);
        $roiURL = $roiMetadata_record['roiURL'];
        $djatoka_url = scaleDjatokaURL($roiURL, '300', '0');
        $html .= "<h3>Details: {$roi_pid}</h3>";
        $html .= "<table><tr><td valign='top' width='300'>";
        $html .= "<img src='{$djatoka_url}'/></td>";
        $html .= "<td>Specimen: {$sp_pid}<br/>Image: {$image_pid}<br/>ROI: {$roi_pid}<br/>Datastream: specimenMetadata<br/><br/>";
        $text = shell_exec("curl -H - XGET {$fedora_base_url}/get/{$roi_pid}/specimenMetadata");
        $check = strpos($text, "404 Not Found");
        if ($check === FALSE) {
            $specimenMetadata_xml_url = $server_base . '/drupal/modules/apiary_project/workflow/include/specimenMetadata_xml.php?pid=' . $roi_pid;
            $html .= '<textarea style="width:500px; height:200px">' . $text . '</textarea></td>';
            $html .= "</tr></table>";
        } else {
            $html .= "No specimenMetadata found";
        }
    } else {
    }
    $html .= '</div><!-- specimenMetadata_details_content -->' . "\n";
    echo $html;
}
Example #4
0
 function get_specimen_pid($roi_pid)
 {
     $image_pid = $this->get_image_pid($roi_pid);
     $specimen_pid = AP_Image::get_specimen_pid($image_pid);
     return $specimen_pid;
 }