diff --git a/tests/documentmanagement/DocumentBrowser.php b/tests/documentmanagement/DocumentBrowser.php index 400fc27..291647f 100644 --- a/tests/documentmanagement/DocumentBrowser.php +++ b/tests/documentmanagement/DocumentBrowser.php @@ -24,10 +24,8 @@ require_once ("$default->owl_fs_root/lib/documentmanagement/DocumentBrowser.inc" // ------------------------------- if (checkSession()) { - $default->log->debug("DocumentBrowser.php:: authorised flag:" . $_SESSION["authorised"]); echo "
";
-    
     $db = new DocumentBrowser();
 
     // default browse- should resolve to root folder
@@ -38,7 +36,7 @@ if (checkSession()) {
         $_SESSION["errorMessage"] = NULL;
     }        
     print_r($artifacts);
-    
+
     // now supply a folderid
     $folderID = 3;
     echo "browse- starting at folder (folderID=$folderID)
"; @@ -51,17 +49,15 @@ if (checkSession()) { // browse by category echo "category browse- return a list of categories:
"; - $categories = $db->browseByCategory(); + $results = $db->browseByCategory(); if (!is_null($_SESSION["errorMessage"])) { echo "error: " . $_SESSION["errorMessage"] . "
"; $_SESSION["errorMessage"] = NULL; } - print_r($categories); + print_r($results); - // pick a random category - srand ((float) microtime() * 10000000); - $rand_keys = array_rand ($categories, 1); - $category = $categories[$rand_keys]; + // pick the first category + $category = $results["categories"][0]; echo "browsing by category = $category
"; $artifacts = $db->browseByCategory($category); if (!is_null($_SESSION["errorMessage"])) { @@ -72,25 +68,25 @@ if (checkSession()) { // document type browsing echo "document type browse- get list of doc types
"; - $documentTypes = $db->browseByDocumentType(); + $results = $db->browseByDocumentType(); if (!is_null($_SESSION["errorMessage"])) { echo "error: " . $_SESSION["errorMessage"] . "
"; $_SESSION["errorMessage"] = NULL; } - print_r($documentTypes); + print_r($results); - // pick a random document type + // pick the first document type id srand ((float) microtime() * 10000000); - $documentTypeID = array_rand ($documentTypes, 1); - - echo "browsing by document type = " . $documentTypeID . "
"; + $documentTypeID = $results["documentTypes"][0]["id"]; + $documentTypeName = $results["documentTypes"][0]["name"]; + echo "browsing by document type = $documentTypeID; name=$documentTypeName
"; $artifacts = $db->browseByDocumentType($documentTypeID); if (!is_null($_SESSION["errorMessage"])) { echo "error: " . $_SESSION["errorMessage"] . "
"; $_SESSION["errorMessage"] = NULL; } print_r($artifacts); - + echo "
"; } else { // FIXME: redirect to no permission page