added community find page and some necessary patches to the framework, fixed

bugs
This commit is contained in:
Eric J. Bowersox
2003-05-31 04:35:38 +00:00
parent 3fa600206e
commit b1d1f8e381
17 changed files with 430 additions and 17 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
*--------------------------------------------------------------------------------

View File

@@ -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