BrightSide Workbench Full Report + Source Code
org.turro.dossier.command.DossierAction Class Reference
Inheritance diagram for org.turro.dossier.command.DossierAction:
Collaboration diagram for org.turro.dossier.command.DossierAction:

Public Member Functions

boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
String parseWorths (IConstructor constructor, Dossier dossier, String root, String tmpl, String grpg)
 
boolean isMine (WorthDefinition worthDefinition, Double value)
 
boolean isParticipant (Dossier dossier, IContact contact, String label)
 

Static Public Member Functions

static String createPOST (String values)
 
static String createPOST (String domId, 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 59 of file DossierAction.java.

Member Function Documentation

◆ createPOST() [1/2]

static String org.turro.dossier.command.DossierAction.createPOST ( String  domId,
String  values 
)
static

Definition at line 68 of file DossierAction.java.

68  {
69  return "$.post(\"" + ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + getIdentifier() + "\"," +
70  "{ exrino : \"" + Actions.createRightNowParameter(values) + "\", domid: \"" + domId + "\" })" +
71  ".done(function(data) { $(\"#" + domId + "\").html(data); });";
72  }

◆ createPOST() [2/2]

static String org.turro.dossier.command.DossierAction.createPOST ( String  values)
static

Definition at line 63 of file DossierAction.java.

63  {
64  return "$.post(\"" + ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + getIdentifier() + "\"," +
65  "{ exrino : \"" + Actions.createRightNowParameter(values) + "\" })";
66  }

◆ createURL()

static String org.turro.dossier.command.DossierAction.createURL ( String  values)
static

Definition at line 74 of file DossierAction.java.

74  {
75  String exrino = Actions.createRightNowAction(values);
76  return ElephantContext.getRootWebPath() +
77  DirectContents.DIRECT_CONTENT_PATH + getIdentifier() +
78  "?" + exrino;
79  }

◆ execute()

void org.turro.dossier.command.DossierAction.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 96 of file DossierAction.java.

96  {
97  IConstructor constructor = ElephantContext.getConstructor(request, response);
98  KeyValueMap map = Actions.getRightNowAction(constructor);
99  if(map != null) {
100  String type = map.get("type");
101  if("worth".equals(type)) {
102  processWorth(map, constructor);
103  } else if("participate".equals(type)) {
104  processParticipate(map, constructor);
105  }
106  }
107  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.dossier.command.DossierAction.getIdentifier ( )
static

Definition at line 81 of file DossierAction.java.

81  {
82  return DossierAction.class.getAnnotation(DirectContent.class).identifier();
83  }

◆ isMine()

boolean org.turro.dossier.command.DossierAction.isMine ( WorthDefinition  worthDefinition,
Double  value 
)

Definition at line 199 of file DossierAction.java.

199  {
200  IContact contact = Authentication.getIContact();
201  if(contact != null && contact.isWebUser()) {
202  Double v = (Double) getDao().getSingleResultOrNull(
203  "select v.value from WorthValue v " +
204  "where v.dossier = ? and v.worthDefinition = ? and v.idContact = ?",
205  new Object[] {
206  worthDefinition.getDossier(), worthDefinition, contact.getId()
207  });
208  return value.equals(v);
209  }
210  return false;
211  }
Object getSingleResultOrNull(SqlClause sc)
Definition: Dao.java:419
Here is the call graph for this function:

◆ isParticipant()

boolean org.turro.dossier.command.DossierAction.isParticipant ( Dossier  dossier,
IContact  contact,
String  label 
)

Definition at line 215 of file DossierAction.java.

215  {
216  if("Beneficiary".equals(label)) {
217  return dossier.getParticipationsList().isBeneficiary(contact) || hasRequested(dossier, contact, label);
218  } else if("Offerer".equals(label)) {
219  return dossier.getParticipationsList().isOfferer(contact) || hasRequested(dossier, contact, label);
220  } else if("Support".equals(label)) {
221  return dossier.getParticipationsList().isSupport(contact) || hasRequested(dossier, contact, label);
222  } else if("Coordinator".equals(label)) {
223  return dossier.getParticipationsList().isCoordinator(contact) || hasRequested(dossier, contact, label);
224  } else if("Funding".equals(label)) {
225  return dossier.getParticipationsList().isFunding(contact) || hasRequested(dossier, contact, label);
226  } else if("Research".equals(label)) {
227  return dossier.getParticipationsList().isResearch(contact) || hasRequested(dossier, contact, label);
228  } else if("Consortium".equals(label)) {
229  return dossier.getFullParticipants().isConsortium(contact) || hasRequested(dossier, contact, label);
230  }
231  return false;
232  }
Here is the call graph for this function:

◆ itsMe()

boolean org.turro.dossier.command.DossierAction.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 86 of file DossierAction.java.

86  {
87  return getIdentifier().equals(id);
88  }

◆ myTurn()

boolean org.turro.dossier.command.DossierAction.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 91 of file DossierAction.java.

91  {
92  return DirectContents.isYourTurn(request, getIdentifier());
93  }
Here is the call graph for this function:

◆ parseWorths()

String org.turro.dossier.command.DossierAction.parseWorths ( IConstructor  constructor,
Dossier  dossier,
String  root,
String  tmpl,
String  grpg 
)

Definition at line 183 of file DossierAction.java.

183  {
184  if(!Strings.isBlank(root) && !Strings.isBlank(tmpl)) {
185  ElephantMarker em = new ElephantMarker(constructor);
186  em.put("control", this);
187  em.put("contact", Authentication.getIContact());
188  em.put("dossier", dossier);
189  em.put("grouping", grpg);
190  em.put("container", true);
191  em.put("controlId", IdGenerator.generateHex());
192  em.put("root", root);
193  em.put("tmpl", tmpl);
194  return em.parse(root, tmpl);
195  }
196  return "";
197  }
Here is the call graph for this function:

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