BrightSide Workbench Full Report + Source Code
org.turro.mail.impl.MailFormAction Class Reference
Inheritance diagram for org.turro.mail.impl.MailFormAction:
Collaboration diagram for org.turro.mail.impl.MailFormAction:

Public Member Functions

 MailFormAction ()
 
int execute () throws Exception
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractAction
 AbstractAction ()
 
void setConstructor (IConstructor constructor)
 
IConstructor getConstructor ()
 
String getContextParameter ()
 
String getIdelParameter ()
 
String getActionParameter ()
 
String getParameter (String param)
 
String getParameter (String param, boolean encode)
 
String getStringParameter (String param)
 
String getValueParameter (String param)
 
boolean getBooleanParameter (String param)
 
int getIntParameter (String param, int defaultValue)
 
double getDoubleParameter (String param, double defaultValue)
 
Date getDateParameter (String param, Date defaultValue)
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractAction
static String makeDateParameter (Date date)
 
static String makeDateParameter (Timestamp date)
 
static String getValuePortion (String key, String value)
 
- Static Public Attributes inherited from org.turro.elephant.context.IAction
static final int DONE = 0
 
static final int NO_DATA = 1
 
static final int ERROR = 2
 
- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractAction
IConstructor constructor
 

Detailed Description

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

Definition at line 33 of file MailFormAction.java.

Constructor & Destructor Documentation

◆ MailFormAction()

org.turro.mail.impl.MailFormAction.MailFormAction ( )

Creates a new instance of MailFormAction

Definition at line 36 of file MailFormAction.java.

36  {
37  }

Member Function Documentation

◆ execute()

int org.turro.mail.impl.MailFormAction.execute ( ) throws Exception

Called by constructor in request for one action.

Exceptions
java.lang.Exception
Returns
Action's result.

Implements org.turro.elephant.context.IAction.

Definition at line 40 of file MailFormAction.java.

40  {
41  String ctx = getContextParameter(),
42  action = getActionParameter();
43 
44  boolean isAJAX = false;
45 
46  if("mailform-send".equals(action)) {
47  HTMLGenerator hg = new HTMLGenerator();
48  hg.startTable("width='100%' style='padding:5px;background-color:#fefefe;color:#444444;border: solid 1px #eeeeee;font-size:12px;font-family:verdana'");
49  hg.startTableCol("")
50  .startTag("div", " style='border-bottom: solid 1px #eeeeee;font-weight:bold'")
51  .write(ctx + " FORM")
52  .endTag()
53  .startTag("p");
54 
55  for(String name : new TreeSet<String>((Set<String>) constructor.getRequest().getParameterMap().keySet())) {
56  if(!name.equals("context") && !name.equals("action") && !name.equals("email_to")) {
57  hg.write(name + ": ")
58  .startTag("b")
59  .write(StringParser.toHTML(constructor.getParameter(name)))
60  .endTag()
61  .writeNewLine();
62  }
63  }
64  hg.endAllTags();
65 
66  MailPool mp = (MailPool) ContextFactory.getImplementation(constructor, "IMailPool");
67  mp.setEncoding(ElephantContext.getEncoding());
68 
69  mp.addToPool(null, constructor.getParameter("email_to"), null, ctx + " FORM", hg.toString(), "text/html");
70 
71  mp.sendPool();
72  }
73 
74  if(!isAJAX) constructor.redirect(ctx);
75 
76  return IAction.DONE;
77  }
Here is the call graph for this function:

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