18 package org.turro.dossier.dossier;
20 import java.util.LinkedList;
21 import org.turro.string.Strings;
22 import org.turro.dossier.db.DossierPU;
23 import org.turro.dossier.entity.Dossier;
24 import org.turro.dossier.entity.ParticipantRole;
25 import org.turro.elephant.context.Application;
26 import org.turro.elephant.db.WhereClause;
27 import org.turro.jpa.Dao;
28 import org.turro.util.Chars;
29 import org.turro.zkoss.input.GenericCombobox;
38 public void populateList(String value, LinkedList list,
int nRows) {
43 wc.
addClause(
"select distinct dossier from Dossier as dossier");
49 wc.
addClause(
"and not exists (select p from Participant as p");
50 wc.
addClause(
"where p.dossier = dossier and p.role = :rolenot)");
52 if(!Strings.isBlank(value)) {
61 wc.
addClause(
"order by dossier.description");
63 for(Object o : dao.getResultList(wc, nRows)) {
70 wc.
addClause(
"select distinct dossier from Dossier as dossier");
71 wc.
addClause(
"left join dossier.participants participant");
73 wc.
addClause(
"and participant.role = :role");
75 if(!Strings.isBlank(value)) {
86 wc.
addClause(
"order by dossier.description");
87 for(Object o : dao.getResultList(wc, nRows)) {
101 String[] s = text.split(Chars.forward().regexp().spaced().toString());
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) {
124 String[] s = text.split(Chars.forward().regexp().spaced().toString());
128 }
else if(s.length == 3) {
131 }
else if(s.length == 2) {
140 int p = text.lastIndexOf(
"#");
143 id = Long.valueOf(text.substring(p + 1));
145 id = Long.valueOf(text);
147 }
catch(Exception ex) {}
void populateList(String value, LinkedList list, int nRows)
long getIdFromText(String text)
String getCategoryFromText(String text)
String getTextFromObject(Dossier value)
String getNameFromText(String text)
String getSubjectFromText(String text)
String getFullDescription()
boolean isInRole(String role)
static Application getApplication()
void setPrefix(String prefix)
void addClause(String clause)
void addLikeFields(String[] fields, String value)
void addNamedValue(String name, Object value)