|
static boolean | isAccepted (String path) |
|
static boolean | isBlocked (String path) |
|
static AcceptanceStatus | getStatusFor (String path, IContact contact) |
|
static AcceptanceStatus | getStatusFor (String path, Contact contact) |
|
static List< Acceptance > | getAcceptances (String path) |
|
static List< Acceptance > | getPendingAcceptances (IContact contact) |
|
static List< Acceptance > | getPendingAcceptances (Contact contact) |
|
static List< Acceptance > | getPendingRequests (IContact contact) |
|
static List< Acceptance > | getPendingRequests (Contact contact) |
|
static Acceptance | accept (Acceptance a) |
|
static Acceptance | accept (IContact petitioner, IContact contact, String path, String comment) |
|
static Acceptance | accept (Contact petitioner, Contact contact, String path, String comment) |
|
static Acceptance | request (IContact petitioner, IContact contact, String path, String comment) |
|
static Acceptance | request (Contact petitioner, Contact contact, String path, String comment) |
|
static void | delete (IContact contact, String path) |
|
static void | delete (Contact contact, String path) |
|
◆ accept() [1/3]
Definition at line 127 of file AcceptanceUtil.java.
128 return accept(a.getPetitioner(), a.getContact(), a.getPath(),
null);
static Acceptance accept(Acceptance a)
◆ accept() [2/3]
static Acceptance org.turro.acceptance.AcceptanceUtil.accept |
( |
Contact |
petitioner, |
|
|
Contact |
contact, |
|
|
String |
path, |
|
|
String |
comment |
|
) |
| |
|
static |
Definition at line 135 of file AcceptanceUtil.java.
136 Dao dao =
new ContactsPU();
139 a = (Acceptance) dao.getSingleResult(
140 "select a from Acceptance as a " +
141 "where a.contact = ? " +
142 "and a.petitioner = ? " +
144 "and a.dateAcceptance is null",
146 contact, petitioner, path
148 if(comment !=
null) {
149 a.setAcceptanceComment(a.getAcceptanceComment() +
"\n" + comment);
151 a.setDateAcceptance(
new Date());
152 a = dao.saveObject(a);
153 }
catch(NoResultException ex) {
◆ accept() [3/3]
static Acceptance org.turro.acceptance.AcceptanceUtil.accept |
( |
IContact |
petitioner, |
|
|
IContact |
contact, |
|
|
String |
path, |
|
|
String |
comment |
|
) |
| |
|
static |
Definition at line 131 of file AcceptanceUtil.java.
132 return accept((Contact) petitioner.getContact(), (Contact) contact.getContact(), path, comment);
◆ delete() [1/2]
static void org.turro.acceptance.AcceptanceUtil.delete |
( |
Contact |
contact, |
|
|
String |
path |
|
) |
| |
|
static |
Definition at line 194 of file AcceptanceUtil.java.
195 Dao dao =
new ContactsPU();
197 "delete from Acceptance " +
198 "where contact = ? " +
◆ delete() [2/2]
static void org.turro.acceptance.AcceptanceUtil.delete |
( |
IContact |
contact, |
|
|
String |
path |
|
) |
| |
|
static |
◆ getAcceptances()
static List<Acceptance> org.turro.acceptance.AcceptanceUtil.getAcceptances |
( |
String |
path | ) |
|
|
static |
Definition at line 87 of file AcceptanceUtil.java.
88 Dao dao =
new ContactsPU();
89 return dao.getResultList(
90 "select a from Acceptance a " +
◆ getPendingAcceptances() [1/2]
static List<Acceptance> org.turro.acceptance.AcceptanceUtil.getPendingAcceptances |
( |
Contact |
contact | ) |
|
|
static |
Definition at line 101 of file AcceptanceUtil.java.
102 Dao dao =
new ContactsPU();
103 return dao.getResultList(
104 "select a from Acceptance as a " +
105 "where a.contact = ? " +
106 "and a.dateAcceptance is null",
◆ getPendingAcceptances() [2/2]
static List<Acceptance> org.turro.acceptance.AcceptanceUtil.getPendingAcceptances |
( |
IContact |
contact | ) |
|
|
static |
Definition at line 97 of file AcceptanceUtil.java.
static List< Acceptance > getPendingAcceptances(IContact contact)
◆ getPendingRequests() [1/2]
static List<Acceptance> org.turro.acceptance.AcceptanceUtil.getPendingRequests |
( |
Contact |
contact | ) |
|
|
static |
Definition at line 116 of file AcceptanceUtil.java.
117 Dao dao =
new ContactsPU();
118 return dao.getResultList(
119 "select a from Acceptance as a " +
120 "where a.petitioner = ? " +
121 "and a.dateAcceptance is null",
◆ getPendingRequests() [2/2]
static List<Acceptance> org.turro.acceptance.AcceptanceUtil.getPendingRequests |
( |
IContact |
contact | ) |
|
|
static |
Definition at line 112 of file AcceptanceUtil.java.
static List< Acceptance > getPendingRequests(IContact contact)
◆ getStatusFor() [1/2]
Definition at line 56 of file AcceptanceUtil.java.
59 return AcceptanceStatus.NONE_EXISTS;
61 boolean accepted =
false, pending =
false;
62 AcceptanceStatus selfStatus =
null;
63 for(Acceptance a : list) {
64 if(a.getDateAcceptance() !=
null) {
66 if(a.getContact().getId().equals(contact.getId())) {
67 selfStatus = AcceptanceStatus.SELF_ACCEPTED;
71 if(a.getContact().getId().equals(contact.getId())) {
72 selfStatus = AcceptanceStatus.SELF_PENDING;
78 return selfStatus ==
null ? AcceptanceStatus.SOME_PENDING : selfStatus;
80 return AcceptanceStatus.FULLY_ACCEPTED;
83 return selfStatus ==
null ? AcceptanceStatus.FULLY_PENDING : selfStatus;
static List< Acceptance > getAcceptances(String path)
◆ getStatusFor() [2/2]
Definition at line 52 of file AcceptanceUtil.java.
53 return getStatusFor(path, (Contact) contact.getContact());
static AcceptanceStatus getStatusFor(String path, IContact contact)
◆ isAccepted()
static boolean org.turro.acceptance.AcceptanceUtil.isAccepted |
( |
String |
path | ) |
|
|
static |
Definition at line 36 of file AcceptanceUtil.java.
38 if(list.isEmpty())
return false;
39 for(Acceptance a : list) {
40 if(a.getDateAcceptance() ==
null) {
◆ isBlocked()
static boolean org.turro.acceptance.AcceptanceUtil.isBlocked |
( |
String |
path | ) |
|
|
static |
◆ request() [1/2]
static Acceptance org.turro.acceptance.AcceptanceUtil.request |
( |
Contact |
petitioner, |
|
|
Contact |
contact, |
|
|
String |
path, |
|
|
String |
comment |
|
) |
| |
|
static |
Definition at line 162 of file AcceptanceUtil.java.
163 Dao dao =
new ContactsPU();
166 a = (Acceptance) dao.getSingleResult(
167 "select a from Acceptance as a " +
168 "where a.contact = ? " +
169 "and a.petitioner = ? " +
172 contact, petitioner, path
174 if(comment !=
null) {
175 a.setAcceptanceComment(a.getAcceptanceComment() +
"\n" + comment);
177 a = dao.saveObject(a);
178 }
catch(NoResultException ex) {
179 a =
new Acceptance();
180 a.setAcceptanceComment(comment);
181 a.setPetitioner(petitioner);
182 a.setContact(contact);
183 a.setDateRequest(
new Date());
185 a = dao.saveObject(a);
◆ request() [2/2]
static Acceptance org.turro.acceptance.AcceptanceUtil.request |
( |
IContact |
petitioner, |
|
|
IContact |
contact, |
|
|
String |
path, |
|
|
String |
comment |
|
) |
| |
|
static |
Definition at line 158 of file AcceptanceUtil.java.
159 return request((Contact) petitioner.getContact(), (Contact) contact.getContact(), path, comment);
static Acceptance request(IContact petitioner, IContact contact, String path, String comment)
The documentation for this class was generated from the following file: