Esempio n. 1
0
function add_roi_to_queue($image_pid, $roi_pid, $workflow_id)
{
    $queue_item_html = '';
    $status_dom = AP_ROI::getROILock($roi_pid);
    if ($status_dom != false) {
        $transcribedStatus = $status_dom->getElementsByTagName('transcribedStatus')->item(0)->nodeValue;
        $parsedL1Status = $status_dom->getElementsByTagName('parsedL1Status')->item(0)->nodeValue;
        $locked = $status_dom->getElementsByTagName('locked')->item(0)->nodeValue;
        $locked_time = $status_dom->getElementsByTagName('locked_time')->item(0)->nodeValue;
        $locked_session = $status_dom->getElementsByTagName('locked_session')->item(0)->nodeValue;
        $workflow_status = workflow_status($locked, $locked_time, $locked_session);
        $queue_item_html .= create_queue_list_roi($roi_pid, $image_pid, $transcribedStatus, $parsedL1Status, $locked_by, $workflow_status, $workflow_id);
    } else {
        $queue_item_html = "locked";
    }
    return $queue_item_html;
}
function get_workflow_status_via_solr($pid)
{
    $solr_q = 'q=id:("' . $pid . '")';
    $solr_fl = 'fl=status_locked+locked_time+status_locked_session';
    $solr_sxml = solr_query_xml($solr_q, $solr_fl);
    if ($solr_sxml != false) {
        foreach ($solr_sxml->result[0]->doc[0]->children() as $sxml_node) {
            $sxml_arr = $sxml_node->attributes();
            $sxml_attrib_name = $sxml_arr["name"];
            if ($sxml_attrib_name == 'status_locked') {
                $locked = $sxml_node;
            }
            if ($sxml_attrib_name == 'locked_time') {
                $locked_time = (double) $sxml_node;
            }
            if ($sxml_attrib_name == 'status_locked_session') {
                $locked_session = $sxml_node;
            }
        }
        return workflow_status($locked, $locked_time, $locked_session);
    } else {
        return false;
    }
}