Skip to content
Snippets Groups Projects
Commit 31a92e64 authored by juanf's avatar juanf
Browse files

SSDM-2495 : Adding v3 client API to ELN (Last stable version before making fundamental changes)

SVN: 34693
parent 967416a7
No related branches found
No related tags found
No related merge requests found
...@@ -574,6 +574,7 @@ function ServerFacade(openbisServer) { ...@@ -574,6 +574,7 @@ function ServerFacade(openbisServer) {
// require(["util/Json"], function(Json){ // require(["util/Json"], function(Json){
// Json.fromJson(jsonParsed).done(function(data) { // Json.fromJson(jsonParsed).done(function(data) {
// var samples = data.objects; // var samples = data.objects;
// callbackFunction(samples);
// }).fail(function() { // }).fail(function() {
// alert("V3 dropbox search failed to be parsed."); // alert("V3 dropbox search failed to be parsed.");
// }); // });
...@@ -905,6 +906,15 @@ function ServerFacade(openbisServer) { ...@@ -905,6 +906,15 @@ function ServerFacade(openbisServer) {
// //
// Free Text Search // Free Text Search
// //
// this.searchWithText = function(freeText, callbackFunction)
// {
// this.searchSamples({
// "anyField" : freeText,
// "withProperties" : true,
// "withOrOperator" : true
// }, callbackFunction);
// }
this.searchWithText = function(freeText, callbackFunction) this.searchWithText = function(freeText, callbackFunction)
{ {
var _this = this; var _this = this;
...@@ -989,6 +999,7 @@ function ServerFacade(openbisServer) { ...@@ -989,6 +999,7 @@ function ServerFacade(openbisServer) {
return sampleCriteria; return sampleCriteria;
} }
// //
// Search Domains // Search Domains
// //
......
...@@ -493,9 +493,12 @@ def searchSamples(tr, parameters, tableBuilder, sessionId): ...@@ -493,9 +493,12 @@ def searchSamples(tr, parameters, tableBuilder, sessionId):
############### ###############
############### V3 Search ############### V3 Search
############### ###############
fechOptions = parameters;
# FreeText
anyField = fechOptions.get("anyField");
# Attributes # Attributes
fechOptions = parameters;
samplePermId = fechOptions.get("samplePermId"); samplePermId = fechOptions.get("samplePermId");
sampleIdentifier = fechOptions.get("sampleIdentifier"); sampleIdentifier = fechOptions.get("sampleIdentifier");
sampleCode = fechOptions.get("sampleCode"); sampleCode = fechOptions.get("sampleCode");
...@@ -517,9 +520,19 @@ def searchSamples(tr, parameters, tableBuilder, sessionId): ...@@ -517,9 +520,19 @@ def searchSamples(tr, parameters, tableBuilder, sessionId):
#Search Setup #Search Setup
criterion = SampleSearchCriterion(); criterion = SampleSearchCriterion();
criterion.withAndOperator();
fetchOptions = SampleFetchOptions(); fetchOptions = SampleFetchOptions();
#Operator
withOrOperator = fechOptions.get("withOrOperator");
if withOrOperator:
criterion.withOrOperator();
else:
criterion.withAndOperator();
#Free Text
if anyField is not None:
criterion.withAnyField().thatContains(anyField);
#Attributes #Attributes
if samplePermId is not None: if samplePermId is not None:
criterion.withPermId().thatEquals(samplePermId); criterion.withPermId().thatEquals(samplePermId);
...@@ -554,6 +567,12 @@ def searchSamples(tr, parameters, tableBuilder, sessionId): ...@@ -554,6 +567,12 @@ def searchSamples(tr, parameters, tableBuilder, sessionId):
if withDescendants: if withDescendants:
fetchOptions.withChildren(fetchOptions); fetchOptions.withChildren(fetchOptions);
#Standard Fetch Options, always use
fetchOptions.withType();
fetchOptions.withSpace();
fetchOptions.withRegistrator();
fetchOptions.withModifier();
############### ###############
############### ###############
############### ###############
......
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