index.html 14.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Plato - api/icat/icatPlus.js</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->

  <link href="../../assets/css/vendor/morris.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/bootstrap.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/font-awesome.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/codemirror.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/plato.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/plato-file.css" rel="stylesheet" type="text/css">

</head>

<body>

<div class="navbar navbar-fixed-top">
  <div class="container">
    <a class="navbar-brand" href="https://github.com/the-simian/es6-plato">ES6 Plato on Github</a>
    <ul class="nav navbar-nav">
      <li>
        <a href="../../index.html">Report Home</a>
      </li>
      <li class="active">
        <a href="display.html">Summary Display</a>
      </li>
    </ul>
  </div>
</div>

<div class="jumbotron">
  <div class="container">
    <h1>api/icat/icatPlus.js</h1>
  </div>
</div>

<div class="container aggregate-stats">
  <div class="row">
    <div class="col-md-6">
      <h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/maintainability-index-range-and-meaning.aspx"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="A value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability." data-original-title="Maintainability Index"  data-container="body"></i></a></h2>
50
      <p class="stat">89.55</p>
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    </div>
    <div class="col-md-6">
      <h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC" data-container="body"></i></h2>
      <p class="stat">207</p>
    </div>
  </div>
  <div class="row historical">
    <div class="col-md-6">
      <p id="chart_historical_maint" class="chart"></p>
    </div>
    <div class="col-md-6">
      <p id="chart_historical_sloc" class="chart"></p>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6">
      <h2 class="header">Difficulty  <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty" data-container="body"></i></a></h2>
68
      <p class="stat">30.38</p>
69 70 71
    </div>
    <div class="col-md-6">
      <h2 class="header">Estimated Errors  <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs" data-container="body"></i></a></h2>
72
      <p class="stat">1.45</p>
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
    </div>
  </div>
</div>

<div class="container charts">
  <div class="row">
    <h2 class="header">Function weight</h2>
  </div>
  <div class="row">
    <div class="col-md-6">
      <h3 class="chart-header">By Complexity <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="This metric counts the number of distinct paths through a block of code. Lower values are better." data-original-title="Cyclomatic Complexity" data-container="body"></i></a></h3>
      <div id="fn-by-complexity" class="stat"></div>
    </div>
    <div class="col-md-6">
      <h3 class="chart-header">By SLOC  <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC" data-container="body"></i></h3>
      <div id="fn-by-sloc" class="stat"></div>
    </div>
  </div>
</div>

<div class="container">
  <div class="row">
    <textarea id="file-source" class="col-md-12">import ICATPLUS from &#039;../../config/icat/icatPlus.js&#039;

/**
 * Get URL needed to retrieve events for a given investigation
 * @param {String} sessionId the session identifier
 * @param {String} investigationId the session identifier
 * @return {String} the URL to get the requested events. Null if investigationId or sessionId is missing.
 */
export function getEventsByInvestigationId(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/query&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/**
 * Get URL needed to retrieve the event count for a given investigation
 * @param {string} sessionId the session identifier
 * @param {String} investigationId the investigation identifier
 * @return {String} the URL to get the requested event count
 */
export function getEventCountByInvestigationId(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/count&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/**
* Get URL used to create a new event for a given investigation on ICAT+ 
* @param {*} investigationId investigation indentifier 
* @param {String} sessionId session identifier
* @return {String} URL to get the requested events
*/
export function createEvent(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/create&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/**
 * Get URL used to update an event on a given investigation on ICAT+ 
 * @param {String} sessionId the session identifier
 * @param {String} investigationId the investigation indentifier 
 * @return {String} the URL to get the requested events
 */
export function updateEvent(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/update&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/**
* Get URL used to upload data such as a file to ICAT+.
* @param {*} investigationId the investigationId
*/
export function uploadFile(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/resource/sessionId/file/investigation/id/investigationId/upload&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/**
* Get URL used to retrieve the file of an event which category is &#039;file&#039;
* @param {string} sessionId session identifier 
* @param {*} investigationId investigation identifier
* @param {string} eventId event identifier where the file is stored
* @return {String} URL to get the file
*/
export function getFileByEventId(sessionId, investigationId, eventId) {
    return ICATPLUS.server + &quot;/resource/sessionId/file/id/eventId/investigation/id/investigationId/download&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId)
        .replace(&quot;eventId&quot;, eventId);
}

/**
* Get URL used to download a PDF file for a given investigation from the logbook
* @param {string} sessionId session identifier 
* @param {*} investigationId investigation identifier
* @param {object} selectionFilter selection filter used to retrieve part of the logbook. This is URI encoded and passed as query string
*/
export function getPDF(sessionId, investigationId, selectionFilter) {
176 177 178


    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/pdf?find=&amp;sort=&amp;skip=&amp;limit=&quot;
179 180
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId)
181 182 183 184
        .replace(&quot;find=&quot;, () =&gt; { return &#039;find=&#039; + ((selectionFilter &amp;&amp; selectionFilter.find) ? JSON.stringify(selectionFilter.find) : &#039;&#039;) })
        .replace(&quot;&amp;sort=&quot;, () =&gt; { return &#039;&amp;sort=&#039; + ((selectionFilter &amp;&amp; selectionFilter.sort) ? JSON.stringify(selectionFilter.sort) : &#039;&#039;) })
        .replace(&quot;&amp;skip=&quot;, () =&gt; { return &#039;&amp;skip=&#039; + ((selectionFilter &amp;&amp; selectionFilter.skip !== undefined) ? JSON.stringify(selectionFilter.skip) : &#039;&#039;) })
        .replace(&quot;&amp;limit=&quot;, () =&gt; { return &#039;&amp;limit=&#039; + ((selectionFilter &amp;&amp; selectionFilter.limit !== undefined) ? JSON.stringify(selectionFilter.limit) : &#039;&#039;) });
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
}

/**
 * Get the URL used to mint a DOI
 * @param {*} sessionId session identifier
 * @return {string} URL used to mint a DOI
 */
export function getMintDOI(sessionId) {
    return ICATPLUS.server + &quot;/doi/sessionId/mint&quot;
        .replace(&quot;sessionId&quot;, sessionId);
}

/** Get the tags associated to a given investigation 
* @param {string} sessionId session identifier 
* @param {*} investigationId investigation identifier
*/
export function getTagsByInvestigationId(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/&quot; + sessionId + &quot;/investigation/id/&quot; + investigationId + &quot;/tag&quot;;
}

/** Create a given tag associated to a given investigation */
export function createTagsByInvestigationId(sessionId, investigationId) {
    return ICATPLUS.server + &#039;/logbook/&#039; + sessionId + &#039;/investigation/id/&#039; + investigationId + &#039;/tag/create&#039;;
}

/** Update a given tag associated to a given investigation */
export function updateTagsByInvestigationId(sessionId, investigationId, tagId) {
    return ICATPLUS.server + &quot;/logbook/&quot; + sessionId + &quot;/investigation/id/&quot; + investigationId + &quot;/tag/id/&quot; + tagId + &quot;/tag/update&quot;;
}

export function getDownloadURLByDatasetId(sessionId, datasetIds) {
    return IDS.server + &quot;/getData?sessionId=&quot; + sessionId + &quot;&amp;datasetIds=&quot; + datasetIds;
}

export function getDownloadURLByDatafileId(sessionId, datafileIds) {
    return IDS.server + &quot;/getData?sessionId=&quot; + sessionId + &quot;&amp;datafileIds=&quot; + datafileIds;
}

export function getFilesByDatasetId(sessionId, datasetIds) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/dataset/id/datasetIds/datafile&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;datasetIds&quot;, datasetIds);
}

export function getUsersByInvestigationIds(sessionId, investigationIds) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation/id/investigationIds/investigationusers&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationIds&quot;, investigationIds);
}

export function getInvestigationById(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation/id/investigationId/investigation&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

export function getEmbargoedInvestigations(sessionId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation/status/embargoed/investigation&quot;
        .replace(&quot;sessionId&quot;, sessionId);
}

export function getReleasedInvestigations(sessionId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation/status/released/investigation&quot;
        .replace(&quot;sessionId&quot;, sessionId);
}

export function getInvestigationsByUser(sessionId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation&quot;
        .replace(&quot;sessionId&quot;, sessionId);
}

export function getDatasetsById(sessionId, datasetIds) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/dataset/id/datasetIds/dataset&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;datasetIds&quot;, datasetIds);
}

export function getDatasetByDOI(sessionId, doi) {
    return ICATPLUS.server + &quot;/doi/&quot; + doi + &quot;/datasets?sessionId=&quot; + sessionId;
}

export function getDatasetsByInvestigationId(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/investigation/id/investigationId/dataset&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

export function getDatasetStatus(sessionId, datasetIds) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/dataset/id/datasetIds/status&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;datasetIds&quot;, datasetIds);
}

export function getDataCollections(sessionId) {
    return ICATPLUS.server + &quot;/catalogue/sessionId/datacollection&quot;
        .replace(&quot;sessionId&quot;, sessionId);
}

export function getDataCollectionByDatasetId(sessionId, datasetId) {
    return ICATPLUS.server + &quot;/datasets/&quot; + datasetId + &quot;/datacollection?sessionId=&quot; + sessionId;
}

export function createEventFromBase64(sessionId, investigationId) {
    return ICATPLUS.server + &quot;/logbook/sessionId/investigation/id/investigationId/event/createfrombase64&quot;
        .replace(&quot;sessionId&quot;, sessionId)
        .replace(&quot;investigationId&quot;, investigationId);
}

/** To be removed from here */
var IDS =
{
    //server: &quot;https://ovm-icat-test.esrf.fr:8181&quot;,
    server: &quot;https://ids.esrf.fr/ids&quot;,
    connection: {
        plugins: [&#039;esrf&#039;]
    }
};</textarea>
  </div>
</div>

<footer class="footer">
  <div class="container">
    <p>.</p>
  </div>
</footer>

<script type="text/html" id="complexity-popover-template">
  <div class="complexity-notice">
    Complexity : {{ complexity.cyclomatic }} <br>
    Length : {{ complexity.halstead.length }} <br>
    Difficulty : {{ complexity.halstead.difficulty.toFixed(2) }} <br>
    Est # bugs : {{ complexity.halstead.bugs.toFixed(2) }}<br>
  </div>
</script>

<script type="text/javascript" src="../../assets/scripts/bundles/core-bundle.js"></script>
<script type="text/javascript" src="../../assets/scripts/bundles/codemirror.js"></script>
<script type="text/javascript" src="../../assets/scripts/codemirror.markpopovertext.js"></script>
<script type="text/javascript" src="report.js"></script>
<script type="text/javascript" src="report.history.js"></script>
<script type="text/javascript" src="../../assets/scripts/plato-file.js"></script>
</body>
</html>