loadModule(); require_once($module->modulePath . "/classes/CasBrowser.class.php"); require_once($module->modulePath . "/scripts/widgets/MetadataDisplayWidget.php"); require_once($module->modulePath . "/scripts/widgets/ProductDownloadWidget.php"); // Get a CAS-Browser XML/RPC client $browser = new CasBrowser(); $client = $browser->getClient(); // Get the specified product $productId = App::Get()->request->segments[0]; $product = $client->getProductById($productId); $productName = $product->getName(); $productTypeName = $product->getType()->getName(); $productTypeId = $product->getType()->getId(); $productMetadata = $client->getMetadata($product); // Get metadata for product and productType as associative arrays $productTypeInfo = $product->getType()->toAssocArray(); $productInfo = $productMetadata->toAssocArray(); $productVisibilityLevel = $browser->getProductVisibilityLevel($productId); // Redirect the user if they are not authorized if ($productVisibilityLevel == CasBrowser::VIS_NONE) { App::Get()->redirect(SITE_ROOT . '/errors/403'); } // Create and load a MetadataDisplay widget wit the visible metadata $metadataWidget = new MetadataDisplayWidget(array()); $metadataWidget->loadMetadata($browser->getVisibleMetadataForProduct($productId)); // Record the product page to send the user back to, if provided $returnPage = isset(App::Get()->request->segments[1]) ? App::Get()->request->segments[1] : 1; // Create a ProductDownloadWidget $productDownloadWidget = new ProductDownloadWidget(array( "dataDeliveryUrl" => App::Get()->settings['browser_datadeliv_url'])); $productDownloadWidget->setClient($client); $productDownloadWidget->load($product); // Add the cas-browser styles App::Get()->response->addStylesheet($module->moduleStatic . '/css/cas-browser.css'); // Prepare BreadcrumbWigdet $bcw = new BreadcrumbsWidget(); $bcw->add('Home',SITE_ROOT . '/'); $bcw->add('Browse By Type', $module->moduleRoot . '/'); $bcw->add($productTypeName, $module->moduleRoot."/dataset/{$productTypeId}"); $bcw->add('Products', $module->moduleRoot."/products/{$productTypeId}/page/{$returnPage}"); $bcw->add(App::Get()->request->segments[0]); ?>

Product Metadata: ",true);?>

render()?>

Download this Product:

render()?>