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
579c5cf6
Commit
579c5cf6
authored
14 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
SE-242 HCS library registration: add starting date to the email
SVN: 15713
parent
919e3651
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
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java
+17
-8
17 additions, 8 deletions
.../screening/client/web/server/LibraryRegistrationTask.java
with
17 additions
and
8 deletions
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java
+
17
−
8
View file @
579c5cf6
package
ch.systemsx.cisd.openbis.plugin.screening.client.web.server
;
import
java.util.Date
;
import
java.util.List
;
import
ch.systemsx.cisd.common.mail.IMailClient
;
...
...
@@ -54,6 +55,7 @@ class LibraryRegistrationTask implements Runnable
public
void
run
()
{
Date
startDate
=
new
Date
();
StringBuilder
message
=
new
StringBuilder
();
try
{
...
...
@@ -68,7 +70,7 @@ class LibraryRegistrationTask implements Runnable
{
message
.
append
(
"ERROR: Genes could not be registered!\n"
);
message
.
append
(
ex
.
getMessage
());
sendErrorEmail
(
message
.
toString
()
,
email
);
sendErrorEmail
(
message
,
startDate
,
email
);
return
;
}
try
...
...
@@ -83,7 +85,7 @@ class LibraryRegistrationTask implements Runnable
{
message
.
append
(
"ERROR: Oligos could not be registered!\n"
);
message
.
append
(
ex
.
getMessage
());
sendErrorEmail
(
message
.
toString
()
,
email
);
sendErrorEmail
(
message
,
startDate
,
email
);
return
;
}
try
...
...
@@ -98,21 +100,28 @@ class LibraryRegistrationTask implements Runnable
{
message
.
append
(
"ERROR: Plates and wells could not be registered!\n"
);
message
.
append
(
ex
.
getMessage
());
sendErrorEmail
(
message
.
toString
()
,
email
);
sendErrorEmail
(
message
,
startDate
,
email
);
return
;
}
sendSuccessEmail
(
message
.
toString
()
,
email
);
sendSuccessEmail
(
message
,
startDate
,
email
);
}
private
void
sendErrorEmail
(
String
content
,
String
recipient
)
private
void
sendErrorEmail
(
String
Builder
content
,
Date
startDate
,
String
recipient
)
{
sendEmail
(
UNSUCCESSFUL_LIBRARY_REGISTARION_STATUS
,
content
,
recipient
);
String
subject
=
addDate
(
UNSUCCESSFUL_LIBRARY_REGISTARION_STATUS
,
startDate
);
sendEmail
(
subject
,
content
.
toString
(),
recipient
);
}
private
void
sendSuccessEmail
(
String
content
,
String
recipient
)
private
void
sendSuccessEmail
(
String
Builder
content
,
Date
startDate
,
String
recipient
)
{
sendEmail
(
SUCCESSFUL_LIBRARY_REGISTARION_STATUS
,
content
,
recipient
);
String
subject
=
addDate
(
SUCCESSFUL_LIBRARY_REGISTARION_STATUS
,
startDate
);
sendEmail
(
subject
,
content
.
toString
(),
recipient
);
}
private
static
String
addDate
(
String
subject
,
Date
startDate
)
{
return
subject
+
" (initiated at "
+
startDate
+
")"
;
}
private
void
sendEmail
(
String
subject
,
String
content
,
String
recipient
)
...
...
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