19 package org.turro.www.convocation;
21 import java.util.HashMap;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.collections.parser.ParserException;
25 import org.turro.action.Actions;
26 import org.turro.action.Contacts;
27 import org.turro.action.ContentService;
28 import org.turro.annotation.ElephantPlugin;
29 import org.turro.auth.Authentication;
30 import org.turro.collections.KeyValueMap;
31 import org.turro.contacts.Contact;
32 import org.turro.contacts.Convocation;
33 import org.turro.contacts.db.ContactsPU;
34 import org.turro.elephant.context.Application;
35 import org.turro.elephant.context.ElephantContext;
36 import org.turro.elephant.context.IConstructor;
37 import org.turro.elephant.direct.AbstractDirectEntityCtrl;
38 import org.turro.elephant.direct.DirectContent;
39 import org.turro.elephant.direct.DirectContents;
40 import org.turro.elephant.security.IUser;
41 import org.turro.jpa.Dao;
42 import org.turro.marker.ElephantMarker;
43 import org.turro.marker.MarkerHelper;
44 import org.turro.plugin.contacts.IContact;
45 import org.turro.zul.convocation.ConvocationSender;
51 @ElephantPlugin(label=
"convocation-ctrl")
52 @DirectContent(identifier=
"convocation-action")
56 super(
"convocation",
"convocation");
70 throw new UnsupportedOperationException(
"Not supported yet.");
76 marker.
put(
"entiter",
this);
81 String type = map.get(
"type");
82 if(
"attended".equals(type)) {
86 if(convocation !=
null && contact !=
null && contact.
isValid()) {
92 (convocation == null ?
"null:" + map.get(
"id") : convocation.getId() +
" " + convocation.getName()),
93 (contact == null || !contact.isValid() ?
"null:" + map.get(
"contact") : contact.getId() +
" " + contact.getName())
101 (contact == null || !contact.isValid() ?
"null:" + map.get(
"contact") : contact.getId() +
" " + contact.getName())
104 }
if(
"willattend".equals(type)) {
108 convocation = getDao().saveObject(convocation);
130 return createRightNowURL(
"type=willattend;id=" + convocation.
getId());
135 KeyValueMap kvm =
new KeyValueMap(
"");
136 kvm.put(
"type",
"attended");
137 kvm.put(
"id", convocation.
getId());
145 HashMap map =
new HashMap();
146 map.put(
"type",
"qrcode");
147 map.put(
"data", url);
149 }
catch (ParserException ex) {
164 private Dao getDao() {
166 _dao =
new ContactsPU();
static String createAction(String email, String redir)
static String createURL(IConstructor constructor, KeyValueMap values)
static IContact getIContact()
boolean isInRole(String role)
static Application getApplication()
static String getServerBase(String scheme)
static String getRootWebPath()
static String logMsg(String msg)
void setEntityPath(String entityPath)
void setConstructor(IConstructor constructor)
static final String DIRECT_CONTENT_PATH
static String getIdentifier(Class<? extends IDirectContent > control)
Object put(Object key, Object value)
static String setObfuscatedPars(String parameters)
static String createAttendantQrCodeURL(IConstructor constructor, IContact contact, Convocation convocation)
void prepareCleanMarker(ElephantMarker em, KeyValueMap kvm)
void prepareMarker(ElephantMarker marker)
String createAttendantQrCode(IContact contact, Convocation convocation)
static String createRegistrationURL(IConstructor constructor, IContact contact, Convocation convocation)
void doExecute(IConstructor constructor, KeyValueMap map)
String createRegistration(IConstructor constructor, IContact contact, Convocation convocation)
static final String CONNECTOR_EMAIL