BrightSide Workbench Full Report + Source Code
org.turro.www.convocation.ConvocationCtrl Class Reference
Inheritance diagram for org.turro.www.convocation.ConvocationCtrl:
Collaboration diagram for org.turro.www.convocation.ConvocationCtrl:

Public Member Functions

 ConvocationCtrl ()
 
boolean isRestricted ()
 
String createRegistration (IConstructor constructor, IContact contact, Convocation convocation)
 
String createAttendantQrCode (IContact contact, Convocation convocation)
 
- Public Member Functions inherited from org.turro.elephant.direct.AbstractDirectEntityCtrl
 AbstractDirectEntityCtrl (String tmplRoot, String entityAttribute)
 
void setConstructor (IConstructor constructor)
 
void setEntityPath (String entityPath)
 
boolean hasContent ()
 
- Public Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
 AbstractDirectContentCtrl (String tmplRoot)
 
String createFormAction ()
 
String createPOST (String values)
 
String getAjaxSubmitUrl (String containerId)
 
String getAjaxUrl (String containerId, String values)
 
String getAjaxUrl (String containerId, KeyValueMap values)
 
String getAjaxEvalUrl (KeyValueMap values)
 
String createRightNowURL (String values)
 
String createRightNowURL (KeyValueMap values)
 
String createLinkTo (String link, KeyValueMap values)
 
String createURL ()
 
String createURL (IConstructor constructor, String values)
 
String createURL (IConstructor constructor, String values, int daysValid)
 
String createURL (IConstructor constructor, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, KeyValueMap values, int daysValid, boolean withDomain)
 
void setTemplate (String template)
 
void render (IConstructor constructor)
 
String parse (IConstructor constructor)
 
boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
void execute (IConstructor constructor)
 
- Public Member Functions inherited from org.turro.action.IEntityCtrl
void setTemplate (String template)
 
void render (IConstructor constructor)
 
String parse (IConstructor constructor)
 

Static Public Member Functions

static String createRegistrationURL (IConstructor constructor, IContact contact, Convocation convocation)
 
static String createAttendantQrCodeURL (IConstructor constructor, IContact contact, Convocation convocation)
 

Protected Member Functions

String getIdentifier ()
 
void prepareCleanMarker (ElephantMarker em, KeyValueMap kvm)
 
void prepareMarker (ElephantMarker marker)
 
void doExecute (IConstructor constructor, KeyValueMap map)
 
- Protected Member Functions inherited from org.turro.elephant.direct.AbstractDirectEntityCtrl
ElephantMarker getMarker (IConstructor constructor)
 
- Protected Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String getRedirContext (IConstructor constructor, boolean withDomain)
 
ElephantMarker getCleanMarkerFrom (IConstructor constructor)
 
void addContainerId (ElephantMarker marker, boolean container)
 
String getTmplRoot ()
 
String getTemplate ()
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map)
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map, Map extra)
 
void setNeedsUser (boolean needsUser)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.elephant.direct.AbstractDirectEntityCtrl
String entityPath
 
IElephantEntity iee
 
IConstructor norReentrantConstructor
 
- Protected Attributes inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String template = "full"
 

Detailed Description

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

Definition at line 53 of file ConvocationCtrl.java.

Constructor & Destructor Documentation

◆ ConvocationCtrl()

org.turro.www.convocation.ConvocationCtrl.ConvocationCtrl ( )

Definition at line 55 of file ConvocationCtrl.java.

55  {
56  super("convocation", "convocation");
57  }

Member Function Documentation

◆ createAttendantQrCode()

String org.turro.www.convocation.ConvocationCtrl.createAttendantQrCode ( IContact  contact,
Convocation  convocation 
)

Definition at line 133 of file ConvocationCtrl.java.

133  {
134  try {
135  KeyValueMap kvm = new KeyValueMap("");
136  kvm.put("type", "attended");
137  kvm.put("id", convocation.getId());
138  kvm.put("contact", contact.getConnector(IUser.CONNECTOR_EMAIL));
139  kvm.put(Actions.REDIR_PAR, ElephantContext.getServerBase("http") + getUserConvocation(convocation, contact));
140  String exacton = Actions.createAction(kvm, (int) convocation.getDaysLeft() + 1, false);
141  String url = ElephantContext.getServerBase("http") +
142  ElephantContext.getRootWebPath() +
143  DirectContents.DIRECT_CONTENT_PATH + DirectContents.getIdentifier(ConvocationCtrl.class) +
144  "?" + exacton;
145  HashMap map = new HashMap();
146  map.put("type", "qrcode");
147  map.put("data", url);
148  return ContentService.createURL(null, new KeyValueMap(map));
149  } catch (ParserException ex) {
150  Logger.getLogger(ConvocationCtrl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
151  }
152  return "";
153  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAttendantQrCodeURL()

static String org.turro.www.convocation.ConvocationCtrl.createAttendantQrCodeURL ( IConstructor  constructor,
IContact  contact,
Convocation  convocation 
)
static

Definition at line 122 of file ConvocationCtrl.java.

122  {
123  ConvocationCtrl cc = new ConvocationCtrl();
124  cc.setConstructor(constructor);
125  cc.setEntityPath(ContactsPU.getObjectPath(convocation));
126  return cc.createAttendantQrCode(contact, convocation);
127  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createRegistration()

String org.turro.www.convocation.ConvocationCtrl.createRegistration ( IConstructor  constructor,
IContact  contact,
Convocation  convocation 
)

Definition at line 129 of file ConvocationCtrl.java.

129  {
130  return createRightNowURL("type=willattend;id=" + convocation.getId());
131  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createRegistrationURL()

static String org.turro.www.convocation.ConvocationCtrl.createRegistrationURL ( IConstructor  constructor,
IContact  contact,
Convocation  convocation 
)
static

Definition at line 115 of file ConvocationCtrl.java.

115  {
116  ConvocationCtrl cc = new ConvocationCtrl();
117  cc.setConstructor(constructor);
118  cc.setEntityPath(ContactsPU.getObjectPath(convocation));
119  return cc.createRegistration(constructor, contact, convocation);
120  }
Here is the call graph for this function:

◆ doExecute()

void org.turro.www.convocation.ConvocationCtrl.doExecute ( IConstructor  constructor,
KeyValueMap  map 
)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 80 of file ConvocationCtrl.java.

80  {
81  String type = map.get("type");
82  if("attended".equals(type)) {
83  if(Application.getApplication().isInRole("convocation:validate")) {
84  Convocation convocation = getDao().find(Convocation.class, map.get("id"));
85  IContact contact = Contacts.getContactByEmail(map.get("contact"));
86  if(convocation != null && contact != null && contact.isValid()) {
87  convocation.attended(contact);
88  } else {
89  Logger.getLogger(ConvocationCtrl.class.getName()).log(Level.SEVERE,
90  ElephantContext.logMsg("Validating Convocation: {0} - Contact: {1}"),
91  new Object[] {
92  (convocation == null ? "null:" + map.get("id") : convocation.getId() + " " + convocation.getName()),
93  (contact == null || !contact.isValid() ? "null:" + map.get("contact") : contact.getId() + " " + contact.getName())
94  });
95  }
96  } else {
97  IContact contact = Authentication.getIContact();
98  Logger.getLogger(ConvocationCtrl.class.getName()).log(Level.SEVERE,
99  ElephantContext.logMsg("No permissions: {1}"),
100  new Object[] {
101  (contact == null || !contact.isValid() ? "null:" + map.get("contact") : contact.getId() + " " + contact.getName())
102  });
103  }
104  } if("willattend".equals(type)) {
105  IContact contact = Authentication.getIContact();
106  Convocation convocation = getDao().find(Convocation.class, map.get("id"));
107  convocation.addContact((Contact) contact.getContact());
108  convocation = getDao().saveObject(convocation);
109  new ConvocationSender(convocation, contact).send();
110  }
111  }
Here is the call graph for this function:

◆ getIdentifier()

String org.turro.www.convocation.ConvocationCtrl.getIdentifier ( )
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 64 of file ConvocationCtrl.java.

64  {
65  return DirectContents.getIdentifier(ConvocationCtrl.class);
66  }
Here is the call graph for this function:

◆ isRestricted()

boolean org.turro.www.convocation.ConvocationCtrl.isRestricted ( )

Definition at line 59 of file ConvocationCtrl.java.

59  {
60  return true;
61  }

◆ prepareCleanMarker()

void org.turro.www.convocation.ConvocationCtrl.prepareCleanMarker ( ElephantMarker  em,
KeyValueMap  kvm 
)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 69 of file ConvocationCtrl.java.

69  {
70  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
71  }

◆ prepareMarker()

void org.turro.www.convocation.ConvocationCtrl.prepareMarker ( ElephantMarker  marker)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 74 of file ConvocationCtrl.java.

74  {
75  // Compatibility with ConvocationContentIterator isRestricted()
76  marker.put("entiter", this);
77  }
Here is the call graph for this function:

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