|
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 48 of file PollAction.java.
◆ createURL()
static String org.turro.polls.PollAction.createURL |
( |
PollOption |
option, |
|
|
IContact |
contact, |
|
|
int |
vote |
|
) |
| throws UnsupportedEncodingException, Exception |
|
static |
Definition at line 50 of file PollAction.java.
51 HashMap<String, String> values =
new HashMap<>();
52 values.put(Actions.USER_PAR, contact.getConnector(IUser.CONNECTOR_EMAIL));
53 values.put(Actions.REDIR_PAR, URLEncoder.encode(ElephantContext.getRootWebPath() +
"/user/mypolls?item=" + option.getIdPoll(),
"UTF-8"));
54 values.put(
"pollId", ObjectString.formatNativeObject(option.getIdPoll(),
false));
55 values.put(
"pollData", option.getPollData());
56 values.put(
"contactId", contact.getId());
57 values.put(
"vote", ObjectString.formatNativeObject(Integer.valueOf(vote),
false));
58 return ElephantContext.getRootWebPath() +
60 "?" + Actions.createAction(values, 7,
false);
static String getIdentifier()
◆ execute()
void org.turro.polls.PollAction.execute |
( |
ServletContext |
context, |
|
|
HttpServletRequest |
request, |
|
|
HttpServletResponse |
response |
|
) |
| |
Implements org.turro.elephant.direct.IDirectContent.
Definition at line 78 of file PollAction.java.
80 IConstructor constructor = ElephantContext.getConstructor(request, response);
81 KeyValueMap map = Actions.getAction(constructor);
82 if(Actions.prepareActions(constructor, map)) {
83 PollsUtil polls =
new PollsUtil(map.get(
"contactId"));
85 (Long) ObjectString.parseNativeString(map.get(
"pollId"), Long.class,
true),
86 (String) map.get(
"pollData"),
87 (Integer) ObjectString.parseNativeString(map.get(
"vote"), Integer.class,
true));
88 response.sendRedirect(URLDecoder.decode(map.get(Actions.REDIR_PAR),
"UTF-8"));
90 }
catch (IOException ex) {
91 Logger.getLogger(PollAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ getIdentifier()
static String org.turro.polls.PollAction.getIdentifier |
( |
| ) |
|
|
static |
Definition at line 63 of file PollAction.java.
64 return PollAction.class.getAnnotation(DirectContent.class).identifier();
◆ itsMe()
boolean org.turro.polls.PollAction.itsMe |
( |
String |
id | ) |
|
◆ myTurn()
boolean org.turro.polls.PollAction.myTurn |
( |
HttpServletRequest |
request | ) |
|
The documentation for this class was generated from the following file: