added database tables outlining "community" objects and initial interface

definition for community and community service
This commit is contained in:
Eric J. Bowersox
2003-05-27 09:04:40 +00:00
parent 25569583ea
commit 9218e24591
5 changed files with 443 additions and 113 deletions

View File

@@ -0,0 +1,73 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice;
import java.util.*;
import org.apache.commons.lang.enum.*;
public final class CommunitySearchField extends Enum
{
/*--------------------------------------------------------------------------------
* The actual enumeration values
*--------------------------------------------------------------------------------
*/
public static final CommunitySearchField NAME = new CommunitySearchField("NAME");
public static final CommunitySearchField SYNOPSIS = new CommunitySearchField("SYNOPSIS");
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
private CommunitySearchField(String name)
{
super(name);
} // end constructor
/*--------------------------------------------------------------------------------
* Standard static method implementations
*--------------------------------------------------------------------------------
*/
public static CommunitySearchField getEnum(String name)
{
return (CommunitySearchField)getEnum(CommunitySearchField.class,name);
} // end getEnum
public static Map getEnumMap()
{
return getEnumMap(CommunitySearchField.class);
} // end getEnumMap
public static List getEnumList()
{
return getEnumList(CommunitySearchField.class);
} // end getEnumList
public static Iterator iterator()
{
return iterator(CommunitySearchField.class);
} // end iterator
} // end class CommunitySearchField

View File

@@ -0,0 +1,74 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice;
import java.util.*;
import org.apache.commons.lang.enum.*;
public final class CommunityVisibility extends Enum
{
/*--------------------------------------------------------------------------------
* The actual enumeration values
*--------------------------------------------------------------------------------
*/
public static final CommunityVisibility SEARCHDIR = new CommunityVisibility("SEARCHDIR");
public static final CommunityVisibility SEARCHONLY = new CommunityVisibility("SEARCHONLY");
public static final CommunityVisibility NONE = new CommunityVisibility("NONE");
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
private CommunityVisibility(String name)
{
super(name);
} // end constructor
/*--------------------------------------------------------------------------------
* Standard static method implementations
*--------------------------------------------------------------------------------
*/
public static CommunityVisibility getEnum(String name)
{
return (CommunityVisibility)getEnum(CommunityVisibility.class,name);
} // end getEnum
public static Map getEnumMap()
{
return getEnumMap(CommunityVisibility.class);
} // end getEnumMap
public static List getEnumList()
{
return getEnumList(CommunityVisibility.class);
} // end getEnumList
public static Iterator iterator()
{
return iterator(CommunityVisibility.class);
} // end iterator
} // end class CommunityVisibility

View File

@@ -0,0 +1,53 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.community;
import java.util.List;
import com.silverwrist.dynamo.except.DatabaseException;
import com.silverwrist.dynamo.except.DynamoSecurityException;
import com.silverwrist.dynamo.iface.DynamoUser;
import com.silverwrist.venice.CommunitySearchField;
import com.silverwrist.venice.SearchMode;
import com.silverwrist.venice.iface.VeniceCategory;
import com.silverwrist.venice.iface.VeniceCommunity;
public interface CommunityService
{
public List getMemberCommunities(DynamoUser caller, DynamoUser user)
throws DatabaseException, DynamoSecurityException;
public VeniceCommunity getCommunity(int cid) throws DatabaseException;
public VeniceCommunity getCommunity(String alias) throws DatabaseException;
public List searchForCommunities(DynamoUser caller, CommunitySearchField field, SearchMode mode, String term,
int offset, int count) throws DatabaseException;
public int getSearchCommunityCount(DynamoUser caller, CommunitySearchField field, SearchMode mode, String term)
throws DatabaseException;
public List getCommunitiesInCategory(DynamoUser caller, int catid, int offset, int count) throws DatabaseException;
public List getCommunitiesInCategory(DynamoUser caller, VeniceCategory cat, int offset, int count)
throws DatabaseException;
public int getNumCommunitiesInCategory(DynamoUser caller, int catid) throws DatabaseException;
public int getNumCommunitiesInCategory(DynamoUser caller, VeniceCategory cat) throws DatabaseException;
} // end interface CommunityService

View File

@@ -0,0 +1,87 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.iface;
import java.security.Principal;
import java.security.acl.AclNotFoundException;
import java.util.Date;
import com.silverwrist.dynamo.except.DatabaseException;
import com.silverwrist.dynamo.except.DynamoSecurityException;
import com.silverwrist.dynamo.iface.DynamoAcl;
import com.silverwrist.dynamo.iface.DynamoGroup;
import com.silverwrist.dynamo.iface.DynamoUser;
import com.silverwrist.dynamo.iface.NamedObject;
import com.silverwrist.dynamo.iface.SecureObjectStore;
import com.silverwrist.venice.CommunityVisibility;
public interface VeniceCommunity extends NamedObject, SecureObjectStore
{
public int getCID();
public int getMemberGID();
public DynamoGroup getMemberGroup() throws DatabaseException;
public int getHostGID();
public DynamoGroup getHostGroup() throws DatabaseException;
public int getHostUID();
public DynamoUser getHostUser() throws DatabaseException;
public DynamoAcl getAcl() throws DatabaseException, AclNotFoundException;
public int getCategoryID();
public VeniceCategory getCategory() throws DatabaseException;
public void setCategoryID(DynamoUser caller, int catid) throws DatabaseException, DynamoSecurityException;
public void setCategory(DynamoUser caller, VeniceCategory cat) throws DatabaseException, DynamoSecurityException;
public CommunityVisibility getVisibility();
public void setVisibility(DynamoUser caller, CommunityVisibility vis)
throws DatabaseException, DynamoSecurityException;
public void setName(DynamoUser caller, String name) throws DatabaseException, DynamoSecurityException;
public String getAlias();
public void setAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException;
public java.util.Date getCreationDate();
public java.util.Date getLastAccessDate();
public void setLastAccessDate(DynamoUser caller, java.util.Date date)
throws DatabaseException, DynamoSecurityException;
public java.util.Date getLastUpdateDate();
public void setLastUpdateDate(DynamoUser caller, java.util.Date date)
throws DatabaseException, DynamoSecurityException;
public void grantAccess(DynamoUser caller, Principal subject, String auth_namespace, String auth_name,
String source_info, String auth_info, boolean single_use)
throws DatabaseException, DynamoSecurityException;
public void revokeAccess(DynamoUser caller, Principal subject) throws DatabaseException, DynamoSecurityException;
} // end interface VeniceCommunity