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
7a85f717
Commit
7a85f717
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1761] changes in batch update of vocabulary terms
SVN: 17895
parent
42d55867
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
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java
+44
-5
44 additions, 5 deletions
...penbis/generic/client/web/server/CommonClientService.java
with
44 additions
and
5 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java
+
44
−
5
View file @
7a85f717
...
@@ -1191,15 +1191,19 @@ public final class CommonClientService extends AbstractClientService implements
...
@@ -1191,15 +1191,19 @@ public final class CommonClientService extends AbstractClientService implements
AbstractParserObjectFactory
<
VocabularyTerm
>
AbstractParserObjectFactory
<
VocabularyTerm
>
{
{
private
final
VocabularyTermBatchUpdateDetails
batchUpdateDetails
;
private
final
VocabularyTermBatchUpdateDetails
ba
sicBa
tchUpdateDetails
;
protected
UpdatedVocabularyTermObjectFactory
(
IPropertyMapper
propertyMapper
)
protected
UpdatedVocabularyTermObjectFactory
(
IPropertyMapper
propertyMapper
)
{
{
super
(
VocabularyTerm
.
class
,
propertyMapper
);
super
(
VocabularyTerm
.
class
,
propertyMapper
);
this
.
batchUpdateDetails
=
createBatchUpdateDetails
();
this
.
ba
sicBa
tchUpdateDetails
=
createBa
sicBa
tchUpdateDetails
();
}
}
private
VocabularyTermBatchUpdateDetails
createBatchUpdateDetails
()
/**
* Prepares details about which values should be updated in general taking into account
* only the information about availability of columns in the file.
*/
private
VocabularyTermBatchUpdateDetails
createBasicBatchUpdateDetails
()
{
{
boolean
updateLabel
=
isColumnAvailable
(
UpdatedVocabularyTerm
.
LABEL
);
boolean
updateLabel
=
isColumnAvailable
(
UpdatedVocabularyTerm
.
LABEL
);
boolean
updateDescription
=
isColumnAvailable
(
UpdatedVocabularyTerm
.
DESCRIPTION
);
boolean
updateDescription
=
isColumnAvailable
(
UpdatedVocabularyTerm
.
DESCRIPTION
);
...
@@ -1209,8 +1213,43 @@ public final class CommonClientService extends AbstractClientService implements
...
@@ -1209,8 +1213,43 @@ public final class CommonClientService extends AbstractClientService implements
@Override
@Override
public
VocabularyTerm
createObject
(
String
[]
lineTokens
)
throws
ParserException
public
VocabularyTerm
createObject
(
String
[]
lineTokens
)
throws
ParserException
{
{
final
VocabularyTerm
vocabularyTerm
=
super
.
createObject
(
lineTokens
);
final
VocabularyTerm
term
=
super
.
createObject
(
lineTokens
);
return
new
UpdatedVocabularyTerm
(
vocabularyTerm
,
batchUpdateDetails
);
final
VocabularyTermBatchUpdateDetails
updateDetails
=
createBatchUpdateDetails
(
term
);
cleanUp
(
term
);
return
new
UpdatedVocabularyTerm
(
term
,
updateDetails
);
}
//
// handle empty values and deletion
//
/**
* Returns details about which values should be updated for the specified term. If a
* cell was left empty in the file the corresponding value will not be modified.
*/
private
VocabularyTermBatchUpdateDetails
createBatchUpdateDetails
(
VocabularyTerm
term
)
{
final
boolean
updateLabel
=
basicBatchUpdateDetails
.
isLabelUpdateRequested
()
&&
isNotEmpty
(
term
.
getLabel
());
final
boolean
updateDescription
=
basicBatchUpdateDetails
.
isDescriptionUpdateRequested
()
&&
isNotEmpty
(
term
.
getDescription
());
return
new
VocabularyTermBatchUpdateDetails
(
updateLabel
,
updateDescription
);
}
/** Cleans properties of the specified term that are marked for deletion. */
private
void
cleanUp
(
VocabularyTerm
term
)
{
if
(
isDeletionMark
(
term
.
getLabel
()))
{
term
.
setLabel
(
null
);
}
if
(
isDeletionMark
(
term
.
getDescription
()))
{
term
.
setDescription
(
null
);
}
}
}
}
}
...
...
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