<?php require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php"; require_once dirname(dirname(__FILE__)) . "/mmsearch/custom/MMSearchResults.php"; global $CONFIG; //read all the resources for a specific user $items = get_entities_from_metadata('creatorg', 939, 'user', '', '', 10000); //read all the resources from the SESAME $address = $CONFIG->API_URL . "searchall?properties=mdc:title"; $searchResults = new MMSearchResults(connectToSesame($address), true); $SESAME_results = $searchResults->DisplayResourcesList(); //identify the SESAME id for the wanted resources foreach ($items as $item) { $doru = $item->guid; for ($i = 0; $i + 1 < count($SESAME_results); $i++) { if ($doru == $SESAME_results[$i]->internalID) { echo $item->guid . " ----> " . str_replace("http://purl.org/meducator/resources/", "", $SESAME_results[$i]->ID) . "<br>"; echo '<a href="' . $SESAME_results[$i]->ID . '">view</a><br><br>'; //break; //$deladdress=$CONFIG->API_URL . str_replace("http://purl.org/meducator/resources/", "", $SESAME_results[$i]->ID); //echo connectToSesame($deladdress,"","YES"); } } }
<?php // Load Elgg engine include_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php"; //include_once(dirname(dirname(__FILE__)) . "/mmsearch/views/default/resources/properties_list.php"); include_once dirname(dirname(__FILE__)) . "/mmsearch/custom/MMSearchResults.php"; $address = "searchall?properties=mdc:title;mdc:identifier;mdc:hasRepurposingContext"; $address = $CONFIG->API_URL . $address; $result = connectToSesame($address); $searchResults = new MMSearchResults($result, true); print_r($searchResults->getResults());
$firstProperty = false; } } $address .= "ids=" . $idList . "&properties=" . $propertyList; //echo $address; //exit(); } elseif ($searchType == "get_resources_list") { //TO DO $propertyList = ""; $address = "searchall?properties=mdc:title;mdc:identifier"; } $address = $CONFIG->API_URL . $address; //echo "link = " . $address; $result = connectToSesame($address); //echo "result = " . $result; $searchResults = new MMSearchResults($result, true); //print_r($searchResults); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); if ($searchType == "details") { echo $searchResults->displayDetails(); header('Content-type: text/html'); } else { $response = new stdClass(); $response->searchID = $searchID; $response->searchType = $searchType; $response->__elgg_ts = time(); $response->__elgg_token = elgg_view('ajax/securitytoken'); if ($searchType == "specific") { $response->results = $searchResults->displaySpecificResultsList($propertyList); } elseif ($searchType == "get_resources_list") {