added community find page and some necessary patches to the framework, fixed
bugs
This commit is contained in:
@@ -608,4 +608,10 @@ class GroupObject implements DynamoGroup
|
||||
|
||||
} // end setAcl
|
||||
|
||||
public synchronized int getMemberCount() throws DatabaseException
|
||||
{
|
||||
return m_ops.getMemberCount(m_gid);
|
||||
|
||||
} // end getMemberCount
|
||||
|
||||
} // end class GroupObject
|
||||
|
||||
@@ -60,4 +60,6 @@ abstract class GroupObjectOps extends OpsBase
|
||||
|
||||
abstract void setAclID(int gid, int aclid) throws DatabaseException;
|
||||
|
||||
abstract int getMemberCount(int gid) throws DatabaseException;
|
||||
|
||||
} // end class GroupObjectOps
|
||||
|
||||
@@ -553,4 +553,36 @@ class GroupObjectOps_mysql extends GroupObjectOps
|
||||
|
||||
} // end setAclID
|
||||
|
||||
int getMemberCount(int gid) throws DatabaseException
|
||||
{
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
ArrayList tmp = null;
|
||||
try
|
||||
{ // get a connection
|
||||
conn = getConnection();
|
||||
|
||||
// create a query to get all the UIDs
|
||||
stmt = conn.prepareStatement("SELECT COUNT(*) FROM groupmembers WHERE gid = ?;");
|
||||
stmt.setInt(1,gid);
|
||||
rs = stmt.executeQuery();
|
||||
return SQLUtils.getReturnCountInt(rs,1);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // translate to a general DatabaseException
|
||||
throw generalException(e);
|
||||
|
||||
} // end catch
|
||||
finally
|
||||
{ // shut everything down
|
||||
SQLUtils.shutdown(rs);
|
||||
SQLUtils.shutdown(stmt);
|
||||
SQLUtils.shutdown(conn);
|
||||
|
||||
} // end finally
|
||||
|
||||
} // end getMemberCount
|
||||
|
||||
} // end class GroupObjectOps_mysql
|
||||
|
||||
@@ -235,6 +235,12 @@ abstract class GroupProxy implements DynamoGroup, DynamicWrapper
|
||||
|
||||
} // end setAcl
|
||||
|
||||
public int getMemberCount() throws DatabaseException
|
||||
{
|
||||
return getRealGroup().getMemberCount();
|
||||
|
||||
} // end getMemberCount
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface DynamicWrapper
|
||||
*--------------------------------------------------------------------------------
|
||||
|
||||
@@ -45,4 +45,6 @@ public interface DynamoGroup extends Group, NamedObject, SecureObjectStore
|
||||
|
||||
public void setAcl(DynamoUser caller, DynamoAcl acl) throws DatabaseException, DynamoSecurityException;
|
||||
|
||||
public int getMemberCount() throws DatabaseException;
|
||||
|
||||
} // end interface DynamoGroup
|
||||
|
||||
Reference in New Issue
Block a user