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

Public Member Functions

void setConstructor (IConstructor constructor)
 
void setEntityPath (String entityPath)
 
void setTemplate (String template)
 
boolean hasContent ()
 
void render (IConstructor constructor)
 
String parse (IConstructor constructor)
 
boolean isMine (Challenge challenge)
 
Object getFollowCtrl ()
 
boolean allowsQuestion ()
 
boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
long countParticipations (String root, IContact contact, String reason)
 
long countResponses (IContact contact)
 

Static Public Member Functions

static String createPOST (String values)
 
static String createURL (String values)
 
static String getIdentifier ()
 

Detailed Description

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

Definition at line 56 of file StudentsCtrl.java.

Member Function Documentation

◆ allowsQuestion()

boolean org.turro.students.www.StudentsCtrl.allowsQuestion ( )

Definition at line 108 of file StudentsCtrl.java.

108  {
109  IContact contact = Authentication.getIContact();
110  return contact.isWebUser() && contact.isInNetworking();
111  }
Here is the call graph for this function:

◆ countParticipations()

long org.turro.students.www.StudentsCtrl.countParticipations ( String  root,
IContact  contact,
String  reason 
)

Definition at line 195 of file StudentsCtrl.java.

195  {
196  return ParticipationInfo.getParticipationCount(root, contact, ParticipationReason.valueOf(reason));
197  }
Here is the call graph for this function:

◆ countResponses()

long org.turro.students.www.StudentsCtrl.countResponses ( IContact  contact)

Definition at line 199 of file StudentsCtrl.java.

199  {
200  WhereClause wc = new WhereClause();
201  wc.addClause("select count(sp) from Response sp");
202  wc.addClause("where :student member of sp.studentIds");
203  wc.addNamedValue("student", contact.getId());
204  return (long) getDao().getSingleResultOrNull(wc);
205  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ createPOST()

static String org.turro.students.www.StudentsCtrl.createPOST ( String  values)
static

Definition at line 158 of file StudentsCtrl.java.

158  {
159  return "$.post(\"" + ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + getIdentifier() + "\"," +
160  "{ exrino : \"" + Actions.createRightNowParameter(values) + "\" })";
161  }

◆ createURL()

static String org.turro.students.www.StudentsCtrl.createURL ( String  values)
static

Definition at line 163 of file StudentsCtrl.java.

163  {
164  String exrino = Actions.createRightNowAction(values);
165  return ElephantContext.getRootWebPath() +
166  DirectContents.DIRECT_CONTENT_PATH + getIdentifier() +
167  "?" + exrino;
168  }

◆ execute()

void org.turro.students.www.StudentsCtrl.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 185 of file StudentsCtrl.java.

185  {
186  IConstructor current = ElephantContext.getConstructor(request, response);
187  KeyValueMap map = Actions.getRightNowAction(current);
188  if(map != null) {
189  String type = map.get("type");
190  }
191  }
Here is the call graph for this function:

◆ getFollowCtrl()

Object org.turro.students.www.StudentsCtrl.getFollowCtrl ( )

Definition at line 104 of file StudentsCtrl.java.

104  {
105  return Entities.getController(entityPath).getParticipationControl(constructor, ParticipationReason.REASON_FOLLOW);
106  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.students.www.StudentsCtrl.getIdentifier ( )
static

Definition at line 170 of file StudentsCtrl.java.

170  {
171  return StudentsCtrl.class.getAnnotation(DirectContent.class).identifier();
172  }

◆ hasContent()

boolean org.turro.students.www.StudentsCtrl.hasContent ( )

Implements org.turro.action.IEntityCtrl.

Definition at line 80 of file StudentsCtrl.java.

80  {
81  getStudents();
82  getChallenger();
83  getRelatedChallenges();
84  return (Contacts.isStudent(Authentication.getIContact())) ||
85  (challenger != null && challenger.isWebUser()) ||
86  !students.isEmpty() || !challenges.isEmpty();
87  }
Here is the call graph for this function:

◆ isMine()

boolean org.turro.students.www.StudentsCtrl.isMine ( Challenge  challenge)

Definition at line 99 of file StudentsCtrl.java.

99  {
100  IContact contact = Authentication.getIContact();
101  return challenge.getIdChallenger().equals(contact.getId());
102  }
Here is the call graph for this function:

◆ itsMe()

boolean org.turro.students.www.StudentsCtrl.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 175 of file StudentsCtrl.java.

175  {
176  return getIdentifier().equals(id);
177  }

◆ myTurn()

boolean org.turro.students.www.StudentsCtrl.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 180 of file StudentsCtrl.java.

180  {
181  return DirectContents.isYourTurn(request, getIdentifier());
182  }
Here is the call graph for this function:

◆ parse()

String org.turro.students.www.StudentsCtrl.parse ( IConstructor  constructor)

Implements org.turro.action.IEntityCtrl.

Definition at line 95 of file StudentsCtrl.java.

95  {
96  return getMarker().parse("students", template);
97  }
String parse(String rootTmpl, String tmpl)

◆ render()

void org.turro.students.www.StudentsCtrl.render ( IConstructor  constructor)

Implements org.turro.action.IEntityCtrl.

Definition at line 90 of file StudentsCtrl.java.

90  {
91  getMarker().process("students", template);
92  }
void process(String rootTmpl, String tmpl)

◆ setConstructor()

void org.turro.students.www.StudentsCtrl.setConstructor ( IConstructor  constructor)

Implements org.turro.action.IEntityCtrl.

Definition at line 65 of file StudentsCtrl.java.

65  {
66  this.constructor = constructor;
67  }

◆ setEntityPath()

void org.turro.students.www.StudentsCtrl.setEntityPath ( String  entityPath)

Implements org.turro.action.IEntityCtrl.

Definition at line 70 of file StudentsCtrl.java.

70  {
71  this.entityPath = entityPath;
72  }

◆ setTemplate()

void org.turro.students.www.StudentsCtrl.setTemplate ( String  template)

Implements org.turro.action.IEntityCtrl.

Definition at line 75 of file StudentsCtrl.java.

75  {
76  this.template = template;
77  }

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