19 package org.turro.contacts.util;
21 import org.turro.contacts.Contact;
22 import org.turro.contacts.db.ContactsPU;
23 import org.turro.elephant.db.SQLHelper;
24 import org.turro.jpa.Dao;
25 import org.turro.security.Permissions;
26 import org.turro.zkoss.input.CollectionListbox;
27 import org.zkoss.lang.Strings;
38 if(provider !=
null) {
44 if(!Strings.isBlank(name) && name.trim().length() > 2) {
49 "select c from Contact as c where c.name like ? order by c.name",
50 new String[] {
"%" + name.trim() +
"%" }));
59 "select contact from Contact as contact where " +
61 " order by contact.name"));
69 private static String getInRole(String role) {
73 if(!Strings.isBlank(in)) {
75 "select syndication from Syndication as syndication" +
76 "where syndication.name in (" + in +
")" +
77 "and syndication.contact = c" +
static String convertToIn(Collection collection)
static Set< String > getSecurityGroupIdsBy(String role)