|
boolean | itsMe (String id) |
|
boolean | myTurn (HttpServletRequest request) |
|
void | execute (ServletContext context, HttpServletRequest request, HttpServletResponse response) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 47 of file PetitionCtrl.java.
◆ createPetition() [1/2]
static String org.turro.acceptance.PetitionCtrl.createPetition |
( |
String |
path, |
|
|
IContact |
contact, |
|
|
String |
link |
|
) |
| |
|
static |
Definition at line 49 of file PetitionCtrl.java.
static String createPetition(String path, IContact contact, String link)
◆ createPetition() [2/2]
static String org.turro.acceptance.PetitionCtrl.createPetition |
( |
String |
path, |
|
|
IContact |
contact, |
|
|
String |
link, |
|
|
String |
template |
|
) |
| |
|
static |
Definition at line 53 of file PetitionCtrl.java.
54 ElephantMarker marker =
new ElephantMarker(Application.getApplication().getConstructor());
55 marker.put(
"action", DirectContents.createRelativeURL(
getIdentifier()));
56 marker.put(
"uniqueId", IdGenerator.generateHex());
57 marker.put(
"path", path);
58 marker.put(
"contact", contact);
59 marker.put(
"petitioner", Authentication.getIContact());
60 marker.put(
"redirect", link);
61 return marker.parse(
"acceptance", Strings.isBlank(
template) ?
"petition" :
template);
static String getIdentifier()
◆ execute()
void org.turro.acceptance.PetitionCtrl.execute |
( |
ServletContext |
context, |
|
|
HttpServletRequest |
request, |
|
|
HttpServletResponse |
response |
|
) |
| |
Implements org.turro.elephant.direct.IDirectContent.
Definition at line 79 of file PetitionCtrl.java.
80 IConstructor constructor = Application.getApplication().getConstructor();
81 IContact petitioner = Contacts.getContactById(request.getParameter(
"petitioner"));
82 IContact contact = Contacts.getContactById(request.getParameter(
"contact"));
83 String path = request.getParameter(
"path");
84 String comment = request.getParameter(
"comment");
85 String redirect = request.getParameter(
"redirect");
86 if(petitioner.isValid()) {
87 if(contact.isValid() && !Strings.isBlank(path) && !Strings.isBlank(comment)) {
88 IAcceptances acceptances = Plugins.loadImplementation(IAcceptances.class);
89 new AcceptanceMail(acceptances.request(petitioner, contact, path, comment)).sendMail();
94 if(!Strings.isBlank(redirect)) {
96 constructor.redirect(redirect);
97 }
catch (IOException ex) {
98 Logger.getLogger(PetitionCtrl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ getIdentifier()
static String org.turro.acceptance.PetitionCtrl.getIdentifier |
( |
| ) |
|
|
static |
Definition at line 64 of file PetitionCtrl.java.
65 return PetitionCtrl.class.getAnnotation(DirectContent.class).identifier();
◆ itsMe()
boolean org.turro.acceptance.PetitionCtrl.itsMe |
( |
String |
id | ) |
|
◆ myTurn()
boolean org.turro.acceptance.PetitionCtrl.myTurn |
( |
HttpServletRequest |
request | ) |
|
The documentation for this class was generated from the following file: