BrightSide Workbench Full Report + Source Code
org.turro.mail.recipients.MailFormAction Class Reference
Inheritance diagram for org.turro.mail.recipients.MailFormAction:
Collaboration diagram for org.turro.mail.recipients.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.recipients.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.recipients.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  boolean proceed = true;
48  HTMLGenerator hg = new HTMLGenerator();
49  hg.startTable("width='100%' style='padding:5px;background-color:#fefefe;color:#444444;border: solid 1px #eeeeee;font-size:12px;font-family:verdana'");
50  hg.startTableCol("")
51  .startTag("div", " style='border-bottom: solid 1px #eeeeee;font-weight:bold'")
52  .write(ctx + " FORM")
53  .endTag()
54  .startTag("p");
55 
56  for(String name : new TreeSet<String>((Set<String>) constructor.getRequest().getParameterMap().keySet())) {
57  if(name.equals("formtrick")) {
58  proceed = FormTrick.checkTrick(constructor.getParameter(name));
59  } else if(!name.equals("context") && !name.equals("action") && !name.equals("email_to")) {
60  hg.write(name + ": ")
61  .startTag("b")
62  .write(StringParser.toHTML(constructor.getParameter(name)))
63  .endTag()
64  .writeNewLine();
65  }
66  }
67  hg.endAllTags();
68 
69  if(proceed) {
70  MailSenders.getPool()
71  .addUser(null, constructor.getParameter("email_to"))
72  .send(ctx + " FORM", hg.toString());
73  }
74  }
75 
76  if(!isAJAX) constructor.redirect(ctx);
77 
78  return IAction.DONE;
79  }
Here is the call graph for this function:

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