BrightSide Workbench Full Report + Source Code
org.turro.participation.ParticipationCtrl Class Reference
Inheritance diagram for org.turro.participation.ParticipationCtrl:
Collaboration diagram for org.turro.participation.ParticipationCtrl:

Public Member Functions

 ParticipationCtrl ()
 
void setReason (ParticipationReason reason)
 
ContactList getParticipators ()
 
List< IEntityParticipationgetParticipations ()
 
List< IEntityParticipationgetCrossParticipations ()
 
- 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)
 

Protected Member Functions

void prepareCleanMarker (ElephantMarker marker, KeyValueMap map)
 
void prepareMarker (ElephantMarker marker)
 
String getIdentifier ()
 
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 43 of file ParticipationCtrl.java.

Constructor & Destructor Documentation

◆ ParticipationCtrl()

org.turro.participation.ParticipationCtrl.ParticipationCtrl ( )

Definition at line 47 of file ParticipationCtrl.java.

47  {
48  super("widgets/participation", "participation");
49  setNeedsUser(true);
50  }

Member Function Documentation

◆ doExecute()

void org.turro.participation.ParticipationCtrl.doExecute ( IConstructor  constructor,
KeyValueMap  map 
)
protected

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

Definition at line 110 of file ParticipationCtrl.java.

110  {
111  String type = map.get("type");
112  if("click".equals(type)) {
113  processClick(constructor, map);
114  }
115  }

◆ getCrossParticipations()

List<IEntityParticipation> org.turro.participation.ParticipationCtrl.getCrossParticipations ( )

Implements org.turro.participation.IParticipationCtrl.

Definition at line 73 of file ParticipationCtrl.java.

73  {
74  return new ParticipationInfo(entityPath, reason).getCrossParticipations();
75  }
Here is the call graph for this function:

◆ getIdentifier()

String org.turro.participation.ParticipationCtrl.getIdentifier ( )
protected

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

Definition at line 105 of file ParticipationCtrl.java.

105  {
106  return ParticipationCtrl.class.getAnnotation(DirectContent.class).identifier();
107  }

◆ getParticipations()

List<IEntityParticipation> org.turro.participation.ParticipationCtrl.getParticipations ( )

Implements org.turro.participation.IParticipationCtrl.

Definition at line 68 of file ParticipationCtrl.java.

68  {
69  return new ParticipationInfo(entityPath, reason).getParticipations();
70  }
Here is the call graph for this function:

◆ getParticipators()

ContactList org.turro.participation.ParticipationCtrl.getParticipators ( )

Implements org.turro.participation.IParticipationCtrl.

Definition at line 59 of file ParticipationCtrl.java.

59  {
60  ContactList list = new ContactList();
61  for(IEntityParticipation ep : new ParticipationInfo(entityPath, reason).getParticipations()) {
62  list.add(ep.getContact());
63  }
64  return list;
65  }
List< IEntityParticipation > getParticipations()
Here is the call graph for this function:

◆ prepareCleanMarker()

void org.turro.participation.ParticipationCtrl.prepareCleanMarker ( ElephantMarker  marker,
KeyValueMap  map 
)
protected

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

Definition at line 78 of file ParticipationCtrl.java.

78  {
79  marker.putAll(map);
80  marker.put("info", new ParticipationInfo(map.get("entityPath"),
81  map.get("participatorPath"), ParticipationReason.valueOf((String) marker.get("reason"))));
82  marker.put("checkLink", getAjaxUrl((String) marker.get("domid"), map));
83  }
String getAjaxUrl(String containerId, String values)
Here is the call graph for this function:

◆ prepareMarker()

void org.turro.participation.ParticipationCtrl.prepareMarker ( ElephantMarker  marker)
protected

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

Definition at line 87 of file ParticipationCtrl.java.

87  {
88  addContainerId(marker, true);
89  IContact contact = Authentication.getIContact();
90  if(contact.isWebUser()) {
91  String participatorPath = "/contact/" + contact.getId();
92  marker.put("info", new ParticipationInfo(entityPath, participatorPath, reason));
93  KeyValueMap kvm = new KeyValueMap(Collections.EMPTY_MAP);
94  kvm.put("type", "click");
95  kvm.put("entityPath", entityPath);
96  kvm.put("participatorPath", participatorPath);
97  kvm.put("reason", reason.toString());
98  marker.put("checkLink", getAjaxUrl((String) marker.get("containerId"), kvm));
99  }
100  }
void addContainerId(ElephantMarker marker, boolean container)
Here is the call graph for this function:

◆ setReason()

void org.turro.participation.ParticipationCtrl.setReason ( ParticipationReason  reason)

Implements org.turro.participation.IParticipationCtrl.

Definition at line 53 of file ParticipationCtrl.java.

53  {
54  this.reason = reason;
55  setTemplate(reason.toString().replaceAll("_", "-").toLowerCase());
56  }
void setTemplate(String template)

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