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
4bd1afc3
Commit
4bd1afc3
authored
8 years ago
by
gakin
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-4389 : Retrieve vocabularies and terms and add to Resource List xml
SVN: 37507
parent
511fa381
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/ethz/sis/openbis/generic/server/EntityRetriever.java
+34
-0
34 additions, 0 deletions
...a/ch/ethz/sis/openbis/generic/server/EntityRetriever.java
with
34 additions
and
0 deletions
openbis/source/java/ch/ethz/sis/openbis/generic/server/EntityRetriever.java
+
34
−
0
View file @
4bd1afc3
...
@@ -82,6 +82,8 @@ import ch.ethz.sis.openbis.generic.shared.entitygraph.EntityGraph;
...
@@ -82,6 +82,8 @@ import ch.ethz.sis.openbis.generic.shared.entitygraph.EntityGraph;
import
ch.ethz.sis.openbis.generic.shared.entitygraph.Node
;
import
ch.ethz.sis.openbis.generic.shared.entitygraph.Node
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IMasterDataRegistrationTransaction
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IMasterDataRegistrationTransaction
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IPropertyTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IPropertyTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IVocabularyImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IVocabularyTermImmutable
;
public
class
EntityRetriever
public
class
EntityRetriever
{
{
...
@@ -423,6 +425,33 @@ public class EntityRetriever
...
@@ -423,6 +425,33 @@ public class EntityRetriever
Element
rootElement
=
doc
.
createElement
(
"masterData"
);
Element
rootElement
=
doc
.
createElement
(
"masterData"
);
doc
.
appendChild
(
rootElement
);
doc
.
appendChild
(
rootElement
);
// append vocabularies
List
<
IVocabularyImmutable
>
vocabularies
=
listVocabularies
();
if
(
vocabularies
.
size
()
>
0
)
{
Element
vocabsElement
=
doc
.
createElement
(
"vocabularies"
);
rootElement
.
appendChild
(
vocabsElement
);
for
(
IVocabularyImmutable
vocabImmutable
:
vocabularies
)
{
Element
vocabElement
=
doc
.
createElement
(
"vocabulary"
);
vocabElement
.
setAttribute
(
"code"
,
vocabImmutable
.
getCode
());
vocabElement
.
setAttribute
(
"description"
,
vocabImmutable
.
getDescription
());
vocabElement
.
setAttribute
(
"urlTemplate"
,
vocabImmutable
.
getUrlTemplate
());
vocabsElement
.
appendChild
(
vocabElement
);
List
<
IVocabularyTermImmutable
>
terms
=
vocabImmutable
.
getTerms
();
for
(
IVocabularyTermImmutable
vocabTermImmutable
:
terms
)
{
Element
termElement
=
doc
.
createElement
(
"term"
);
termElement
.
setAttribute
(
"code"
,
vocabTermImmutable
.
getCode
());
termElement
.
setAttribute
(
"label"
,
vocabTermImmutable
.
getLabel
());
termElement
.
setAttribute
(
"description"
,
vocabTermImmutable
.
getDescription
());
termElement
.
setAttribute
(
"ordinal"
,
String
.
valueOf
(
vocabTermImmutable
.
getOrdinal
()));
termElement
.
setAttribute
(
"url"
,
vocabTermImmutable
.
getUrl
());
vocabElement
.
appendChild
(
termElement
);
}
}
}
// append property types
// append property types
List
<
IPropertyTypeImmutable
>
propertyTypes
=
listPropertyTypes
();
List
<
IPropertyTypeImmutable
>
propertyTypes
=
listPropertyTypes
();
if
(
propertyTypes
.
size
()
>
0
)
if
(
propertyTypes
.
size
()
>
0
)
...
@@ -616,6 +645,11 @@ public class EntityRetriever
...
@@ -616,6 +645,11 @@ public class EntityRetriever
return
masterDataRegistrationTransaction
.
listPropertyTypes
();
return
masterDataRegistrationTransaction
.
listPropertyTypes
();
}
}
public
List
<
IVocabularyImmutable
>
listVocabularies
()
{
return
masterDataRegistrationTransaction
.
listVocabularies
();
}
private
List
<
DataSetType
>
getDataSetTypes
()
private
List
<
DataSetType
>
getDataSetTypes
()
{
{
DataSetTypeSearchCriteria
searchCriteria
=
new
DataSetTypeSearchCriteria
();
DataSetTypeSearchCriteria
searchCriteria
=
new
DataSetTypeSearchCriteria
();
...
...
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