BrightSide Workbench Full Report + Source Code
org.turro.publication.util.PublicationMail Class Reference

Public Member Functions

void prepareMail (IConstructor constructor, PublicationCategory pubcat, List< Publication > pubs, String path)
 
void sendMail (IConstructor constructor, PublicationCategory pubcat)
 

Detailed Description

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

Definition at line 46 of file PublicationMail.java.

Member Function Documentation

◆ prepareMail()

void org.turro.publication.util.PublicationMail.prepareMail ( IConstructor  constructor,
PublicationCategory  pubcat,
List< Publication pubs,
String  path 
)

Definition at line 50 of file PublicationMail.java.

51  {
52  constructor.setOutputToString();
53  try {
54  MailPool mp = (MailPool) HeadlessApplication.getInstance().getImplementation("IMailPool_Publication");
55  templatePublication = mp.getTemplateString("template-publication");
56  String start = extractStart(), end = extractEnd();
57  PrintWriter out = constructor.getOut();
58  if(Strings.isBlank(start)) {
59  out.print("<h1>" + MailContact.createLink(pubcat.getName() + " - " + ElephantContext.getSiteName(), path, false) + "</h1>");
60  } else {
61  out.print(start.replaceAll("#pathall", Parser.escapeGrouping(MailContact.createLink(pubcat.getName() + " - " + ElephantContext.getSiteName(), path, false))));
62  }
63  if(Strings.isBlank(templatePublication)) {
64  out.print(PublicationContent.getPublicationsStr(pubs, null, true, false, true, false, path, true, null, constructor));
65  } else {
66  out.print(PublicationContent.getPublicationsTemplateStr(templatePublication, pubs, null, true, true, true, true, path, false, null, constructor));
67  }
68  if(Strings.isBlank(end)) {
69  out.print("<p>" + MailContact.createLink(I_.get("My subscriptions"), "/user", true) + "</p>");
70  } else {
71  out.print(end.replaceAll("#mysubscriptions", Parser.escapeGrouping(MailContact.createLink(I_.get("My subscriptions"), "/user", true))));
72  }
73  } catch(Exception ex) {
74  Logger.getLogger(PublicationMail.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
75  }
76 
77  mailStr = constructor.getOutputString();
78  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendMail()

void org.turro.publication.util.PublicationMail.sendMail ( IConstructor  constructor,
PublicationCategory  pubcat 
)

Definition at line 80 of file PublicationMail.java.

80  {
81 // Iterator<PublicationSubscription> itps = subs.iterator();
82 // ArrayList<PublicationSubscription> pool = new ArrayList<PublicationSubscription>();
83 // int count = 0;
84 // while(itps.hasNext()) {
85 // pool.add(itps.next());
86 // itps.remove();
87 // count++;
88 // if(count > 50) {
89 // doSend(pool, pubcat);
90 // pool = new ArrayList<>();
91 // count = 0;
92 // }
93 // }
94  doSend(pubcat);
95  }
Here is the caller graph for this function:

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