Example #1
0
 /**
  * @author Minh Duc Nguyen <*****@*****.**>
  */
 function run_test()
 {
     /* Set up variables to pass to the test functions to stimulate good and faulty DOI API calls */
     $app_id = $this->config->item('gDOIS_TEST_APP_ID');
     $incorrect_app_id = 'mvivnnvnjvn4tjvmve2432nvbthth';
     $shared_secret = $this->config->item('gDOIS_TEST_SHARED_SECRET');
     $incorrect_shared_secret = 'gmpryonty';
     $url = 'http://devl.ands.org.au/example1.php';
     $incorrect_url = 'http;//no.domain.exists/example.php';
     $doiversion_service_points = array('v1.0' => 'https://services.ands.org.au/home/dois/doi_', 'v1.1' => 'https://services.ands.org.au/doi/1.1/', 'test' => apps_url() . '/mydois/');
     $validxml = 'xml=' . file_get_contents(asset_url('test_cases/doi/validxml.xml'), 'test_suite');
     $invalidxml = 'xml=' . file_get_contents(asset_url('test_cases/doi/invalidxml.xml'), 'test_suite');
     $requestURI = $doiversion_service_points['v1.1'];
     $requestURI = $doiversion_service_points['test'];
     $v1_service_url = $doiversion_service_points['v1.0'];
     /* first we mint a DOI using the latest version of the CMD API*/
     $testDOI = $this->test_mint($app_id, $shared_secret, $url, $requestURI, 'mint', 'json', $validxml);
     $this->unit->run(is_string($testDOI), true, 'Test Mint returns DOI: ' . $testDOI);
     if ($testDOI) {
         $validxml = str_replace('<identifier identifierType="DOI"></identifier>', '<identifier identifierType="DOI">' . $testDOI . '</identifier>', $validxml);
         $this->test_doi_api_functions($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
         $this->test_doi_authentication($app_id, $incorrect_app_id, $shared_secret, $incorrect_shared_secret, $url, $testDOI, $requestURI);
         $this->test_doi_xml($app_id, $shared_secret, $url, $testDOI, $validxml, $invalidxml, $requestURI);
         $this->test_doi_service_point($app_id, $shared_secret, $url, $testDOI, $validxml, $v1_service_url, $requestURI);
         $this->test_response_type($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
     } else {
         return;
     }
 }
Example #2
0
            if (mod_enabled('mydois')) {
                ?>
		       <li class="divider"></li>
			  <li class=""><?php 
                echo anchor(apps_url('/mydois/list_trusted'), 'List Trusted DOI Clients');
                ?>
</li>
		      <?php 
            }
            ?>
		      <?php 
            if (mod_enabled('pids')) {
                ?>
		       <li class="divider"></li>
			  <li class=""><?php 
                echo anchor(apps_url('/pids/list_trusted'), 'List Trusted PIDs Clients');
                ?>
</li>
		      <?php 
            }
            ?>
                    <?php 
        }
        ?>
              
                </ul>
              </li>
              <?php 
    }
    ?>
          
									<input type="text" placeholder="Title" value="<?php 
        echo $i['title'];
        ?>
" name="title">
									<label>URL:</label>
									<input type="text" placeholder="URL" value="<?php 
        echo $i['url'];
        ?>
" name="url">
									<label>Link Text: <small class="muted">(will display instead of the URL, if specified)</small></label>
									<input type="text" placeholder="Link Display Text" value="<?php 
        echo isset($i['url_text']) ? $i['url_text'] : "";
        ?>
" name="url_text">
									<label>Image URL: <small>(<?php 
        echo anchor(apps_url('uploader/'), "upload a new image", array("target" => "_blank"));
        ?>
)</small></label>
									<input type="text" placeholder="Image URL" value="<?php 
        echo $i['img_url'];
        ?>
" name="img_url">
									<label>Image Attribution <small class="muted">(will display on mouse over on image)</small></label>
									<input type="text" placeholder="Image Attribution" value="<?php 
        if (isset($i['img_attr'])) {
            echo $i['img_attr'];
        }
        ?>
" name="img_attr">
									<label>Open In:</label>
									<select name="new_window" required>
                The ANDS Grant Widget allows you to verify a research grant ID against the grant information supplied by research funders to ANDS, or alternatively to search for a grant using keywords in the following fields - Title, Lead Institution, Investigrators, Principal Investigator, Description.
            </p>
            <p>
                This widget is a jQuery plugin with extensible options over styling and functionality. Hence the widget is dependent on the jQuery plugin to function correctly.
            </p>
            <h2>How to use this widget</h2>
            <p>
                Put the following code snippet into your document's &lt;head&gt; segment
                <pre class="prettyprint pre-scrollable">
&lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js'&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<?php 
echo apps_url('assets/grant_widget/css/grant_widget.js');
?>
"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" type="text/css" href="<?php 
echo apps_url('assets/grant_widget/css/grant_widget.css');
?>
" /&gt;
                </pre>
            </p>
            <p>
                You can init the plugin simply by
                <pre class="prettyprint">
&lt;input type="text" class="grant_widget"&gt;
                </pre>
                The plugin will automatically bind to all elements that have the class of <code>.grant_widget</code>
            </p>


            <p>You can also manually trigger the plugin with</p>
            <pre class="prettyprint">
				</div>
				<div class="control-group">
					<div class="controls">
						<a href="javascript:;" id="mint_confirm" class="btn btn-primary">Mint</a>
					</div>
				</div>
				<div class="control-group">
					<div class="controls" id="mint_result"></div>
				</div>
				<hr>
				
			</form>
		</div>
		<div class="widget-content hide" name="export">
			<a href="<?php 
echo apps_url('pids/my_pids');
?>
" class="btn btn-primary">Export All PIDs as CSV</a>
			<?php 
if ($batch_pid_files) {
    ?>
			    <ul>
			        <?php 
    foreach ($batch_pid_files as $o) {
        ?>
			            <li><a href="../assets/uploads/pids/<?php 
        echo $o;
        ?>
"><?php 
        echo $o;
        ?>
                The ANDS ORCID Widget allows you to lookup an ORCID ID and search for one using <a href="http://support.orcid.org/knowledgebase/articles/116874-orcid-api-guide" target="_blank">ORCID JSONP API</a>
            </p>
            <p>
                This widget is a jQuery plugin with extensible options over styling and functionality. Hence the widget is dependent on the jQuery plugin to function correctly.
            </p>
            <h2>How to use this widget</h2>
            <p>
                Put the following code snippet into your document's &lt;head&gt; segment
                <pre class="prettyprint pre-scrollable">
&lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js'&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<?php 
echo apps_url('assets/orcid_widget/css/orcid_widget.js');
?>
 ?>"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" type="text/css" href="<?php 
echo apps_url('assets/orcid_widget/css/orcid_widget.css');
?>
 ?>" /&gt;
                </pre>
            </p>
            <p>
                You can init the plugin simply by
                <pre class="prettyprint">
&lt;input type="text" class="orcid_widget"&gt;
                </pre>
                the plugin will automatically binds to all element that has the class of <code>.orcid_widget</code>
            </p>


            <p>You can also manually trigger the plugin with</p>
            <pre class="prettyprint">
Example #7
0
 * Simple demo of the registry summary widget
 *
 */
?>

<?php 
$this->load->view('header');
?>
<link href="<?php 
echo apps_url('assets/registry_summary/css/rosummary_widget.css/');
?>
" rel="stylesheet" type="text/css">
    <h1>Registry Summary Widget Demonstrator</h1>
    <h2>Example Summary Retrieval</h2>
    <hr/>

<div class="rosummary"/>

<?php 
$this->load->view('footer');
?>

<script src="<?php 
echo apps_url('assets/registry_summary/js/rosummary_widget.js');
?>
" type="text/javascript"></script>




Example #8
0
        ?>
" rel="stylesheet" type="text/css">
            <script src="<?php 
        echo apps_url('assets/registry_object_search/js/rosearch_widget.js');
        ?>
" type="text/javascript"></script>

        <?php 
    } elseif ($lib == 'registry_widget') {
        ?>
            <link href="<?php 
        echo apps_url('assets/registry_widget/css/registry_widget.css');
        ?>
" rel="stylesheet" type="text/css">
            <script src="<?php 
        echo apps_url('assets/registry_widget/js/registry_widget.js');
        ?>
" type="text/javascript"></script>

         <?php 
    } elseif ($lib == 'statistics') {
        ?>
            <script src="<?php 
        echo str_replace('/apps', '/applications/apps', base_url());
        ?>
statistics/assets/js/statistics.js" type="text/javascript"></script>

        <?php 
    } elseif ($lib == 'bootstro') {
        ?>
            <link href="<?php 
Example #9
0
$testDoiPrefix = $this->config->item('test_doi_prefix');
?>

<div class="content-header">
	<h1><?php 
echo $client->client_name;
?>
</h1>
</div>

<div id="breadcrumb" style="clear:both;">
	<?php 
echo anchor(registry_url('auth/dashboard'), '<i class="icon-home"></i> Home');
?>
	<?php 
echo anchor(apps_url('mydois'), 'Digital Object Identifiers');
?>
	<a href="#/" class="current"><?php 
echo $client->client_name;
?>
 <small class="muted">(<?php 
echo $client->app_id;
?>
)</small></a>
</div>

<div class="container-fluid">
	<div class="widget-box">
		<div class="widget-title">
			<ul class="nav nav-tabs">
				<li class="active" name="list"><a href="javascript:;">My DOIs</a></li>
Example #10
0
    function index()
    {
        /* Set up variables to pass to the test functions to stimulate good and faulty DOI API calls */
        $app_id = $this->config->item('gDOIS_TEST_APP_ID');
        $incorrect_app_id = 'mvivnnvnjvn4tjvmve2432nvbthth';
        $shared_secret = $this->config->item('gDOIS_TEST_SHARED_SECRET');
        $incorrect_shared_secret = 'gmpryonty';
        $url = 'http://devl.ands.org.au/example1.php';
        $incorrect_url = 'http;//no.domain.exists/example.php';
        $doiversion_service_points = array('v1.0' => 'https://services.ands.org.au/home/dois/doi_', 'v1.1' => 'https://services.ands.org.au/doi/1.1/', 'test' => apps_url() . '/mydois/');
        $validxml = 'xml=' . urlencode('<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://datacite.org/schema/kernel-2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-2.1 http://schema.datacite.org/meta/kernel-2.1/metadata.xsd">
  <identifier identifierType="DOI"></identifier>
  <creators>
    <creator>
      <creatorName>Woods, Liz</creatorName>
    </creator>
  </creators>
  <titles>
    <title>Data &amp; Test Example</title>
  </titles>
  <publisher>ANDS</publisher>
  <publicationYear>2014</publicationYear>
</resource>');
        $invalidxml = 'xml=' . urlencode('<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://datacite.org/schema/kernel-2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-2.1 http://schema.datacite.org/meta/kernel-2.1/metadata.xsd">
  <identifier identifierType="DOI">adoitotest</identifier>
  <anelement>dsfdsfgS</anelement>
  <creators>
    <creator>
      <creatorName>Woods, Liz</creatorName>
    </creator>
  </creators>
  <titles>
    <title>Data Test Example</title>
  </titles>
  <publisher>ANDS</publisher>
  <publicationYear>2014</publicationYear>
</resource>');
        $requestURI = $doiversion_service_points['v1.1'];
        $requestURI = $doiversion_service_points['test'];
        $v1_service_url = $doiversion_service_points['v1.0'];
        /* first we mint a DOI using the latest version of the CMD API*/
        $testDOI = $this->test_mint($app_id, $shared_secret, $url, $requestURI, 'mint', 'json', $validxml);
        if ($testDOI) {
            $validxml = str_replace(urlencode('<identifier identifierType="DOI"></identifier>'), urlencode('<identifier identifierType="DOI">' . $testDOI . '</identifier>'), $validxml);
            $data['test_mint'] = "   <span style='color: #0C0;'>Passed </span> " . $testDOI . " minted successfully.";
            /* Now use the just minted test DOI to test autentication function using the update DOI API call */
            $this->load->library('unit_test');
            /**
             * A series of test case
             * @var in the form of array(test_name, 1st argument, 2nd argument, 3rd argument, 4th argument, 5th argument, 6th argument, 7th argument, expected_result)
             */
            $data['test_functions'] = $this->test_doi_api_functions($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
            unset($this->unit->results);
            $data['authentication'] = $this->test_doi_authentication($app_id, $incorrect_app_id, $shared_secret, $incorrect_shared_secret, $url, $testDOI, $requestURI);
            unset($this->unit->results);
            $data['valid_xml'] = $this->test_doi_xml($app_id, $shared_secret, $url, $testDOI, $validxml, $invalidxml, $requestURI);
            unset($this->unit->results);
            $data['service_point'] = $this->test_doi_service_point($app_id, $shared_secret, $url, $testDOI, $validxml, $v1_service_url, $requestURI);
            unset($this->unit->results);
            $data['response_type'] = $this->test_response_type($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
        } else {
            $data['test_mint'] = "<span style='color: #C00;'>Failed </span> -  System could not perform initial mint - testing cannot continue.<br />";
            $data['authentication'] = '';
            $data['valid_xml'] = '';
            $data['service_point'] = '';
            $data['response_type'] = '';
        }
        $this->load->view('doi_test', $data);
    }
Example #11
0
    ?>
	<?php 
}
?>

			<div class="box">
				<div class="box-header clearfix">
					<h1>My Vocabularies</h1>
				</div>
				<div class="box-content">
					<?php 
if ($hasAffiliation) {
    if (sizeof($group_vocabs) > 0) {
        echo '<ul>';
        foreach ($group_vocabs as $g) {
            echo '<li><a href="' . apps_url('vocab_service/#!/view/' . $g->id) . '">' . $g->title . "</a></li>";
        }
        echo '</ul>';
    } else {
        echo 'You have not published any vocabularies.';
    }
} else {
    echo 'You have not published any vocabularies.';
    //echo "You can't manage any vocabulary unless you are affiliate with an organisation";
}
?>
				</div>
			</div>
		</div>
	</div>
</div>