diff options
author | ddunne | 2011-07-18 21:00:17 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-07-18 21:00:17 +0000 |
commit | 045ad1cd68e1bc4d0bc2a9cf76449f15a091f45d (patch) | |
tree | 0f875794eb659ce9bf6369277bdb823c5ab79e1c | |
parent | ba0b561c4820b9190f20b91682c513583ac6f73c (diff) | |
download | org.eclipse.osee-045ad1cd68e1bc4d0bc2a9cf76449f15a091f45d.tar.gz org.eclipse.osee-045ad1cd68e1bc4d0bc2a9cf76449f15a091f45d.tar.xz org.eclipse.osee-045ad1cd68e1bc4d0bc2a9cf76449f15a091f45d.zip |
feature: Add EmailActionsBlam to ATS
16 files changed, 361 insertions, 74 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/notify/AtsNotificationManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/notify/AtsNotificationManager.java index dc129b2cecb..3056e4f0a5d 100644 --- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/notify/AtsNotificationManager.java +++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/notify/AtsNotificationManager.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.ats.core.notify; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; @@ -25,6 +26,8 @@ import org.eclipse.osee.framework.core.model.IBasicUser; import org.eclipse.osee.framework.jdk.core.util.Collections; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects; +import org.eclipse.osee.framework.skynet.core.UserManager; +import org.eclipse.osee.framework.skynet.core.email.EmailGroup; import org.eclipse.osee.framework.skynet.core.utility.INotificationManager; import org.eclipse.osee.framework.skynet.core.utility.OseeNotificationEvent; @@ -146,4 +149,19 @@ public class AtsNotificationManager { AtsNotificationManager.isProduction = isProduction; } + public static List<EmailGroup> getEmailableGroups(AbstractWorkflowArtifact workflow) throws OseeCoreException { + ArrayList<EmailGroup> groupNames = new ArrayList<EmailGroup>(); + ArrayList<String> emails = new ArrayList<String>(); + emails.add(UserManager.getEmail(workflow.getCreatedBy())); + groupNames.add(new EmailGroup("Originator", emails)); + if (workflow.getStateMgr().getAssignees().size() > 0) { + emails = new ArrayList<String>(); + for (IBasicUser u : workflow.getStateMgr().getAssignees()) { + emails.add(UserManager.getEmail(u)); + } + groupNames.add(new EmailGroup("Assignees", emails)); + } + return groupNames; + } + } diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/EmailActionAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/EmailActionAction.java index fa556f7d98e..cd459304820 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/EmailActionAction.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/EmailActionAction.java @@ -16,7 +16,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; import org.eclipse.osee.ats.internal.AtsPlugin; -import org.eclipse.osee.ats.util.ArtifactEmailWizard; +import org.eclipse.osee.ats.notify.ArtifactEmailWizard; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java index cc501993a36..bc3888dd5e0 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java @@ -38,6 +38,7 @@ import org.eclipse.osee.ats.health.ValidateChangeReports; import org.eclipse.osee.ats.internal.AtsPlugin; import org.eclipse.osee.ats.navigate.EmailTeamsItem.MemberType; import org.eclipse.osee.ats.notify.AtsNotificationNavigateItem; +import org.eclipse.osee.ats.notify.EmailActionsBlam; import org.eclipse.osee.ats.search.AtsQuickSearchOperationFactory; import org.eclipse.osee.ats.util.AtsEditor; import org.eclipse.osee.ats.util.DoesNotWorkItemAts; @@ -267,6 +268,7 @@ public final class AtsNavigateViewItems implements XNavigateViewItems, IXNavigat new EmailUserGroups(emailItems); new SubscribeByActionableItem(emailItems); new SubscribeByTeamDefinition(emailItems); + new XNavigateItemBlam(emailItems, new EmailActionsBlam(), FrameworkImage.EMAIL); items.add(emailItems); items.add(reportItems); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/ArtifactEmailWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/ArtifactEmailWizard.java new file mode 100644 index 00000000000..37c74193678 --- /dev/null +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/ArtifactEmailWizard.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.notify; + +import java.util.List; +import org.eclipse.osee.ats.core.notify.AtsNotificationManager; +import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; +import org.eclipse.osee.ats.util.Overview.PreviewStyle; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.ui.skynet.util.email.EmailWizard; + +/** + * @author Donald G. Dunne + */ +public class ArtifactEmailWizard extends EmailWizard { + + public ArtifactEmailWizard(AbstractWorkflowArtifact sma) throws OseeCoreException { + this(sma, null); + } + + public ArtifactEmailWizard(AbstractWorkflowArtifact sma, List<Object> toAddress) throws OseeCoreException { + super( + AtsNotificationManagerUI.getPreviewHtml(sma, PreviewStyle.HYPEROPEN, PreviewStyle.NO_SUBSCRIBE_OR_FAVORITE), + " Regarding " + sma.getArtifactTypeName() + " - " + sma.getName(), + AtsNotificationManager.getEmailableGroups(sma), toAddress); + } + +} diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationCheckTreeDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationCheckTreeDialog.java index 4d43897e6ac..21a934711a4 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationCheckTreeDialog.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationCheckTreeDialog.java @@ -163,9 +163,6 @@ public class AtsNotificationCheckTreeDialog extends CheckedTreeSelectionDialog { }; }; - /** - * @return the sendNotifications - */ public boolean isSendNotifications() { return sendNotifications; } diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationManagerUI.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationManagerUI.java new file mode 100644 index 00000000000..807a4f618f0 --- /dev/null +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationManagerUI.java @@ -0,0 +1,25 @@ +/* + * Created on Jul 18, 2011 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.ats.notify; + +import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; +import org.eclipse.osee.ats.util.Overview; +import org.eclipse.osee.ats.util.Overview.PreviewStyle; +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +/** + * @author Donald G. Dunne + */ +public class AtsNotificationManagerUI { + + public static String getPreviewHtml(AbstractWorkflowArtifact workflow, PreviewStyle... styles) throws OseeCoreException { + Overview o = new Overview(); + o.addHeader(workflow, styles); + o.addFooter(workflow, styles); + return o.getPage(); + } + +} diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsBlam.java new file mode 100644 index 00000000000..0c868fddb3d --- /dev/null +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsBlam.java @@ -0,0 +1,185 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.notify; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact; +import org.eclipse.osee.ats.internal.AtsPlugin; +import org.eclipse.osee.ats.util.Overview.PreviewStyle; +import org.eclipse.osee.framework.core.exception.OseeArgumentException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.model.IBasicUser; +import org.eclipse.osee.framework.core.util.Result; +import org.eclipse.osee.framework.jdk.core.util.AHTML; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.skynet.core.User; +import org.eclipse.osee.framework.skynet.core.UserManager; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.utility.EmailUtil; +import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam; +import org.eclipse.osee.framework.ui.skynet.blam.VariableMap; +import org.eclipse.osee.framework.ui.skynet.blam.operation.SendEmailCall; +import org.eclipse.osee.framework.ui.skynet.notify.OseeEmail; +import org.eclipse.osee.framework.ui.skynet.notify.OseeEmail.BodyType; +import org.eclipse.osee.framework.ui.skynet.widgets.XButtonPush; +import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener; +import org.eclipse.osee.framework.ui.skynet.widgets.XText; +import org.eclipse.osee.framework.ui.skynet.widgets.XWidget; +import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout; +import org.eclipse.osee.framework.ui.swt.Displays; +import org.eclipse.ui.forms.widgets.FormToolkit; + +/** + * @author Donald G. Dunne + */ +public class EmailActionsBlam extends AbstractBlam { + private XText bodyTextBox; + private XText subjectTextBox; + private ExecutorService emailTheadPool; + private final Collection<Future<String>> futures = new ArrayList<Future<String>>(300); + public final static String TEAM_WORKFLOW = "Team Workflows (drop here)"; + + @Override + public String getName() { + return "Email Message to Action(s) Assignees"; + } + + private EmailActionsData getEmailActionsData(final VariableMap variableMap) { + final EmailActionsData data = new EmailActionsData(); + Displays.pendInDisplayThread(new Runnable() { + @Override + public void run() { + try { + data.getWorkflows().addAll(variableMap.getArtifacts(TEAM_WORKFLOW)); + } catch (OseeArgumentException ex) { + OseeLog.log(AtsPlugin.class, Level.SEVERE, ex); + } + data.setSubject(subjectTextBox.get()); + data.setBody(bodyTextBox.get()); + } + }); + return data; + } + + @Override + public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception { + EmailActionsData data = getEmailActionsData(variableMap); + Result result = data.isValid(); + if (result.isFalse()) { + AWorkbench.popup(result); + return; + } + sendEmailViaThreadPool(data); + } + + private void sendEmailViaThreadPool(EmailActionsData data) throws Exception { + emailTheadPool = Executors.newFixedThreadPool(30); + futures.clear(); + + for (Artifact user : data.getWorkflows()) { + sendEmailTo(data, (TeamWorkFlowArtifact) user); + } + emailTheadPool.shutdown(); + emailTheadPool.awaitTermination(100, TimeUnit.MINUTES); + for (Future<String> future : futures) { + report(future.get()); + } + + } + + private void sendEmailTo(EmailActionsData data, final TeamWorkFlowArtifact teamArt) throws OseeCoreException { + Set<IBasicUser> assignees = new HashSet<IBasicUser>(); + assignees.addAll(teamArt.getStateMgr().getAssignees()); + Collection<IBasicUser> activeEmailUsers = EmailUtil.getActiveEmailUsers(assignees); + if (assignees.isEmpty()) { + report(String.format("No active assignees for workflow [%s].", teamArt.toStringWithId())); + return; + } + + List<String> emailAddresses = new ArrayList<String>(); + for (IBasicUser basicUser : activeEmailUsers) { + User oseeUser = UserManager.getUser(basicUser); + if (EmailUtil.isEmailValid(oseeUser.getEmail())) { + emailAddresses.add(oseeUser.getEmail()); + } + } + + if (emailAddresses.isEmpty()) { + report(String.format("No valid emails for workflow [%s].", teamArt.toStringWithId())); + return; + } + + if (!EmailUtil.isEmailValid(UserManager.getUser())) { + report(String.format("Can't email from user account [%s] cause email not valid.", UserManager.getUser())); + return; + } + + final OseeEmail emailMessage = + new OseeEmail(emailAddresses, UserManager.getUser().getEmail(), UserManager.getUser().getEmail(), + data.getSubject(), "", BodyType.Html); + emailMessage.setHTMLBody("<p>" + AHTML.textToHtml(data.getBody()) + "</p><p>--------------------------------------------------------</p>"); + emailMessage.addHTMLBody(getHtmlMessage(data, teamArt)); + String description = String.format("%s for %s", teamArt.toStringWithId(), emailAddresses); + futures.add(emailTheadPool.submit(new SendEmailCall(emailMessage, description))); + } + + private String getHtmlMessage(EmailActionsData data, TeamWorkFlowArtifact teamArt) throws OseeCoreException { + return AtsNotificationManagerUI.getPreviewHtml(teamArt, PreviewStyle.HYPEROPEN, + PreviewStyle.NO_SUBSCRIBE_OR_FAVORITE); + } + + @Override + public void widgetCreating(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException { + super.widgetCreating(xWidget, toolkit, art, dynamicXWidgetLayout, modListener, isEditable); + if (xWidget.getLabel().equals("Body")) { + bodyTextBox = (XText) xWidget; + } else if (xWidget.getLabel().equals("Subject")) { + subjectTextBox = (XText) xWidget; + } else if (xWidget.getLabel().equals("Preview Message")) { + XButtonPush button = (XButtonPush) xWidget; + button.setDisplayLabel(false); + } + } + + @Override + public String getXWidgetsXml() { + // @formatter:off + return "<xWidgets>" + + "<XWidget xwidgetType=\"XListDropViewer\" displayName=\"" + TEAM_WORKFLOW + "\" />" + + "<XWidget xwidgetType=\"XText\" displayName=\"Subject\" />" + + "<XWidget xwidgetType=\"XText\" displayName=\"Body\" fill=\"Vertically\" />" + + "</xWidgets>"; + // @formatter:on + } + + @Override + public String getDescriptionUsage() { + return "Loop through all dropped Team Workflows and email to assignee(s) with message. Note: User will get one email per item they are assigned."; + } + + @Override + public Collection<String> getCategories() { + return Arrays.asList("ATS/Util"); + } + +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsData.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsData.java new file mode 100644 index 00000000000..6e0740bf6ca --- /dev/null +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/EmailActionsData.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2010 Boeing. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.ats.notify; + +import java.util.HashSet; +import java.util.Set; +import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; +import org.eclipse.osee.framework.core.util.Result; +import org.eclipse.osee.framework.jdk.core.util.Strings; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +/** + * @author Donald G. Dunne + */ +public class EmailActionsData { + + private String subject; + private String body; + private final Set<Artifact> workflows = new HashSet<Artifact>(5); + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public Set<Artifact> getGroups() { + return workflows; + } + + public Result isValid() { + if (!Strings.isValid(getSubject())) { + return new Result("Must enter subject"); + } + if (!Strings.isValid(getBody())) { + return new Result("Must enter body"); + } + if (workflows.size() == 0) { + return new Result("No workflows dropped"); + } + for (Artifact workflow : workflows) { + if (!(workflow instanceof AbstractWorkflowArtifact)) { + return new Result("Only valid for Workflow Artifacts, not [%s]", workflow.getArtifactTypeName()); + } + } + return Result.TrueResult; + } + + public String getHtmlResult() { + StringBuilder html = new StringBuilder(); + + html.append("<pre>"); + html.append(body); + html.append("</pre>"); + + return html.toString(); + } + + public Set<Artifact> getWorkflows() { + return workflows; + } +} diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java deleted file mode 100644 index 63555384cb4..00000000000 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ats.util; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; -import org.eclipse.osee.ats.util.Overview.PreviewStyle; -import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.IBasicUser; -import org.eclipse.osee.framework.skynet.core.UserManager; -import org.eclipse.osee.framework.ui.skynet.util.email.EmailGroup; -import org.eclipse.osee.framework.ui.skynet.util.email.EmailWizard; - -public class ArtifactEmailWizard extends EmailWizard { - - public ArtifactEmailWizard(AbstractWorkflowArtifact sma) throws OseeCoreException { - this(sma, null); - } - - public ArtifactEmailWizard(AbstractWorkflowArtifact sma, List<Object> toAddress) throws OseeCoreException { - super(getPreviewHtml(sma, PreviewStyle.HYPEROPEN, PreviewStyle.NO_SUBSCRIBE_OR_FAVORITE), - " Regarding " + sma.getArtifactTypeName() + " - " + sma.getName(), getEmailableGroups(sma), toAddress); - } - - private static List<EmailGroup> getEmailableGroups(AbstractWorkflowArtifact workflow) throws OseeCoreException { - ArrayList<EmailGroup> groupNames = new ArrayList<EmailGroup>(); - ArrayList<String> emails = new ArrayList<String>(); - emails.add(UserManager.getEmail(workflow.getCreatedBy())); - groupNames.add(new EmailGroup("Originator", emails)); - if (workflow.getStateMgr().getAssignees().size() > 0) { - emails = new ArrayList<String>(); - for (IBasicUser u : workflow.getStateMgr().getAssignees()) { - emails.add(UserManager.getEmail(u)); - } - groupNames.add(new EmailGroup("Assignees", emails)); - } - return groupNames; - } - - public static String getPreviewHtml(AbstractWorkflowArtifact workflow, PreviewStyle... styles) throws OseeCoreException { - Overview o = new Overview(); - o.addHeader(workflow, styles); - o.addFooter(workflow, styles); - return o.getPage(); - } - -} diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java index 033ed092fce..a951d73bfa0 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java @@ -54,7 +54,7 @@ import org.eclipse.osee.ats.core.type.AtsArtifactTypes; import org.eclipse.osee.ats.core.util.AtsUtilCore; import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact; import org.eclipse.osee.ats.internal.AtsPlugin; -import org.eclipse.osee.ats.util.ArtifactEmailWizard; +import org.eclipse.osee.ats.notify.ArtifactEmailWizard; import org.eclipse.osee.ats.util.AtsUtil; import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsAttributeColumn; import org.eclipse.osee.ats.workflow.TransitionToMenu; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF index cc548fe8b4d..952028503c5 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF @@ -29,6 +29,7 @@ Export-Package: org.eclipse.osee.framework.skynet.core, org.eclipse.osee.framework.skynet.core.change, org.eclipse.osee.framework.skynet.core.commit.actions, org.eclipse.osee.framework.skynet.core.conflict, + org.eclipse.osee.framework.skynet.core.email, org.eclipse.osee.framework.skynet.core.event, org.eclipse.osee.framework.skynet.core.event.filter, org.eclipse.osee.framework.skynet.core.event.listener, diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailGroup.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java index e5518cfe8d0..fa274866e77 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailGroup.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java @@ -8,15 +8,15 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.ui.skynet.util.email; +package org.eclipse.osee.framework.skynet.core.email; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; import org.eclipse.osee.framework.jdk.core.util.Collections; import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.skynet.core.internal.Activator; import org.eclipse.osee.framework.skynet.core.utility.EmailUtil; -import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; /** * @author Donald G. Dunne @@ -62,7 +62,7 @@ public class EmailGroup { if (EmailUtil.isEmailValid(str)) { this.emails.add(str); } else { - OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, String.format("Invalid Email [%s]", str)); + OseeLog.log(Activator.class, Level.SEVERE, String.format("Invalid Email [%s]", str)); } } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java index 97ea2d0c816..5a10722187e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java @@ -126,7 +126,8 @@ public class EmailGroupsBlam extends AbstractBlam { } final OseeEmail emailMessage = new OseeEmail(emailAddress, data.getSubject(), "", BodyType.Html); emailMessage.addHTMLBody(data.getHtmlResult(user)); - futures.add(emailTheadPool.submit(new SendEmailCall(user, emailMessage, emailAddress))); + String description = String.format("[%s] for [%s]", emailAddress, user); + futures.add(emailTheadPool.submit(new SendEmailCall(emailMessage, description))); } @Override diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SendEmailCall.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SendEmailCall.java index e7e590ed699..a34b17bbfe3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SendEmailCall.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SendEmailCall.java @@ -12,18 +12,15 @@ package org.eclipse.osee.framework.ui.skynet.blam.operation; import java.util.concurrent.Callable; import javax.mail.MessagingException; -import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.ui.skynet.notify.OseeEmail; public final class SendEmailCall implements Callable<String> { - private final Artifact user; private final OseeEmail emailMessage; - private final String emailAddress; + private final String description; - SendEmailCall(Artifact user, OseeEmail emailMessage, String emailAddress) { - this.user = user; + public SendEmailCall(OseeEmail emailMessage, String description) { this.emailMessage = emailMessage; - this.emailAddress = emailAddress; + this.description = description; } @Override @@ -31,9 +28,8 @@ public final class SendEmailCall implements Callable<String> { try { emailMessage.sendLocalThread(); } catch (MessagingException ex) { - return String.format("An exception occured with sending the email for address \"%s\" for user %s. %s", - emailAddress, user.getName(), ex); + return String.format("An exception occured with sending the email [%s]. %s", description, ex); } - return String.format("Sucess for address \"%s\" for user %s.", emailAddress, user.getName()); + return String.format("Sucess for [%s]", description); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java index 65ef9674b14..95c97cfcc27 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java @@ -18,6 +18,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.wizard.Wizard; import org.eclipse.osee.framework.jdk.core.util.AHTML; import org.eclipse.osee.framework.skynet.core.UserManager; +import org.eclipse.osee.framework.skynet.core.email.EmailGroup; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.skynet.notify.OseeEmail; import org.eclipse.osee.framework.ui.skynet.notify.OseeEmail.BodyType; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java index e57367cce17..fe479ae5ce3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java @@ -27,6 +27,7 @@ import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.User; import org.eclipse.osee.framework.skynet.core.UserManager; +import org.eclipse.osee.framework.skynet.core.email.EmailGroup; import org.eclipse.osee.framework.skynet.core.utility.EmailUtil; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider; |