Skip to content
Snippets Groups Projects
Commit 47a20969 authored by cramakri's avatar cramakri
Browse files

SE-406 Added a small, minimal example of an openBIS app

SVN: 24336
parent 9bee07e7
No related branches found
No related tags found
No related merge requests found
Showing
with 16213 additions and 22 deletions
......@@ -10,8 +10,10 @@
<body>
<script type="text/javascript">
$(document).ready(function(){
var openbisHost = 'http://127.0.0.1:8888';
var dssHost = 'http://127.0.0.1:8889';
//var openbisHost = 'http://127.0.0.1:8888';
//var dssHost = 'http://127.0.0.1:8889';
var openbisHost = 'https://sprint-openbis.ethz.ch:8446';
var dssHost = 'https://sprint-openbis.ethz.ch:8447';
var openbisContext = 'openbis';
var o = new openbis(openbisHost, openbisContext, dssHost);
......@@ -19,12 +21,12 @@
var featureVectorDatasetReference = {
"@class":".FeatureVectorDatasetReference",
"permId":"20100925142438333-158190"
"permId":"20110913112215416-82999"
}
var featureVectorDatasetWellReference = {
"@class": ".FeatureVectorDatasetWellReference",
"permId":"20100925142438333-158190",
"permId":"20110913112215416-82999",
"wellPosition": {
"wellColumn": 1,
"wellRow": 1
......@@ -33,13 +35,14 @@
var imageDatasetReference = {
"@class": ".ImageDatasetReference",
"permId":"20111222081950963-158742"
"permId":"20110913111517610-82996"
}
o.dss_listAvailableFeatureNames([featureVectorDatasetReference]);
o.dss_listAvailableFeatureNames([featureVectorDatasetReference], function(response) { $("#log").append('<p>'+response.result+'</p>')});
o.dss_listAvailableFeatureCodes([featureVectorDatasetReference], function(response){
o.dss_loadFeatures([featureVectorDatasetReference], response.result);
o.dss_loadFeaturesForDatasetWellReferences([featureVectorDatasetWellReference], response.result);
$("#log").append('<p>'+response.result+'</p>')
o.dss_loadFeatures([featureVectorDatasetReference], response.result, function(response) { $("#log").append('<p>'+response.result+'</p>')});
o.dss_loadFeaturesForDatasetWellReferences([featureVectorDatasetWellReference], response.result, function(response) { $("#log").append('<p>'+response.result+'</p>')});
});
o.dss_listPlateImageReferencesForChannel(imageDatasetReference, [{wellColumn: 1, wellRow: 1}], 'DAPI');
o.dss_listPlateImageReferencesForChannels(imageDatasetReference, [{wellColumn: 1, wellRow: 1}], ['DAPI','GFP','CY3']);
......@@ -61,19 +64,19 @@
o.screening_listPlatesForExperiment({
"@class": ".ExperimentIdentifier",
permId: "20100910161306692-5",
spaceCode: "HCS-LAB-BRAGGER",
projectCode: "MARTA-PROJECT",
experimentCode: "DEMO_SCREEN_01"
permId: "20110913110350093-82823",
spaceCode: "PLATONIC",
projectCode: "SCREENING-EXAMPLES",
experimentCode: "EXP-1"
}, function(response){
o.screening_listFeatureVectorDatasets(response.result, function(){});
});
o.screening_getPlateMetadataList([{
"@class": ".PlateIdentifier",
permId: "20100917094502305-79298",
plateCode: "PLATE-132-B",
spaceCodeOrNull: "HCS-LAB-BRAGGER"
permId: "20110913110856015-82825",
plateCode: "PLATE-1",
spaceCodeOrNull: "PLATONIC"
}], function(response){
o.screening_listFeatureVectorDatasets(response.result, function(){});
});
......@@ -81,7 +84,7 @@
o.screening_listExperiments(function(response){
for(var index in response.result){
var experiment = response.result[index];
if(experiment.experimentCode == 'DEMO_SCREEN_02'){
if(experiment.experimentCode == 'EXP-1'){
o.screening_listPlatesForExperiment(experiment, function(){});
o.screening_listPlateWellsForExperimentAndMaterial(experiment, {
"@class": ".MaterialIdentifier",
......@@ -96,7 +99,7 @@
o.screening_listExperimentsForUser('admin', function(response){
for(var index in response.result){
var experiment = response.result[index];
if(experiment.experimentCode == 'DEMO_SCREEN_01'){
if(experiment.experimentCode == 'EXP-1'){
o.screening_listPlatesForExperiment(experiment, function(){});
}
}
......@@ -104,21 +107,22 @@
o.screening_listFeatureVectorDatasets([{
"@class": ".PlateIdentifier",
permId: "20100917094502305-79298",
plateCode: "PLATE-132-B",
spaceCodeOrNull: "HCS-LAB-BRAGGER"
permId: "20110913110856015-82825",
plateCode: "PLATE-1",
spaceCodeOrNull: "PLATONIC"
}], function(){});
o.screening_getDatasetIdentifiers(['20100917120747867-157707', '20100917120809240-157708'], function(){});
o.screening_getDatasetIdentifiers(['20110928155536073-83014', '20100823223152041-79084'], function(){});
o.screening_listPlateWellsForMaterial({
"@class": ".MaterialIdentifier",
materialTypeIdentifier: {materialTypeCode: "SIRNA"},
materialCode: "10280_1"
materialCode: "GENE-256_256"
}, function(){});
});
});
</script>
<div id="log"></div>
</body>
</html>
\ No newline at end of file
body { font: 14px "Trebuchet MS", sans-serif; }
h1 { font: 16px; }
h3 { font: 12px; }
div#vis { padding-top: 10px;}
div#vis div { padding-top: 2px;}
button {
font: 14px "Trebuchet MS";
background-color: #222;
background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11)));
background-image: -webkit-linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.11));
color: #fff;
text-rendering: optimizeLegibility;
text-shadow: 0 -1px 1px #222;
padding: 3px 5px 3px 5px;
border: 0;
border-radius: 0;
border-bottom: 1px solid #222;
margin: 0;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
}
button.first {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
button.last {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
button.active {
background-color: rgb(65,102,133);
}
button:hover {
background-color: steelblue;
}
input {
font: 14px "Trebuchet MS";
background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11)));
background-image: -webkit-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.1));
color: #000;
text-rendering: optimizeLegibility;
padding: 3px 5px 3px 5px;
border: 0;
border-radius: 0;
margin: 0;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
openbis/sourceTest/javascript/simpleapp/images/openBIS_Logo.png

7.06 KiB

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="400.023px" height="174.566px" viewBox="0 0 400.023 174.566" enable-background="new 0 0 400.023 174.566"
xml:space="preserve">
<g id="Layer_1">
<g>
<text transform="matrix(1 0 0 1 46.4854 154.2764)"><tspan x="0" y="0" fill="#010101" font-family="'HelveticaNeue-Bold'" font-size="93.505" letter-spacing="-4">open</tspan><tspan x="204.679" y="0" fill="#231F20" font-family="'HelveticaNeue'" font-size="93.505">BIS</tspan></text>
<rect x="204.234" y="158.748" fill="none" width="192.64" height="14.936"/>
<text transform="matrix(1 0 0 1 204.2329 169.876)" fill="#010101" font-family="'HelveticaNeue'" font-size="15.5842">Biology Information System</text>
<g>
<g>
<g>
<g>
<polygon fill="#068172" points="125.213,81.967 141.416,98.167 147.252,92.333 131.053,76.132 125.213,76.132 "/>
</g>
<g>
<g>
<polygon fill="#068172" points="120.206,81.967 104.005,98.167 98.168,92.333 114.368,76.132 120.206,76.132 "/>
</g>
<g>
<polygon fill="#068172" points="120.206,65.286 104.005,49.084 98.168,54.92 114.368,71.12 120.206,71.12 "/>
</g>
</g>
</g>
<g>
<polygon fill="#068172" points="125.213,65.286 141.416,49.084 147.252,54.92 131.053,71.12 125.213,71.12 "/>
</g>
</g>
<g>
<g>
<polygon fill="#A4A4A4" points="76.131,16.201 92.331,0 98.168,5.836 81.969,22.036 76.13,22.036 "/>
</g>
<g>
<g>
<polygon fill="#ADACAF" points="76.131,32.882 92.331,49.084 98.168,43.247 81.969,27.048 76.13,27.048 "/>
</g>
<g>
<g>
<polygon fill="#ADACAF" points="71.122,32.882 54.921,49.084 49.084,43.247 65.283,27.048 71.123,27.048 "/>
</g>
<g>
<polygon fill="#ADACAF" points="71.122,16.201 54.921,0 49.084,5.836 65.283,22.036 71.123,22.036 "/>
</g>
</g>
</g>
</g>
<g>
<g>
<polygon fill="#ADACAF" points="27.046,65.286 43.247,49.084 49.083,54.92 32.884,71.12 27.045,71.12 "/>
</g>
<g>
<polygon fill="#ADACAF" points="27.046,81.967 43.247,98.167 49.083,92.333 32.884,76.132 27.045,76.132 "/>
</g>
<g>
<polygon fill="#ADACAF" points="22.038,81.967 5.837,98.167 0,92.333 16.199,76.132 22.038,76.132 "/>
</g>
<g>
<polygon fill="#ADACAF" points="22.038,65.286 5.837,49.084 0,54.92 16.199,71.12 22.038,71.12 "/>
</g>
</g>
</g>
</g>
</g>
<g id="Layer_2">
</g>
</svg>
This diff is collapsed.
/**
* Caches openBIS JSON responses into the local browser storage.
*
* Once the local storage is populated with data from real
* server interactions, the UI development can be done offline
* based on the cached server responses.
*
* USAGE : include this script in your app *after* the openbis facade.
* Be careful not to distribute it to your customers.
*
* <script type="text/javascript" src="openbis-request-cache.js"></script>
*
* To clear the cache, you can call "localStorage.clear()" in a browser console.
*/
var original_ajax_request_func = ajaxRequest;
ajaxRequest = function(settings) {
function getCacheId(settings) {
var methodName = settings.data['method']
if (methodName.toLowerCase().indexOf('authenticate') != -1) {
// do not store sensitive parameters information
// for login methods (e.g. username/password)
return methodName
} else {
var params = settings.data['params']
return methodName + '-' + JSON.stringify(params)
}
}
var cacheId = getCacheId(settings)
var cachedResponse = localStorage.getItem(cacheId)
if (cachedResponse == null) {
var originalCallback = settings.success
settings.success = function(response) {
localStorage.setItem(cacheId, JSON.stringify(response))
originalCallback(response)
}
original_ajax_request_func(settings);
} else {
// async execution after a delay of 100ms
setTimeout(function() {
settings.success(JSON.parse(cachedResponse))
}, 100)
}
}
alert("This app includes development code. For production, do not forget to remove the reference to openbis-request-cache.js")
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment