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
3e763d7c
Commit
3e763d7c
authored
13 years ago
by
brinn
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-2445] Allow multiple parent sequencing samples for a flow lane sample
SVN: 22565
parent
76d56c7b
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
deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java
+25
-17
25 additions, 17 deletions
...sd/dsu/tracking/email/EntityTrackingEmailDataManager.java
with
25 additions
and
17 deletions
deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java
+
25
−
17
View file @
3e763d7c
...
...
@@ -17,6 +17,7 @@
package
ch.ethz.bsse.cisd.dsu.tracking.email
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Map
;
...
...
@@ -66,7 +67,8 @@ class EntityTrackingEmailDataManager
{
for
(
Sample
sequencingSample
:
trackedEntities
.
getSequencingSamplesToBeProcessed
())
{
for
(
String
recipient
:
getSequencingSampleTrackingRecipients
(
sequencingSample
))
for
(
String
recipient
:
getSequencingSampleTrackingRecipients
(
Collections
.
singleton
(
sequencingSample
)))
{
final
EntityTrackingEmailData
emailData
=
getOrCreateRecipientEmailData
(
result
,
recipient
);
...
...
@@ -81,7 +83,8 @@ class EntityTrackingEmailDataManager
{
for
(
Sample
sequencingSample
:
trackedEntities
.
getSequencingSamplesProcessed
())
{
for
(
String
recipient
:
getSequencingSampleTrackingRecipients
(
sequencingSample
))
for
(
String
recipient
:
getSequencingSampleTrackingRecipients
(
Collections
.
singleton
(
sequencingSample
)))
{
final
EntityTrackingEmailData
emailData
=
getOrCreateRecipientEmailData
(
result
,
recipient
);
...
...
@@ -122,9 +125,10 @@ class EntityTrackingEmailDataManager
* <var>sequencingSample</var>.<br>
*/
// NOTE: Set is needed because one recipient can occur in many roles for one sample
private
static
Set
<
String
>
getSequencingSampleTrackingRecipients
(
Sample
sequencingSample
)
private
static
Set
<
String
>
getSequencingSampleTrackingRecipients
(
Collection
<
Sample
>
sequencingSamples
)
{
assert
sequencingSample
!=
null
;
assert
sequencingSample
s
!=
null
;
final
Set
<
String
>
recipients
=
new
HashSet
<
String
>();
...
...
@@ -133,22 +137,26 @@ class EntityTrackingEmailDataManager
recipientPropertyTypeCodes
.
add
(
CONTACT_PERSON_EMAIL
);
recipientPropertyTypeCodes
.
add
(
PRINCIPAL_INVESTIGATOR_EMAIL
);
for
(
IEntityProperty
property
:
sequencingSample
.
getProperties
()
)
for
(
Sample
sequencingSample
:
sequencingSample
s
)
{
final
String
propertyCode
=
property
.
getPropertyType
().
getCode
();
final
String
propertyValue
=
property
.
tryGetAsString
();
if
(
recipientPropertyTypeCodes
.
contains
(
propertyCode
))
for
(
IEntityProperty
property
:
sequencingSample
.
getProperties
())
{
recipients
.
add
(
propertyValue
);
}
else
{
// add recipient for affiliation if his email was specified in properties
if
(
propertyCode
.
equals
(
AFFILIATION
))
final
String
propertyCode
=
property
.
getPropertyType
().
getCode
();
final
String
propertyValue
=
property
.
tryGetAsString
();
if
(
recipientPropertyTypeCodes
.
contains
(
propertyCode
))
{
recipients
.
add
(
propertyValue
);
}
else
{
String
affiliationRecipientOrNull
=
recipientsByAffiliation
.
get
(
propertyValue
);
if
(
affiliationRecipientOrNull
!=
null
)
// add recipient for affiliation if his email was specified in properties
if
(
propertyCode
.
equals
(
AFFILIATION
)
)
{
recipients
.
add
(
affiliationRecipientOrNull
);
String
affiliationRecipientOrNull
=
recipientsByAffiliation
.
get
(
propertyValue
);
if
(
affiliationRecipientOrNull
!=
null
)
{
recipients
.
add
(
affiliationRecipientOrNull
);
}
}
}
}
...
...
@@ -166,7 +174,7 @@ class EntityTrackingEmailDataManager
// Recipients are taken from properties of sequencing sample
// that is a parent of the flow lane sample.
assert
flowLaneSample
!=
null
;
return
getSequencingSampleTrackingRecipients
(
flowLaneSample
.
get
GeneratedFrom
());
return
getSequencingSampleTrackingRecipients
(
flowLaneSample
.
get
Parents
());
}
/**
...
...
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