BrightSide Workbench Full Report + Source Code
org.turro.dossier.issue.MyIssuesNotification Class Reference

Public Member Functions

 MyIssuesNotification (IContact contact)
 
void sendMailTemplate (IConstructor constructor) throws EmailException
 
void addToQueue (IConstructor constructor) throws EmailException
 
String create (IConstructor constructor, Issue issue, IContact contact) throws Exception
 
String create (IConstructor constructor, String redir, IContact contact) throws Exception
 
String create (IConstructor constructor, String redir, String email) throws Exception
 
String createRef (IConstructor constructor, Issue issue) throws Exception
 
String createRef (IConstructor constructor, String redir) throws Exception
 
IssueStage getStage (WorkloadItem item)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 51 of file MyIssuesNotification.java.

Constructor & Destructor Documentation

◆ MyIssuesNotification()

org.turro.dossier.issue.MyIssuesNotification.MyIssuesNotification ( IContact  contact)

Definition at line 55 of file MyIssuesNotification.java.

55  {
56  this.contact = contact;
57  }

Member Function Documentation

◆ addToQueue()

void org.turro.dossier.issue.MyIssuesNotification.addToQueue ( IConstructor  constructor) throws EmailException

Definition at line 86 of file MyIssuesNotification.java.

86  {
87  QueueManager qm = new QueueManager();
88  NotificationCategory nc = new DossierElephantNotification().getCategory(DossierElephantNotification.MY_ISSUES_NOTIFICATION);
89  if(qm.contactMayWant(contact, nc.getIdCategory())) {
90  WorkloadQuery wq = new WorkloadQuery(contact);
91  WorkloadSet ws = wq.getResults();
92  ws.keep(EnumSet.of(
93  IssueStage.ISSUE_STAGE_WORKSHEET,
94  IssueStage.ISSUE_STAGE_DATE_SURPASSED,
95  IssueStage.ISSUE_STAGE_UNRELATED,
96  IssueStage.ISSUE_STAGE_TO_DO));
97  if(!ws.isEmpty()) {
98  MailMessageTemplate mmt = MailMessageTemplate.of(MailProviders.instance().getProvider("Dossier"));
99  mmt.setRoot("/issues");
100  mmt.setSubject(getSubject(constructor));
101  mmt.addTo(contact.getConnector(IUser.CONNECTOR_EMAIL), contact.getName());
102  ElephantMarker em = new ElephantMarker(constructor, true);
103  em.put("workloadSet", ws);
104  em.put("contact", contact);
105  em.put("email", contact.getConnector(IUser.CONNECTOR_EMAIL));
106  em.put("notifier", this);
107  mmt.setMessage(em, "myissues", contact);
108  qm.addToQueue(nc, contact, mmt, null, "Dossier");
109  }
110  }
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [1/3]

String org.turro.dossier.issue.MyIssuesNotification.create ( IConstructor  constructor,
Issue  issue,
IContact  contact 
) throws Exception

Definition at line 113 of file MyIssuesNotification.java.

113  {
114  return create(constructor,
115  DossierEntityInfo.linkForPath(new Path(DossierPU.getObjectPath(issue)), contact, LinkType.WEB_INTERNAL),
116  contact.getConnector(IUser.CONNECTOR_EMAIL));
117  }
String create(IConstructor constructor, Issue issue, IContact contact)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/3]

String org.turro.dossier.issue.MyIssuesNotification.create ( IConstructor  constructor,
String  redir,
IContact  contact 
) throws Exception

Definition at line 119 of file MyIssuesNotification.java.

119  {
120  return create(constructor, redir,
121  contact.getConnector(IUser.CONNECTOR_EMAIL));
122  }
Here is the call graph for this function:

◆ create() [3/3]

String org.turro.dossier.issue.MyIssuesNotification.create ( IConstructor  constructor,
String  redir,
String  email 
) throws Exception

Definition at line 124 of file MyIssuesNotification.java.

124  {
125  HashMap<String, String> values = new HashMap<>();
126  values.put(Actions.USER_PAR, email);
127  values.put(Actions.REDIR_PAR, URLEncoder.encode(redir, "UTF-8"));
128  return Actions.createAction(values, 7, false);
129  }

◆ createRef() [1/2]

String org.turro.dossier.issue.MyIssuesNotification.createRef ( IConstructor  constructor,
Issue  issue 
) throws Exception

Definition at line 131 of file MyIssuesNotification.java.

131  {
132  return createRef(constructor,
133  DossierEntityInfo.linkForPath(new Path(DossierPU.getObjectPath(issue)), contact, LinkType.WEB_INTERNAL));
134  }
String createRef(IConstructor constructor, Issue issue)
Here is the call graph for this function:

◆ createRef() [2/2]

String org.turro.dossier.issue.MyIssuesNotification.createRef ( IConstructor  constructor,
String  redir 
) throws Exception

Definition at line 136 of file MyIssuesNotification.java.

136  {
137  return "{liveref:" + redir + "}";
138  }

◆ getStage()

IssueStage org.turro.dossier.issue.MyIssuesNotification.getStage ( WorkloadItem  item)

Definition at line 140 of file MyIssuesNotification.java.

140  {
141  return WorkloadSet.getStage(item);
142  }
Here is the call graph for this function:

◆ sendMailTemplate()

void org.turro.dossier.issue.MyIssuesNotification.sendMailTemplate ( IConstructor  constructor) throws EmailException

Definition at line 59 of file MyIssuesNotification.java.

59  {
60  WorkloadQuery wq = new WorkloadQuery(contact);
61  WorkloadSet ws = wq.getResults();
62  ws.keep(EnumSet.of(
63  IssueStage.ISSUE_STAGE_WORKSHEET,
64  IssueStage.ISSUE_STAGE_DATE_SURPASSED,
65  IssueStage.ISSUE_STAGE_UNRELATED,
66  IssueStage.ISSUE_STAGE_TO_DO));
67  if(!ws.isEmpty()) {
68  MailMessagePool pool = MailProviders.instance().getPool(constructor, "Dossier");
69  if(pool != null) {
70  MailMessageTemplate mmt = MailMessageTemplate.of(pool.getProvider());
71  mmt.setRoot("/issues");
72  mmt.setSubject(getSubject(constructor));
73  mmt.addTo(contact.getConnector(IUser.CONNECTOR_EMAIL), contact.getName());
74  ElephantMarker em = new ElephantMarker(constructor, true);
75  em.put("workloadSet", ws);
76  em.put("contact", contact);
77  em.put("email", contact.getConnector(IUser.CONNECTOR_EMAIL));
78  em.put("notifier", this);
79  mmt.setMessage(em, "myissues", contact);
80  pool.addToPool(mmt);
81  }
82  pool.sendPool();
83  }
84  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: