diff --git a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index f21b38a8ecc3ad51650281e8e10a5c58bb4f12c1..c5a13f1850d8aa88eeabebc7743555eac4c94ce4 100644 Binary files a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/index.html b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/index.html index b7e27684f2cda2b24cd2b228431dca5e70731acf..d3c362ce26703358c7fb2c40cc033f32c75d6be0 100644 --- a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/index.html +++ b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/index.html @@ -69,10 +69,19 @@ <div class="container"> <h1>Root</h1> - <p class="lead">Root data from the iPad UI</p> - <div class="row-fluid"> - <div id="root" class="span12" style="overflow: auto;"></div> - </div> + <div class="row-fluid"> + <div id="root" class="span12" style="height: 410px; overflow: auto;"></div> + </div> + <br> + <h1>Drill</h1> + <div class="row-fluid"> + <div id="drill" class="span12" style="overflow: auto;"></div> + </div> + <br> + <h1>Details</h1> + <div class="row-fluid"> + <div id="detail" class="span12" style="overflow: auto;"></div> + </div> </div> <!-- /container --> </div> <!-- /main --> diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/openbis.js b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/openbis.js index a0a3f819d40161eb8957200002174dd6fc5ee3f5..36c5c3e7219e5571b22a84ec17a9ddb4dbfdd979 100644 --- a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/openbis.js +++ b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/openbis.js @@ -112,6 +112,8 @@ openbis.prototype.useSession = function(sessionToken){ } openbis.prototype.isSessionActive = function(action) { + if (this.sessionToken == null) return; + if (this.sessionToken == "") return; ajaxRequest({ url: this.generalInfoServiceUrl, data: { "method" : "isSessionActive", diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/webapp.js b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/webapp.js index f7ceee3d8eab37f4bdac461aed6b3682156ef9e2..feaf9f4f96cd4a929eddf109c681146417415a17 100644 --- a/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/webapp.js +++ b/openbis-ipad/ipad-example-data/ipad-ui/1/as/webapps/ipad-debug/html/webapp.js @@ -23,18 +23,19 @@ function IpadModel() { } IpadModel.prototype.initializeModel = function() { - this.selectionStack = []; + this.selectedEntity = null; } IpadModel.prototype.selectEntity = function(d) { - this.selectionStack.push(d); + this.selectedEntity = d; var permId = d[0].value; var refcon = parseJson(d[1].value); var children = parseJson(d[5].value); if (children.length > 0) { - console.log(["DETAILS", permId, refcon]); + drillOnEntity(permId, refcon); + detailsForEntity(permId, refcon); } else { - console.log(["DRILL", permId, refcon]); + detailsForEntity(permId, refcon); } } @@ -44,7 +45,7 @@ model = new IpadModel(); /// The visualization, referenced by functions that display content -var root; +var root, drill, detail; /** * Create the DOM elements to store the visualization (tree + inspectors) @@ -55,6 +56,8 @@ function createVis() // Create a div to house the tree visualization and the inspectors root = d3.select("#root"); + drill = d3.select("#drill"); + detail = d3.select("#detail"); didCreateVis = true; } @@ -91,9 +94,9 @@ function showTableData(table) /** - * Display the samples returned by the server + * Display the data returned by the server */ -function displayRoot(data) +function displayResults(node, data) { if (data.error) { console.log(data.error); @@ -106,23 +109,55 @@ function displayRoot(data) var tableData = data.result; // Display the rows in a table - var table = root.selectAll("table").data([tableData]); + var table = node.selectAll("table").data([tableData]); // Code under enter is run if there is no HTML element for a data element table.enter().append("table").attr("class", "table"); showTableHeader(table); showTableData(table); } +function displayRoot(data) +{ + displayResults(root, data) +} + +function displayDrill(data) +{ + console.log(data); + displayResults(drill, data) +} + +function displayDetail(data) +{ + displayResults(detail, data) +} + /** * Request samples matching some criteria from the server and show them in the Page. */ -function callAggregationService() +function listRootLevelEntities() { var parameters = {requestKey : 'ROOT'}; openbisServer.createReportFromAggregationService("DSS1", "ipad-read-service-v1", parameters, displayRoot); } +function drillOnEntity(permId, refcon) +{ + var entities = [{"PERM_ID" : permId, "REFCON" : refcon}]; + var parameters = {requestKey : 'DRILL', entities: entities}; + + openbisServer.createReportFromAggregationService("DSS1", "ipad-read-service-v1", parameters, displayDrill); +} + +function detailsForEntity(permId, refcon) +{ + var entities = [{"PERM_ID" : permId, "REFCON" : refcon}]; + var parameters = {requestKey : 'DETAIL', entities: entities}; + + openbisServer.createReportFromAggregationService("DSS1", "ipad-read-service-v1", parameters, displayDetail); +} + function enterApp(data) { @@ -136,5 +171,5 @@ function enterApp(data) $('#main').show(); createVis(); - callAggregationService(); + listRootLevelEntities(); } \ No newline at end of file diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py index 379d895c5808a3be674dc29ae87a4b2a42fafa4f..bcfad3aaff452a22c808dc33baa15211609294bc 100644 --- a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py +++ b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py @@ -208,6 +208,8 @@ def samples_to_dict(samples, material_by_perm_id): return result def retrieve_samples(sample_perm_ids_and_ref_cons): + if not sample_perm_ids_and_ref_cons: + return [] sc = SearchCriteria() sc.setOperator(sc.SearchOperator.MATCH_ANY_CLAUSES) for sample in sample_perm_ids_and_ref_cons: diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 1ccfb32350c82080b85574e0b41261da11a09637..9b833c007c9c784d4d31fb89ba5a98a62842406d 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ