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
a8fc1c7d
"git@sissource.ethz.ch:sispub/openbis.git" did not exist on "8fa7a3866a57f8a6d1aacd57f88a55c00815f2f6"
Commit
a8fc1c7d
authored
8 years ago
by
gakin
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-4594 : OpenbisSync - retrieve file format types
SVN: 37646
parent
dfeeb1ad
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
datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/sync/common/MasterDataExtractor.java
+22
-9
22 additions, 9 deletions
...c/server/dss/plugins/sync/common/MasterDataExtractor.java
with
22 additions
and
9 deletions
datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/sync/common/MasterDataExtractor.java
+
22
−
9
View file @
a8fc1c7d
...
...
@@ -51,6 +51,7 @@ import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.DataType;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IDataSetTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IEntityType
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IExperimentTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IFileFormatTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IMasterDataRegistrationTransaction
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IMaterialTypeImmutable
;
import
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IPropertyTypeImmutable
;
...
...
@@ -93,6 +94,10 @@ public class MasterDataExtractor
Element
rootElement
=
doc
.
createElement
(
"masterData"
);
doc
.
appendChild
(
rootElement
);
// append file format types
List
<
IFileFormatTypeImmutable
>
fileFormatTypes
=
masterDataRegistrationTransaction
.
listFileFormatTypes
();
appendFileFormatTypes
(
doc
,
rootElement
,
fileFormatTypes
);
// append vocabularies
List
<
IVocabularyImmutable
>
vocabularies
=
masterDataRegistrationTransaction
.
listVocabularies
();
appendVocabularies
(
doc
,
rootElement
,
vocabularies
);
...
...
@@ -126,6 +131,22 @@ public class MasterDataExtractor
return
writer
.
toString
();
}
private
void
appendFileFormatTypes
(
Document
doc
,
Element
rootElement
,
List
<
IFileFormatTypeImmutable
>
fileFormatTypes
)
{
if
(
fileFormatTypes
.
size
()
>
0
)
{
Element
fileFormatTypesElement
=
doc
.
createElement
(
"fileFormatTypes"
);
rootElement
.
appendChild
(
fileFormatTypesElement
);
for
(
IFileFormatTypeImmutable
fileFormatType
:
fileFormatTypes
)
{
Element
fileFormatTypeElement
=
doc
.
createElement
(
"fileFormatType"
);
fileFormatTypeElement
.
setAttribute
(
"code"
,
fileFormatType
.
getCode
());
fileFormatTypeElement
.
setAttribute
(
"description"
,
fileFormatType
.
getCode
());
fileFormatTypesElement
.
appendChild
(
fileFormatTypeElement
);
}
}
}
private
void
appendPropertyTypes
(
Document
doc
,
Element
rootElement
,
List
<
IPropertyTypeImmutable
>
propertyTypes
)
{
if
(
propertyTypes
.
size
()
>
0
)
...
...
@@ -302,9 +323,8 @@ public class MasterDataExtractor
{
Element
propertyAssignmentElement
=
doc
.
createElement
(
"propertyAssignment"
);
propertyAssignmentsElement
.
appendChild
(
propertyAssignmentElement
);
propertyAssignmentElement
.
setAttribute
(
"property
_t
ype
_c
ode"
,
CodeConverter
.
tryToBusinessLayer
(
propAssignment
.
getPropertyType
().
getCode
(),
propertyAssignmentElement
.
setAttribute
(
"property
T
ype
C
ode"
,
CodeConverter
.
tryToBusinessLayer
(
propAssignment
.
getPropertyType
().
getCode
(),
propAssignment
.
getPropertyType
().
isInternalNameSpace
()));
// propertyAssigmentElement.setAttribute("data_type_code", propAssignment.getPropertyType().getDataType().toString());
propertyAssignmentElement
.
setAttribute
(
"ordinal"
,
String
.
valueOf
(
propAssignment
.
getOrdinal
()));
propertyAssignmentElement
.
setAttribute
(
"section"
,
propAssignment
.
getSection
());
propertyAssignmentElement
.
setAttribute
(
"showInEdit"
,
String
.
valueOf
(
propAssignment
.
isShowInEditView
()));
...
...
@@ -314,13 +334,6 @@ public class MasterDataExtractor
return
propertyAssignmentsElement
;
}
// @XmlRootElement
// @XmlAccessorType(XmlAccessType.FIELD)
private
static
class
MasterData
{
// @XmlElement(name = "sampleType")
}
private
Map
<
String
,
List
<
PropertyAssignment
>>
loadDataSetTypesUsingV3WithPropertyAssignments
()
{
// We are mixing up v1 and v3 here because using v3 api to get property assignments is easier
...
...
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