Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
d2b5c58e
Commit
d2b5c58e
authored
9 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-2495 : Refactoring, removing/merging/categorizing sample search calls
SVN: 34671
parent
98a31033
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
+44
-41
44 additions, 41 deletions
...lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
with
44 additions
and
41 deletions
plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
+
44
−
41
View file @
d2b5c58e
...
@@ -523,19 +523,33 @@ function ServerFacade(openbisServer) {
...
@@ -523,19 +523,33 @@ function ServerFacade(openbisServer) {
this
.
openbisServer
.
searchForDataSets
(
dataSetCriteria
,
callbackFunction
)
this
.
openbisServer
.
searchForDataSets
(
dataSetCriteria
,
callbackFunction
)
}
}
// Used for blast search datasets
this
.
getSamplesForDataSets
=
function
(
dataSetCodes
,
callback
)
{
this
.
openbisServer
.
getDataSetMetaDataWithFetchOptions
(
dataSetCodes
,
[
'
SAMPLE
'
],
callback
);
}
//
//
// Search Samples
// Search Samples
//
//
this
.
searchSamples
=
function
(
fechOptions
,
callbackFunction
)
this
.
searchSamples
=
function
(
fechOptions
,
callbackFunction
)
{
{
//Attributes
var
samplePermId
=
fechOptions
[
"
samplePermId
"
];
var
samplePermId
=
fechOptions
[
"
samplePermId
"
];
var
sampleIdentifier
=
fechOptions
[
"
sampleIdentifier
"
];
var
sampleIdentifier
=
fechOptions
[
"
sampleIdentifier
"
];
var
sampleCode
=
fechOptions
[
"
sampleCode
"
];
var
sampleCode
=
fechOptions
[
"
sampleCode
"
];
var
sampleTypeCode
=
fechOptions
[
"
sampleTypeCode
"
];
var
sampleTypeCode
=
fechOptions
[
"
sampleTypeCode
"
];
//Properties
var
properyKeyValueList
=
fechOptions
[
"
properyKeyValueList
"
];
var
properyKeyValueList
=
fechOptions
[
"
properyKeyValueList
"
];
//Sub Queries
var
sampleExperimentIdentifier
=
fechOptions
[
"
sampleExperimentIdentifier
"
];
var
sampleExperimentIdentifier
=
fechOptions
[
"
sampleExperimentIdentifier
"
];
var
sampleContainer
=
fechOptions
[
"
sampleContainer
"
];
//Hierarchy Options
var
withProperties
=
fechOptions
[
"
withProperties
"
];
var
withProperties
=
fechOptions
[
"
withProperties
"
];
var
withParents
=
fechOptions
[
"
withParents
"
];
var
withParents
=
fechOptions
[
"
withParents
"
];
var
withChildren
=
fechOptions
[
"
withChildren
"
];
var
withAncestors
=
fechOptions
[
"
withAncestors
"
];
var
withAncestors
=
fechOptions
[
"
withAncestors
"
];
var
withDescendants
=
fechOptions
[
"
withDescendants
"
];
var
withDescendants
=
fechOptions
[
"
withDescendants
"
];
...
@@ -630,6 +644,22 @@ function ServerFacade(openbisServer) {
...
@@ -630,6 +644,22 @@ function ServerFacade(openbisServer) {
});
});
}
}
if
(
sampleContainer
)
{
subCriterias
.
push
({
"
@type
"
:
"
SearchSubCriteria
"
,
"
targetEntityKind
"
:
"
SAMPLE_CONTAINER
"
,
"
criteria
"
:
{
matchClauses
:
[{
"
@type
"
:
"
AttributeMatchClause
"
,
fieldType
:
"
ATTRIBUTE
"
,
attribute
:
"
PERM_ID
"
,
desiredValue
:
sampleContainer
}],
operator
:
"
MATCH_ALL_CLAUSES
"
}
});
}
var
sampleCriteria
=
{
var
sampleCriteria
=
{
matchClauses
:
matchClauses
,
matchClauses
:
matchClauses
,
subCriterias
:
subCriterias
,
subCriterias
:
subCriterias
,
...
@@ -654,6 +684,10 @@ function ServerFacade(openbisServer) {
...
@@ -654,6 +684,10 @@ function ServerFacade(openbisServer) {
options
.
push
(
"
PARENTS
"
);
options
.
push
(
"
PARENTS
"
);
}
}
if
(
withChildren
)
{
options
.
push
(
"
CHILDREN
"
);
}
var
localReference
=
this
;
var
localReference
=
this
;
this
.
openbisServer
.
searchForSamplesWithFetchOptions
(
sampleCriteria
,
options
,
function
(
data
)
{
this
.
openbisServer
.
searchForSamplesWithFetchOptions
(
sampleCriteria
,
options
,
function
(
data
)
{
callbackFunction
(
localReference
.
getInitializedSamples
(
data
.
result
));
callbackFunction
(
localReference
.
getInitializedSamples
(
data
.
result
));
...
@@ -742,6 +776,15 @@ function ServerFacade(openbisServer) {
...
@@ -742,6 +776,15 @@ function ServerFacade(openbisServer) {
searchNext
();
searchNext
();
}
}
this
.
searchContained
=
function
(
permId
,
callbackFunction
)
{
this
.
searchSamples
({
"
sampleContainer
"
:
permId
,
"
withProperties
"
:
true
,
"
withParents
"
:
true
,
"
withChildren
"
:
true
},
callbackFunction
);
}
this
.
getInitializedSamples
=
function
(
result
)
{
this
.
getInitializedSamples
=
function
(
result
)
{
//
//
...
@@ -830,47 +873,7 @@ function ServerFacade(openbisServer) {
...
@@ -830,47 +873,7 @@ function ServerFacade(openbisServer) {
}
}
//
//
// Sample Search Very Specific cases
// Free Text Search
//
// Used for Plates
this
.
searchContained
=
function
(
permId
,
callbackFunction
)
{
var
matchClauses
=
[];
var
subCriteria
=
{
"
@type
"
:
"
SearchSubCriteria
"
,
"
targetEntityKind
"
:
"
SAMPLE_CONTAINER
"
,
"
criteria
"
:
{
matchClauses
:
[{
"
@type
"
:
"
AttributeMatchClause
"
,
fieldType
:
"
ATTRIBUTE
"
,
attribute
:
"
PERM_ID
"
,
desiredValue
:
permId
}],
operator
:
"
MATCH_ALL_CLAUSES
"
}
}
var
sampleCriteria
=
{
matchClauses
:
matchClauses
,
subCriterias
:
[
subCriteria
],
operator
:
"
MATCH_ALL_CLAUSES
"
};
var
localReference
=
this
;
this
.
openbisServer
.
searchForSamplesWithFetchOptions
(
sampleCriteria
,
[
"
PROPERTIES
"
,
"
PARENTS
"
,
"
CHILDREN
"
],
function
(
data
)
{
callbackFunction
(
localReference
.
getInitializedSamples
(
data
.
result
));
});
}
// Used for blast search datasets
this
.
getSamplesForDataSets
=
function
(
dataSetCodes
,
callback
)
{
this
.
openbisServer
.
getDataSetMetaDataWithFetchOptions
(
dataSetCodes
,
[
'
SAMPLE
'
],
callback
);
}
//
// Free Search
//
//
this
.
searchWithText
=
function
(
freeText
,
callbackFunction
)
this
.
searchWithText
=
function
(
freeText
,
callbackFunction
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment