Exemplo n.º 1
0
 function updatePlaceReference($tokenID, $docID, $placeURI)
 {
     $output = false;
     $uriID = false;
     if (!$placeURI) {
         //no place URI, so we're just turning off gaz references to a given token
         $this->deactiveTokenGazRefs($tokenID);
         //simply deactivate all place references associated with a given token
         $output = true;
     } else {
         //we've got a place URI, so now we need to associate it with a given place
         $gazURIobj = new GazetteerURIs();
         $uriID = $gazURIobj->getOrAddPlaceRecord($placeURI);
         if (!$uriID) {
             $this->noteError(implode(" ", $gazURIobj->errors));
         } else {
             $this->deactiveTokenGazRefs($tokenID);
             //simply deactivate all place references associated with a given token
             $data = array("tokenID" => $tokenID, "docID" => $docID, "active" => true, "gazRef" => "user input", "uriID" => $uriID);
             $ok = $this->addRecord($data);
             if (!$ok) {
                 $this->noteError("Error in adding new gaz reference: " . implode(" ", $data));
             } else {
                 $output = true;
             }
         }
     }
     return $output;
 }
Exemplo n.º 2
0
 function apiPleiadesUpdateAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $requestParams = $this->_request->getParams();
     Zend_Loader::loadClass("GazetteerURIs");
     if ($this->acceptEdits) {
         if (isset($requestParams["uri"])) {
             $gazURIobj = new GazetteerURIs();
             $gazURIobj->updatePleiadesData($requestParams["uri"]);
             $location = "../../report/search/?uri=" . urlencode($requestParams["uri"]);
             header("Location: " . $location);
         } else {
             header("HTTP/1.0 403 Forbidden");
             $message = "Need a uriID amd a uri";
             echo $message;
         }
     } else {
         header("HTTP/1.0 403 Forbidden");
         echo $this->editMessage;
     }
 }