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

Public Member Functions

void setContact (IContact contact)
 
void setContact (String idContact)
 
boolean isValid ()
 
boolean canNotify ()
 
boolean canAccess ()
 
boolean canAct (String action)
 
boolean declinedNotifications ()
 
boolean declinedAccessing ()
 
void sendIfNecessary (IConstructor constructor)
 
String getPendingAccessURL ()
 
String getPendingActURL (String action)
 
boolean canSendEmails (NotificationCategory nc)
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.action.IAgreements
static boolean checkAgreements (HttpServletRequest request, HttpServletResponse response) throws IOException
 
- Public Attributes inherited from org.turro.action.IAgreements
String AGREE_CHECKED = "AGREE_CHECKED"
 

Detailed Description

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

Definition at line 40 of file AgreementsPlugin.java.

Member Function Documentation

◆ canAccess()

boolean org.turro.agreements.AgreementsPlugin.canAccess ( )

Implements org.turro.action.IAgreements.

Definition at line 65 of file AgreementsPlugin.java.

65  {
66  return agreements.canAccess();
67  }
Here is the call graph for this function:

◆ canAct()

boolean org.turro.agreements.AgreementsPlugin.canAct ( String  action)

Implements org.turro.action.IAgreements.

Definition at line 70 of file AgreementsPlugin.java.

70  {
71  return agreements.canAct(action);
72  }
Here is the call graph for this function:

◆ canNotify()

boolean org.turro.agreements.AgreementsPlugin.canNotify ( )

Implements org.turro.action.IAgreements.

Definition at line 60 of file AgreementsPlugin.java.

60  {
61  return agreements.canNotify();
62  }
Here is the call graph for this function:

◆ canSendEmails()

boolean org.turro.agreements.AgreementsPlugin.canSendEmails ( NotificationCategory  nc)

Implements org.turro.action.IAgreements.

Definition at line 126 of file AgreementsPlugin.java.

126  {
127  return (NotificationRole.NOTIF_OBSERVER.equals(nc.getRole()) && agreements.canNotify()) ||
128  (NotificationRole.NOTIF_PARTICIPANT.equals(nc.getRole()) && !agreements.declinedNotifications());
129  }
Here is the call graph for this function:

◆ declinedAccessing()

boolean org.turro.agreements.AgreementsPlugin.declinedAccessing ( )

Implements org.turro.action.IAgreements.

Definition at line 80 of file AgreementsPlugin.java.

80  {
81  return agreements.declinedAccessing();
82  }
Here is the call graph for this function:

◆ declinedNotifications()

boolean org.turro.agreements.AgreementsPlugin.declinedNotifications ( )

Implements org.turro.action.IAgreements.

Definition at line 75 of file AgreementsPlugin.java.

75  {
76  return agreements.declinedNotifications();
77  }
Here is the call graph for this function:

◆ getPendingAccessURL()

String org.turro.agreements.AgreementsPlugin.getPendingAccessURL ( )

Implements org.turro.action.IAgreements.

Definition at line 106 of file AgreementsPlugin.java.

106  {
107  for(AgreementSignature as : agreements.getSignatures(null)) {
108  if(!as.doesAgree() && as.getAgreement().isRequiredToAccess()) {
109  return "/user/myagreements/?item=" + as.getId();
110  }
111  }
112  return null;
113  }
List< AgreementSignature > getSignatures(String action)
Here is the call graph for this function:

◆ getPendingActURL()

String org.turro.agreements.AgreementsPlugin.getPendingActURL ( String  action)

Implements org.turro.action.IAgreements.

Definition at line 116 of file AgreementsPlugin.java.

116  {
117  for(AgreementSignature as : agreements.getSignatures(action)) {
118  if(!as.doesAgree() && as.getAgreement().isRequiredToAction() && action.equals(as.getAgreement().getAction())) {
119  return "/user/myagreements/?item=" + as.getId();
120  }
121  }
122  return null;
123  }
Here is the call graph for this function:

◆ isValid()

boolean org.turro.agreements.AgreementsPlugin.isValid ( )

Implements org.turro.action.IAgreements.

Definition at line 55 of file AgreementsPlugin.java.

55  {
56  return agreements.isValid();
57  }
Here is the call graph for this function:

◆ sendIfNecessary()

void org.turro.agreements.AgreementsPlugin.sendIfNecessary ( IConstructor  constructor)

Implements org.turro.action.IAgreements.

Definition at line 85 of file AgreementsPlugin.java.

85  {
86  for(AgreementSignature as : agreements.getSignatures(null)) {
87  if(as.shouldSend() && as.getSignedDate() == null && as.getAgreement().isRequiredToNotify()) {
88  try {
89  Map args = new HashMap();
90  MailSenders.getPool()
91  .setRoot("/agreements")
92  .addContact(agreements.getContact())
93  .put("signature", as)
94  .put("acceptUrl", AgreementAction.createURL(constructor, as, agreements.getContact(), true))
95  .put("declineUrl", AgreementAction.createURL(constructor, as, agreements.getContact(), false))
96  .sendTemplate("requiredSignature", as.getAgreement().getTitle() + " : " + ElephantContext.getSiteName());
97  agreements.markAsSent(as);
98  } catch (Exception ex) {
99  Logger.getLogger(AgreementsPlugin.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
100  }
101  }
102  }
103  }
void markAsSent(AgreementSignature as)
Here is the call graph for this function:

◆ setContact() [1/2]

void org.turro.agreements.AgreementsPlugin.setContact ( IContact  contact)

Implements org.turro.action.IAgreements.

Definition at line 45 of file AgreementsPlugin.java.

45  {
46  agreements = new AgreementsUtil(contact);
47  }

◆ setContact() [2/2]

void org.turro.agreements.AgreementsPlugin.setContact ( String  idContact)

Implements org.turro.action.IAgreements.

Definition at line 50 of file AgreementsPlugin.java.

50  {
51  agreements = new AgreementsUtil(idContact);
52  }

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