◆ getCategoryFromText()
String org.turro.dossier.dossier.DossierCombobox.getCategoryFromText |
( |
String |
text | ) |
|
Definition at line 123 of file DossierCombobox.java.
124 String[] s = text.split(Chars.forward().regexp().spaced().toString());
128 }
else if(s.length == 3) {
131 }
else if(s.length == 2) {
String getNameFromText(String text)
◆ getIdFromText()
long org.turro.dossier.dossier.DossierCombobox.getIdFromText |
( |
String |
text | ) |
|
Definition at line 138 of file DossierCombobox.java.
140 int p = text.lastIndexOf(
"#");
143 id = Long.valueOf(text.substring(p + 1));
145 id = Long.valueOf(text);
147 }
catch(Exception ex) {}
◆ getNameFromText()
String org.turro.dossier.dossier.DossierCombobox.getNameFromText |
( |
String |
text | ) |
|
Definition at line 108 of file DossierCombobox.java.
109 String[] s = text.split(Chars.forward().regexp().spaced().toString());
112 return s[1] + Chars.forward().spaced() + s[2] + Chars.forward().spaced() + s[3];
113 }
else if(s.length == 3) {
116 }
else if(s.length == 2) {
◆ getSubjectFromText()
String org.turro.dossier.dossier.DossierCombobox.getSubjectFromText |
( |
String |
text | ) |
|
Definition at line 100 of file DossierCombobox.java.
101 String[] s = text.split(Chars.forward().regexp().spaced().toString());
◆ getTextFromObject()
String org.turro.dossier.dossier.DossierCombobox.getTextFromObject |
( |
Dossier |
value | ) |
|
Definition at line 96 of file DossierCombobox.java.
97 return value.getFullDescription() +
" #" + value.getId();
◆ populateList()
void org.turro.dossier.dossier.DossierCombobox.populateList |
( |
String |
value, |
|
|
LinkedList |
list, |
|
|
int |
nRows |
|
) |
| |
Reimplemented from org.turro.zkoss.input.GenericCombobox< V >.
Definition at line 38 of file DossierCombobox.java.
39 boolean all = Application.getApplication().isInRole(
"dossier:all");
40 Dao dao =
new DossierPU();
42 WhereClause wc =
new WhereClause();
43 wc.addClause(
"select distinct dossier from Dossier as dossier");
45 wc.addClause(
"where dossier.id = :id");
46 wc.addNamedValue(
"id",
id);
48 wc.addClause(
"where 1=1");
49 wc.addClause(
"and not exists (select p from Participant as p");
50 wc.addClause(
"where p.dossier = dossier and p.role = :rolenot)");
51 wc.addNamedValue(
"rolenot", ParticipantRole.PARTICIPANT_SUBJECT);
52 if(!Strings.isBlank(value)) {
53 wc.addClause(
"and (");
55 wc.addLikeFields(
new String[] {
"dossier.description"},
getNameFromText(value));
57 wc.addLikeFields(
new String[] {
"dossier.category.fullDescription"},
getCategoryFromText(value));
61 wc.addClause(
"order by dossier.description");
63 for(Object o : dao.getResultList(wc, nRows)) {
64 if(all ||
new DossierWrapper((Dossier) (o)).isParticipant()) {
65 list.add((Dossier) o);
69 wc =
new WhereClause();
70 wc.addClause(
"select distinct dossier from Dossier as dossier");
71 wc.addClause(
"left join dossier.participants participant");
72 wc.addClause(
"where 1=1");
73 wc.addClause(
"and participant.role = :role");
74 wc.addNamedValue(
"role", ParticipantRole.PARTICIPANT_SUBJECT);
75 if(!Strings.isBlank(value)) {
76 wc.addClause(
"and (");
80 wc.addLikeFields(
new String[] {
"dossier.description"},
getNameFromText(value));
82 wc.addLikeFields(
new String[] {
"dossier.category.fullDescription"},
getCategoryFromText(value));
86 wc.addClause(
"order by dossier.description");
87 for(Object o : dao.getResultList(wc, nRows)) {
88 if(all ||
new DossierWrapper((Dossier) (o)).isParticipant()) {
89 list.add((Dossier) o);
long getIdFromText(String text)
String getCategoryFromText(String text)
String getSubjectFromText(String text)
The documentation for this class was generated from the following file: