You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2012/10/17 17:05:33 UTC

svn commit: r1399295 - /incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java

Author: solomax
Date: Wed Oct 17 15:05:33 2012
New Revision: 1399295

URL: http://svn.apache.org/viewvc?rev=1399295&view=rev
Log:
Wicket: Search to the ldap configs page is added (not tested)

Modified:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java?rev=1399295&r1=1399294&r2=1399295&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/LdapConfigDaoImpl.java Wed Oct 17 15:05:33 2012
@@ -35,6 +35,7 @@ import org.apache.openmeetings.Openmeeti
 import org.apache.openmeetings.data.OmDAO;
 import org.apache.openmeetings.data.user.dao.UsersDaoImpl;
 import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
+import org.apache.openmeetings.utils.DaoHelper;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,9 +50,9 @@ import org.springframework.transaction.a
  */
 @Transactional
 public class LdapConfigDaoImpl implements OmDAO<LdapConfig> {
-
 	private static final Logger log = Red5LoggerFactory.getLogger(
 			LdapConfigDaoImpl.class, OpenmeetingsVariables.webAppRootKey);
+	public final static String[] searchFields = {"name", "configFileName", "domain", "comment"};
 
 	@PersistenceContext
 	private EntityManager em;
@@ -289,8 +290,10 @@ public class LdapConfigDaoImpl implement
 	}
 
 	public List<LdapConfig> get(String search, int start, int count) {
-		// TODO Auto-generated method stub
-		return null;
+		TypedQuery<LdapConfig> q = em.createQuery(DaoHelper.getSearchQuery("LdapConfig", "lc", search, true, false, searchFields), LdapConfig.class);
+		q.setFirstResult(start);
+		q.setMaxResults(count);
+		return q.getResultList();
 	}
 	
 	public long count() {
@@ -298,8 +301,8 @@ public class LdapConfigDaoImpl implement
 	}
 
 	public long count(String search) {
-		// TODO Auto-generated method stub
-		return 0;
+		TypedQuery<Long> q = em.createQuery(DaoHelper.getSearchQuery("LdapConfig", "lc", search, true, true, searchFields), Long.class);
+		return q.getSingleResult();
 	}
 	
 	public void update(LdapConfig entity, long userId) {