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
f3bcabe8
Commit
f3bcabe8
authored
14 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1887 Added another utility method to DataSetLister -- useful for testing.
SVN: 18872
parent
e06e5213
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java
+28
-5
28 additions, 5 deletions
...stemsx/cisd/openbis/generic/client/cli/DataSetLister.java
with
28 additions
and
5 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java
+
28
−
5
View file @
f3bcabe8
...
...
@@ -44,11 +44,11 @@ public class DataSetLister
{
String
serverUrl
=
args
[
0
];
String
userId
=
args
[
1
];
String
password
;
if
(
args
.
length
==
3
)
{
password
=
args
[
2
];
password
=
args
[
2
];
}
else
{
password
=
getConsoleReader
().
readLine
(
"Password: "
,
Character
.
valueOf
(
'*'
));
...
...
@@ -78,11 +78,10 @@ public class DataSetLister
return
new
ConsoleReader
();
}
catch
(
final
IOException
ex
)
{
throw
new
EnvironmentFailureException
(
"ConsoleReader could not be instantiated."
,
ex
);
throw
new
EnvironmentFailureException
(
"ConsoleReader could not be instantiated."
,
ex
);
}
}
private
final
IGeneralInformationService
generalInformationService
;
private
final
String
sessionToken
;
...
...
@@ -132,4 +131,28 @@ public class DataSetLister
System
.
out
.
println
(
sb
.
toString
());
System
.
out
.
println
(
"\n"
);
}
/**
* Find data sets with a specific value for a property.
*/
@SuppressWarnings
(
"unused"
)
private
void
findDataSetsForSamplesWithCode
(
String
code
)
{
SearchCriteria
sc
=
new
SearchCriteria
();
sc
.
addMatchClause
(
MatchClause
.
createAttributeMatch
(
MatchClauseAttribute
.
CODE
,
code
));
List
<
Sample
>
samples
=
generalInformationService
.
searchForSamples
(
sessionToken
,
sc
);
List
<
DataSet
>
result
=
generalInformationService
.
listDataSets
(
sessionToken
,
samples
);
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"Found "
);
sb
.
append
(
samples
.
size
());
sb
.
append
(
" sample(s) with code"
);
sb
.
append
(
"="
);
sb
.
append
(
code
);
sb
.
append
(
". Data sets attached to these samples:\n"
);
sb
.
append
(
result
);
System
.
out
.
println
(
sb
.
toString
());
System
.
out
.
println
(
"\n"
);
}
}
\ No newline at end of file
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