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

@ -30,37 +30,37 @@ USE venice;
# The "namespace cache" table, used to map string namespaces (used in the code) to integer IDs # The "namespace cache" table, used to map string namespaces (used in the code) to integer IDs
# (used in the database). # (used in the database).
CREATE TABLE namespaces ( CREATE TABLE namespaces (
nsid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, nsid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # namespace ID
namespace VARCHAR(255) BINARY NOT NULL, namespace VARCHAR(255) BINARY NOT NULL, # the actual namespace
UNIQUE INDEX on_namespace (namespace) UNIQUE INDEX on_namespace (namespace)
); );
# The global properties table. # The global properties table.
CREATE TABLE globalprop ( CREATE TABLE globalprop (
nsid INT NOT NULL, nsid INT NOT NULL, # namespace ID of property
prop_name VARCHAR(255) BINARY NOT NULL, prop_name VARCHAR(255) BINARY NOT NULL, # name of the property
prop_value VARCHAR(255), prop_value VARCHAR(255), # property value
PRIMARY KEY (nsid, prop_name) PRIMARY KEY (nsid, prop_name)
); );
# The global "blocks" table, used to store fragments of text/HTML for later use. # The global "blocks" table, used to store fragments of text/HTML for later use.
CREATE TABLE globalblock ( CREATE TABLE globalblock (
nsid INT NOT NULL, nsid INT NOT NULL, # namespace ID of block
block_name VARCHAR(255) BINARY NOT NULL, block_name VARCHAR(255) BINARY NOT NULL, # name of block
block TEXT, block TEXT, # actual block (64K text)
PRIMARY KEY (nsid, block_name) PRIMARY KEY (nsid, block_name)
); );
# The main user information table. # The main user information table.
CREATE TABLE users ( CREATE TABLE users (
uid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, uid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # user ID
username VARCHAR(64) NOT NULL, username VARCHAR(64) NOT NULL, # user name
email VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, # E-mail address
is_anon TINYINT DEFAULT 0, is_anon TINYINT DEFAULT 0, # is this the "anonymous" user?
locked TINYINT DEFAULT 0, locked TINYINT DEFAULT 0, # is this user account locked?
nospam TINYINT DEFAULT 0, nospam TINYINT DEFAULT 0, # if 1, do not include this user in any mass mailings
created DATETIME NOT NULL, created DATETIME NOT NULL, # date user was created
last_accessed DATETIME, last_accessed DATETIME, # date user last logged in
UNIQUE INDEX on_username (username) UNIQUE INDEX on_username (username)
); );
@ -68,117 +68,115 @@ CREATE TABLE users (
# and name, and provide "source data" to allow multiple sources for the same type of # and name, and provide "source data" to allow multiple sources for the same type of
# authentication (such as browser cookies for multiple browsers). # authentication (such as browser cookies for multiple browsers).
CREATE TABLE userauth ( CREATE TABLE userauth (
uid INT NOT NULL, uid INT NOT NULL, # user ID
nsid INT NOT NULL, nsid INT NOT NULL, # namespace ID of authentication method
method VARCHAR(255) BINARY NOT NULL, method VARCHAR(255) BINARY NOT NULL, # name of authentication method
source_data VARCHAR(255), source_data VARCHAR(255), # source data for authentication method
auth_data VARCHAR(255), auth_data VARCHAR(255), # authentication data
PRIMARY KEY (uid, nsid, method) PRIMARY KEY (uid, nsid, method)
); );
# The user properties table. # The user properties table.
CREATE TABLE userprop ( CREATE TABLE userprop (
uid INT NOT NULL, uid INT NOT NULL, # user ID
nsid INT NOT NULL, nsid INT NOT NULL, # namespace ID of property
prop_name VARCHAR(255) BINARY NOT NULL, prop_name VARCHAR(255) BINARY NOT NULL, # name of property
prop_value VARCHAR(255), prop_value VARCHAR(255), # property value
PRIMARY KEY (uid, nsid, prop_name) PRIMARY KEY (uid, nsid, prop_name)
); );
# The groups table. # The groups table.
CREATE TABLE groups ( CREATE TABLE groups (
gid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, gid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # group ID
groupname VARCHAR(64) NOT NULL, groupname VARCHAR(64) NOT NULL, # name of group
gaclid INT NOT NULL DEFAULT -1, gaclid INT NOT NULL DEFAULT -1, # ACL ID for the group
UNIQUE INDEX on_groupname (groupname) UNIQUE INDEX on_groupname (groupname)
); );
# The group membership table. # The group membership table.
CREATE TABLE groupmembers ( CREATE TABLE groupmembers (
gid INT NOT NULL, gid INT NOT NULL, # ID of group
uid INT NOT NULL, uid INT NOT NULL, # ID of user that is a member
PRIMARY KEY (gid, uid), PRIMARY KEY (gid, uid),
UNIQUE INDEX reverse_index (uid, gid) UNIQUE INDEX reverse_index (uid, gid)
); );
# The group properties table. # The group properties table.
CREATE TABLE groupprop ( CREATE TABLE groupprop (
gid INT NOT NULL, gid INT NOT NULL, # ID of group
nsid INT NOT NULL, nsid INT NOT NULL, # namespace ID for property
prop_name VARCHAR(255) BINARY NOT NULL, prop_name VARCHAR(255) BINARY NOT NULL, # name of property
prop_value VARCHAR(255), prop_value VARCHAR(255), # property value
PRIMARY KEY (gid, nsid, prop_name) PRIMARY KEY (gid, nsid, prop_name)
); );
# The main ACL table. Each ACL has a numeric ID, a name, an unordered collection of owners (which may # The main ACL table. Each ACL has a numeric ID, a name, an unordered collection of owners (which may
# be groups or users), and an ordered collection of entries (ACEs). # be groups or users), and an ordered collection of entries (ACEs).
CREATE TABLE acl ( CREATE TABLE acl (
aclid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, aclid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # ID of the ACL
aclname VARCHAR(255) NOT NULL, aclname VARCHAR(255) NOT NULL, # name of the ACL
INDEX on_name (aclname) INDEX on_name (aclname)
); );
# The table of owners for ACLs. Each ACL has one or more owners. # The table of owners for ACLs. Each ACL has one or more owners.
# Flags Bit 0: 0=user, 1=group
CREATE TABLE aclowner ( CREATE TABLE aclowner (
aclid INT NOT NULL, aclid INT NOT NULL, # ID of the ACL
ownerid INT NOT NULL, ownerid INT NOT NULL, # ID of the owner
flags TINYINT NOT NULL, flags TINYINT NOT NULL, # Flags Bit 0: 0=user, 1=group
INDEX on_acl (aclid) INDEX on_acl (aclid)
); );
# The table mapping ACLs to ACEs. Each ACL has zero or more ACEs. # The table mapping ACLs to ACEs. Each ACL has zero or more ACEs.
CREATE TABLE acldata ( CREATE TABLE acldata (
aclid INT NOT NULL, aclid INT NOT NULL, # ID of the ACL
seq INT NOT NULL, seq INT NOT NULL, # sequence of this ACE
aceid INT NOT NULL, aceid INT NOT NULL, # ID of the corresponding ACE
PRIMARY KEY (aclid, seq) PRIMARY KEY (aclid, seq)
); );
# The main ACE table. Each ACE has a numeric ID, a principal reference (which may be a user or # The main ACE table. Each ACE has a numeric ID, a principal reference (which may be a user or
# group ID), a "negative" flag, and an unordered collection of permissions. # group ID), a "negative" flag, and an unordered collection of permissions.
# Flags Bit 0: 0=user, 1=group
# Flags Bit 4: 0=positive ACE, 1=negative ACE
CREATE TABLE ace ( CREATE TABLE ace (
aceid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, aceid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # ID of this ACE
pri INT, pri INT, # Principal reference
flags TINYINT NOT NULL DEFAULT 0 flags TINYINT NOT NULL DEFAULT 0 # Flags Bit 0: 0=user, 1=group
# Flags Bit 4: 0=positive ACE, 1=negative ACE
); );
# The table mapping permissions into ACEs. Permissions are identified by namespace and name. # The table mapping permissions into ACEs. Permissions are identified by namespace and name.
CREATE TABLE acedata ( CREATE TABLE acedata (
aceid INT NOT NULL, aceid INT NOT NULL, # ID of this ACE
perm_nsid INT NOT NULL, perm_nsid INT NOT NULL, # namespace ID of permission
perm_name VARCHAR(255) BINARY NOT NULL, perm_name VARCHAR(255) BINARY NOT NULL, # name of permission
INDEX on_ace (aceid) INDEX on_ace (aceid)
); );
# Global security data table. # Global security data table. This table has only one row.
CREATE TABLE globalsec ( CREATE TABLE globalsec (
admin_uid INT NOT NULL, admin_uid INT NOT NULL, # administrator UID
admin_gid INT NOT NULL, admin_gid INT NOT NULL, # GID of administrators group
global_aclid INT NOT NULL, global_aclid INT NOT NULL, # ACLID of global ACL
alluser_gid INT NOT NULL, alluser_gid INT NOT NULL, # GID of "all users" GID
verified_gid INT NOT NULL verified_gid INT NOT NULL # GID of "verified users" GID
); );
# The audit information table. Each audit "event" can have up to 8 properties defined with it, # The audit information table. Each audit "event" can have up to 8 properties defined with it,
# which are serialized as other "properties." # which are serialized as other "properties."
CREATE TABLE audit ( CREATE TABLE audit (
record BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, record BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, # audit record ID
on_date DATETIME NOT NULL, on_date DATETIME NOT NULL, # date stamp of audit record
event INT NOT NULL, event INT NOT NULL, # event ID
uid INT NOT NULL, uid INT NOT NULL, # user ID of responsible user
subid INT NOT NULL DEFAULT 0, subid INT NOT NULL DEFAULT 0, # "sub ID" (often community ID)
ip VARCHAR(48), ip VARCHAR(48), # IP address of source
prop0 VARCHAR(255), prop0 VARCHAR(255), # event property
prop1 VARCHAR(255), prop1 VARCHAR(255), # event property
prop2 VARCHAR(255), prop2 VARCHAR(255), # event property
prop3 VARCHAR(255), prop3 VARCHAR(255), # event property
prop4 VARCHAR(255), prop4 VARCHAR(255), # event property
prop5 VARCHAR(255), prop5 VARCHAR(255), # event property
prop6 VARCHAR(255), prop6 VARCHAR(255), # event property
prop7 VARCHAR(255), prop7 VARCHAR(255), # event property
INDEX by_date (on_date), INDEX by_date (on_date),
INDEX sub_view (subid, on_date) INDEX sub_view (subid, on_date)
); );
@ -187,82 +185,127 @@ CREATE TABLE audit (
# to cut down on space usage in the audit table. Event IDs can be predefined # to cut down on space usage in the audit table. Event IDs can be predefined
# at database create time, or defined dynamically, or both. # at database create time, or defined dynamically, or both.
CREATE TABLE auditevent ( CREATE TABLE auditevent (
eventid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, eventid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # event ID
event_nsid INT NOT NULL, event_nsid INT NOT NULL, # namespace ID of event
event_name VARCHAR(255) BINARY NOT NULL, event_name VARCHAR(255) BINARY NOT NULL, # event name
descr TINYTEXT, descr TINYTEXT, # event description
UNIQUE INDEX by_event (event_nsid, event_name) UNIQUE INDEX by_event (event_nsid, event_name)
); );
# The image store table. This is used to store relatively small images like # The image store table. This is used to store relatively small images like
# user photos and logos. # user photos and logos.
CREATE TABLE imagestore ( CREATE TABLE imagestore (
imageid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, imageid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # image ID
typecode INT NOT NULL, typecode INT NOT NULL, # image type code
ownerid INT NOT NULL, ownerid INT NOT NULL, # who owns it?
ownerflag TINYINT NOT NULL DEFAULT 0, ownerflag TINYINT NOT NULL DEFAULT 0, # owner: user or group?
mimetype VARCHAR(128), mimetype VARCHAR(128), # MIME type of image
length INT, length INT, # length of image in bytes
data MEDIUMBLOB data MEDIUMBLOB # image data (max 16 Mb)
); );
# The image type table, used to differentiate between images stored in the table. # The image type table, used to differentiate between images stored in the table.
CREATE TABLE imagetype ( CREATE TABLE imagetype (
typecode INT NOT NULL PRIMARY KEY AUTO_INCREMENT, typecode INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # image type code
nsid INT NOT NULL, nsid INT NOT NULL, # image type namespace ID
name VARCHAR(255) BINARY NOT NULL name VARCHAR(255) BINARY NOT NULL # image type name
); );
#### following this line are Venice-specific tables #### #### following this line are Venice-specific tables ####
# The table which defines menus. # The table which defines menus.
CREATE TABLE menus ( CREATE TABLE menus (
menuid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, menuid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # menu ID
menu_nsid INT NOT NULL, menu_nsid INT NOT NULL, # namespace ID of menu name
menu_name VARCHAR(255) BINARY NOT NULL, menu_name VARCHAR(255) BINARY NOT NULL, # name of menu
title VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, # menu title
subtitle VARCHAR(255) NULL, subtitle VARCHAR(255) NULL, # menu subtitle
UNIQUE INDEX by_name (menu_nsid, menu_name) UNIQUE INDEX by_name (menu_nsid, menu_name)
); );
# Definitions of variables for menus. # Definitions of variables for menus.
CREATE TABLE menuvars ( CREATE TABLE menuvars (
menuid INT NOT NULL, menuid INT NOT NULL, # menu ID
var_name VARCHAR(255) NOT NULL, var_name VARCHAR(255) NOT NULL, # name of variable
default_val VARCHAR(255) NULL, default_val VARCHAR(255) NULL, # default value of variable
PRIMARY KEY (menuid, var_name) PRIMARY KEY (menuid, var_name)
); );
# Definitions of menu items. # Definitions of menu items.
CREATE TABLE menuitems ( CREATE TABLE menuitems (
menuid INT NOT NULL, menuid INT NOT NULL, # menu ID
sequence INT NOT NULL, sequence INT NOT NULL, # sequence of menu item
itemtype VARCHAR(32) NOT NULL, itemtype VARCHAR(32) NOT NULL, # menu item type
enable TINYINT NOT NULL DEFAULT 1, enable TINYINT NOT NULL DEFAULT 1, # enable this menu item?
indent INT NOT NULL DEFAULT 0, indent INT NOT NULL DEFAULT 0, # indent level of menu item
text VARCHAR(255) NULL, text VARCHAR(255) NULL, # text of menu item
linktype VARCHAR(32) NULL, linktype VARCHAR(32) NULL, # link type to use with menu item
link VARCHAR(255) NULL, link VARCHAR(255) NULL, # link for menu item
target VARCHAR(255) NULL, target VARCHAR(255) NULL, # target frame for menu item
title VARCHAR(255) NULL, title VARCHAR(255) NULL, # menu item title
on_click VARCHAR(255) NULL, on_click VARCHAR(255) NULL, # menu item onClick= property
perm_nsid INT NULL, perm_nsid INT NULL, # you must have this permission (namespace ID)
perm_name VARCHAR(255) BINARY NULL, perm_name VARCHAR(255) BINARY NULL, # you must have this permission (name)
ifdef_var VARCHAR(255) NULL, ifdef_var VARCHAR(255) NULL, # show item if this variable is defined
ifndef_var VARCHAR(255) NULL, ifndef_var VARCHAR(255) NULL, # show item if this variable is not defined
PRIMARY KEY (menuid, sequence) PRIMARY KEY (menuid, sequence)
); );
# The table mapping category IDs to category names. # The table mapping category IDs to category names.
CREATE TABLE refcategory ( CREATE TABLE refcategory (
catid INT NOT NULL PRIMARY KEY, catid INT NOT NULL PRIMARY KEY, # category ID
parent INT NOT NULL, parent INT NOT NULL, # parent category
symlink INT NOT NULL, symlink INT NOT NULL, # if this is a symlink, what category does it link to?
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL, # category name
dontuse TINYINT DEFAULT 0, dontuse TINYINT DEFAULT 0, # 1 if this is a deprecated category
UNIQUE INDEX display (parent, name) UNIQUE INDEX display (parent, name)
); );
# The master communities table.
CREATE TABLE communities (
cid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, # community ID
member_gid INT NOT NULL, # group ID representing community members
host_gid INT NOT NULL, # group ID representing community hosts
host_uid INT NOT NULL, # UID of host
aclid INT NOT NULL, # community ACL ID
catid INT NOT NULL DEFAULT 0, # community category ID (xref to "refcategory" table)
hide_dir TINYINT NOT NULL DEFAULT 0, # do we want to hide community from directory?
hide_search TINYINT NOT NULL DEFAULT 0, # do we want to hide community from searches?
name VARCHAR(128) NOT NULL, # community name
alias VARCHAR(32) NOT NULL, # community alias
createdate DATETIME NOT NULL, # creation date/time
lastaccess DATETIME, # last access date/time
lastupdate DATETIME, # last update date/time
INDEX by_name (name),
UNIQUE INDEX by_alias (alias),
INDEX by_catdate (catid, createdate),
INDEX by_create (createdate),
INDEX by_catname (catid, name)
);
# Community access table, which dictates if a community is public or private and the way people
# have to authenticate to join it.
CREATE TABLE commaccess (
cid INT NOT NULL, # the community ID
ugid INT NOT NULL, # user or group ID
is_group TINYINT NOT NULL, # 1 if this is a group, 0 if a user
single_use TINYINT NOT NULL DEFAULT 0, # if 1, this will be removed after a join
auth_nsid INT NULL, # authenticator namespace ID (NULL for none)
auth_name VARCHAR(255) BINARY NULL, # authenticator name (NULL for none)
source_data VARCHAR(255), # authenticator source data
auth_data VARCHAR(255), # authentication data
PRIMARY KEY (cid, is_group, ugid)
);
# The community properties table.
CREATE TABLE commprops (
cid INT NOT NULL, # community ID
nsid INT NOT NULL, # namespace ID of property
prop_name VARCHAR(255) BINARY NOT NULL, # name of property
prop_value VARCHAR(255), # property value
PRIMARY KEY (cid, nsid, prop_name)
);
############################################################################## ##############################################################################
# Set table access rights # Set table access rights
############################################################################## ##############################################################################

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