THE GREAT RENAMING! All that was "SIG" should now be "community," except for
the database and the URLs (for backward compatibility). Do a full rebuild after browsing this one!
This commit is contained in:
@@ -6,9 +6,10 @@ Frequently-Asked Questions about Venice (*)
|
||||
Q: What is Venice?
|
||||
A: The Venice Web Community System is a system for supporting online
|
||||
communities and special interest groups. A single Venice server will
|
||||
support multiple SIGs, and all users authenticating themselves with the
|
||||
Venice server will be able to join any SIG based on that server. SIGs
|
||||
will support features like Web conferencing, chat, and instant messaging.
|
||||
support multiple communities, and all users authenticating themselves with
|
||||
the Venice server will be able to join any community based on that server.
|
||||
Communities will support features like Web conferencing, chat, and instant
|
||||
messaging.
|
||||
|
||||
Q: Aren't there already conferencing packages out there?
|
||||
A: Yes, and some of them are very good. However, Venice is being designed
|
||||
@@ -83,6 +84,16 @@ A: Not at all. Some of the design structures are similar to CommunityWare,
|
||||
with a more self-consistent one. As time goes on, Venice will continue
|
||||
to incorporate features that distinguish it from the original WebbMe.
|
||||
|
||||
Q: What was up with the whole "SIGs" nomenclature?
|
||||
A: That was one of the ways I was trying to differentiate myself from
|
||||
CommunityWare and WebbMe. However, the terminology ("Special Interest
|
||||
Group") turned out to be too cumbersome. Besides, as of November 2001,
|
||||
Webb Interactive is out of that business, and indeed out of all business but
|
||||
Jabber.com Inc. Therefore, I reversed myself on November 7, 2001 ("The Day
|
||||
of The Great Renaming") and they're now called "Communities" everywhere.
|
||||
(With two exceptions; the database and the URL generation, both for backward
|
||||
compatibility.)
|
||||
|
||||
Q: Did WebbMe have instant messaging, too?
|
||||
A: Yes, it did. The original CommunityWare instant messaging and chat was
|
||||
based on code derived from Durand's earlier MindWire product. It was later
|
||||
|
||||
@@ -8,16 +8,16 @@ SourceForge Home: <http://sourceforge.net/projects/venice/>
|
||||
Description:
|
||||
The Venice Web Communities System is a system for supporting online
|
||||
communities and special interest groups. A single Venice server will
|
||||
support multiple SIGs, and all users authenticating themselves with the
|
||||
Venice server will be able to join any SIG based on that server.
|
||||
support multiple communities, and all users authenticating themselves with
|
||||
the Venice server will be able to join any community based on that server.
|
||||
|
||||
SIGs support multiple features, the first of which will be Web-based linear
|
||||
conferencing (along the lines of WellEngaged, UBB, and other conferencing
|
||||
systems). Features to be added thereafter include instant messaging and
|
||||
chat (which will be based on the Jabber open-source instant-messaging
|
||||
system), calendars, link directories, e-mail newsletters, and possibly
|
||||
advanced features such as collaborative databases and content creation/
|
||||
publishing.
|
||||
Communities support multiple features, the first of which will be Web-based
|
||||
linear conferencing (along the lines of WellEngaged, UBB, and other
|
||||
conferencing systems). Features to be added thereafter include instant
|
||||
messaging and chat (which will be based on the Jabber open-source
|
||||
instant-messaging system), calendars, link directories, e-mail newsletters,
|
||||
and possibly advanced features such as collaborative databases and content
|
||||
creation/publishing.
|
||||
|
||||
Implementation:
|
||||
Venice is written in Java using Java Servlet and JSP technologies, and
|
||||
|
||||
@@ -36,8 +36,8 @@ Lots!
|
||||
|
||||
- <SiteHelp.3.38>: move topics from one conf to another?
|
||||
|
||||
- Unimplemented functions on the SIG Administration page:
|
||||
Set SIG Features (sigadmin, command=F)
|
||||
- Unimplemented functions on the Community Administration page:
|
||||
Set Community Features (sigadmin, command=F)
|
||||
|
||||
- Unimplemented functions in the system admin menu:
|
||||
Set Global Parameters
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CATEGORY SYSTEM FOR VENICE SIGS
|
||||
CATEGORY SYSTEM FOR VENICE COMMUNITIES
|
||||
(Based on the Mozilla Open Directory Project category system)
|
||||
|
||||
Arts
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<OL>
|
||||
<LI>A replacement for the CommunityWare/WebbMe conferencing system</LI>
|
||||
<LI>Java/JSP/servlets implementation running under Apache Tomcat, MySQL backend</LI>
|
||||
<LI>Multiple SIGs (communities) hosted per server, each with multiple conferences
|
||||
(and other features); users logged into one server can join multiple SIGs</LI>
|
||||
<LI>Multiple communities hosted per server, each with multiple conferences
|
||||
(and other features); users logged into one server can join multiple communities</LI>
|
||||
<LI>Conferencing functionality similar to CW/WebbMe:
|
||||
<UL>
|
||||
<LI>Linear topics composed of HTML messages</LI>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<EM>Eric J. Bowersox <<A HREF="mailto:erbo@silcom.com">erbo@silcom.com</A>> -
|
||||
January 26, 2001</EM><P>
|
||||
|
||||
Venice identifiers are used for user IDs, SIG aliases, and conference aliases (and maybe other unique
|
||||
Venice identifiers are used for user IDs, community aliases, and conference aliases (and maybe other unique
|
||||
identifiers in the future). A valid Venice ID consists of characters from the following character set
|
||||
only:
|
||||
<UL>
|
||||
|
||||
+28
-27
@@ -109,7 +109,7 @@
|
||||
"high band" security level refers to someone who exercises administrative control over that scope
|
||||
(and therefore all scopes greater than or "inside" it). Objects which are logically "enclosed" by
|
||||
other objects have a higher scope value; for instance, a conference would have a higher scope value
|
||||
than a SIG, which in turn would have a higher scope value than 0 (the "global" scope).<P>
|
||||
than a community, which in turn would have a higher scope value than 0 (the "global" scope).<P>
|
||||
The values 65000-65535 are not used, except that the value 65500 is defined as "no access" (something
|
||||
not even the global system administrator can touch). Neither are the values 32000-32999, except that
|
||||
the value 32500 is defined as "unrestricted user" (lying above the low bands of all scopes but below
|
||||
@@ -122,34 +122,34 @@
|
||||
<LI>64000 - Assistant administrator accounts ("PFY" level)</LI>
|
||||
<LI>64999 - Global system administrator ("BOFH" level)</LI>
|
||||
</UL><P>
|
||||
SIGs use the scope level 3; the following values are defined within that scope:
|
||||
Communities use the scope level 3; the following values are defined within that scope:
|
||||
<UL>
|
||||
<LI>6500 - SIG member</LI>
|
||||
<LI>58000 - SIG co-host</LI>
|
||||
<LI>58500 - SIG host</LI>
|
||||
<LI>6500 - Community member</LI>
|
||||
<LI>58000 - Community co-host</LI>
|
||||
<LI>58500 - Community host</LI>
|
||||
</UL><P>
|
||||
Within SIGs, conferences use scope 6; the following values are defined within that scope:
|
||||
Within communities, conferences use scope 6; the following values are defined within that scope:
|
||||
<UL>
|
||||
<LI>12500 - Conference member (for private conferences)</LI>
|
||||
<LI>52500 - Conference host</LI>
|
||||
</UL><P>
|
||||
Each user has a "base access" level, within scope 0, that is stored in the "users" table. Each SIG
|
||||
Each user has a "base access" level, within scope 0, that is stored in the "users" table. Each community
|
||||
has four defined access levels associated with it:
|
||||
<UL>
|
||||
<LI><B>Read level</B> - minimum access level required to read the SIG's data. This is commonly 6500
|
||||
(must be a member) but may be lower for special cases.</LI>
|
||||
<LI><B>Write level</B> - minimum access level required to write the SIG's data. Since this refers to
|
||||
the SIG itself, this is commonly 58000 (hosts/co-hosts only)</LI>
|
||||
<LI><B>Create level</B> - minimum access level required to create new objects in the SIG. Typically
|
||||
58000 (hosts/co-hosts only).</LI>
|
||||
<LI><B>Delete level</B> - minimum access level required to delete the SIG. Typically 58500 (host
|
||||
<LI><B>Read level</B> - minimum access level required to read the community's data. This is commonly
|
||||
6500 (must be a member) but may be lower for special cases.</LI>
|
||||
<LI><B>Write level</B> - minimum access level required to write the community's data. Since this
|
||||
refers to the community itself, this is commonly 58000 (hosts/co-hosts only)</LI>
|
||||
<LI><B>Create level</B> - minimum access level required to create new objects in the community.
|
||||
Typically 58000 (hosts/co-hosts only).</LI>
|
||||
<LI><B>Delete level</B> - minimum access level required to delete the community. Typically 58500 (host
|
||||
only).</LI>
|
||||
</UL><P>
|
||||
The "sigmember" table maps UIDs to SIGIDs, adding a "granted level" field that specifies a given user's
|
||||
access level within the SIG itself. (If a user already has a higher access level than the "granted"
|
||||
access level, as in the case of the global sysadmin, the higher level takes precedence.) Note that
|
||||
this level grant is within the context of <EM>that SIG only,</EM> and does not affect access privileges
|
||||
to any other SIG.<P>
|
||||
The "sigmember" table maps UIDs to community IDs, adding a "granted level" field that specifies a given
|
||||
user's access level within the community itself. (If a user already has a higher access level than the
|
||||
"granted" access level, as in the case of the global sysadmin, the higher level takes precedence.) Note
|
||||
that this level grant is within the context of <EM>that community only,</EM> and does not affect access
|
||||
privileges to any other community.<P>
|
||||
Each conference has seven defined access levels associated with it:
|
||||
<UL>
|
||||
<LI><B>Read level</B> - minimum access level required to read the posts. Commonly 6500 (member of
|
||||
@@ -165,15 +165,16 @@
|
||||
<LI><B>Change level</B> - minimum access level required to change the conference's profile or
|
||||
membership list. Commonly 52500 (conference hosts only).</LI>
|
||||
<LI><B>Delete level</B> - minimum access level required to delete the conference. Commonly 58000
|
||||
(hosts/cohosts of the enclosing SIG only).</LI>
|
||||
(hosts/cohosts of the enclosing community only).</LI>
|
||||
</UL><P>
|
||||
As with SIGs, there is a "confmember" table that maps UIDs to CONFIDs, adding a "granted level" field
|
||||
that grants additional access privileges. (There is also a field in the table that maps conferences
|
||||
into SIGs that allows a SIG to grant its users additional privileges within a conference. Normally,
|
||||
this field is 0, and so it "drops out" of the calculation of access levels.) Note that, if a user has
|
||||
no membership entry for a conference, the entry for the conference's enclosing SIG takes precedence,
|
||||
or the base level if there is no entry in any enclosing SIG. Also note that a grant of level for a
|
||||
conference or SIG only applies with respect to <EM>that</EM> conference or SIG, not any other.<P>
|
||||
As with communities, there is a "confmember" table that maps UIDs to CONFIDs, adding a "granted level"
|
||||
field that grants additional access privileges. (There is also a field in the table that maps
|
||||
conferences into communities that allows a community to grant its users additional privileges within a
|
||||
conference. Normally, this field is 0, and so it "drops out" of the calculation of access levels.) Note
|
||||
that, if a user has no membership entry for a conference, the entry for the conference's enclosing
|
||||
community takes precedence, or the base level if there is no entry in any enclosing community. Also
|
||||
note that a grant of level for a conference or community only applies with respect to <EM>that</EM>
|
||||
conference or community, not any other.<P>
|
||||
Additional scopes and levels will be defined for additional objects as they are added to Venice.<P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -136,7 +136,7 @@ Text of this agreement is TBD.
|
||||
<!-- Menu definitions for the base page -->
|
||||
<menu-definitions>
|
||||
|
||||
<!-- Definition for the "top" menu (when not in a SIG) -->
|
||||
<!-- Definition for the "top" menu (when not in a community) -->
|
||||
<menudef id="top">
|
||||
<header>Front Page</header>
|
||||
<menuitem>
|
||||
@@ -151,7 +151,7 @@ Text of this agreement is TBD.
|
||||
</menuitem>
|
||||
</menudef>
|
||||
|
||||
<!-- Definition for the "fixed" menu (always displayed under the "top" or "SIG" menus) -->
|
||||
<!-- Definition for the "fixed" menu (always displayed under the "top" or "community" menus) -->
|
||||
<menudef id="fixed">
|
||||
<header>About This Site</header>
|
||||
<menuitem>
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
<sidebox-config>
|
||||
|
||||
<sidebox id="1">
|
||||
<title>Your SIGs</title>
|
||||
<anon-title>Featured SIGs</anon-title>
|
||||
<factory-class>com.silverwrist.venice.servlets.format.sideboxes.SIGBox</factory-class>
|
||||
<null-msg>You are not a member of any SIGs.</null-msg>
|
||||
<title>Your Communities</title>
|
||||
<anon-title>Featured Communities</anon-title>
|
||||
<factory-class>com.silverwrist.venice.servlets.format.sideboxes.CommunityBox</factory-class>
|
||||
<null-msg>You are not a member of any communities.</null-msg>
|
||||
<manage-link>Manage</manage-link>
|
||||
<create-new-link>Create New</create-new-link>
|
||||
<bullet width="14" height="14" fixup="true">purple-ball.gif</bullet>
|
||||
|
||||
+24
-24
@@ -157,51 +157,51 @@ IMMEDIATELY.
|
||||
|
||||
<password-change-subject>Venice Password Changed</password-change-subject>
|
||||
|
||||
<!-- Invitation message to a public SIG -->
|
||||
<!-- Parameters: signame = name of SIG, sigalias = alias of SIG, personal = personal message,
|
||||
fullname = name of inviter, username = user name of inviter -->
|
||||
<!-- Invitation message to a public community -->
|
||||
<!-- Parameters: community.name = name of community, community.alias = alias of community,
|
||||
personal = personal message, fullname = name of inviter,
|
||||
username = user name of inviter -->
|
||||
<invite-public>
|
||||
<![CDATA[
|
||||
Hi! I would like to invite you to join the "${signame}" Special Interest Group (SIG) on the Venice
|
||||
conferencing system. To do so, you must register as a user, which is absolutely free! Just point
|
||||
your Web browser at <http://delenn/venice/sig/${sigalias}> and click the "Create Account" link
|
||||
at the top of the page, or click the "Log In" link if you already have a Venice account. Once you have
|
||||
completed the process, click the "Join Now" button. You will then be able to take part in the conferences
|
||||
that are going on in the SIG.
|
||||
Hi! I would like to invite you to join the "${community.name}" community on the Venice conferencing system.
|
||||
To do so, you must register as a user, which is absolutely free! Just point your Web browser at
|
||||
<http://delenn/venice/sig/${community.alias}> and click the "Create Account" link at the top of the page,
|
||||
or click the "Log In" link if you already have a Venice account. Once you have completed the process,
|
||||
click the "Join Now" button. You will then be able to take part in the conferences that are going on in
|
||||
the community.
|
||||
|
||||
${personal}
|
||||
|
||||
Hope to see you in "${signame}" soon!
|
||||
Hope to see you in "${community.name}" soon!
|
||||
|
||||
-- ${fullname} (Venice user ID: ${username})
|
||||
]]>
|
||||
</invite-public>
|
||||
|
||||
<!-- Invitation message to a private SIG -->
|
||||
<!-- Parameters: signame = name of SIG, sigalias = alias of SIG, joinkey = join key for SIG,
|
||||
personal = personal message, fullname = name of inviter,
|
||||
username = user name of inviter -->
|
||||
<!-- Invitation message to a private community -->
|
||||
<!-- Parameters: community.name = name of community, community.alias = alias of community,
|
||||
joinkey = join key for community, personal = personal message,
|
||||
fullname = name of inviter, username = user name of inviter -->
|
||||
<invite-private>
|
||||
<![CDATA[
|
||||
Hi! I would like to invite you to join the "${signame}" Special Interest Group (SIG) on the Venice
|
||||
conferencing system. To do so, you must register as a user, which is absolutely free! Just point
|
||||
your Web browser at <http://delenn/venice/sig/${sigalias}> and click the "Create Account" link
|
||||
at the top of the page, or click the "Log In" link if you already have a Venice account. Once you have
|
||||
completed the process, click the "Join Now" button. You will be prompted for the "password" for this
|
||||
SIG, which is "${joinkey}". You will then be able to take part in the conferences that are going on in the
|
||||
SIG.
|
||||
Hi! I would like to invite you to join the "${community.name}" community on the Venice conferencing system.
|
||||
To do so, you must register as a user, which is absolutely free! Just point your Web browser at
|
||||
<http://delenn/venice/sig/${community.alias}> and click the "Create Account" link at the top of the page,
|
||||
or click the "Log In" link if you already have a Venice account. Once you have completed the process,
|
||||
click the "Join Now" button. You will be prompted for the "password" for this community, which is
|
||||
"${joinkey}". You will then be able to take part in the conferences that are going on in the community.
|
||||
|
||||
${personal}
|
||||
|
||||
Hope to see you in "${signame}" soon!
|
||||
Hope to see you in "${community.name}" soon!
|
||||
|
||||
-- ${fullname} (Venice user ID: ${username})
|
||||
]]>
|
||||
</invite-private>
|
||||
|
||||
<!-- Subject line for invitation messages -->
|
||||
<!-- Parameters: signame = name of SIG -->
|
||||
<subj-invite>Invitation to "${signame}" SIG</subj-invite>
|
||||
<!-- Parameters: community.name = name of community -->
|
||||
<subj-invite>Invitation to "${community.name}" Community</subj-invite>
|
||||
|
||||
</messages>
|
||||
|
||||
|
||||
+17
-17
@@ -110,36 +110,36 @@
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>sigfrontend</servlet-name>
|
||||
<servlet-name>communityfrontend</servlet-name>
|
||||
<description>
|
||||
The "front end" for SIG display; it redirects the user to whatever page has
|
||||
been defined as the "default" for that SIG.
|
||||
The "front end" for community display; it redirects the user to whatever page has
|
||||
been defined as the "default" for that community.
|
||||
</description>
|
||||
<servlet-class>com.silverwrist.venice.servlets.SIGFrontEnd</servlet-class>
|
||||
<servlet-class>com.silverwrist.venice.servlets.CommunityFrontEnd</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>sigprofile</servlet-name>
|
||||
<servlet-name>communityprofile</servlet-name>
|
||||
<description>
|
||||
Displays the profile for a given SIG.
|
||||
Displays the profile for a given community.
|
||||
</description>
|
||||
<servlet-class>com.silverwrist.venice.servlets.SIGProfile</servlet-class>
|
||||
<servlet-class>com.silverwrist.venice.servlets.CommunityProfile</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>sigadmin</servlet-name>
|
||||
<servlet-name>communityadmin</servlet-name>
|
||||
<description>
|
||||
SIG administration functions.
|
||||
Community administration functions.
|
||||
</description>
|
||||
<servlet-class>com.silverwrist.venice.servlets.SIGAdmin</servlet-class>
|
||||
<servlet-class>com.silverwrist.venice.servlets.CommunityAdmin</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>sigoperations</servlet-name>
|
||||
<servlet-name>communityoperations</servlet-name>
|
||||
<description>
|
||||
General SIG operations.
|
||||
General community operations.
|
||||
</description>
|
||||
<servlet-class>com.silverwrist.venice.servlets.SIGOperations</servlet-class>
|
||||
<servlet-class>com.silverwrist.venice.servlets.CommunityOperations</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
@@ -282,22 +282,22 @@
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>sigfrontend</servlet-name>
|
||||
<servlet-name>communityfrontend</servlet-name>
|
||||
<url-pattern>/sig/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>sigprofile</servlet-name>
|
||||
<servlet-name>communityprofile</servlet-name>
|
||||
<url-pattern>/sigprofile</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>sigadmin</servlet-name>
|
||||
<servlet-name>communityadmin</servlet-name>
|
||||
<url-pattern>/sigadmin</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>sigoperations</servlet-name>
|
||||
<servlet-name>communityoperations</servlet-name>
|
||||
<url-pattern>/sigops</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface AuditData extends Audit
|
||||
|
||||
public abstract int getUID();
|
||||
|
||||
public abstract int getSIGID();
|
||||
public abstract int getCommunityID();
|
||||
|
||||
public abstract String getIPAddress();
|
||||
|
||||
@@ -42,6 +42,6 @@ public interface AuditData extends Audit
|
||||
|
||||
public abstract String getUserName();
|
||||
|
||||
public abstract String getSIGName();
|
||||
public abstract String getCommunityName();
|
||||
|
||||
} // end interface AuditData
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
+7
-7
@@ -21,13 +21,13 @@ import java.util.BitSet;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface SIGContext extends SearchMode
|
||||
public interface CommunityContext extends SearchMode
|
||||
{
|
||||
public static final int HIDE_NONE = 0;
|
||||
public static final int HIDE_DIRECTORY = 1;
|
||||
public static final int HIDE_BOTH = 2;
|
||||
|
||||
public abstract int getSIGID();
|
||||
public abstract int getCommunityID();
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
@@ -37,7 +37,7 @@ public interface SIGContext extends SearchMode
|
||||
|
||||
public abstract boolean isAdmin();
|
||||
|
||||
public abstract boolean isPublicSIG();
|
||||
public abstract boolean isPublicCommunity();
|
||||
|
||||
public abstract int getCategoryID();
|
||||
|
||||
@@ -69,7 +69,7 @@ public interface SIGContext extends SearchMode
|
||||
|
||||
public abstract void setFeatures(BitSet feature_set, BitSet mask) throws DataException, AccessError;
|
||||
|
||||
public abstract List getSIGFeaturesList();
|
||||
public abstract List getCommunityFeaturesList();
|
||||
|
||||
public abstract String getDefaultApplet();
|
||||
|
||||
@@ -116,11 +116,11 @@ public interface SIGContext extends SearchMode
|
||||
public abstract void setSecurityLevels(int read, int write, int create, int delete, int join)
|
||||
throws DataException, AccessError;
|
||||
|
||||
public abstract boolean canAdministerSIG();
|
||||
public abstract boolean canAdministerCommunity();
|
||||
|
||||
public abstract boolean canModifyProfile();
|
||||
|
||||
public abstract boolean isAdminSIG();
|
||||
public abstract boolean isAdminCommunity();
|
||||
|
||||
public abstract void join(String joinkey) throws DataException, AccessError;
|
||||
|
||||
@@ -171,4 +171,4 @@ public interface SIGContext extends SearchMode
|
||||
|
||||
public abstract int getAuditRecordCount() throws AccessError, DataException;
|
||||
|
||||
} // end interface SIGContext
|
||||
} // end interface CommunityContext
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package com.silverwrist.venice.core;
|
||||
|
||||
public interface SIGFeature
|
||||
public interface CommunityFeature
|
||||
{
|
||||
public abstract int getFeatureCode();
|
||||
|
||||
@@ -29,4 +29,4 @@ public interface SIGFeature
|
||||
|
||||
public abstract int getSequence();
|
||||
|
||||
} // end interface SIGFeature
|
||||
} // end interface CommunityFeature
|
||||
@@ -90,9 +90,9 @@ public interface ConferenceContext
|
||||
|
||||
public abstract void removeMember(int uid) throws DataException, AccessError;
|
||||
|
||||
public abstract int getSIGGrantedLevel() throws DataException, AccessError;
|
||||
public abstract int getCommunityGrantedLevel() throws DataException, AccessError;
|
||||
|
||||
public abstract void setSIGGrantedLevel(int new_level) throws DataException, AccessError;
|
||||
public abstract void setCommunityGrantedLevel(int new_level) throws DataException, AccessError;
|
||||
|
||||
public abstract short getSequence() throws DataException, AccessError;
|
||||
|
||||
@@ -147,7 +147,7 @@ public interface ConferenceContext
|
||||
|
||||
public abstract boolean canAddToHotlist();
|
||||
|
||||
public abstract SIGContext getEnclosingSIG();
|
||||
public abstract CommunityContext getEnclosingCommunity();
|
||||
|
||||
public abstract void removeFromHotlist() throws DataException;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -117,7 +117,7 @@ public interface ContactInfo
|
||||
|
||||
public abstract int getOwnerUID();
|
||||
|
||||
public abstract int getOwnerSIGID();
|
||||
public abstract int getOwnerCommunityID();
|
||||
|
||||
public abstract Date getLastUpdate();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -19,9 +19,9 @@ package com.silverwrist.venice.core;
|
||||
|
||||
public interface SearchMode
|
||||
{
|
||||
public static final int FIELD_SIG_NAME = 0;
|
||||
public static final int FIELD_COMMUNITY_NAME = 0;
|
||||
|
||||
public static final int FIELD_SIG_SYNOPSIS = 1;
|
||||
public static final int FIELD_COMMUNITY_SYNOPSIS = 1;
|
||||
|
||||
public static final int FIELD_USER_NAME = 2;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -54,38 +54,39 @@ public interface UserContext extends SearchMode
|
||||
|
||||
public abstract void setDescription(String new_descr) throws DataException;
|
||||
|
||||
public abstract List getMemberSIGs() throws DataException;
|
||||
public abstract List getMemberCommunities() throws DataException;
|
||||
|
||||
public abstract SIGContext getSIGContext(int sigid) throws DataException;
|
||||
public abstract CommunityContext getCommunityContext(int cid) throws DataException;
|
||||
|
||||
public abstract SIGContext getSIGContext(String alias) throws DataException;
|
||||
public abstract CommunityContext getCommunityContext(String alias) throws DataException;
|
||||
|
||||
public abstract List getRootCategoryList() throws DataException;
|
||||
|
||||
public abstract CategoryDescriptor getCategoryDescriptor(int catid) throws DataException;
|
||||
|
||||
public abstract List searchForSIGs(int field, int mode, String term, int offset, int count)
|
||||
public abstract List searchForCommunities(int field, int mode, String term, int offset, int count)
|
||||
throws DataException;
|
||||
|
||||
public abstract int getSearchSIGCount(int field, int mode, String term) throws DataException;
|
||||
public abstract int getSearchCommunityCount(int field, int mode, String term) throws DataException;
|
||||
|
||||
public abstract List getSIGsInCategory(int catid, int offset, int count) throws DataException;
|
||||
public abstract List getCommunitiesInCategory(int catid, int offset, int count) throws DataException;
|
||||
|
||||
public abstract List getSIGsInCategory(CategoryDescriptor cat, int offset, int count) throws DataException;
|
||||
public abstract List getCommunitiesInCategory(CategoryDescriptor cat, int offset, int count)
|
||||
throws DataException;
|
||||
|
||||
public abstract int getNumSIGsInCategory(int catid) throws DataException;
|
||||
public abstract int getNumCommunitiesInCategory(int catid) throws DataException;
|
||||
|
||||
public abstract int getNumSIGsInCategory(CategoryDescriptor cat) throws DataException;
|
||||
public abstract int getNumCommunitiesInCategory(CategoryDescriptor cat) throws DataException;
|
||||
|
||||
public abstract List searchForCategories(int mode, String term, int offset, int count) throws DataException;
|
||||
|
||||
public abstract int getSearchCategoryCount(int mode, String term) throws DataException;
|
||||
|
||||
public abstract SIGContext createSIG(String name, String alias, String language, String synopsis,
|
||||
String rules, String joinkey, int hide_mode)
|
||||
public abstract CommunityContext createCommunity(String name, String alias, String language, String synopsis,
|
||||
String rules, String joinkey, int hide_mode)
|
||||
throws DataException, AccessError;
|
||||
|
||||
public abstract boolean canCreateSIG();
|
||||
public abstract boolean canCreateCommunity();
|
||||
|
||||
public abstract List getSideBoxList() throws DataException;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface VeniceEngine extends SearchMode
|
||||
public abstract UserContext createNewAccount(String remote_addr, String username, String password,
|
||||
String reminder) throws DataException, AccessError;
|
||||
|
||||
public abstract boolean aliasExists(String alias, int exist_sigid);
|
||||
public abstract boolean aliasExists(String alias, int exist_cid);
|
||||
|
||||
public abstract boolean isValidCategoryID(int catid);
|
||||
|
||||
@@ -73,7 +73,7 @@ public interface VeniceEngine extends SearchMode
|
||||
|
||||
public abstract int getMaxNumConferenceMembersDisplay();
|
||||
|
||||
public abstract int getMaxNumSIGMembersDisplay();
|
||||
public abstract int getMaxNumCommunityMembersDisplay();
|
||||
|
||||
public abstract List getMasterSideBoxList();
|
||||
|
||||
|
||||
@@ -338,9 +338,9 @@ class AdminUserContextImpl implements AdminUserContext
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("putContactInfo() for UID " + uid);
|
||||
|
||||
if ((ci.getOwnerUID()!=uid) || (ci.getOwnerSIGID()>=0))
|
||||
if ((ci.getOwnerUID()!=uid) || (ci.getOwnerCommunityID()>=0))
|
||||
{ // the contact information is not owned correctly
|
||||
logger.error("ContactInfo ownership wrong (it's " + ci.getOwnerUID() + ", " + ci.getOwnerSIGID()
|
||||
logger.error("ContactInfo ownership wrong (it's " + ci.getOwnerUID() + ", " + ci.getOwnerCommunityID()
|
||||
+ "), should be (" + uid + ", -1)");
|
||||
throw new DataException("invalid contact information record");
|
||||
|
||||
|
||||
+23
-23
@@ -26,14 +26,14 @@ import com.silverwrist.venice.db.*;
|
||||
import com.silverwrist.venice.core.DataException;
|
||||
import com.silverwrist.venice.core.InternalStateError;
|
||||
|
||||
class BackgroundSIGPurge implements Runnable
|
||||
class BackgroundCommunityPurge implements Runnable
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(BackgroundSIGPurge.class.getName());
|
||||
private static Category logger = Category.getInstance(BackgroundCommunityPurge.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
@@ -43,7 +43,7 @@ class BackgroundSIGPurge implements Runnable
|
||||
private EngineBackend engine;
|
||||
private DataPool datapool;
|
||||
private UserBackend user;
|
||||
private int sigid;
|
||||
private int cid;
|
||||
private int num_confs;
|
||||
private int max_confid;
|
||||
private ReferenceCache conf_refcache;
|
||||
@@ -53,13 +53,13 @@ class BackgroundSIGPurge implements Runnable
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
BackgroundSIGPurge(EngineBackend engine, DataPool datapool, UserBackend user, int sigid, int num_confs,
|
||||
int max_confid, ReferenceCache conf_refcache)
|
||||
BackgroundCommunityPurge(EngineBackend engine, DataPool datapool, UserBackend user, int cid, int num_confs,
|
||||
int max_confid, ReferenceCache conf_refcache)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.datapool = datapool;
|
||||
this.user = user;
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
this.num_confs = num_confs;
|
||||
this.max_confid = max_confid;
|
||||
this.conf_refcache = conf_refcache;
|
||||
@@ -74,7 +74,7 @@ class BackgroundSIGPurge implements Runnable
|
||||
public void run()
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("BackgroundSIGPurge running on SIG #" + sigid);
|
||||
logger.debug("BackgroundCommunityPurge running on community #" + cid);
|
||||
|
||||
Connection conn = null; // pooled database connection
|
||||
ParallelRunQueue rq = new ParallelRunQueue(2);
|
||||
@@ -85,23 +85,23 @@ class BackgroundSIGPurge implements Runnable
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
// run some "lower priority" deletes
|
||||
stmt.executeUpdate("DELETE FROM contacts WHERE owner_sigid = " + sigid + ";");
|
||||
stmt.executeUpdate("DELETE FROM sigftrs WHERE sigid = " + sigid + ";");
|
||||
stmt.executeUpdate("DELETE FROM sigban WHERE sigid = " + sigid + ";");
|
||||
stmt.executeUpdate("DELETE FROM contacts WHERE owner_sigid = " + cid + ";");
|
||||
stmt.executeUpdate("DELETE FROM sigftrs WHERE sigid = " + cid + ";");
|
||||
stmt.executeUpdate("DELETE FROM sigban WHERE sigid = " + cid + ";");
|
||||
|
||||
// look up all conference IDs in this SIG
|
||||
// look up all conference IDs in this community
|
||||
int[] conf_ids = new int[num_confs];
|
||||
StringBuffer sql = new StringBuffer("SELECT confid FROM sigtoconf WHERE sigid = ");
|
||||
sql.append(sigid).append(" AND confid <= ").append(max_confid).append(" ORDER BY confid;");
|
||||
sql.append(cid).append(" AND confid <= ").append(max_confid).append(" ORDER BY confid;");
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
int conferences = 0;
|
||||
while (rs.next())
|
||||
conf_ids[conferences++] = rs.getInt(1);
|
||||
|
||||
for (int i=0; i<conferences; i++)
|
||||
{ // look to see if there's a conference SIG object first
|
||||
{ // look to see if there's a conference community object first
|
||||
Integer key = new Integer(conf_ids[i]);
|
||||
ConferenceSIGContext confobj = (ConferenceSIGContext)(conf_refcache.get(key));
|
||||
ConferenceCommunityContext confobj = (ConferenceCommunityContext)(conf_refcache.get(key));
|
||||
if (confobj!=null)
|
||||
{ // OK, there's an object - do the delete internally and release the object
|
||||
conf_refcache.detach(key);
|
||||
@@ -113,18 +113,18 @@ class BackgroundSIGPurge implements Runnable
|
||||
{ // we need to manually remove the conference ourselves
|
||||
boolean delete_core = true;
|
||||
|
||||
// see if conference is linked to other SIGs - will determine whether we do the core purge
|
||||
// see if conference is linked to other communities - will determine whether we do the core purge
|
||||
// routine
|
||||
sql.setLength(0);
|
||||
sql.append("SELECT sigid FROM sigtoconf WHERE confid = ").append(key).append(" AND sigid <> ");
|
||||
sql.append(sigid).append(" LIMIT 1;");
|
||||
sql.append(cid).append(" LIMIT 1;");
|
||||
rs = stmt.executeQuery(sql.toString());
|
||||
if (rs.next())
|
||||
delete_core = false;
|
||||
|
||||
// delete the sigtoconf record
|
||||
sql.setLength(0);
|
||||
sql.append("DELETE FROM sigtoconf WHERE sigid = ").append(sigid).append(" AND confid = ");
|
||||
sql.append("DELETE FROM sigtoconf WHERE sigid = ").append(cid).append(" AND confid = ");
|
||||
sql.append(key).append(';');
|
||||
|
||||
if (delete_core)
|
||||
@@ -139,7 +139,7 @@ class BackgroundSIGPurge implements Runnable
|
||||
sql.append("SELECT COUNT(*), MAX(topicid) FROM topics WHERE confid = ").append(key).append(';');
|
||||
rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new InternalStateError("BackgroundSIGPurge.run screwup on conference SELECT");
|
||||
throw new InternalStateError("BackgroundCommunityPurge.run screwup on conference SELECT");
|
||||
rq.queue(new BackgroundConferencePurge(engine,datapool,key.intValue(),rs.getInt(1),rs.getInt(2)));
|
||||
|
||||
} // end if (have to delete conference data)
|
||||
@@ -149,18 +149,18 @@ class BackgroundSIGPurge implements Runnable
|
||||
} // end for
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("BackgroundSIGPurge basic delete complete for sig #" + sigid);
|
||||
logger.debug("BackgroundCommunityPurge basic delete complete for community #" + cid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // on an error, just die
|
||||
logger.error("BackgroundSIGPurge FATAL EXCEPTION purging #" + sigid + ": " + e.getMessage(),e);
|
||||
logger.error("BackgroundCommunityPurge FATAL EXCEPTION purging #" + cid + ": " + e.getMessage(),e);
|
||||
return;
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // on an error, just die
|
||||
logger.error("BackgroundSIGPurge FATAL EXCEPTION purging #" + sigid + ": " + de.getMessage(),de);
|
||||
logger.error("BackgroundCommunityPurge FATAL EXCEPTION purging #" + cid + ": " + de.getMessage(),de);
|
||||
return;
|
||||
|
||||
} // end catch
|
||||
@@ -174,8 +174,8 @@ class BackgroundSIGPurge implements Runnable
|
||||
rq.run(); // now run the parallel queue to finish processing
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("BackgroundSIGPurge COMPLETE for sig #" + sigid);
|
||||
logger.debug("BackgroundCommunityPurge COMPLETE for community #" + cid);
|
||||
|
||||
} // end run
|
||||
|
||||
} // end class BackgroundSIGPurge
|
||||
} // end class BackgroundCommunityPurge
|
||||
@@ -486,8 +486,8 @@ class CategoryDescriptorImpl implements CategoryDescriptor, Cloneable
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // turn SQLException into data exception
|
||||
logger.error("DB error reading SIG entries: " + e.getMessage(),e);
|
||||
throw new DataException("unable to retrieve user SIG information: " + e.getMessage(),e);
|
||||
logger.error("DB error reading category entries: " + e.getMessage(),e);
|
||||
throw new DataException("unable to retrieve category information: " + e.getMessage(),e);
|
||||
|
||||
} // end catch
|
||||
finally
|
||||
@@ -554,8 +554,8 @@ class CategoryDescriptorImpl implements CategoryDescriptor, Cloneable
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // turn SQLException into data exception
|
||||
logger.error("DB error reading SIG entries: " + e.getMessage(),e);
|
||||
throw new DataException("unable to retrieve user SIG information: " + e.getMessage(),e);
|
||||
logger.error("DB error reading category entries: " + e.getMessage(),e);
|
||||
throw new DataException("unable to retrieve category information: " + e.getMessage(),e);
|
||||
|
||||
} // end catch
|
||||
finally
|
||||
|
||||
+8
-8
@@ -18,26 +18,26 @@
|
||||
package com.silverwrist.venice.core.impl;
|
||||
|
||||
import com.silverwrist.venice.core.DataException;
|
||||
import com.silverwrist.venice.core.SIGContext;
|
||||
import com.silverwrist.venice.core.CommunityContext;
|
||||
|
||||
public interface SIGBackend extends UserBackend
|
||||
public interface CommunityBackend extends UserBackend
|
||||
{
|
||||
public abstract SIGContext selfSIG();
|
||||
public abstract CommunityContext selfCommunity();
|
||||
|
||||
public abstract int realSIGID();
|
||||
public abstract int realCommunityID();
|
||||
|
||||
public abstract boolean userHideHiddenConferences();
|
||||
|
||||
public abstract int realSIGLevel();
|
||||
public abstract int realCommunityLevel();
|
||||
|
||||
public abstract ConferenceSIGContext getConferenceDataObject(int confid) throws DataException;
|
||||
public abstract ConferenceCommunityContext getConferenceDataObject(int confid) throws DataException;
|
||||
|
||||
public abstract boolean userCanCreateSubobjects();
|
||||
|
||||
public abstract String realSIGAlias();
|
||||
public abstract String realCommunityAlias();
|
||||
|
||||
public abstract void detachConferenceDataObject(int confid) throws DataException;
|
||||
|
||||
public abstract boolean userCanDeleteSubobjects();
|
||||
|
||||
} // end interface SIGBackend
|
||||
} // end interface CommunityBackend
|
||||
+241
-236
File diff suppressed because it is too large
Load Diff
+14
-13
@@ -25,7 +25,7 @@ import com.silverwrist.venice.core.AccessError;
|
||||
import com.silverwrist.venice.core.ContactInfo;
|
||||
import com.silverwrist.venice.core.DataException;
|
||||
|
||||
public interface SIGData extends ReferencedData
|
||||
public interface CommunityData extends ReferencedData
|
||||
{
|
||||
public abstract int getID();
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface SIGData extends ReferencedData
|
||||
|
||||
public abstract String getAlias();
|
||||
|
||||
public abstract boolean isPublicSIG();
|
||||
public abstract boolean isPublicCommunity();
|
||||
|
||||
public abstract int getCategoryID();
|
||||
|
||||
@@ -57,15 +57,15 @@ public interface SIGData extends ReferencedData
|
||||
|
||||
public abstract boolean checkMembership(int level, boolean is_member);
|
||||
|
||||
public abstract boolean canReadSIGSubObjects(int level);
|
||||
public abstract boolean canReadCommunitySubObjects(int level);
|
||||
|
||||
public abstract boolean canModifySIGProfile(int level);
|
||||
public abstract boolean canModifyCommunityProfile(int level);
|
||||
|
||||
public abstract boolean canCreateSIGSubObjects(int level);
|
||||
public abstract boolean canCreateCommunitySubObjects(int level);
|
||||
|
||||
public abstract boolean canDeleteSIG(int level);
|
||||
public abstract boolean canDeleteCommunity(int level);
|
||||
|
||||
public abstract boolean canJoinSIG(int uid, int level);
|
||||
public abstract boolean canJoinCommunity(int uid, int level);
|
||||
|
||||
public abstract void putContactInfo(UserBackend user, ContactInfo ci) throws DataException;
|
||||
|
||||
@@ -73,7 +73,7 @@ public interface SIGData extends ReferencedData
|
||||
|
||||
public abstract void putFeatureSet(UserBackend user, BitSet set) throws DataException;
|
||||
|
||||
public abstract List getSIGFeaturesList(int level);
|
||||
public abstract List getCommunityFeaturesList(int level);
|
||||
|
||||
public abstract String getDefaultApplet();
|
||||
|
||||
@@ -122,7 +122,7 @@ public interface SIGData extends ReferencedData
|
||||
public abstract void setSecurityLevels(UserBackend user, int read, int write, int create, int delete,
|
||||
int join) throws DataException;
|
||||
|
||||
public abstract boolean isAdminSIG();
|
||||
public abstract boolean isAdminCommunity();
|
||||
|
||||
public abstract void setMembership(UserBackend user, int uid, int grant_level, boolean locked,
|
||||
boolean hidden) throws DataException;
|
||||
@@ -131,12 +131,13 @@ public interface SIGData extends ReferencedData
|
||||
|
||||
public abstract boolean isFeaturePresent(String symbol);
|
||||
|
||||
public abstract ConferenceSIGContext getConferenceDataObject(int confid) throws DataException;
|
||||
public abstract ConferenceCommunityContext getConferenceDataObject(int confid) throws DataException;
|
||||
|
||||
public abstract void detachConferenceDataObject(int confid);
|
||||
|
||||
public abstract ConferenceSIGContext createConference(SIGBackend sig, String name, String alias,
|
||||
String description, boolean pvt, boolean hide_list)
|
||||
public abstract ConferenceCommunityContext createConference(CommunityBackend comm, String name, String alias,
|
||||
String description, boolean pvt,
|
||||
boolean hide_list)
|
||||
throws DataException;
|
||||
|
||||
public abstract List searchForMembers(int field, int mode, String term, int offset, int count,
|
||||
@@ -153,4 +154,4 @@ public interface SIGData extends ReferencedData
|
||||
|
||||
public abstract void sweepCache();
|
||||
|
||||
} // end interface SIGData
|
||||
} // end interface CommunityData
|
||||
+3
-3
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
package com.silverwrist.venice.core.impl;
|
||||
|
||||
public interface SIGDataBackend
|
||||
public interface CommunityDataBackend
|
||||
{
|
||||
public abstract int realSIGID();
|
||||
public abstract int realCommunityID();
|
||||
|
||||
} // end interface SIGDataBackend
|
||||
} // end interface CommunityDataBackend
|
||||
+481
-481
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -23,7 +23,7 @@ import java.util.Date;
|
||||
import com.silverwrist.venice.db.PostLinkDecoderContext;
|
||||
import com.silverwrist.venice.core.DataException;
|
||||
|
||||
public interface ConferenceBackend extends SIGBackend
|
||||
public interface ConferenceBackend extends CommunityBackend
|
||||
{
|
||||
public abstract int realConfID();
|
||||
|
||||
|
||||
+12
-12
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
import com.silverwrist.util.rcache.ReferencedData;
|
||||
import com.silverwrist.venice.core.DataException;
|
||||
|
||||
public interface ConferenceSIGContext extends ReferencedData
|
||||
public interface ConferenceCommunityContext extends ReferencedData
|
||||
{
|
||||
public abstract int getConfID();
|
||||
|
||||
@@ -35,7 +35,7 @@ public interface ConferenceSIGContext extends ReferencedData
|
||||
|
||||
public abstract Date getLastUpdateDate();
|
||||
|
||||
public abstract int getSIGGrantedLevel();
|
||||
public abstract int getCommunityGrantedLevel();
|
||||
|
||||
public abstract List getAliases() throws DataException;
|
||||
|
||||
@@ -63,20 +63,20 @@ public interface ConferenceSIGContext extends ReferencedData
|
||||
|
||||
public abstract int getDeleteLevel() throws DataException;
|
||||
|
||||
public abstract void setSecurityLevels(SIGBackend sig, int read, int post, int create, int hide,
|
||||
public abstract void setSecurityLevels(CommunityBackend comm, int read, int post, int create, int hide,
|
||||
int nuke, int change, int delete) throws DataException;
|
||||
|
||||
public abstract void setName(SIGBackend sig, String val) throws DataException;
|
||||
public abstract void setName(CommunityBackend comm, String val) throws DataException;
|
||||
|
||||
public abstract void setDescription(String val) throws DataException;
|
||||
|
||||
public abstract void addAlias(SIGBackend sig, String alias) throws DataException;
|
||||
public abstract void addAlias(CommunityBackend comm, String alias) throws DataException;
|
||||
|
||||
public abstract void removeAlias(SIGBackend sig, String alias) throws DataException;
|
||||
public abstract void removeAlias(CommunityBackend comm, String alias) throws DataException;
|
||||
|
||||
public abstract void setMembership(SIGBackend sig, int uid, int grant_level) throws DataException;
|
||||
public abstract void setMembership(CommunityBackend comm, int uid, int grant_level) throws DataException;
|
||||
|
||||
public abstract void setSIGGrantedLevel(SIGBackend sig, int new_level) throws DataException;
|
||||
public abstract void setCommunityGrantedLevel(CommunityBackend comm, int new_level) throws DataException;
|
||||
|
||||
public abstract short getSequence();
|
||||
|
||||
@@ -84,14 +84,14 @@ public interface ConferenceSIGContext extends ReferencedData
|
||||
|
||||
public abstract boolean getHideList();
|
||||
|
||||
public abstract void setHideList(SIGBackend sig, boolean flag) throws DataException;
|
||||
public abstract void setHideList(CommunityBackend comm, boolean flag) throws DataException;
|
||||
|
||||
public abstract boolean canHideTopics(int level);
|
||||
|
||||
public abstract String getAnAlias() throws DataException;
|
||||
|
||||
public abstract ReturnTopicInfo createNewTopic(SIGBackend sig, String title, String pseud, String body)
|
||||
throws DataException;
|
||||
public abstract ReturnTopicInfo createNewTopic(CommunityBackend comm, String title, String pseud,
|
||||
String body) throws DataException;
|
||||
|
||||
public abstract boolean canScribblePosts(int level);
|
||||
|
||||
@@ -109,4 +109,4 @@ public interface ConferenceSIGContext extends ReferencedData
|
||||
|
||||
public abstract void delete(UserBackend user) throws DataException;
|
||||
|
||||
} // end interface ConferenceSIGContext
|
||||
} // end interface ConferenceCommunityContext
|
||||
+56
-56
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -25,7 +25,7 @@ import com.silverwrist.venice.htmlcheck.*;
|
||||
import com.silverwrist.venice.security.AuditRecord;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
class ConferenceCommunityContextImpl implements ConferenceCommunityContext
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Inner class used to cache locally-important data
|
||||
@@ -71,19 +71,19 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(ConferenceSIGContextImpl.class.getName());
|
||||
private static Category logger = Category.getInstance(ConferenceCommunityContextImpl.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private int refcount = 1; // reference count (within the SIGData)
|
||||
private int refcount = 1; // reference count (within the CommunityData)
|
||||
private EngineBackend engine; // engine object reference
|
||||
private SIGDataBackend sig; // SIG object reference
|
||||
private CommunityDataBackend comm; // community object reference
|
||||
private DataPool datapool; // data pool object
|
||||
private int confid; // ID of this conference
|
||||
private int level; // level granted in conference to members of the SIG
|
||||
private int level; // level granted in conference to members of the community
|
||||
private short sequence; // sequence number this conference appears in list
|
||||
private boolean hide_list; // hide the conference in the list?
|
||||
private ConfCache cache; // cache of locally-important information
|
||||
@@ -95,15 +95,15 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
ConferenceSIGContextImpl(EngineBackend engine, SIGDataBackend sig, DataPool datapool, int confid)
|
||||
throws DataException
|
||||
ConferenceCommunityContextImpl(EngineBackend engine, CommunityDataBackend comm, DataPool datapool,
|
||||
int confid) throws DataException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("new ConferenceSIGContextImpl(#" + String.valueOf(confid) + ") for SIG # "
|
||||
+ String.valueOf(sig.realSIGID()));
|
||||
logger.debug("new ConferenceCommunityContextImpl(#" + String.valueOf(confid) + ") for community # "
|
||||
+ comm.realCommunityID());
|
||||
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.datapool = datapool;
|
||||
this.confid = confid;
|
||||
|
||||
@@ -119,15 +119,15 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
StringBuffer sql =
|
||||
new StringBuffer("SELECT c.createdate, c.name, c.descr, s.granted_lvl, s.sequence, s.hide_list "
|
||||
+ "FROM sigtoconf s, confs c WHERE s.confid = c.confid AND s.sigid = ");
|
||||
sql.append(sig.realSIGID()).append(" AND c.confid = ").append(confid).append(';');
|
||||
sql.append(comm.realCommunityID()).append(" AND c.confid = ").append(confid).append(';');
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
|
||||
// Run that monster query!
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new DataException("conference ID#" + String.valueOf(confid) + " not found in SIG#"
|
||||
+ String.valueOf(sig.realSIGID()));
|
||||
throw new DataException("conference ID#" + confid + " not found in community#"
|
||||
+ comm.realCommunityID());
|
||||
|
||||
// fill in the "cache" and "level" indicators
|
||||
this.cache = new ConfCache(rs.getString(2),rs.getString(3),SQLUtil.getFullDateTime(rs,1));
|
||||
@@ -151,15 +151,15 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end constructor
|
||||
|
||||
ConferenceSIGContextImpl(EngineBackend engine, SIGDataBackend sig, DataPool datapool,
|
||||
short sequence, boolean hide_list, ConferenceData cdata)
|
||||
ConferenceCommunityContextImpl(EngineBackend engine, CommunityDataBackend comm, DataPool datapool,
|
||||
short sequence, boolean hide_list, ConferenceData cdata)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("new ConferenceSIGContextImpl(NEW#" + String.valueOf(confid) + ") for SIG # "
|
||||
+ String.valueOf(sig.realSIGID()));
|
||||
logger.debug("new ConferenceCommunityContextImpl(NEW#" + confid + ") for community # "
|
||||
+ comm.realCommunityID());
|
||||
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.datapool = datapool;
|
||||
this.confid = cdata.getID();
|
||||
this.level = 0;
|
||||
@@ -182,7 +182,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
confdata.rd_release();
|
||||
confdata = null;
|
||||
engine = null;
|
||||
sig = null;
|
||||
comm = null;
|
||||
datapool = null;
|
||||
cache = null;
|
||||
|
||||
@@ -196,7 +196,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
private synchronized ConferenceData getConferenceData() throws DataException
|
||||
{
|
||||
if (confdata==null)
|
||||
{ // attempt to load the ConferenceSIGContext
|
||||
{ // attempt to load the ConferenceCommunityContext
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
confdata = engine.getConferenceDataObject(confid);
|
||||
@@ -213,12 +213,12 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
private synchronized ConferenceData getConferenceDataNE()
|
||||
{
|
||||
if (confdata==null)
|
||||
{ // we need to load the ConferenceSIGContext...
|
||||
{ // we need to load the ConferenceCommunityContext...
|
||||
if (deleted)
|
||||
return null; // no return on deletion
|
||||
|
||||
try
|
||||
{ // attempt to load the ConferenceSIGContext
|
||||
{ // attempt to load the ConferenceCommunityContext
|
||||
confdata = engine.getConferenceDataObject(confid);
|
||||
|
||||
} // end try
|
||||
@@ -268,7 +268,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
} // end rd_getKey
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface ConferenceSIGContext
|
||||
* Implementations from interface ConferenceCommunityContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -324,11 +324,11 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end getLastUpdateDate
|
||||
|
||||
public int getSIGGrantedLevel()
|
||||
public int getCommunityGrantedLevel()
|
||||
{
|
||||
return level;
|
||||
|
||||
} // end getSIGGrantedLevel
|
||||
} // end getCommunityGrantedLevel
|
||||
|
||||
public List getAliases() throws DataException
|
||||
{
|
||||
@@ -432,16 +432,16 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end getDeleteLevel
|
||||
|
||||
public synchronized void setSecurityLevels(SIGBackend sig, int read, int post, int create, int hide,
|
||||
public synchronized void setSecurityLevels(CommunityBackend comm, int read, int post, int create, int hide,
|
||||
int nuke, int change, int delete) throws DataException
|
||||
{
|
||||
getConferenceData().setSecurityLevels(sig,read,post,create,hide,nuke,change,delete);
|
||||
getConferenceData().setSecurityLevels(comm,read,post,create,hide,nuke,change,delete);
|
||||
|
||||
} // end setSecurityLevels
|
||||
|
||||
public synchronized void setName(SIGBackend sig, String val) throws DataException
|
||||
public synchronized void setName(CommunityBackend comm, String val) throws DataException
|
||||
{
|
||||
getConferenceData().setName(sig,val);
|
||||
getConferenceData().setName(comm,val);
|
||||
|
||||
} // end setName
|
||||
|
||||
@@ -451,25 +451,25 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end setDescription
|
||||
|
||||
public synchronized void addAlias(SIGBackend sig, String alias) throws DataException
|
||||
public synchronized void addAlias(CommunityBackend comm, String alias) throws DataException
|
||||
{
|
||||
getConferenceData().addAlias(sig,alias);
|
||||
getConferenceData().addAlias(comm,alias);
|
||||
|
||||
} // end addAlias
|
||||
|
||||
public synchronized void removeAlias(SIGBackend sig, String alias) throws DataException
|
||||
public synchronized void removeAlias(CommunityBackend comm, String alias) throws DataException
|
||||
{
|
||||
getConferenceData().removeAlias(sig,alias);
|
||||
getConferenceData().removeAlias(comm,alias);
|
||||
|
||||
} // end removeAlias
|
||||
|
||||
public synchronized void setMembership(SIGBackend sig, int uid, int grant_level) throws DataException
|
||||
public synchronized void setMembership(CommunityBackend comm, int uid, int grant_level) throws DataException
|
||||
{
|
||||
getConferenceData().setMembership(sig,uid,grant_level);
|
||||
getConferenceData().setMembership(comm,uid,grant_level);
|
||||
|
||||
} // end setMembership
|
||||
|
||||
public synchronized void setSIGGrantedLevel(SIGBackend sig, int new_level) throws DataException
|
||||
public synchronized void setCommunityGrantedLevel(CommunityBackend comm, int new_level) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -484,8 +484,8 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
// create the SQL statement
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("UPDATE sigtoconf SET granted_lvl = ");
|
||||
sql.append(new_level).append(" WHERE sigid = ").append(this.sig.realSIGID()).append(" AND confid = ");
|
||||
sql.append(confid).append(';');
|
||||
sql.append(new_level).append(" WHERE sigid = ").append(this.comm.realCommunityID());
|
||||
sql.append(" AND confid = ").append(confid).append(';');
|
||||
|
||||
// execute the update
|
||||
stmt.executeUpdate(sql.toString());
|
||||
@@ -494,8 +494,8 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
level = new_level;
|
||||
|
||||
// create an audit record reflecting the change
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + String.valueOf(confid));
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -523,7 +523,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end finally
|
||||
|
||||
} // end setSIGGrantedLevel
|
||||
} // end setCommunityGrantedLevel
|
||||
|
||||
public short getSequence()
|
||||
{
|
||||
@@ -545,7 +545,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
// create the SQL statement
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("UPDATE sigtoconf SET sequence = ");
|
||||
sql.append(seq).append(" WHERE sigid = ").append(this.sig.realSIGID()).append(" AND confid = ");
|
||||
sql.append(seq).append(" WHERE sigid = ").append(this.comm.realCommunityID()).append(" AND confid = ");
|
||||
sql.append(confid).append(';');
|
||||
|
||||
// execute the update
|
||||
@@ -576,7 +576,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end getHideList
|
||||
|
||||
public void setHideList(SIGBackend sig, boolean flag) throws DataException
|
||||
public void setHideList(CommunityBackend comm, boolean flag) throws DataException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("setHideList(conf #" + confid + ", " + flag + ")");
|
||||
@@ -605,7 +605,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
// create the SQL statement
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("UPDATE sigtoconf SET hide_list = ");
|
||||
sql.append(flag ? '1' : '0').append(" WHERE sigid = ").append(this.sig.realSIGID());
|
||||
sql.append(flag ? '1' : '0').append(" WHERE sigid = ").append(this.comm.realCommunityID());
|
||||
sql.append(" AND confid = ").append(confid).append(';');
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
@@ -617,8 +617,8 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
hide_list = flag;
|
||||
|
||||
// create an audit record reflecting the change
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + String.valueOf(confid));
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -666,7 +666,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end getAnAlias
|
||||
|
||||
public ReturnTopicInfo createNewTopic(SIGBackend sig, String title, String pseud, String body)
|
||||
public ReturnTopicInfo createNewTopic(CommunityBackend comm, String title, String pseud, String body)
|
||||
throws DataException
|
||||
{
|
||||
ConferenceData d = getConferenceData();
|
||||
@@ -677,7 +677,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
{ // preprocess the body argument through the HTML checker
|
||||
HTMLChecker text_ch = engine.createCheckerObject(engine.HTMLC_POST_BODY);
|
||||
text_ch.setContextValue("PostLinkDecoderContext",
|
||||
new PostLinkDecoderContext(sig.realSIGAlias(),conf_alias,new_topic));
|
||||
new PostLinkDecoderContext(comm.realCommunityAlias(),conf_alias,new_topic));
|
||||
|
||||
try
|
||||
{ // run through the HTML checker
|
||||
@@ -693,7 +693,7 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
try
|
||||
{ // call down to create the new topic!
|
||||
return d.createNewTopic(sig,title,pseud,text_ch.getValue(),text_ch.getLines());
|
||||
return d.createNewTopic(comm,title,pseud,text_ch.getValue(),text_ch.getLines());
|
||||
|
||||
} // end try
|
||||
catch (NotYetFinishedException e)
|
||||
@@ -788,15 +788,15 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
// see if we have to delete the core object as well
|
||||
StringBuffer sql = new StringBuffer("SELECT sigid FROM sigtoconf WHERE confid = ");
|
||||
sql.append(confid).append(" AND sigid <> ").append(sig.realSIGID()).append(" LIMIT 1;");
|
||||
sql.append(confid).append(" AND sigid <> ").append(comm.realCommunityID()).append(" LIMIT 1;");
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (rs.next())
|
||||
delete_core = false; // we don't delete the core yet
|
||||
|
||||
// remove the row that links this conference to this SIG
|
||||
// remove the row that links this conference to this community
|
||||
sql.setLength(0);
|
||||
sql.append("DELETE FROM sigtoconf WHERE confid = ").append(confid).append(" AND sigid = ");
|
||||
sql.append(sig.realSIGID()).append(';');
|
||||
sql.append(comm.realCommunityID()).append(';');
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
// record that we've been deleted
|
||||
@@ -821,8 +821,8 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
} // end finally
|
||||
|
||||
if (delete_core)
|
||||
{ // the conference is not linked to any other SIGs - we need to delete the core as well
|
||||
c.delete(user,sig.realSIGID());
|
||||
{ // the conference is not linked to any other communities - we need to delete the core as well
|
||||
c.delete(user,comm.realCommunityID());
|
||||
engine.detachConferenceDataObject(confid);
|
||||
|
||||
} // end if
|
||||
@@ -833,4 +833,4 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
|
||||
|
||||
} // end delete
|
||||
|
||||
} // end class ConferenceSIGContextImpl
|
||||
} // end class ConferenceCommunityContextImpl
|
||||
@@ -32,7 +32,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(ConferenceCoreData.class.getName());
|
||||
private static Category logger = Category.getInstance(ConferenceCoreData.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
@@ -389,7 +389,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end getDeleteLevel
|
||||
|
||||
public synchronized void setSecurityLevels(SIGBackend sig, int read, int post, int create, int hide,
|
||||
public synchronized void setSecurityLevels(CommunityBackend comm, int read, int post, int create, int hide,
|
||||
int nuke, int change, int delete) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
@@ -425,8 +425,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
last_update = now;
|
||||
|
||||
// create an audit record reflecting the change
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + confid);
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -456,7 +456,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end setSecurityLevels
|
||||
|
||||
public synchronized void setName(SIGBackend sig, String val) throws DataException
|
||||
public synchronized void setName(CommunityBackend comm, String val) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -483,8 +483,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
last_update = now;
|
||||
|
||||
// create an audit record reflecting the change
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + confid);
|
||||
ar = new AuditRecord(AuditRecord.CONF_SECURITY,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -554,7 +554,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end setDescription
|
||||
|
||||
public synchronized void addAlias(SIGBackend sig, String alias) throws DataException
|
||||
public synchronized void addAlias(CommunityBackend comm, String alias) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -598,8 +598,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
// set the database's update date and generate a new audit record
|
||||
touchUpdate(conn);
|
||||
ar = new AuditRecord(AuditRecord.CONF_ALIAS,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + confid,"add=" + alias);
|
||||
ar = new AuditRecord(AuditRecord.CONF_ALIAS,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid,"add=" + alias);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -629,7 +629,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end addAlias
|
||||
|
||||
public synchronized void removeAlias(SIGBackend sig, String alias) throws DataException
|
||||
public synchronized void removeAlias(CommunityBackend comm, String alias) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -686,8 +686,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
touchUpdate(conn);
|
||||
if ((cached_alias!=null) && cached_alias.equals(alias))
|
||||
cached_alias = null; // also release the cached alias and force a re-get
|
||||
ar = new AuditRecord(AuditRecord.CONF_ALIAS,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + confid,"remove=" + alias);
|
||||
ar = new AuditRecord(AuditRecord.CONF_ALIAS,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid,"remove=" + alias);
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -719,7 +719,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end removeAlias
|
||||
|
||||
public synchronized void setMembership(SIGBackend sig, int uid, int grant_level) throws DataException
|
||||
public synchronized void setMembership(CommunityBackend comm, int uid, int grant_level) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -780,8 +780,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
if (did_it)
|
||||
{ // set the database's update date and generate a new audit record
|
||||
touchUpdate(conn);
|
||||
ar = new AuditRecord(AuditRecord.CONF_MEMBERSHIP,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"conf=" + confid,"uid=" + uid,"level=" + grant_level);
|
||||
ar = new AuditRecord(AuditRecord.CONF_MEMBERSHIP,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"conf=" + confid,"uid=" + uid,"level=" + grant_level);
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -861,7 +861,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end getAnAlias
|
||||
|
||||
public synchronized ReturnTopicInfo createNewTopic(SIGBackend sig, String title, String pseud,
|
||||
public synchronized ReturnTopicInfo createNewTopic(CommunityBackend comm, String title, String pseud,
|
||||
String body, int body_lines) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
@@ -888,10 +888,11 @@ class ConferenceCoreData implements ConferenceData
|
||||
// add the topic row to the database
|
||||
StringBuffer sql = new StringBuffer("INSERT INTO topics (confid, num, creator_uid, createdate, "
|
||||
+ "lastupdate, name) VALUES (");
|
||||
sql.append(confid).append(", ").append(new_topic_num).append(", ").append(sig.realUID()).append(", '");
|
||||
sql.append(confid).append(", ").append(new_topic_num).append(", ").append(comm.realUID());
|
||||
creation = new java.util.Date();
|
||||
String now_str = SQLUtil.encodeDate(creation);
|
||||
sql.append(now_str).append("', '").append(now_str).append("', '").append(title).append("');");
|
||||
sql.append(", '").append(now_str).append("', '").append(now_str).append("', '").append(title);
|
||||
sql.append("');");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
stmt.executeUpdate(sql.toString());
|
||||
@@ -905,7 +906,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
// insert the "header" for the "zero post" in the topic
|
||||
sql.setLength(0);
|
||||
sql.append("INSERT INTO posts (topicid, num, linecount, creator_uid, posted, pseud) VALUES (");
|
||||
sql.append(new_topic_id).append(", 0, ").append(body_lines).append(", ").append(sig.realUID());
|
||||
sql.append(new_topic_id).append(", 0, ").append(body_lines).append(", ").append(comm.realUID());
|
||||
sql.append(", '").append(now_str).append("', '").append(pseud).append("');");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
@@ -936,8 +937,9 @@ class ConferenceCoreData implements ConferenceData
|
||||
last_update = creation;
|
||||
|
||||
// create an audit record indicating we were successful
|
||||
ar = new AuditRecord(AuditRecord.CREATE_TOPIC,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"confid=" + confid,"num=" + new_topic_num,"title=" + title);
|
||||
ar = new AuditRecord(AuditRecord.CREATE_TOPIC,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"confid=" + confid,"num=" + new_topic_num,
|
||||
"title=" + title);
|
||||
|
||||
} // end try
|
||||
finally
|
||||
@@ -1160,7 +1162,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
} // end canDeleteConference
|
||||
|
||||
public synchronized void delete(UserBackend user, int the_sigid) throws DataException
|
||||
public synchronized void delete(UserBackend user, int the_cid) throws DataException
|
||||
{
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -1214,7 +1216,7 @@ class ConferenceCoreData implements ConferenceData
|
||||
} // end finally
|
||||
|
||||
// create an audit record indicating we were successful
|
||||
ar = new AuditRecord(AuditRecord.DELETE_CONF,user.realUID(),user.userRemoteAddress(),the_sigid,
|
||||
ar = new AuditRecord(AuditRecord.DELETE_CONF,user.realUID(),user.userRemoteAddress(),the_cid,
|
||||
"confid=" + confid);
|
||||
|
||||
} // end try
|
||||
@@ -1257,9 +1259,9 @@ class ConferenceCoreData implements ConferenceData
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static ReturnConfSeq createConference(EngineBackend engine, SIGBackend sig, DataPool datapool, String name,
|
||||
String alias, String description, boolean pvt, boolean hide_list,
|
||||
int host_uid) throws DataException
|
||||
static ReturnConfSeq createConference(EngineBackend engine, CommunityBackend comm, DataPool datapool,
|
||||
String name, String alias, String description, boolean pvt,
|
||||
boolean hide_list, int host_uid) throws DataException
|
||||
{
|
||||
Connection conn = null; // database connection
|
||||
AuditRecord ar = null; // audit record
|
||||
@@ -1289,7 +1291,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
|
||||
// compute our new sequence number
|
||||
sql.setLength(0);
|
||||
sql.append("SELECT MAX(sequence) FROM sigtoconf WHERE sigid = ").append(sig.realSIGID()).append(';');
|
||||
sql.append("SELECT MAX(sequence) FROM sigtoconf WHERE sigid = ").append(comm.realCommunityID());
|
||||
sql.append(';');
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
rs = stmt.executeQuery(sql.toString());
|
||||
@@ -1327,10 +1330,10 @@ class ConferenceCoreData implements ConferenceData
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
// Link the SIG to the conference by adding a row to sigtoconf.
|
||||
// Link the community to the conference by adding a row to sigtoconf.
|
||||
sql.setLength(0);
|
||||
sql.append("INSERT INTO sigtoconf (sigid, confid, sequence, hide_list) VALUES (");
|
||||
sql.append(sig.realSIGID()).append(", ").append(new_confid).append(", ").append(new_sequence);
|
||||
sql.append(comm.realCommunityID()).append(", ").append(new_confid).append(", ").append(new_sequence);
|
||||
sql.append(", ").append(hide_list ? '1' : '0').append(");");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
@@ -1353,8 +1356,8 @@ class ConferenceCoreData implements ConferenceData
|
||||
} // end finally
|
||||
|
||||
// create an audit record indicating we were successful
|
||||
ar = new AuditRecord(AuditRecord.CREATE_CONF,sig.realUID(),sig.userRemoteAddress(),sig.realSIGID(),
|
||||
"confid=" + new_confid,"name=" + name,"alias=" + alias);
|
||||
ar = new AuditRecord(AuditRecord.CREATE_CONF,comm.realUID(),comm.userRemoteAddress(),
|
||||
comm.realCommunityID(),"confid=" + new_confid,"name=" + name,"alias=" + alias);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
|
||||
@@ -61,25 +61,25 @@ public interface ConferenceData extends ReferencedData
|
||||
|
||||
public abstract int getDeleteLevel();
|
||||
|
||||
public abstract void setSecurityLevels(SIGBackend sig, int read, int post, int create, int hide,
|
||||
public abstract void setSecurityLevels(CommunityBackend comm, int read, int post, int create, int hide,
|
||||
int nuke, int change, int delete) throws DataException;
|
||||
|
||||
public abstract void setName(SIGBackend sig, String val) throws DataException;
|
||||
public abstract void setName(CommunityBackend comm, String val) throws DataException;
|
||||
|
||||
public abstract void setDescription(String val) throws DataException;
|
||||
|
||||
public abstract void addAlias(SIGBackend sig, String alias) throws DataException;
|
||||
public abstract void addAlias(CommunityBackend comm, String alias) throws DataException;
|
||||
|
||||
public abstract void removeAlias(SIGBackend sig, String alias) throws DataException;
|
||||
public abstract void removeAlias(CommunityBackend comm, String alias) throws DataException;
|
||||
|
||||
public abstract void setMembership(SIGBackend sig, int uid, int grant_level) throws DataException;
|
||||
public abstract void setMembership(CommunityBackend comm, int uid, int grant_level) throws DataException;
|
||||
|
||||
public abstract boolean canHideTopics(int level);
|
||||
|
||||
public abstract String getAnAlias() throws DataException;
|
||||
|
||||
public abstract ReturnTopicInfo createNewTopic(SIGBackend sig, String title, String pseud, String body,
|
||||
int body_lines) throws DataException;
|
||||
public abstract ReturnTopicInfo createNewTopic(CommunityBackend comm, String title, String pseud,
|
||||
String body, int body_lines) throws DataException;
|
||||
|
||||
public abstract boolean canScribblePosts(int level);
|
||||
|
||||
@@ -101,6 +101,6 @@ public interface ConferenceData extends ReferencedData
|
||||
|
||||
public abstract boolean canDeleteConference(int level);
|
||||
|
||||
public abstract void delete(UserBackend user, int the_sigid) throws DataException;
|
||||
public abstract void delete(UserBackend user, int the_cid) throws DataException;
|
||||
|
||||
} // end interface ConferenceData
|
||||
|
||||
@@ -163,12 +163,12 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
*/
|
||||
|
||||
private EngineBackend engine; // pointer to the engine back end
|
||||
private SIGBackend sig; // pointer to the SIG back end
|
||||
private CommunityBackend comm; // pointer to the community back end
|
||||
private DataPool datapool; // pointer to the data pool
|
||||
private int confid; // the conference ID
|
||||
private int level; // access level I have within this conference
|
||||
private ConfCache cache; // cached internal data for the conference
|
||||
private ConferenceSIGContext confdata = null; // the internal subobject
|
||||
private ConferenceCommunityContext confdata = null; // the internal subobject
|
||||
private boolean settings_loaded = false; // did we load the settings from the database?
|
||||
private String pseud; // default pseud to use in this conference
|
||||
private java.util.Date last_read; // last date we read this conference
|
||||
@@ -180,32 +180,32 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected ConferenceUserContextImpl(EngineBackend engine, SIGBackend sig, DataPool datapool, int confid,
|
||||
String name, String description, java.util.Date created, int sig_level,
|
||||
int user_level, Connection conn) throws DataException
|
||||
protected ConferenceUserContextImpl(EngineBackend engine, CommunityBackend comm, DataPool datapool,
|
||||
int confid, String name, String description, java.util.Date created,
|
||||
int comm_level, int user_level, Connection conn) throws DataException
|
||||
{
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.datapool = datapool;
|
||||
this.confid = confid;
|
||||
this.cache = new ConfCache(name,description,created,sig_level);
|
||||
this.cache = new ConfCache(name,description,created,comm_level);
|
||||
recalcLevel(user_level);
|
||||
tryLoadSettings(conn);
|
||||
|
||||
} // end constructor
|
||||
|
||||
ConferenceUserContextImpl(EngineBackend engine, SIGBackend sig, DataPool datapool,
|
||||
ConferenceSIGContext cdata) throws DataException
|
||||
ConferenceUserContextImpl(EngineBackend engine, CommunityBackend comm, DataPool datapool,
|
||||
ConferenceCommunityContext cdata) throws DataException
|
||||
{
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.datapool = datapool;
|
||||
this.confid = cdata.getConfID();
|
||||
this.cache = null;
|
||||
cdata.rd_addRef();
|
||||
this.confdata = cdata;
|
||||
recalcLevel(DefaultLevels.hostConference());
|
||||
this.pseud = sig.userDefaultPseud();
|
||||
this.pseud = comm.userDefaultPseud();
|
||||
this.last_read = null;
|
||||
this.last_post = null;
|
||||
|
||||
@@ -221,7 +221,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
if (confdata!=null)
|
||||
confdata.rd_release();
|
||||
engine = null;
|
||||
sig = null;
|
||||
comm = null;
|
||||
datapool = null;
|
||||
cache = null;
|
||||
confdata = null;
|
||||
@@ -233,15 +233,15 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private ConferenceSIGContext getConferenceData() throws DataException
|
||||
private ConferenceCommunityContext getConferenceData() throws DataException
|
||||
{
|
||||
if (confdata==null)
|
||||
{ // attempt to load the ConferenceSIGContext
|
||||
{ // attempt to load the ConferenceCommunityContext
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
confdata = sig.getConferenceDataObject(confid);
|
||||
confdata = comm.getConferenceDataObject(confid);
|
||||
if (confdata!=null)
|
||||
sig.saveMRU("conf",confdata);
|
||||
comm.saveMRU("conf",confdata);
|
||||
|
||||
// clear cache when we get the real confdata
|
||||
cache = null;
|
||||
@@ -252,18 +252,18 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
} // end getConferenceData
|
||||
|
||||
private ConferenceSIGContext getConferenceDataNE()
|
||||
private ConferenceCommunityContext getConferenceDataNE()
|
||||
{
|
||||
if (confdata==null)
|
||||
{ // we need to load the ConferenceSIGContext...
|
||||
{ // we need to load the ConferenceCommunityContext...
|
||||
if (deleted)
|
||||
return null; // no return on deletion
|
||||
|
||||
try
|
||||
{ // attempt to load the ConferenceSIGContext
|
||||
confdata = sig.getConferenceDataObject(confid);
|
||||
{ // attempt to load the ConferenceCommunityContext
|
||||
confdata = comm.getConferenceDataObject(confid);
|
||||
if (confdata!=null)
|
||||
sig.saveMRU("conf",confdata);
|
||||
comm.saveMRU("conf",confdata);
|
||||
|
||||
} // end try
|
||||
catch (DataException e)
|
||||
@@ -284,21 +284,21 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
private void recalcLevel(int new_level)
|
||||
{
|
||||
level = sig.realSIGLevel();
|
||||
level = comm.realCommunityLevel();
|
||||
|
||||
int sig_level = -1;
|
||||
int comm_level = -1;
|
||||
if (cache!=null)
|
||||
sig_level = cache.getGrantsLevel();
|
||||
comm_level = cache.getGrantsLevel();
|
||||
else
|
||||
{ // look at the ConferenceSIGContext to get the SIG level
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
{ // look at the ConferenceCommunityContext to get the community level
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c!=null)
|
||||
sig_level = c.getSIGGrantedLevel();
|
||||
comm_level = c.getCommunityGrantedLevel();
|
||||
|
||||
} // end else
|
||||
|
||||
if (sig_level>level)
|
||||
level = sig_level;
|
||||
if (comm_level>level)
|
||||
level = comm_level;
|
||||
if (new_level>level)
|
||||
level = new_level;
|
||||
|
||||
@@ -313,7 +313,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
{ // look up the conference settings for this user
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT * FROM confsettings WHERE confid = ");
|
||||
sql.append(confid).append(" AND uid = ").append(sig.realUID()).append(';');
|
||||
sql.append(confid).append(" AND uid = ").append(comm.realUID()).append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
|
||||
if (rs.next())
|
||||
@@ -327,7 +327,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
else
|
||||
{ // just default everything
|
||||
settings_loaded = false;
|
||||
pseud = sig.userDefaultPseud();
|
||||
pseud = comm.userDefaultPseud();
|
||||
last_read = null;
|
||||
last_post = null;
|
||||
|
||||
@@ -358,7 +358,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
{
|
||||
if (cache!=null)
|
||||
return cache.getName();
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c!=null)
|
||||
return c.getName();
|
||||
else
|
||||
@@ -370,7 +370,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
{
|
||||
if (cache!=null)
|
||||
return cache.getDescription();
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c!=null)
|
||||
return c.getDescription();
|
||||
else
|
||||
@@ -382,7 +382,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
{
|
||||
if (cache!=null)
|
||||
return cache.getCreated();
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c!=null)
|
||||
return c.getCreationDate();
|
||||
else
|
||||
@@ -392,7 +392,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public java.util.Date getLastUpdateDate()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c!=null)
|
||||
return c.getLastUpdateDate();
|
||||
else
|
||||
@@ -414,7 +414,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canReadConference()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canReadConference(level);
|
||||
@@ -423,7 +423,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canPostToConference()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canPostToConference(level);
|
||||
@@ -432,7 +432,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canCreateTopic()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canCreateTopic(level);
|
||||
@@ -441,7 +441,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canChangeConference()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canChangeConference(level);
|
||||
@@ -592,7 +592,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// Now call through to set the security levels.
|
||||
getConferenceData().setSecurityLevels(sig,read,post,create,hide,nuke,change,delete);
|
||||
getConferenceData().setSecurityLevels(comm,read,post,create,hide,nuke,change,delete);
|
||||
|
||||
} // end setSecurityLevels
|
||||
|
||||
@@ -606,7 +606,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// Call through to set the name.
|
||||
getConferenceData().setName(sig,val);
|
||||
getConferenceData().setName(comm,val);
|
||||
|
||||
} // end setName
|
||||
|
||||
@@ -634,7 +634,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// Call through to add the alias.
|
||||
getConferenceData().addAlias(sig,alias);
|
||||
getConferenceData().addAlias(comm,alias);
|
||||
|
||||
} // end addAlias
|
||||
|
||||
@@ -648,7 +648,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// Call through to remove the alias.
|
||||
getConferenceData().removeAlias(sig,alias);
|
||||
getConferenceData().removeAlias(comm,alias);
|
||||
|
||||
} // end removeAlias
|
||||
|
||||
@@ -662,10 +662,10 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// call down to set the level
|
||||
getConferenceData().setMembership(sig,uid,grant_level);
|
||||
getConferenceData().setMembership(comm,uid,grant_level);
|
||||
|
||||
// If we adjusted our OWN level, reflect that change.
|
||||
if (uid==sig.realUID())
|
||||
if (uid==comm.realUID())
|
||||
recalcLevel(grant_level);
|
||||
|
||||
} // end setMembership
|
||||
@@ -682,38 +682,38 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
} // end removeMember
|
||||
|
||||
public int getSIGGrantedLevel() throws DataException, AccessError
|
||||
public int getCommunityGrantedLevel() throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to retrieve security info");
|
||||
throw new AccessError("You are not permitted to retrieve security information for this conference.");
|
||||
|
||||
} // end if
|
||||
|
||||
return c.getSIGGrantedLevel();
|
||||
return c.getCommunityGrantedLevel();
|
||||
|
||||
} // end getSIGGrantedLevel
|
||||
} // end getCommunityGrantedLevel
|
||||
|
||||
public void setSIGGrantedLevel(int new_level) throws DataException, AccessError
|
||||
public void setCommunityGrantedLevel(int new_level) throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to change security info");
|
||||
throw new AccessError("You are not permitted to change security information for this conference.");
|
||||
|
||||
} // end if
|
||||
|
||||
c.setSIGGrantedLevel(sig,new_level);
|
||||
c.setCommunityGrantedLevel(comm,new_level);
|
||||
|
||||
} // end setSIGGrantedLevel
|
||||
} // end setCommunityGrantedLevel
|
||||
|
||||
public short getSequence() throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to retrieve layout info");
|
||||
throw new AccessError("You are not permitted to retrieve layout information for this conference.");
|
||||
@@ -726,8 +726,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void setSequence(short seq) throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to set layout info");
|
||||
throw new AccessError("You are not permitted to set layout information for this conference.");
|
||||
@@ -740,8 +740,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean getHideList() throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to retrieve security info");
|
||||
throw new AccessError("You are not permitted to retrieve security information for this conference.");
|
||||
@@ -754,15 +754,15 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void setHideList(boolean flag) throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceData();
|
||||
if (!(sig.userCanCreateSubobjects()))
|
||||
ConferenceCommunityContext c = getConferenceData();
|
||||
if (!(comm.userCanCreateSubobjects()))
|
||||
{ // this user can't modify the conference security
|
||||
logger.error("user not permitted to change security info");
|
||||
throw new AccessError("You are not permitted to change security information for this conference.");
|
||||
|
||||
} // end if
|
||||
|
||||
c.setHideList(sig,flag);
|
||||
c.setHideList(comm,flag);
|
||||
|
||||
} // end setHideList
|
||||
|
||||
@@ -774,7 +774,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void setDefaultPseud(String val) throws DataException
|
||||
{
|
||||
if (sig.userIsAnonymous())
|
||||
if (comm.userIsAnonymous())
|
||||
return; // anonymous user can't change pseud
|
||||
if (deleted)
|
||||
throw new DataException("This conference has been deleted.");
|
||||
@@ -790,13 +790,14 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
if (settings_loaded)
|
||||
{ // generate an update statement
|
||||
sql.append("UPDATE confsettings SET default_pseud = '").append(SQLUtil.encodeString(val));
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(sig.realUID()).append(';');
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(comm.realUID());
|
||||
sql.append(';');
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // need to insert a confsettings row
|
||||
sql.append("INSERT INTO confsettings (confid, uid, default_pseud) VALUES (").append(confid);
|
||||
sql.append(", ").append(sig.realUID()).append(", '").append(SQLUtil.encodeString(val)).append("');");
|
||||
sql.append(", ").append(comm.realUID()).append(", '").append(SQLUtil.encodeString(val)).append("');");
|
||||
|
||||
} // end else
|
||||
|
||||
@@ -825,7 +826,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean anyUnread()
|
||||
{
|
||||
if (deleted || sig.userIsAnonymous())
|
||||
if (deleted || comm.userIsAnonymous())
|
||||
return false;
|
||||
Connection conn = null; // pooled database connection
|
||||
|
||||
@@ -842,7 +843,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT t.topicid FROM topics t LEFT JOIN topicsettings s "
|
||||
+ "ON t.topicid = s.topicid AND s.uid = ");
|
||||
sql.append(sig.realUID()).append(" WHERE t.confid = ").append(confid);
|
||||
sql.append(comm.realUID()).append(" WHERE t.confid = ").append(confid);
|
||||
sql.append(" AND t.archived = 0 AND IFNULL(s.hidden,0) = 0 "
|
||||
+ "AND (t.top_message - IFNULL(s.last_message,-1)) > 0 LIMIT 1;");
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -931,7 +932,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
try
|
||||
{ // call down to create the new topic!
|
||||
real_title = title_ch.getValue();
|
||||
new_topic_inf = getConferenceData().createNewTopic(sig,real_title,zp_pseud_ch.getValue(),zp_text);
|
||||
new_topic_inf = getConferenceData().createNewTopic(comm,real_title,zp_pseud_ch.getValue(),zp_text);
|
||||
|
||||
} // end try
|
||||
catch (NotYetFinishedException e)
|
||||
@@ -949,7 +950,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
// create a new record in topicsettings (we WERE the first to post in the topic after all!)
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("INSERT INTO topicsettings (topicid, uid, last_post) VALUES (");
|
||||
sql.append(new_topic_inf.getTopicID()).append(", ").append(sig.realUID()).append(", '");
|
||||
sql.append(new_topic_inf.getTopicID()).append(", ").append(comm.realUID()).append(", '");
|
||||
sql.append(SQLUtil.encodeDate(new_topic_inf.getCreateDate())).append("');");
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
@@ -991,7 +992,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public HTMLChecker getNewTopicPreviewChecker()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
short new_topic;
|
||||
if (c==null)
|
||||
new_topic = 0;
|
||||
@@ -1012,7 +1013,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
} // end if
|
||||
|
||||
if (sig.userIsAnonymous())
|
||||
if (comm.userIsAnonymous())
|
||||
return; // anonymous user can't fixseen
|
||||
|
||||
Connection conn = null;
|
||||
@@ -1031,7 +1032,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
new StringBuffer("SELECT topics.topicid, topics.top_message, ISNULL(topicsettings.last_message) "
|
||||
+ "FROM topics LEFT JOIN topicsettings ON topics.topicid = topicsettings.topicid "
|
||||
+ "AND topicsettings.uid = ");
|
||||
sql.append(sig.realUID()).append(" WHERE topics.confid = ").append(confid).append(';');
|
||||
sql.append(comm.realUID()).append(" WHERE topics.confid = ").append(confid).append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
|
||||
// use the results to build up a list of FixSeenHelpers
|
||||
@@ -1045,7 +1046,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
while (it.hasNext())
|
||||
{ // just hit each one in turn
|
||||
FixSeenHelper fsh = (FixSeenHelper)(it.next());
|
||||
fsh.doFix(stmt,sig.realUID(),now);
|
||||
fsh.doFix(stmt,comm.realUID(),now);
|
||||
|
||||
} // end while
|
||||
|
||||
@@ -1238,8 +1239,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void delete() throws DataException, AccessError
|
||||
{
|
||||
ConferenceSIGContext ctxt = getConferenceData();
|
||||
if (!(ctxt.canDeleteConference(level)) || !(sig.userCanDeleteSubobjects()))
|
||||
ConferenceCommunityContext ctxt = getConferenceData();
|
||||
if (!(ctxt.canDeleteConference(level)) || !(comm.userCanDeleteSubobjects()))
|
||||
{ // no way can we delete this conference, not NO way!
|
||||
logger.error("user not permitted to delete conference");
|
||||
throw new AccessError("You are not permitted to delete this conference.");
|
||||
@@ -1247,8 +1248,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
} // end if
|
||||
|
||||
// call the methods required to delete the conference
|
||||
ctxt.delete(sig);
|
||||
sig.detachConferenceDataObject(confid);
|
||||
ctxt.delete(comm);
|
||||
comm.detachConferenceDataObject(confid);
|
||||
|
||||
// flag that we've been deleted
|
||||
cache = null;
|
||||
@@ -1266,10 +1267,10 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canDeleteConference()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return (c.canDeleteConference(level) && sig.userCanDeleteSubobjects());
|
||||
return (c.canDeleteConference(level) && comm.userCanDeleteSubobjects());
|
||||
|
||||
} // end canDeleteConference
|
||||
|
||||
@@ -1284,8 +1285,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
// do a quickie query
|
||||
StringBuffer sql = new StringBuffer("SELECT sequence FROM confhotlist WHERE uid = ");
|
||||
sql.append(sig.realUID()).append(" AND sigid = ").append(sig.realSIGID()).append(" AND confid = ");
|
||||
sql.append(confid).append(';');
|
||||
sql.append(comm.realUID()).append(" AND sigid = ").append(comm.realCommunityID());
|
||||
sql.append(" AND confid = ").append(confid).append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
return rs.next();
|
||||
|
||||
@@ -1318,15 +1319,15 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
try
|
||||
{ // do a quickie query to see if we're already in the hotlist
|
||||
StringBuffer sql = new StringBuffer("SELECT sequence FROM confhotlist WHERE uid = ");
|
||||
sql.append(sig.realUID()).append(" AND sigid = ").append(sig.realSIGID()).append(" AND confid = ");
|
||||
sql.append(confid).append(';');
|
||||
sql.append(comm.realUID()).append(" AND sigid = ").append(comm.realCommunityID());
|
||||
sql.append(" AND confid = ").append(confid).append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (rs.next())
|
||||
return; // already in hotlist - this is a no-op
|
||||
|
||||
// find a sequence number for the new entry
|
||||
sql.setLength(0);
|
||||
sql.append("SELECT MAX(sequence) FROM confhotlist WHERE uid = ").append(sig.realUID()).append(';');
|
||||
sql.append("SELECT MAX(sequence) FROM confhotlist WHERE uid = ").append(comm.realUID()).append(';');
|
||||
rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new InternalStateError("bogus query result on addToHotlist");
|
||||
@@ -1334,8 +1335,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
// add the new record
|
||||
sql.setLength(0);
|
||||
sql.append("INSERT INTO confhotlist (uid, sequence, sigid, confid) VALUES (").append(sig.realUID());
|
||||
sql.append(", ").append(new_sequence).append(", ").append(sig.realSIGID()).append(", ");
|
||||
sql.append("INSERT INTO confhotlist (uid, sequence, sigid, confid) VALUES (").append(comm.realUID());
|
||||
sql.append(", ").append(new_sequence).append(", ").append(comm.realCommunityID()).append(", ");
|
||||
sql.append(confid).append(");");
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
@@ -1365,17 +1366,17 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean canAddToHotlist()
|
||||
{
|
||||
if (sig.userIsAnonymous())
|
||||
if (comm.userIsAnonymous())
|
||||
return false;
|
||||
return !(isInHotlist());
|
||||
|
||||
} // end canAddToHotlist
|
||||
|
||||
public SIGContext getEnclosingSIG()
|
||||
public CommunityContext getEnclosingCommunity()
|
||||
{
|
||||
return sig.selfSIG();
|
||||
return comm.selfCommunity();
|
||||
|
||||
} // end getEnclosingSIG
|
||||
} // end getEnclosingCommunity
|
||||
|
||||
public void removeFromHotlist() throws DataException
|
||||
{
|
||||
@@ -1389,8 +1390,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
// create the DELETE statement and just execute it blind (if this conference is not in the hotlist,
|
||||
// the DELETE is a no-op).
|
||||
StringBuffer sql = new StringBuffer("DELETE FROM confhotlist WHERE uid = ");
|
||||
sql.append(sig.realUID()).append(" AND sigid = ").append(sig.realSIGID()).append(" AND confid = ");
|
||||
sql.append(confid).append(';');
|
||||
sql.append(comm.realUID()).append(" AND sigid = ").append(comm.realCommunityID());
|
||||
sql.append(" AND confid = ").append(confid).append(';');
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
} // end try
|
||||
@@ -1421,8 +1422,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
// create the UPDATE statement and just execute it blind (if this conference is not in the hotlist,
|
||||
// the UPDATE is a no-op).
|
||||
StringBuffer sql = new StringBuffer("UPDATE confhotlist SET sequence = ");
|
||||
sql.append(seq).append(" WHERE uid = ").append(sig.realUID()).append(" AND sigid = ");
|
||||
sql.append(sig.realSIGID()).append(" AND confid = ").append(confid).append(';');
|
||||
sql.append(seq).append(" WHERE uid = ").append(comm.realUID()).append(" AND sigid = ");
|
||||
sql.append(comm.realCommunityID()).append(" AND confid = ").append(confid).append(';');
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
} // end try
|
||||
@@ -1448,114 +1449,114 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public int realUID()
|
||||
{
|
||||
return sig.realUID();
|
||||
return comm.realUID();
|
||||
|
||||
} // end realUID
|
||||
|
||||
public int realBaseLevel()
|
||||
{
|
||||
return sig.realBaseLevel();
|
||||
return comm.realBaseLevel();
|
||||
|
||||
} // end realBaseLevel
|
||||
|
||||
public String userRemoteAddress()
|
||||
{
|
||||
return sig.userRemoteAddress();
|
||||
return comm.userRemoteAddress();
|
||||
|
||||
} // end userRemoteAddress
|
||||
|
||||
public String userDefaultPseud() throws DataException
|
||||
{
|
||||
return sig.userDefaultPseud();
|
||||
return comm.userDefaultPseud();
|
||||
|
||||
} // end userDefaultPseud
|
||||
|
||||
public boolean userIsAnonymous()
|
||||
{
|
||||
return sig.userIsAnonymous();
|
||||
return comm.userIsAnonymous();
|
||||
|
||||
} // end userIsAnonymous
|
||||
|
||||
public String realUserName()
|
||||
{
|
||||
return sig.realUserName();
|
||||
return comm.realUserName();
|
||||
|
||||
} // end realUserName
|
||||
|
||||
public String realEmailAddress() throws DataException
|
||||
{
|
||||
return sig.realEmailAddress();
|
||||
return comm.realEmailAddress();
|
||||
|
||||
} // end realEmailAddress
|
||||
|
||||
public String realFullName() throws DataException
|
||||
{
|
||||
return sig.realFullName();
|
||||
return comm.realFullName();
|
||||
|
||||
} // end realFullName
|
||||
|
||||
public void saveMRU(String tag, ReferencedData data)
|
||||
{
|
||||
sig.saveMRU(tag,data);
|
||||
comm.saveMRU(tag,data);
|
||||
|
||||
} // end saveMRU
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface SIGBackend
|
||||
* Implementations from interface CommunityBackend
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGContext selfSIG()
|
||||
public CommunityContext selfCommunity()
|
||||
{
|
||||
return sig.selfSIG();
|
||||
return comm.selfCommunity();
|
||||
|
||||
} // end selfsig;
|
||||
} // end selfCommunity
|
||||
|
||||
public int realSIGID()
|
||||
public int realCommunityID()
|
||||
{
|
||||
return sig.realSIGID();
|
||||
return comm.realCommunityID();
|
||||
|
||||
} // end realSIGID
|
||||
} // end realCommunityID
|
||||
|
||||
public boolean userHideHiddenConferences()
|
||||
{
|
||||
return sig.userHideHiddenConferences();
|
||||
return comm.userHideHiddenConferences();
|
||||
|
||||
} // end userHideHiddenConferences
|
||||
|
||||
public int realSIGLevel()
|
||||
public int realCommunityLevel()
|
||||
{
|
||||
return sig.realSIGLevel();
|
||||
return comm.realCommunityLevel();
|
||||
|
||||
} // end realSIGLevel
|
||||
} // end realCommunityLevel
|
||||
|
||||
public ConferenceSIGContext getConferenceDataObject(int confid) throws DataException
|
||||
public ConferenceCommunityContext getConferenceDataObject(int confid) throws DataException
|
||||
{
|
||||
return sig.getConferenceDataObject(confid);
|
||||
return comm.getConferenceDataObject(confid);
|
||||
|
||||
} // end getConferenceDataObject
|
||||
|
||||
public boolean userCanCreateSubobjects()
|
||||
{
|
||||
return sig.userCanCreateSubobjects();
|
||||
return comm.userCanCreateSubobjects();
|
||||
|
||||
} // end userCanCreateSubobjects
|
||||
|
||||
public String realSIGAlias()
|
||||
public String realCommunityAlias()
|
||||
{
|
||||
return sig.realSIGAlias();
|
||||
return comm.realCommunityAlias();
|
||||
|
||||
} // end realSIGAlias
|
||||
} // end realCommunityAlias
|
||||
|
||||
public void detachConferenceDataObject(int confid) throws DataException
|
||||
{
|
||||
sig.detachConferenceDataObject(confid);
|
||||
comm.detachConferenceDataObject(confid);
|
||||
|
||||
} // end detachConferenceDataObject
|
||||
|
||||
public boolean userCanDeleteSubobjects()
|
||||
{
|
||||
return sig.userCanDeleteSubobjects();
|
||||
return comm.userCanDeleteSubobjects();
|
||||
|
||||
} // end userCanDeleteSubobjects
|
||||
|
||||
@@ -1572,7 +1573,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean userCanHide()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canHideTopics(level);
|
||||
@@ -1581,7 +1582,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void touchRead(Connection conn) throws SQLException
|
||||
{
|
||||
if (deleted || sig.userIsAnonymous())
|
||||
if (deleted || comm.userIsAnonymous())
|
||||
return; // anonymous user can't update squat
|
||||
|
||||
Statement stmt = conn.createStatement();
|
||||
@@ -1591,13 +1592,13 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
if (settings_loaded)
|
||||
{ // generate an update statement
|
||||
sql.append("UPDATE confsettings SET last_read = '").append(SQLUtil.encodeDate(now));
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(sig.realUID()).append(';');
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(comm.realUID()).append(';');
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // need to insert a confsettings row
|
||||
sql.append("INSERT INTO confsettings (confid, uid, default_pseud, last_read) VALUES (").append(confid);
|
||||
sql.append(", ").append(sig.realUID()).append(", '").append(SQLUtil.encodeString(pseud)).append("', '");
|
||||
sql.append(", ").append(comm.realUID()).append(", '").append(SQLUtil.encodeString(pseud)).append("', '");
|
||||
sql.append(SQLUtil.encodeDate(now)).append("');");
|
||||
|
||||
} // end else
|
||||
@@ -1613,7 +1614,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public void touchPost(Connection conn, java.util.Date post_date) throws SQLException
|
||||
{
|
||||
if (deleted || sig.userIsAnonymous())
|
||||
if (deleted || comm.userIsAnonymous())
|
||||
return; // anonymous user can't update squat
|
||||
|
||||
Statement stmt = conn.createStatement();
|
||||
@@ -1622,13 +1623,13 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
if (settings_loaded)
|
||||
{ // generate an update statement
|
||||
sql.append("UPDATE confsettings SET last_post = '").append(SQLUtil.encodeDate(post_date));
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(sig.realUID()).append(';');
|
||||
sql.append("' WHERE confid = ").append(confid).append(" AND uid = ").append(comm.realUID()).append(';');
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // need to insert a confsettings row
|
||||
sql.append("INSERT INTO confsettings (confid, uid, default_pseud, last_read) VALUES (").append(confid);
|
||||
sql.append(", ").append(sig.realUID()).append(", '").append(SQLUtil.encodeString(pseud)).append("', '");
|
||||
sql.append(", ").append(comm.realUID()).append(", '").append(SQLUtil.encodeString(pseud)).append("', '");
|
||||
sql.append(SQLUtil.encodeDate(post_date)).append("');");
|
||||
|
||||
} // end else
|
||||
@@ -1663,7 +1664,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean userCanScribble()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canScribblePosts(level);
|
||||
@@ -1672,7 +1673,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public boolean userCanNuke()
|
||||
{
|
||||
ConferenceSIGContext c = getConferenceDataNE();
|
||||
ConferenceCommunityContext c = getConferenceDataNE();
|
||||
if (c==null)
|
||||
return false;
|
||||
return c.canNukePosts(level);
|
||||
@@ -1699,7 +1700,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
public PostLinkDecoderContext createDecoderContext(short topicid)
|
||||
{
|
||||
return new PostLinkDecoderContext(sig.realSIGAlias(),realConfAlias(),topicid);
|
||||
return new PostLinkDecoderContext(comm.realCommunityAlias(),realConfAlias(),topicid);
|
||||
|
||||
} // end createDecoderContext
|
||||
|
||||
@@ -1708,10 +1709,12 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static List getSIGConferences(EngineBackend engine, SIGBackend sig, DataPool datapool) throws DataException
|
||||
static List getCommunityConferences(EngineBackend engine, CommunityBackend comm, DataPool datapool)
|
||||
throws DataException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("getSIGConferences for SIG # " + sig.realSIGID() + ", user #" + sig.realUID());
|
||||
logger.debug("getCommunityConferences for community # " + comm.realCommunityID() + ", user #"
|
||||
+ comm.realUID());
|
||||
ArrayList rc = new ArrayList(); // return from this function
|
||||
Connection conn = null; // pooled database connection
|
||||
|
||||
@@ -1721,17 +1724,18 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
// Build a monster query! The idea is that we get the basic info of all conferences linked to the
|
||||
// SIG, as well as the user level (within the conference) that gets granted to all members of the
|
||||
// linked SIG. (Commonly this is 0; the standard user level within the SIG will then take precedence.)
|
||||
// If the user has an entry within the confmember table for that conference, the level granted by
|
||||
// that entry is also reported. The highest of these two levels and the level of the user within the
|
||||
// SIG is then taken to be the user's access level within the conference.
|
||||
// community, as well as the user level (within the conference) that gets granted to all members of the
|
||||
// linked community. (Commonly this is 0; the standard user level within the community will then take
|
||||
// precedence.) If the user has an entry within the confmember table for that conference, the level
|
||||
// granted by that entry is also reported. The highest of these two levels and the level of the user
|
||||
// within the community is then taken to be the user's access level within the conference.
|
||||
StringBuffer sql =
|
||||
new StringBuffer("SELECT c.confid, c.createdate, c.name, c.descr, s.granted_lvl, m.granted_lvl "
|
||||
+ "FROM sigtoconf s, confs c LEFT JOIN confmember m ON c.confid = m.confid "
|
||||
+ "AND m.uid = ");
|
||||
sql.append(sig.realUID()).append(" WHERE s.confid = c.confid AND s.sigid = ").append(sig.realSIGID());
|
||||
if (sig.userHideHiddenConferences())
|
||||
sql.append(comm.realUID()).append(" WHERE s.confid = c.confid AND s.sigid = ");
|
||||
sql.append(comm.realCommunityID());
|
||||
if (comm.userHideHiddenConferences())
|
||||
sql.append(" AND s.hide_list = 0");
|
||||
sql.append(" ORDER BY s.sequence, c.name;");
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1742,7 +1746,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
while (rs.next())
|
||||
{ // create the appropriate objects to return
|
||||
ConferenceContext cc = new ConferenceUserContextImpl(engine,sig,datapool,rs.getInt(1),rs.getString(3),
|
||||
ConferenceContext cc = new ConferenceUserContextImpl(engine,comm,datapool,rs.getInt(1),rs.getString(3),
|
||||
rs.getString(4),SQLUtil.getFullDateTime(rs,2),
|
||||
rs.getInt(5),rs.getInt(6),conn);
|
||||
rc.add(cc);
|
||||
@@ -1765,13 +1769,14 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
return Collections.unmodifiableList(rc);
|
||||
|
||||
} // end getSIGConferences
|
||||
} // end getCommunityConferences
|
||||
|
||||
static ConferenceContext getConference(EngineBackend engine, SIGBackend sig, DataPool datapool,
|
||||
static ConferenceContext getConference(EngineBackend engine, CommunityBackend comm, DataPool datapool,
|
||||
int confid) throws DataException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("getConference(#" + confid + ") for SIG # " + sig.realSIGID() + ", user #" + sig.realUID());
|
||||
logger.debug("getConference(#" + confid + ") for community # " + comm.realCommunityID() + ", user #"
|
||||
+ comm.realUID());
|
||||
|
||||
Connection conn = null; // pooled database connection
|
||||
|
||||
@@ -1780,24 +1785,25 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
conn = datapool.getConnection();
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
// Build a monster query! This is like the query in getSIGConferences, except that we add the
|
||||
// Build a monster query! This is like the query in getCommunityConferences, except that we add the
|
||||
// conference ID as a search term (thus we can return at most one row).
|
||||
StringBuffer sql =
|
||||
new StringBuffer("SELECT c.createdate, c.name, c.descr, s.granted_lvl, m.granted_lvl "
|
||||
+ "FROM sigtoconf s, confs c LEFT JOIN confmember m ON c.confid = m.confid "
|
||||
+ "AND m.uid = ");
|
||||
sql.append(sig.realUID()).append(" WHERE s.confid = c.confid AND s.sigid = ");
|
||||
sql.append(sig.realSIGID()).append(" AND c.confid = ").append(confid).append(';');
|
||||
sql.append(comm.realUID()).append(" WHERE s.confid = c.confid AND s.sigid = ");
|
||||
sql.append(comm.realCommunityID()).append(" AND c.confid = ").append(confid).append(';');
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
|
||||
// Run that monster query!
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new DataException("conference ID#" + confid + " not found in SIG#" + sig.realSIGID());
|
||||
throw new DataException("conference ID#" + confid + " not found in community#"
|
||||
+ comm.realCommunityID());
|
||||
|
||||
// pass back the new object
|
||||
return new ConferenceUserContextImpl(engine,sig,datapool,confid,rs.getString(2),
|
||||
return new ConferenceUserContextImpl(engine,comm,datapool,confid,rs.getString(2),
|
||||
rs.getString(3),SQLUtil.getFullDateTime(rs,1),
|
||||
rs.getInt(4),rs.getInt(5),conn);
|
||||
|
||||
@@ -1817,12 +1823,12 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
|
||||
} // end getConference
|
||||
|
||||
static ConferenceContext getConference(EngineBackend engine, SIGBackend sig, DataPool datapool,
|
||||
static ConferenceContext getConference(EngineBackend engine, CommunityBackend comm, DataPool datapool,
|
||||
String alias) throws DataException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("getConference(\"" + alias + "\") for SIG # " + sig.realSIGID() + ", user #"
|
||||
+ sig.realUID());
|
||||
logger.debug("getConference(\"" + alias + "\") for community # " + comm.realCommunityID() + ", user #"
|
||||
+ comm.realUID());
|
||||
|
||||
Connection conn = null; // pooled database connection
|
||||
|
||||
@@ -1838,8 +1844,8 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
new StringBuffer("SELECT c.confid, c.createdate, c.name, c.descr, s.granted_lvl, m.granted_lvl "
|
||||
+ "FROM sigtoconf s, confalias a, confs c LEFT JOIN confmember m ON "
|
||||
+ "c.confid = m.confid AND m.uid = ");
|
||||
sql.append(sig.realUID()).append(" WHERE s.confid = c.confid AND a.confid = c.confid AND s.sigid = ");
|
||||
sql.append(sig.realSIGID()).append(" AND a.alias = '").append(SQLUtil.encodeString(alias));
|
||||
sql.append(comm.realUID()).append(" WHERE s.confid = c.confid AND a.confid = c.confid AND s.sigid = ");
|
||||
sql.append(comm.realCommunityID()).append(" AND a.alias = '").append(SQLUtil.encodeString(alias));
|
||||
sql.append("';");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
@@ -1847,10 +1853,11 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
// Run that monster query!
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new DataException("conference \"" + alias + "\" not found in SIG#" + sig.realSIGID());
|
||||
throw new DataException("conference \"" + alias + "\" not found in community#"
|
||||
+ comm.realCommunityID());
|
||||
|
||||
// pass back the new object
|
||||
return new ConferenceUserContextImpl(engine,sig,datapool,rs.getInt(1),rs.getString(3),rs.getString(4),
|
||||
return new ConferenceUserContextImpl(engine,comm,datapool,rs.getInt(1),rs.getString(3),rs.getString(4),
|
||||
SQLUtil.getFullDateTime(rs,2),rs.getInt(5),rs.getInt(6),conn);
|
||||
|
||||
} // end try
|
||||
@@ -1882,7 +1889,7 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
conn = datapool.getConnection();
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
// Build a monster query! We pull the SIGID and ConfID entries from the confhotlist table,
|
||||
// Build a monster query! We pull the CommunityID and ConfID entries from the confhotlist table,
|
||||
// but we need to pull in "confs" and "confmember" (left joined) to get enough data to create
|
||||
// a ConferenceUserContextImpl object.
|
||||
StringBuffer sql =
|
||||
@@ -1898,24 +1905,24 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
|
||||
// Create some temporary data structures to assist us in building the return list.
|
||||
HashMap sig_backend_cache = new HashMap();
|
||||
HashMap comm_backend_cache = new HashMap();
|
||||
|
||||
while (rs.next())
|
||||
{ // retrieve the sigid from the resultset first
|
||||
Integer sigid = new Integer(rs.getInt(1));
|
||||
{ // retrieve the community id from the resultset first
|
||||
Integer cid = new Integer(rs.getInt(1));
|
||||
|
||||
// we need a SIG backend for our conference, so make sure we have one
|
||||
SIGBackend sig = (SIGBackend)(sig_backend_cache.get(sigid));
|
||||
if (sig==null)
|
||||
// we need a community backend for our conference, so make sure we have one
|
||||
CommunityBackend comm = (CommunityBackend)(comm_backend_cache.get(cid));
|
||||
if (comm==null)
|
||||
{ // get it and make sure it's in the cache for next time
|
||||
sig = SIGUserContextImpl.getSIGBackend(engine,user,datapool,conn,sigid.intValue());
|
||||
sig_backend_cache.put(sigid,sig);
|
||||
comm = CommunityUserContextImpl.getCommunityBackend(engine,user,datapool,conn,cid.intValue());
|
||||
comm_backend_cache.put(cid,comm);
|
||||
|
||||
} // end if
|
||||
|
||||
// make the new ConferenceContext
|
||||
ConferenceContext conf =
|
||||
new ConferenceUserContextImpl(engine,sig,datapool,rs.getInt(2),rs.getString(3),rs.getString(4),
|
||||
new ConferenceUserContextImpl(engine,comm,datapool,rs.getInt(2),rs.getString(3),rs.getString(4),
|
||||
SQLUtil.getFullDateTime(rs,5),rs.getInt(6),rs.getInt(7),conn);
|
||||
|
||||
// and create the actual return value
|
||||
|
||||
@@ -130,7 +130,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
private boolean private_fax; // is fax hidden?
|
||||
private boolean private_email; // is email hidden?
|
||||
private int owner_uid; // UID that owns this contact record
|
||||
private int owner_sigid; // SIGID this contact record is in (-1 for none)
|
||||
private int owner_cid; // community ID this contact record is in (-1 for none)
|
||||
private java.util.Date last_update; // date of last update
|
||||
private boolean is_modified = false; // have we modified this ContactInfo?
|
||||
private ImageHook image_hook = null; // image hook object
|
||||
@@ -157,13 +157,13 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
* Constructs a new blank <CODE>ContactInfoImpl</CODE> object.
|
||||
*
|
||||
* @param owner_uid UID that owns this object.
|
||||
* @param owner_sigid SIGID that owns this object.
|
||||
* @param owner_cid Community ID that owns this object.
|
||||
*/
|
||||
ContactInfoImpl(int owner_uid, int owner_sigid)
|
||||
ContactInfoImpl(int owner_uid, int owner_cid)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("new ContactInfoImpl (empty) for UID = " + owner_uid + ", SIGID = " + owner_sigid);
|
||||
makeEmpty(owner_uid,owner_sigid);
|
||||
logger.debug("new ContactInfoImpl (empty) for UID = " + owner_uid + ", Community ID = " + owner_cid);
|
||||
makeEmpty(owner_uid,owner_cid);
|
||||
|
||||
} // end constructor
|
||||
|
||||
@@ -206,7 +206,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private void makeEmpty(int owner_uid, int owner_sigid)
|
||||
private void makeEmpty(int owner_uid, int owner_cid)
|
||||
{
|
||||
this.contactid = -1;
|
||||
this.given_name = null;
|
||||
@@ -232,7 +232,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
this.private_fax = false;
|
||||
this.private_email = false;
|
||||
this.owner_uid = owner_uid;
|
||||
this.owner_sigid = owner_sigid;
|
||||
this.owner_cid = owner_cid;
|
||||
this.last_update = null;
|
||||
|
||||
} // end makeEmpty
|
||||
@@ -273,7 +273,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
private_fax = rs.getBoolean("pvt_fax");
|
||||
private_email = rs.getBoolean("pvt_email");
|
||||
owner_uid = rs.getInt("owner_uid");
|
||||
owner_sigid = rs.getInt("owner_sigid");
|
||||
owner_cid = rs.getInt("owner_sigid");
|
||||
photo_url = rs.getString("photo_url");
|
||||
url = rs.getString("url");
|
||||
last_update = SQLUtil.getFullDateTime(rs,"lastupdate");
|
||||
@@ -587,8 +587,8 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
} // end if
|
||||
else
|
||||
{ // figure out how to create the image hook object
|
||||
if (owner_sigid>=0)
|
||||
image_hook = new NewImageHook(prefix,ImageStore.TYPE_SIG_LOGO,owner_sigid,mimetype,length,data);
|
||||
if (owner_cid>=0)
|
||||
image_hook = new NewImageHook(prefix,ImageStore.TYPE_COMMUNITY_LOGO,owner_cid,mimetype,length,data);
|
||||
else
|
||||
image_hook = new NewImageHook(prefix,ImageStore.TYPE_USER_PHOTO,owner_uid,mimetype,length,data);
|
||||
|
||||
@@ -672,11 +672,11 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
|
||||
} // end getOwnerUID
|
||||
|
||||
public int getOwnerSIGID()
|
||||
public int getOwnerCommunityID()
|
||||
{
|
||||
return owner_sigid;
|
||||
return owner_cid;
|
||||
|
||||
} // end getOwnerSIGID
|
||||
} // end getOwnerCommunityID
|
||||
|
||||
public java.util.Date getLastUpdate()
|
||||
{
|
||||
@@ -754,7 +754,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
} // end if
|
||||
else
|
||||
{ // this involves creating a new record
|
||||
if (owner_sigid>=0)
|
||||
if (owner_cid>=0)
|
||||
stmt.executeUpdate("LOCK TABLES contacts WRITE, sigs WRITE;");
|
||||
else
|
||||
stmt.executeUpdate("LOCK TABLES contacts WRITE, users WRITE;");
|
||||
@@ -788,7 +788,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
buf.append(private_phone ? '1' : '0').append(", ");
|
||||
buf.append(private_fax ? '1' : '0').append(", ");
|
||||
buf.append(private_email ? '1' : '0').append(", ");
|
||||
buf.append(owner_uid).append(", ").append(owner_sigid).append(", ");
|
||||
buf.append(owner_uid).append(", ").append(owner_cid).append(", ");
|
||||
buf.append(SQLUtil.encodeStringArg(photo_url)).append(", ");
|
||||
buf.append(SQLUtil.encodeStringArg(url)).append(", '");
|
||||
update = new java.util.Date();
|
||||
@@ -815,10 +815,10 @@ class ContactInfoImpl implements ContactInfo, Stashable
|
||||
|
||||
// and patch the database table so we know what our contact ID is
|
||||
buf.setLength(0);
|
||||
if (owner_sigid>=0)
|
||||
if (owner_cid>=0)
|
||||
{ // update the SIGS table
|
||||
buf.append("UPDATE sigs SET contactid = ").append(new_contactid).append(" WHERE sigid = ");
|
||||
buf.append(owner_sigid).append(';');
|
||||
buf.append(owner_cid).append(';');
|
||||
|
||||
} // end if
|
||||
else
|
||||
|
||||
@@ -34,11 +34,11 @@ public interface EngineBackend
|
||||
public static final int IP_POSTSPERPAGE = 0;
|
||||
public static final int IP_POSTSATTOP = 1;
|
||||
public static final int IP_MAXSEARCHRETURN = 2;
|
||||
public static final int IP_MAXSIGMEMBERDISPLAY = 3;
|
||||
public static final int IP_MAXCOMMUNITYMEMBERDISPLAY = 3;
|
||||
public static final int IP_MAXCONFMEMBERDISPLAY = 4;
|
||||
public static final int IP_NUMFRONTPAGEPOSTS = 5;
|
||||
public static final int IP_NUMAUDITRECSPERPAGE = 6;
|
||||
public static final int IP_CREATESIGLVL = 7;
|
||||
public static final int IP_CREATECOMMUNITYLVL = 7;
|
||||
public static final int IPC_NUM_PARAMS = 8;
|
||||
|
||||
public abstract SimpleEmailer createEmailer();
|
||||
@@ -51,13 +51,13 @@ public interface EngineBackend
|
||||
|
||||
public abstract String getLanguageNameForCode(String code);
|
||||
|
||||
public abstract SIGData getSIGDataObject(int sigid) throws DataException;
|
||||
public abstract CommunityData getCommunityDataObject(int cid) throws DataException;
|
||||
|
||||
public abstract void detachSIGDataObject(int sigid);
|
||||
public abstract void detachCommunityDataObject(int cid);
|
||||
|
||||
public abstract BitSet getLockedFeaturesMask();
|
||||
|
||||
public abstract List getSIGFeatureSet(BitSet enabled_features, int level, boolean read_privs);
|
||||
public abstract List getCommunityFeatureSet(BitSet enabled_features, int level, boolean read_privs);
|
||||
|
||||
public abstract String getAppletForFeature(int code);
|
||||
|
||||
@@ -65,7 +65,7 @@ public interface EngineBackend
|
||||
|
||||
public abstract BitSet getDefaultFeaturesMask();
|
||||
|
||||
public abstract void registerNewSIG(SIGData sig);
|
||||
public abstract void registerNewCommunity(CommunityData comm);
|
||||
|
||||
public abstract int getFeatureIndexBySymbol(String symbol);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class ImageStore implements BinaryData
|
||||
*/
|
||||
|
||||
public static final short TYPE_USER_PHOTO = 1;
|
||||
public static final short TYPE_SIG_LOGO = 2;
|
||||
public static final short TYPE_COMMUNITY_LOGO = 2;
|
||||
|
||||
private static Category logger = Category.getInstance(ImageStore.class);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -527,7 +527,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
|
||||
// record what we did in an audit record
|
||||
ar = new AuditRecord(AuditRecord.HIDE_MESSAGE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + conf.realConfID() + ",post=" + postid,
|
||||
conf.realCommunityID(),"conf=" + conf.realConfID() + ",post=" + postid,
|
||||
flag ? "hide" : "unhide");
|
||||
|
||||
} // end try
|
||||
@@ -659,7 +659,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
|
||||
// record what we did in an audit record
|
||||
ar = new AuditRecord(AuditRecord.SCRIBBLE_MESSAGE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
conf.realCommunityID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -768,7 +768,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
|
||||
// record what we did in an audit record
|
||||
ar = new AuditRecord(AuditRecord.NUKE_MESSAGE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
conf.realCommunityID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
@@ -949,7 +949,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
|
||||
// Generate an audit record indicating what we did.
|
||||
ar = new AuditRecord(AuditRecord.UPLOAD_ATTACHMENT,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + conf.realConfID() + ",post=" + postid,
|
||||
conf.realCommunityID(),"conf=" + conf.realConfID() + ",post=" + postid,
|
||||
"len=" + length + ",type=" + m_type + ",name=" + file + ",method=" + tmp_stgmethod);
|
||||
|
||||
} // end try
|
||||
@@ -1060,14 +1060,14 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
{ // insert the post reference into the database
|
||||
StringBuffer sql =
|
||||
new StringBuffer("INSERT INTO postpublish (sigid, postid, by_uid, on_date) VALUES (");
|
||||
sql.append(conf.realSIGID()).append(", ").append(postid).append(", ").append(conf.realUID());
|
||||
sql.append(conf.realCommunityID()).append(", ").append(postid).append(", ").append(conf.realUID());
|
||||
java.util.Date now = new java.util.Date();
|
||||
sql.append(", '").append(SQLUtil.encodeDate(now)).append("');");
|
||||
stmt.executeUpdate(sql.toString());
|
||||
|
||||
// generate an audit record indicating what we've done
|
||||
ar = new AuditRecord(AuditRecord.PUBLISH_POST,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
conf.realCommunityID(),"conf=" + conf.realConfID() + ",post=" + postid);
|
||||
|
||||
// establish cached data object for front page
|
||||
engine.publishNew(new PublishedMessageImpl(datapool,postid,parent,num,linecount,creator_uid,
|
||||
|
||||
@@ -32,7 +32,7 @@ class TopicUserContextImpl implements TopicContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(TopicUserContextImpl.class.getName());
|
||||
private static Category logger = Category.getInstance(TopicUserContextImpl.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
@@ -302,7 +302,7 @@ class TopicUserContextImpl implements TopicContext
|
||||
{ // success! save the flag and generate an audit record
|
||||
frozen = flag;
|
||||
ar = new AuditRecord(AuditRecord.TOPIC_FREEZE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
conf.realCommunityID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
+ String.valueOf(topicid),flag ? "freeze" : "unfreeze");
|
||||
|
||||
} // end if
|
||||
@@ -363,7 +363,7 @@ class TopicUserContextImpl implements TopicContext
|
||||
{ // success! save the flag and generate an audit record
|
||||
archived = flag;
|
||||
ar = new AuditRecord(AuditRecord.TOPIC_ARCHIVE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
conf.realCommunityID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
+ String.valueOf(topicid),flag ? "archive" : "unarchive");
|
||||
|
||||
} // end if
|
||||
@@ -801,7 +801,7 @@ class TopicUserContextImpl implements TopicContext
|
||||
|
||||
// record what we did in an audit record
|
||||
ar = new AuditRecord(AuditRecord.POST_MESSAGE,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
conf.realCommunityID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
+ String.valueOf(topicid) + ",post=" + String.valueOf(new_post_id),
|
||||
"pseud=" + real_pseud);
|
||||
|
||||
@@ -911,7 +911,7 @@ class TopicUserContextImpl implements TopicContext
|
||||
|
||||
// record what we did in an audit record
|
||||
ar = new AuditRecord(AuditRecord.DELETE_TOPIC,conf.realUID(),conf.userRemoteAddress(),
|
||||
conf.realSIGID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
conf.realCommunityID(),"conf=" + String.valueOf(conf.realConfID()) + ",topic="
|
||||
+ String.valueOf(topicid));
|
||||
|
||||
} // end try
|
||||
|
||||
@@ -223,12 +223,12 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end sendEmailConfirmation
|
||||
|
||||
private void autoJoinSIGs(Connection conn) throws SQLException
|
||||
private void autoJoinCommunities(Connection conn) throws SQLException
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("autoJoinSIGs (uid " + uid + ", level " + level + ")");
|
||||
logger.debug("autoJoinCommunities (uid " + uid + ", level " + level + ")");
|
||||
|
||||
// See which SIGs we are eligible to autojoin.
|
||||
// See which communities we are eligible to autojoin.
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql =
|
||||
new StringBuffer("SELECT sigmember.sigid, sigmember.locked FROM users, sigmember, sigs "
|
||||
@@ -239,22 +239,22 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
logger.debug("SQL: " + sql.toString());
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
|
||||
// Save the SIGIDs returned into temporary array lists.
|
||||
ArrayList tmp_sigid = new ArrayList();
|
||||
// Save the community IDs returned into temporary array lists.
|
||||
ArrayList tmp_cid = new ArrayList();
|
||||
ArrayList tmp_locked = new ArrayList();
|
||||
while (rs.next())
|
||||
{ // save off the "sigid" and "locked" column pairs
|
||||
tmp_sigid.add(new Integer(rs.getInt(1)));
|
||||
{ // save off the "cid" and "locked" column pairs
|
||||
tmp_cid.add(new Integer(rs.getInt(1)));
|
||||
tmp_locked.add(new Boolean(rs.getBoolean(2)));
|
||||
|
||||
} // end while
|
||||
|
||||
// Figure out which of those SIGs we haven't joined yet and set up to autojoin them.
|
||||
// Figure out which of those communities we haven't joined yet and set up to autojoin them.
|
||||
sql.setLength(0);
|
||||
for (int i=0; i<tmp_sigid.size(); i++)
|
||||
{ // see if the user is already a member of this SIG
|
||||
Integer x_sigid = (Integer)(tmp_sigid.get(i));
|
||||
rs = stmt.executeQuery("SELECT sigid FROM sigmember WHERE sigid = " + x_sigid + " AND uid = " + uid
|
||||
for (int i=0; i<tmp_cid.size(); i++)
|
||||
{ // see if the user is already a member of this community
|
||||
Integer x_cid = (Integer)(tmp_cid.get(i));
|
||||
rs = stmt.executeQuery("SELECT sigid FROM sigmember WHERE sigid = " + x_cid + " AND uid = " + uid
|
||||
+ ";");
|
||||
if (!(rs.next()))
|
||||
{ // tack this information onto the end of our big "INSERT" command
|
||||
@@ -263,8 +263,8 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
sql.append("INSERT INTO sigmember (sigid, uid, granted_lvl, locked) VALUES ");
|
||||
else
|
||||
sql.append(", ");
|
||||
sql.append("(").append(x_sigid).append(", ").append(uid).append(", ");
|
||||
sql.append(DefaultLevels.memberSIG()).append(", ").append(x_locked.booleanValue() ? '1' : '0');
|
||||
sql.append("(").append(x_cid).append(", ").append(uid).append(", ");
|
||||
sql.append(DefaultLevels.memberCommunity()).append(", ").append(x_locked.booleanValue() ? '1' : '0');
|
||||
sql.append(")");
|
||||
|
||||
} // end if
|
||||
@@ -280,7 +280,7 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end if
|
||||
|
||||
} // end autoJoinSIGs
|
||||
} // end autoJoinCommunities
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface UserContext
|
||||
@@ -468,8 +468,8 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
email_verified = true;
|
||||
level = DefaultLevels.afterEmailVerification();
|
||||
|
||||
autoJoinSIGs(conn); // EJB 4/14/2001 - handle autojoin of any SIGs we couldn't autojoin at account
|
||||
// creation time
|
||||
autoJoinCommunities(conn); // EJB 4/14/2001 - handle autojoin of any SIGs we couldn't autojoin at
|
||||
// account creation time
|
||||
|
||||
// record an audit message indicating that we verified OK
|
||||
ar = new AuditRecord(AuditRecord.VERIFY_OK,uid,remote_addr);
|
||||
@@ -594,9 +594,9 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
logger.debug("putContactInfo() for UID " + uid);
|
||||
|
||||
boolean email_changed = false;
|
||||
if ((ci.getOwnerUID()!=uid) || (ci.getOwnerSIGID()>=0))
|
||||
if ((ci.getOwnerUID()!=uid) || (ci.getOwnerCommunityID()>=0))
|
||||
{ // the contact information is not owned correctly
|
||||
logger.error("ContactInfo ownership wrong (it's " + ci.getOwnerUID() + ", " + ci.getOwnerSIGID()
|
||||
logger.error("ContactInfo ownership wrong (it's " + ci.getOwnerUID() + ", " + ci.getOwnerCommunityID()
|
||||
+ "), should be (" + uid + ", -1)");
|
||||
throw new DataException("invalid contact information record");
|
||||
|
||||
@@ -857,23 +857,23 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end setDescription
|
||||
|
||||
public List getMemberSIGs() throws DataException
|
||||
public List getMemberCommunities() throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getMemberSIGEntries(engine,this,datapool);
|
||||
return CommunityUserContextImpl.getMemberCommunityEntries(engine,this,datapool);
|
||||
|
||||
} // end getMemberSIGs
|
||||
} // end getMemberCommunities
|
||||
|
||||
public SIGContext getSIGContext(int sigid) throws DataException
|
||||
public CommunityContext getCommunityContext(int cid) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getSIGContext(engine,this,datapool,sigid);
|
||||
return CommunityUserContextImpl.getCommunityContext(engine,this,datapool,cid);
|
||||
|
||||
} // end getSIGContext
|
||||
} // end getCommunityContext
|
||||
|
||||
public SIGContext getSIGContext(String alias) throws DataException
|
||||
public CommunityContext getCommunityContext(String alias) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getSIGContext(engine,this,datapool,alias);
|
||||
return CommunityUserContextImpl.getCommunityContext(engine,this,datapool,alias);
|
||||
|
||||
} // end getSIGContext
|
||||
} // end getCommunityContext
|
||||
|
||||
public List getRootCategoryList() throws DataException
|
||||
{
|
||||
@@ -887,41 +887,43 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end getCategoryDescriptor
|
||||
|
||||
public List searchForSIGs(int field, int mode, String term, int offset, int count) throws DataException
|
||||
public List searchForCommunities(int field, int mode, String term, int offset, int count)
|
||||
throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.searchForSIGs(engine,this,datapool,field,mode,term,offset,count);
|
||||
return CommunityUserContextImpl.searchForCommunities(engine,this,datapool,field,mode,term,offset,count);
|
||||
|
||||
} // end searchForSIGs
|
||||
} // end searchForCommunities
|
||||
|
||||
public int getSearchSIGCount(int field, int mode, String term) throws DataException
|
||||
public int getSearchCommunityCount(int field, int mode, String term) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getSearchSIGCount(this,datapool,field,mode,term);
|
||||
return CommunityUserContextImpl.getSearchCommunityCount(this,datapool,field,mode,term);
|
||||
|
||||
} // end getSearchSIGCount
|
||||
} // end getSearchCommunityCount
|
||||
|
||||
public List getSIGsInCategory(int catid, int offset, int count) throws DataException
|
||||
public List getCommunitiesInCategory(int catid, int offset, int count) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getSIGsInCategory(engine,this,datapool,catid,offset,count);
|
||||
return CommunityUserContextImpl.getCommunitiesInCategory(engine,this,datapool,catid,offset,count);
|
||||
|
||||
} // end getSIGsInCategory
|
||||
} // end getCommunitiesInCategory
|
||||
|
||||
public List getSIGsInCategory(CategoryDescriptor cat, int offset, int count) throws DataException
|
||||
public List getCommunitiesInCategory(CategoryDescriptor cat, int offset, int count) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getSIGsInCategory(engine,this,datapool,cat.getLinkedCategoryID(),offset,count);
|
||||
return CommunityUserContextImpl.getCommunitiesInCategory(engine,this,datapool,cat.getLinkedCategoryID(),
|
||||
offset,count);
|
||||
|
||||
} // end getSIGsInCategory
|
||||
} // end getCommunitiesInCategory
|
||||
|
||||
public int getNumSIGsInCategory(int catid) throws DataException
|
||||
public int getNumCommunitiesInCategory(int catid) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getNumSIGsInCategory(this,datapool,catid);
|
||||
return CommunityUserContextImpl.getNumCommunitiesInCategory(this,datapool,catid);
|
||||
|
||||
} // end getNumSIGsInCategory
|
||||
} // end getNumCommunitiessInCategory
|
||||
|
||||
public int getNumSIGsInCategory(CategoryDescriptor cat) throws DataException
|
||||
public int getNumCommunitiesInCategory(CategoryDescriptor cat) throws DataException
|
||||
{
|
||||
return SIGUserContextImpl.getNumSIGsInCategory(this,datapool,cat.getLinkedCategoryID());
|
||||
return CommunityUserContextImpl.getNumCommunitiesInCategory(this,datapool,cat.getLinkedCategoryID());
|
||||
|
||||
} // end getNumSIGsInCategory
|
||||
} // end getNumCommunitiesInCategory
|
||||
|
||||
public List searchForCategories(int mode, String term, int offset, int count) throws DataException
|
||||
{
|
||||
@@ -939,36 +941,37 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end getSearchCategoryCount
|
||||
|
||||
public SIGContext createSIG(String name, String alias, String language, String synopsis, String rules,
|
||||
String joinkey, int hide_mode) throws DataException, AccessError
|
||||
public CommunityContext createCommunity(String name, String alias, String language, String synopsis,
|
||||
String rules, String joinkey, int hide_mode)
|
||||
throws DataException, AccessError
|
||||
{
|
||||
if (!canCreateSIG())
|
||||
throw new AccessError("You are not authorized to create new SIGs.");
|
||||
if (!canCreateCommunity())
|
||||
throw new AccessError("You are not authorized to create new communities.");
|
||||
|
||||
// Convert the "hide mode" value into the two hide flags.
|
||||
boolean hide_dir = (hide_mode!=SIGContext.HIDE_NONE);
|
||||
boolean hide_search = (hide_mode==SIGContext.HIDE_BOTH);
|
||||
boolean hide_dir = (hide_mode!=CommunityContext.HIDE_NONE);
|
||||
boolean hide_search = (hide_mode==CommunityContext.HIDE_BOTH);
|
||||
|
||||
// Create the new SIG's database entries and internal data.
|
||||
SIGData new_sig = SIGCoreData.createSIG(engine,this,datapool,name,alias,uid,language,synopsis,rules,
|
||||
joinkey,hide_dir,hide_search);
|
||||
// Create the new community's database entries and internal data.
|
||||
CommunityData new_comm = CommunityCoreData.createCommunity(engine,this,datapool,name,alias,uid,language,
|
||||
synopsis,rules,joinkey,hide_dir,hide_search);
|
||||
|
||||
// Create the SIG context we return to the user.
|
||||
SIGContext rc = new SIGUserContextImpl(engine,this,datapool,new_sig);
|
||||
// Create the community context we return to the user.
|
||||
CommunityContext rc = new CommunityUserContextImpl(engine,this,datapool,new_comm);
|
||||
|
||||
new_sig.rd_release(); // release the extra reference we have on SIGData
|
||||
new_comm.rd_release(); // release the extra reference we have on CommunityData
|
||||
|
||||
// And that's it! You expected lightning bolts maybe? :-)
|
||||
|
||||
return rc;
|
||||
|
||||
} // end createSIG
|
||||
} // end createCommunity
|
||||
|
||||
public boolean canCreateSIG()
|
||||
public boolean canCreateCommunity()
|
||||
{
|
||||
return (level>=engine.getParamInt(EngineBackend.IP_CREATESIGLVL));
|
||||
return (level>=engine.getParamInt(EngineBackend.IP_CREATECOMMUNITYLVL));
|
||||
|
||||
} // end canCreateSIG
|
||||
} // end canCreateCommunity
|
||||
|
||||
public List getSideBoxList() throws DataException
|
||||
{
|
||||
@@ -1550,20 +1553,20 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end loadNewUser
|
||||
|
||||
void autoJoinSIGs() throws DataException
|
||||
void autoJoinCommunities() throws DataException
|
||||
{
|
||||
Connection conn = null;
|
||||
|
||||
try
|
||||
{ // get a database connection and call the internal function
|
||||
conn = datapool.getConnection();
|
||||
autoJoinSIGs(conn);
|
||||
autoJoinCommunities(conn);
|
||||
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // database error - this is a DataException
|
||||
logger.error("error autojoining SIGs: " + e.getMessage(),e);
|
||||
throw new DataException("unable to autojoin SIGs: " + e.getMessage(),e);
|
||||
logger.error("error autojoining communities: " + e.getMessage(),e);
|
||||
throw new DataException("unable to autojoin communities: " + e.getMessage(),e);
|
||||
|
||||
} // end catch
|
||||
finally
|
||||
@@ -1573,6 +1576,6 @@ class UserContextImpl implements UserContext, UserBackend
|
||||
|
||||
} // end finally
|
||||
|
||||
} // end autoJoinSIGs
|
||||
} // end autoJoinCommunities
|
||||
|
||||
} // end class UserContextImpl
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
|
||||
@@ -104,7 +104,7 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
class VeniceFeatureDef implements SIGFeature
|
||||
class VeniceFeatureDef implements CommunityFeature
|
||||
{
|
||||
int code;
|
||||
String symbol;
|
||||
@@ -331,14 +331,14 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
{ // if we're interrupted, just schedule the next run a little early
|
||||
} // end catch
|
||||
|
||||
// sweep the SIG cache first
|
||||
List sigs = sig_refcache.sweepReturn();
|
||||
Iterator it = sigs.iterator();
|
||||
// sweep the community cache first
|
||||
List comms = comm_refcache.sweepReturn();
|
||||
Iterator it = comms.iterator();
|
||||
while (it.hasNext())
|
||||
{ // perform subsweeps on the SIG data
|
||||
SIGData sig = (SIGData)(it.next());
|
||||
sig.sweepCache();
|
||||
sig.rd_release();
|
||||
{ // perform subsweeps on the community data
|
||||
CommunityData comm = (CommunityData)(it.next());
|
||||
comm.sweepCache();
|
||||
comm.rd_release();
|
||||
|
||||
} // end while
|
||||
|
||||
@@ -352,22 +352,22 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
} // end class CacheSweeper
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal class for creating new SIGCoreData objects.
|
||||
* Internal class for creating new CommunityCoreData objects.
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected class SIGCoreDataCreator implements ReferencedDataBuilder
|
||||
protected class CommunityCoreDataCreator implements ReferencedDataBuilder
|
||||
{
|
||||
protected SIGCoreDataCreator()
|
||||
protected CommunityCoreDataCreator()
|
||||
{ // do nothing
|
||||
} // end constructor
|
||||
|
||||
public ReferencedData build(Object key) throws ReferencedDataBuilderException
|
||||
{
|
||||
Integer xsigid = (Integer)key;
|
||||
Integer xcid = (Integer)key;
|
||||
try
|
||||
{ // create the desired object
|
||||
return new SIGCoreData(VeniceEngineImpl.this,datapool,xsigid.intValue());
|
||||
return new CommunityCoreData(VeniceEngineImpl.this,datapool,xcid.intValue());
|
||||
|
||||
} // end try
|
||||
catch (DataException e)
|
||||
@@ -378,7 +378,7 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
|
||||
} // end build
|
||||
|
||||
} // end class SIGCoreDataCreator
|
||||
} // end class CommunityCoreDataCreator
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal class for creating new ConferenceCoreData objects.
|
||||
@@ -491,8 +491,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
private Properties email_props = null; // email properties
|
||||
private javax.mail.Session mailsession = null; // email session object
|
||||
private Hashtable stock_messages = null; // stock messages holder
|
||||
private ReferenceCache sig_refcache = new ReferenceCache();
|
||||
private SIGCoreDataCreator sig_creator = new SIGCoreDataCreator();
|
||||
private ReferenceCache comm_refcache = new ReferenceCache();
|
||||
private CommunityCoreDataCreator comm_creator = new CommunityCoreDataCreator();
|
||||
private VeniceFeatureDef[] features; // master feature table
|
||||
private Hashtable feature_syms = new Hashtable(); // hashtable mapping symbols to features
|
||||
private ReferenceCache conf_refcache = new ReferenceCache();
|
||||
@@ -544,11 +544,11 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
gp_ints[IP_POSTSPERPAGE] = rs.getInt(1);
|
||||
gp_ints[IP_POSTSATTOP] = rs.getInt(2);
|
||||
gp_ints[IP_MAXSEARCHRETURN] = rs.getInt(3);
|
||||
gp_ints[IP_MAXSIGMEMBERDISPLAY] = rs.getInt(4);
|
||||
gp_ints[IP_MAXCOMMUNITYMEMBERDISPLAY] = rs.getInt(4);
|
||||
gp_ints[IP_MAXCONFMEMBERDISPLAY] = rs.getInt(5);
|
||||
gp_ints[IP_NUMFRONTPAGEPOSTS] = rs.getInt(6);
|
||||
gp_ints[IP_NUMAUDITRECSPERPAGE] = rs.getInt(7);
|
||||
gp_ints[IP_CREATESIGLVL] = rs.getInt(8);
|
||||
gp_ints[IP_CREATECOMMUNITYLVL] = rs.getInt(8);
|
||||
|
||||
} // end loadDefaults
|
||||
|
||||
@@ -1385,14 +1385,14 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
// create a new context for the user (they're now effectively logged in)
|
||||
UserContextImpl rc = new UserContextImpl(this,datapool);
|
||||
rc.loadNewUser(remote_addr,new_uid,DefaultLevels.newUser(),username,confirm_num,created,created);
|
||||
rc.autoJoinSIGs(); // EJB 4/14/2001
|
||||
rc.autoJoinCommunities(); // EJB 4/14/2001
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("...created new user context");
|
||||
return rc;
|
||||
|
||||
} // end createNewAccount
|
||||
|
||||
public boolean aliasExists(String alias, int exist_sigid)
|
||||
public boolean aliasExists(String alias, int exist_cid)
|
||||
{
|
||||
checkInitialized();
|
||||
Connection conn = null;
|
||||
@@ -1403,8 +1403,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT sigid FROM sigs WHERE alias = '");
|
||||
sql.append(alias).append("'");
|
||||
if (exist_sigid>0)
|
||||
sql.append(" AND sigid <> ").append(exist_sigid);
|
||||
if (exist_cid>0)
|
||||
sql.append(" AND sigid <> ").append(exist_cid);
|
||||
sql.append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
return rs.next();
|
||||
@@ -1412,7 +1412,7 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
} // end try
|
||||
catch (SQLException e)
|
||||
{ // force to return null
|
||||
logger.warn("DB error looking up SIG: " + e.getMessage(),e);
|
||||
logger.warn("DB error looking up community: " + e.getMessage(),e);
|
||||
|
||||
} // end catch
|
||||
finally
|
||||
@@ -1434,7 +1434,7 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
Connection conn = null;
|
||||
|
||||
try
|
||||
{ // do a SELECT on the sigs table
|
||||
{ // do a SELECT on the category table
|
||||
conn = datapool.getConnection();
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT catid FROM refcategory WHERE catid = ");
|
||||
@@ -1732,11 +1732,11 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
|
||||
} // end getMaxNumConferenceMembersDisplay
|
||||
|
||||
public int getMaxNumSIGMembersDisplay()
|
||||
public int getMaxNumCommunityMembersDisplay()
|
||||
{
|
||||
return gp_ints[IP_MAXSIGMEMBERDISPLAY];
|
||||
return gp_ints[IP_MAXCOMMUNITYMEMBERDISPLAY];
|
||||
|
||||
} // end getMaxNumSIGMembersDisplay
|
||||
} // end getMaxNumCommunityMembersDisplay
|
||||
|
||||
public List getMasterSideBoxList()
|
||||
{
|
||||
@@ -1929,15 +1929,15 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
|
||||
} // end getLanguageNameForCode
|
||||
|
||||
public SIGData getSIGDataObject(int sigid) throws DataException
|
||||
public CommunityData getCommunityDataObject(int cid) throws DataException
|
||||
{
|
||||
checkInitialized();
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("getSIGDataObject(" + sigid + ")...");
|
||||
logger.debug("getCommunityDataObject(" + cid + ")...");
|
||||
|
||||
try
|
||||
{ // delegate to the sig_refcache and sig_creator objects
|
||||
return (SIGData)(sig_refcache.getOrCreate(new Integer(sigid),sig_creator));
|
||||
{ // delegate to the comm_refcache and comm_creator objects
|
||||
return (CommunityData)(comm_refcache.getOrCreate(new Integer(cid),comm_creator));
|
||||
|
||||
} // end try
|
||||
catch (ReferencedDataBuilderException e)
|
||||
@@ -1946,22 +1946,22 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
if (e2 instanceof DataException)
|
||||
throw (DataException)e2;
|
||||
else
|
||||
throw new InternalStateError("unknown creation exception thrown in getSIGDataObject: "
|
||||
throw new InternalStateError("unknown creation exception thrown in getCommunityDataObject: "
|
||||
+ e2.getClass().getName(),e2);
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end getSIGDataObject
|
||||
} // end getCommunityDataObject
|
||||
|
||||
public void detachSIGDataObject(int sigid)
|
||||
public void detachCommunityDataObject(int cid)
|
||||
{
|
||||
checkInitialized();
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("detachSIGDataObject(" + sigid + ")...");
|
||||
logger.debug("detachCommunityDataObject(" + cid + ")...");
|
||||
|
||||
sig_refcache.detach(new Integer(sigid));
|
||||
comm_refcache.detach(new Integer(cid));
|
||||
|
||||
} // end detachSIGDataObject
|
||||
} // end detachCommunityDataObject
|
||||
|
||||
public BitSet getLockedFeaturesMask()
|
||||
{
|
||||
@@ -1975,17 +1975,17 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
|
||||
} // end getLockedFeaturesMask
|
||||
|
||||
public List getSIGFeatureSet(BitSet enabled_features, int level, boolean read_privs)
|
||||
public List getCommunityFeatureSet(BitSet enabled_features, int level, boolean read_privs)
|
||||
{
|
||||
checkInitialized();
|
||||
ArrayList rc = new ArrayList();
|
||||
for (int i=0; i<features.length; i++)
|
||||
if (enabled_features.get(i) && features[i].featureAllowed(level,read_privs))
|
||||
{ // this feature must be included in the eventual output set
|
||||
SIGFeature elt = features[i];
|
||||
CommunityFeature elt = features[i];
|
||||
boolean insert_me = true;
|
||||
for (int j=0; insert_me && (j<rc.size()); j++)
|
||||
if (elt.getSequence()<((SIGFeature)(rc.get(j))).getSequence())
|
||||
if (elt.getSequence()<((CommunityFeature)(rc.get(j))).getSequence())
|
||||
{ // put the item in the list
|
||||
rc.add(j,elt);
|
||||
insert_me = false;
|
||||
@@ -1998,11 +1998,11 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
} // end if and for
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("getSIGFeatureSet() loaded " + rc.size() + " elements");
|
||||
logger.debug("getCommunityFeatureSet() loaded " + rc.size() + " elements");
|
||||
|
||||
return Collections.unmodifiableList(rc); // wrap the vector for return
|
||||
|
||||
} // end getSIGFeatureSet
|
||||
} // end getCommunityFeatureSet
|
||||
|
||||
public String getAppletForFeature(int code)
|
||||
{
|
||||
@@ -2041,15 +2041,15 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend
|
||||
|
||||
} // end getDefaultFeaturesMask
|
||||
|
||||
public void registerNewSIG(SIGData sig)
|
||||
public void registerNewCommunity(CommunityData comm)
|
||||
{
|
||||
checkInitialized();
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("registerNewSIG(" + sig.getID() + ")...");
|
||||
logger.debug("registerNewCommunity(" + comm.getID() + ")...");
|
||||
|
||||
sig_refcache.register(sig);
|
||||
comm_refcache.register(comm);
|
||||
|
||||
} // end registerNewSIG
|
||||
} // end registerNewCommunity
|
||||
|
||||
public int getFeatureIndexBySymbol(String symbol)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PostLinkDecoder
|
||||
*/
|
||||
|
||||
private static final int MAX_LINK_LEN = 130;
|
||||
private static final int MAX_SIG_LEN = 32;
|
||||
private static final int MAX_COMM_LEN = 32;
|
||||
private static final int MAX_CONF_LEN = 64;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
@@ -38,7 +38,7 @@ public class PostLinkDecoder
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String signame = null;
|
||||
private String commname = null;
|
||||
private String confname = null;
|
||||
private short topicnum = -1;
|
||||
private int first_post = -1;
|
||||
@@ -62,11 +62,11 @@ public class PostLinkDecoder
|
||||
// First Test: Bang
|
||||
int pos = work.toString().indexOf('!');
|
||||
if (pos>0)
|
||||
{ // We have "sig!something" ... store off the SIG name
|
||||
setSIGName(work.substring(0,pos));
|
||||
{ // We have "community!something" ... store off the community name
|
||||
setCommunityName(work.substring(0,pos));
|
||||
work.delete(0,pos+1);
|
||||
if (work.length()==0)
|
||||
return; // we had just "sig!" - that's the syntax for a SIG link
|
||||
return; // we had just "community!" - that's the syntax for a community link
|
||||
|
||||
} // end if
|
||||
else if (pos==0)
|
||||
@@ -75,8 +75,8 @@ public class PostLinkDecoder
|
||||
// Second Test: Dot Number One
|
||||
pos = work.toString().indexOf('.');
|
||||
if (pos<0)
|
||||
{ // there's no dots in here...this must have been either "postlink" or "sig!conference"
|
||||
if (signame!=null) // it's "sig!conference"
|
||||
{ // there's no dots in here...this must have been either "postlink" or "community!conference"
|
||||
if (commname!=null) // it's "community!conference"
|
||||
setConferenceName(work.toString());
|
||||
else // it's "postlink"
|
||||
setPostRange(work);
|
||||
@@ -91,8 +91,8 @@ public class PostLinkDecoder
|
||||
work.delete(0,pos+1);
|
||||
|
||||
if (work.length()==0)
|
||||
{ // we had "conference." or "topic." (or perhaps "sig!conference.")
|
||||
if (signame==null)
|
||||
{ // we had "conference." or "topic." (or perhaps "community!conference.")
|
||||
if (commname==null)
|
||||
{ // it's either "conference." or "topic." - try topic first
|
||||
try
|
||||
{ // try it as a topic number first...
|
||||
@@ -106,7 +106,7 @@ public class PostLinkDecoder
|
||||
} // end catch
|
||||
|
||||
} // end if
|
||||
else // it was "sig!conference."...save it off
|
||||
else // it was "community!conference."...save it off
|
||||
setConferenceName(conf_or_topic);
|
||||
|
||||
return; // all done here...
|
||||
@@ -116,8 +116,8 @@ public class PostLinkDecoder
|
||||
// Third Test: Dot Number Two
|
||||
pos = work.toString().indexOf('.');
|
||||
if (pos<0)
|
||||
{ // we had "conference.topic" or "topic.posts" (or perhaps "sig!conference.topic")
|
||||
if (signame==null)
|
||||
{ // we had "conference.topic" or "topic.posts" (or perhaps "community!conference.topic")
|
||||
if (commname==null)
|
||||
{ // we have "conference.topic" or "topic.posts" - have to determine this
|
||||
boolean is_topic = false; // what does "work" currently hold?
|
||||
try
|
||||
@@ -140,7 +140,7 @@ public class PostLinkDecoder
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // it's "sig!conference.topic"...set 'em up accordingly
|
||||
{ // it's "community!conference.topic"...set 'em up accordingly
|
||||
setConferenceName(conf_or_topic);
|
||||
setTopicNumber(work.toString());
|
||||
|
||||
@@ -152,14 +152,14 @@ public class PostLinkDecoder
|
||||
else if (pos==0)
|
||||
throw new ValidationException(". at beginning of string");
|
||||
|
||||
// We definitely have "conference.topic.something" (or "sig!conference.topic.sonething") now,
|
||||
// We definitely have "conference.topic.something" (or "community!conference.topic.something") now,
|
||||
// so save off the conference name and topic number.
|
||||
setConferenceName(conf_or_topic);
|
||||
setTopicNumber(work.substring(0,pos));
|
||||
work.delete(0,pos+1);
|
||||
|
||||
if (work.length()==0)
|
||||
return; // we just had "conference.topic." or "sig!conference.topic.", which is valid
|
||||
return; // we just had "conference.topic." or "community!conference.topic.", which is valid
|
||||
|
||||
setPostRange(work); // the rest must be the post range!
|
||||
|
||||
@@ -183,15 +183,15 @@ public class PostLinkDecoder
|
||||
|
||||
} // end isAllDigits
|
||||
|
||||
private void setSIGName(String name) throws ValidationException
|
||||
private void setCommunityName(String name) throws ValidationException
|
||||
{
|
||||
if (name.length()>MAX_SIG_LEN)
|
||||
throw new ValidationException("SIG alias is too long");
|
||||
if (name.length()>MAX_COMM_LEN)
|
||||
throw new ValidationException("community alias is too long");
|
||||
if (!(IDUtils.isValidVeniceID(name)))
|
||||
throw new ValidationException("SIG alias is not a valid Venice identifier");
|
||||
signame = name;
|
||||
throw new ValidationException("community alias is not a valid Venice identifier");
|
||||
commname = name;
|
||||
|
||||
} // end setSIGName
|
||||
} // end setCommunityName
|
||||
|
||||
private void setConferenceName(String name) throws ValidationException
|
||||
{
|
||||
@@ -293,11 +293,11 @@ public class PostLinkDecoder
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getSIG()
|
||||
public String getCommunity()
|
||||
{
|
||||
return signame;
|
||||
return commname;
|
||||
|
||||
} // end getSIG
|
||||
} // end getCommunity
|
||||
|
||||
public String getConference()
|
||||
{
|
||||
@@ -325,7 +325,7 @@ public class PostLinkDecoder
|
||||
|
||||
public boolean needDatabaseVerification()
|
||||
{
|
||||
return ((signame!=null) || (confname!=null));
|
||||
return ((commname!=null) || (confname!=null));
|
||||
|
||||
} // end needDatabaseVerification
|
||||
|
||||
@@ -337,13 +337,13 @@ public class PostLinkDecoder
|
||||
StringBuffer sql = new StringBuffer();
|
||||
ResultSet rs;
|
||||
|
||||
if (signame!=null)
|
||||
{ // verify the SIG name against the database
|
||||
sql.append("SELECT sigid FROM sigs WHERE alias = '").append(SQLUtil.encodeString(signame));
|
||||
if (commname!=null)
|
||||
{ // verify the community name against the database
|
||||
sql.append("SELECT sigid FROM sigs WHERE alias = '").append(SQLUtil.encodeString(commname));
|
||||
sql.append("';");
|
||||
rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
throw new ValidationException("SIG alias not found");
|
||||
throw new ValidationException("community alias not found");
|
||||
sql.setLength(0);
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -24,7 +24,7 @@ public class PostLinkDecoderContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String signame; // SIG name that's cached
|
||||
private String commname; // community name that's cached
|
||||
private String confname; // conference name that's cached
|
||||
private short topic; // topic that's cached
|
||||
|
||||
@@ -33,9 +33,9 @@ public class PostLinkDecoderContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public PostLinkDecoderContext(String signame, String confname, short topic)
|
||||
public PostLinkDecoderContext(String commname, String confname, short topic)
|
||||
{
|
||||
this.signame = signame;
|
||||
this.commname = commname;
|
||||
this.confname = confname;
|
||||
this.topic = topic;
|
||||
|
||||
@@ -46,11 +46,11 @@ public class PostLinkDecoderContext
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return signame;
|
||||
return commname;
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
public String getConferenceName()
|
||||
{
|
||||
|
||||
@@ -61,12 +61,12 @@ public class PostLinkRewriter implements Rewriter
|
||||
{
|
||||
StringBuffer b = new StringBuffer(URI_PREFIX);
|
||||
boolean started = false;
|
||||
if (pl.getSIG()==null)
|
||||
b.append(ctxt.getSIGName());
|
||||
if (pl.getCommunity()==null)
|
||||
b.append(ctxt.getCommunityName());
|
||||
else
|
||||
{ // append the real SIG name
|
||||
{ // append the real community name
|
||||
started = true;
|
||||
b.append(pl.getSIG());
|
||||
b.append(pl.getCommunity());
|
||||
|
||||
} // end else
|
||||
|
||||
@@ -151,7 +151,7 @@ public class PostLinkRewriter implements Rewriter
|
||||
pl = new PostLinkDecoder(data);
|
||||
|
||||
if (pl.needDatabaseVerification())
|
||||
{ // open up a database connection and verify the SIG/conference names
|
||||
{ // open up a database connection and verify the community/conference names
|
||||
Connection conn = null;
|
||||
|
||||
try
|
||||
|
||||
@@ -37,19 +37,19 @@ public interface Audit
|
||||
public static final int ADMIN_SET_SECURITY = 112;
|
||||
public static final int ADMIN_LOCK_OUT = 113;
|
||||
|
||||
// Codes 201-300 - SIG events
|
||||
public static final int CREATE_SIG = 201;
|
||||
// Codes 201-300 - Community events
|
||||
public static final int CREATE_COMMUNITY = 201;
|
||||
public static final int SET_MEMBERSHIP = 202;
|
||||
public static final int SIG_CONTACT_INFO = 203;
|
||||
public static final int SIG_FEATURE_SET = 204;
|
||||
public static final int SIG_NAME = 205;
|
||||
public static final int SIG_ALIAS = 206;
|
||||
public static final int SIG_CATEGORY = 207;
|
||||
public static final int SIG_HIDE_INFO = 208;
|
||||
public static final int SIG_MEMBERS_ONLY = 209;
|
||||
public static final int SIG_JOIN_KEY = 210;
|
||||
public static final int SIG_SECURITY = 211;
|
||||
public static final int DELETE_SIG = 212;
|
||||
public static final int COMMUNITY_CONTACT_INFO = 203;
|
||||
public static final int COMMUNITY_FEATURE_SET = 204;
|
||||
public static final int COMMUNITY_NAME = 205;
|
||||
public static final int COMMUNITY_ALIAS = 206;
|
||||
public static final int COMMUNITY_CATEGORY = 207;
|
||||
public static final int COMMUNITY_HIDE_INFO = 208;
|
||||
public static final int COMMUNITY_MEMBERS_ONLY = 209;
|
||||
public static final int COMMUNITY_JOIN_KEY = 210;
|
||||
public static final int COMMUNITY_SECURITY = 211;
|
||||
public static final int DELETE_COMMUNITY = 212;
|
||||
|
||||
// Codes 301-400 - Conference events
|
||||
public static final int CREATE_CONF = 301;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class AuditRecord implements AuditData
|
||||
{
|
||||
private HashMap descr_cache = new HashMap();
|
||||
private HashMap uname_cache = new HashMap();
|
||||
private HashMap signame_cache = new HashMap();
|
||||
private HashMap commname_cache = new HashMap();
|
||||
private Statement stmt;
|
||||
|
||||
DescrStringCache(Connection conn) throws SQLException
|
||||
@@ -82,25 +82,25 @@ public class AuditRecord implements AuditData
|
||||
|
||||
} // end getUserName
|
||||
|
||||
String getSIGName(int sigid) throws SQLException, DataException
|
||||
String getCommunityName(int cid) throws SQLException, DataException
|
||||
{
|
||||
if (sigid<=0)
|
||||
return ""; // no SIG
|
||||
Integer sigid_x = new Integer(sigid);
|
||||
String rc = (String)(signame_cache.get(sigid_x));
|
||||
if (cid<=0)
|
||||
return ""; // no community
|
||||
Integer cid_x = new Integer(cid);
|
||||
String rc = (String)(commname_cache.get(cid_x));
|
||||
if (rc==null)
|
||||
{ // OK, get it from the database
|
||||
ResultSet rs = stmt.executeQuery("SELECT signame FROM sigs WHERE sigid = " + sigid + ";");
|
||||
ResultSet rs = stmt.executeQuery("SELECT signame FROM sigs WHERE sigid = " + cid + ";");
|
||||
if (!(rs.next()))
|
||||
throw new DataException("SIG name not found for SIGID " + sigid);
|
||||
throw new DataException("community name not found for community ID " + cid);
|
||||
rc = rs.getString(1);
|
||||
signame_cache.put(sigid_x,rc);
|
||||
commname_cache.put(cid_x,rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return rc;
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
} // end class DescrStringCache
|
||||
|
||||
@@ -113,55 +113,55 @@ public class AuditRecord implements AuditData
|
||||
private java.util.Date when; // the date/time of this audit event
|
||||
private int type; // the audit event type
|
||||
private int uid; // the user ID
|
||||
private int sigid; // the SIG ID
|
||||
private int cid; // the community ID
|
||||
private String ip; // the IP address of the user
|
||||
private String[] data; // the data values associated with the record
|
||||
private String descr = null; // audit record description
|
||||
private String uname = null; // user name of user
|
||||
private String signame = null; // name of SIG
|
||||
private String commname = null; // name of community
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public AuditRecord(int type, int uid, String ip, int sigid, String data1, String data2, String data3,
|
||||
public AuditRecord(int type, int uid, String ip, int cid, String data1, String data2, String data3,
|
||||
String data4)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
setData(data1,data2,data3,data4);
|
||||
|
||||
} // end constructor
|
||||
|
||||
public AuditRecord(int type, int uid, String ip, int sigid, String data1, String data2, String data3)
|
||||
public AuditRecord(int type, int uid, String ip, int cid, String data1, String data2, String data3)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
setData(data1,data2,data3,null);
|
||||
|
||||
} // end constructor
|
||||
|
||||
public AuditRecord(int type, int uid, String ip, int sigid, String data1, String data2)
|
||||
public AuditRecord(int type, int uid, String ip, int cid, String data1, String data2)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
setData(data1,data2,null,null);
|
||||
|
||||
} // end constructor
|
||||
|
||||
public AuditRecord(int type, int uid, String ip, int sigid, String data1)
|
||||
public AuditRecord(int type, int uid, String ip, int cid, String data1)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
setData(data1,null,null,null);
|
||||
|
||||
} // end constructor
|
||||
|
||||
public AuditRecord(int type, int uid, String ip, int sigid)
|
||||
public AuditRecord(int type, int uid, String ip, int cid)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = sigid;
|
||||
this.cid = cid;
|
||||
setData(null,null,null,null);
|
||||
|
||||
} // end constructor
|
||||
@@ -169,7 +169,7 @@ public class AuditRecord implements AuditData
|
||||
public AuditRecord(int type, int uid, String ip, String data1, String data2, String data3, String data4)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = 0;
|
||||
this.cid = 0;
|
||||
setData(data1,data2,data3,data4);
|
||||
|
||||
} // end constructor
|
||||
@@ -177,7 +177,7 @@ public class AuditRecord implements AuditData
|
||||
public AuditRecord(int type, int uid, String ip, String data1, String data2, String data3)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = 0;
|
||||
this.cid = 0;
|
||||
setData(data1,data2,data3,null);
|
||||
|
||||
} // end constructor
|
||||
@@ -185,7 +185,7 @@ public class AuditRecord implements AuditData
|
||||
public AuditRecord(int type, int uid, String ip, String data1, String data2)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = 0;
|
||||
this.cid = 0;
|
||||
setData(data1,data2,null,null);
|
||||
|
||||
} // end constructor
|
||||
@@ -193,7 +193,7 @@ public class AuditRecord implements AuditData
|
||||
public AuditRecord(int type, int uid, String ip, String data1)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = 0;
|
||||
this.cid = 0;
|
||||
setData(data1,null,null,null);
|
||||
|
||||
} // end constructor
|
||||
@@ -201,7 +201,7 @@ public class AuditRecord implements AuditData
|
||||
public AuditRecord(int type, int uid, String ip)
|
||||
{
|
||||
setBaseData(type,uid,ip);
|
||||
this.sigid = 0;
|
||||
this.cid = 0;
|
||||
setData(null,null,null,null);
|
||||
|
||||
} // end constructor
|
||||
@@ -212,7 +212,7 @@ public class AuditRecord implements AuditData
|
||||
when = SQLUtil.getFullDateTime(rs,"on_date");
|
||||
type = rs.getInt("event");
|
||||
uid = rs.getInt("uid");
|
||||
sigid = rs.getInt("sigid");
|
||||
cid = rs.getInt("sigid");
|
||||
ip = rs.getString("ip");
|
||||
data = new String[DATA_COUNT];
|
||||
data[0] = rs.getString("data1");
|
||||
@@ -221,7 +221,7 @@ public class AuditRecord implements AuditData
|
||||
data[3] = rs.getString("data4");
|
||||
descr = cache.getDescription(type);
|
||||
uname = cache.getUserName(uid);
|
||||
signame = cache.getSIGName(sigid);
|
||||
commname = cache.getCommunityName(cid);
|
||||
|
||||
} // end constructor
|
||||
|
||||
@@ -279,11 +279,11 @@ public class AuditRecord implements AuditData
|
||||
|
||||
} // end getType
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sigid;
|
||||
return cid;
|
||||
|
||||
} // end getType
|
||||
} // end getCommunityID
|
||||
|
||||
public String getIPAddress()
|
||||
{
|
||||
@@ -309,11 +309,11 @@ public class AuditRecord implements AuditData
|
||||
|
||||
} // end getUserName
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return signame;
|
||||
return commname;
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
@@ -333,7 +333,7 @@ public class AuditRecord implements AuditData
|
||||
+ "data3, data4) VALUES ('");
|
||||
java.util.Date now = new java.util.Date();
|
||||
sql.append(SQLUtil.encodeDate(now)).append("', ").append(type).append(", ").append(uid).append(", ");
|
||||
sql.append(sigid).append(", '").append(SQLUtil.encodeString(ip)).append("', ");
|
||||
sql.append(cid).append(", '").append(SQLUtil.encodeString(ip)).append("', ");
|
||||
sql.append(SQLUtil.encodeStringArg(data[0])).append(", ").append(SQLUtil.encodeStringArg(data[1]));
|
||||
sql.append(", ").append(SQLUtil.encodeStringArg(data[2])).append(", ");
|
||||
sql.append(SQLUtil.encodeStringArg(data[3])).append(");");
|
||||
@@ -361,7 +361,7 @@ public class AuditRecord implements AuditData
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static List getAuditRecords(Connection conn, int sigid, int offset, int count)
|
||||
public static List getAuditRecords(Connection conn, int cid, int offset, int count)
|
||||
throws SQLException, DataException
|
||||
{
|
||||
ArrayList rc = new ArrayList();
|
||||
@@ -369,8 +369,8 @@ public class AuditRecord implements AuditData
|
||||
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT * FROM audit");
|
||||
if (sigid>0)
|
||||
sql.append(" WHERE sigid = ").append(sigid);
|
||||
if (cid>0)
|
||||
sql.append(" WHERE sigid = ").append(cid);
|
||||
sql.append(" ORDER BY on_date DESC LIMIT ").append(offset).append(", ").append(count).append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
|
||||
@@ -385,12 +385,12 @@ public class AuditRecord implements AuditData
|
||||
|
||||
} // end getAuditRecords
|
||||
|
||||
public static int getAuditRecordCount(Connection conn, int sigid) throws SQLException
|
||||
public static int getAuditRecordCount(Connection conn, int cid) throws SQLException
|
||||
{
|
||||
Statement stmt = conn.createStatement();
|
||||
StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM audit");
|
||||
if (sigid>0)
|
||||
sql.append(" WHERE sigid = ").append(sigid);
|
||||
if (cid>0)
|
||||
sql.append(" WHERE sigid = ").append(cid);
|
||||
sql.append(';');
|
||||
ResultSet rs = stmt.executeQuery(sql.toString());
|
||||
if (!(rs.next()))
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Capability implements SecLevels
|
||||
|
||||
public static boolean isCommunityAdmin(int level)
|
||||
{
|
||||
return (level>=SIG_ANYADMIN);
|
||||
return (level>=COMM_ANYADMIN);
|
||||
|
||||
} // end isCommunityAdmin
|
||||
|
||||
@@ -55,39 +55,39 @@ public class Capability implements SecLevels
|
||||
|
||||
} // end exemptFromMembershipRequirement
|
||||
|
||||
public static boolean hideHiddenSearchSIGs(int level)
|
||||
public static boolean hideHiddenSearchCommunities(int level)
|
||||
{
|
||||
return (level<GLOBAL_ANYADMIN);
|
||||
|
||||
} // end hideHiddenSearchSIGs
|
||||
} // end hideHiddenSearchCommunities
|
||||
|
||||
public static boolean hideHiddenDirectorySIGs(int level)
|
||||
public static boolean hideHiddenDirectoryCommunities(int level)
|
||||
{
|
||||
return (level<GLOBAL_ANYADMIN);
|
||||
|
||||
} // end hideHiddenSearchSIGs
|
||||
} // end hideHiddenSearchCommunities
|
||||
|
||||
public static boolean canJoinPrivateSIGWithoutKey(int level)
|
||||
public static boolean canJoinPrivateCommunityWithoutKey(int level)
|
||||
{
|
||||
return (level>=GLOBAL_ANYADMIN);
|
||||
|
||||
} // end canJoinPrivateSIGWithoutKey
|
||||
} // end canJoinPrivateCommunityWithoutKey
|
||||
|
||||
public static boolean showHiddenSearchCategories(int level)
|
||||
{
|
||||
return (level>=GLOBAL_ANYADMIN);
|
||||
|
||||
} // end hideHiddenSearchSIGs
|
||||
} // end showHioddenSearchCategories
|
||||
|
||||
public static boolean showHiddenSIGMembers(int level)
|
||||
public static boolean showHiddenCommunityMembers(int level)
|
||||
{
|
||||
return (level>=SIG_ANYADMIN);
|
||||
return (level>=COMM_ANYADMIN);
|
||||
|
||||
} // end showHiddenSIGMembers
|
||||
} // end showHiddenCommunityMembers
|
||||
|
||||
public static boolean hideHiddenConferences(int level)
|
||||
{
|
||||
return (level<SIG_ANYADMIN);
|
||||
return (level<COMM_ANYADMIN);
|
||||
|
||||
} // end hideHiddenConferences
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* 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 Community System.
|
||||
* 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
|
||||
@@ -25,11 +25,11 @@ public class DefaultLevels implements SecLevels
|
||||
|
||||
} // end newUser
|
||||
|
||||
public static int memberSIG()
|
||||
public static int memberCommunity()
|
||||
{
|
||||
return SIG_MEMBER;
|
||||
return COMM_MEMBER;
|
||||
|
||||
} // end memberSIG
|
||||
} // end memberCommunity
|
||||
|
||||
public static int PFY()
|
||||
{
|
||||
@@ -49,41 +49,41 @@ public class DefaultLevels implements SecLevels
|
||||
|
||||
} // end afterEmailAddressChange
|
||||
|
||||
public static int newSIGRead()
|
||||
public static int newCommunityRead()
|
||||
{
|
||||
return SIG_MEMBER;
|
||||
return COMM_MEMBER;
|
||||
|
||||
} // end newSIGRead
|
||||
} // end newCommunityRead
|
||||
|
||||
public static int newSIGWrite()
|
||||
public static int newCommunityWrite()
|
||||
{
|
||||
return SIG_COHOST;
|
||||
return COMM_COHOST;
|
||||
|
||||
} // end newSIGWrite
|
||||
} // end newCommunityWrite
|
||||
|
||||
public static int newSIGCreate()
|
||||
public static int newCommunityCreate()
|
||||
{
|
||||
return SIG_COHOST;
|
||||
return COMM_COHOST;
|
||||
|
||||
} // end newSIGCreate
|
||||
} // end newCommunityCreate
|
||||
|
||||
public static int newSIGDelete()
|
||||
public static int newCommunityDelete()
|
||||
{
|
||||
return SIG_HOST;
|
||||
return COMM_HOST;
|
||||
|
||||
} // end newSIGDelete
|
||||
} // end newCommunityDelete
|
||||
|
||||
public static int newSIGJoin()
|
||||
public static int newCommunityJoin()
|
||||
{
|
||||
return GLOBAL_NORMAL;
|
||||
|
||||
} // end newSIGJoin
|
||||
} // end newCommunityJoin
|
||||
|
||||
public static int creatorSIG()
|
||||
public static int creatorCommunity()
|
||||
{
|
||||
return SIG_HOST;
|
||||
return COMM_HOST;
|
||||
|
||||
} // end creatorSIG
|
||||
} // end creatorCommunity
|
||||
|
||||
public static int hostPrivsConference()
|
||||
{
|
||||
@@ -105,19 +105,19 @@ public class DefaultLevels implements SecLevels
|
||||
|
||||
public static int newConferenceRead(boolean pvt)
|
||||
{
|
||||
return (pvt ? CONFERENCE_MEMBER : SIG_MEMBER);
|
||||
return (pvt ? CONFERENCE_MEMBER : COMM_MEMBER);
|
||||
|
||||
} // end newConferenceRead
|
||||
|
||||
public static int newConferencePost(boolean pvt)
|
||||
{
|
||||
return (pvt ? CONFERENCE_MEMBER : SIG_MEMBER);
|
||||
return (pvt ? CONFERENCE_MEMBER : COMM_MEMBER);
|
||||
|
||||
} // end newConferencePost
|
||||
|
||||
public static int newConferenceCreate(boolean pvt)
|
||||
{
|
||||
return (pvt ? CONFERENCE_MEMBER : SIG_MEMBER);
|
||||
return (pvt ? CONFERENCE_MEMBER : COMM_MEMBER);
|
||||
|
||||
} // end newConferencePost
|
||||
|
||||
@@ -141,7 +141,7 @@ public class DefaultLevels implements SecLevels
|
||||
|
||||
public static int newConferenceDelete()
|
||||
{
|
||||
return SIG_COHOST;
|
||||
return COMM_COHOST;
|
||||
|
||||
} // end newConferenceHide
|
||||
|
||||
|
||||
@@ -30,23 +30,23 @@ public class Role implements Comparable, SecLevels
|
||||
private static Role no_access;
|
||||
private static Role unrestricted_user;
|
||||
private static Role global_admin;
|
||||
private static Role sig_host;
|
||||
private static Role comm_host;
|
||||
private static ArrayList global_low;
|
||||
private static ArrayList global_high;
|
||||
private static ArrayList sig_low;
|
||||
private static ArrayList sig_high;
|
||||
private static ArrayList comm_low;
|
||||
private static ArrayList comm_high;
|
||||
private static ArrayList conf_low;
|
||||
private static ArrayList conf_high;
|
||||
private static HashMap all_roles;
|
||||
|
||||
private static List base_levels = null;
|
||||
private static List base_levels_2 = null;
|
||||
private static List sigreadlist_rc = null;
|
||||
private static List sigwritelist_rc = null;
|
||||
private static List sigcreatelist_rc = null;
|
||||
private static List sigdeletelist_rc = null;
|
||||
private static List sigjoinlist_rc = null;
|
||||
private static List sig_member_levels = null;
|
||||
private static List commreadlist_rc = null;
|
||||
private static List commwritelist_rc = null;
|
||||
private static List commcreatelist_rc = null;
|
||||
private static List commdeletelist_rc = null;
|
||||
private static List commjoinlist_rc = null;
|
||||
private static List comm_member_levels = null;
|
||||
private static List confreadlist_rc = null;
|
||||
private static List confpostlist_rc = null;
|
||||
private static List confhidelist_rc = null;
|
||||
@@ -182,105 +182,105 @@ public class Role implements Comparable, SecLevels
|
||||
|
||||
} // end getGlobalAdmin
|
||||
|
||||
public static List getSIGReadList()
|
||||
public static List getCommunityReadList()
|
||||
{
|
||||
if (sigreadlist_rc==null)
|
||||
if (commreadlist_rc==null)
|
||||
{ // create the returned list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(global_low);
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.add(unrestricted_user);
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.add(global_high.get(0));
|
||||
sigreadlist_rc = Collections.unmodifiableList(rc);
|
||||
commreadlist_rc = Collections.unmodifiableList(rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return sigreadlist_rc;
|
||||
return commreadlist_rc;
|
||||
|
||||
} // end getSIGReadList
|
||||
} // end getCommunityReadList
|
||||
|
||||
public static List getSIGWriteList()
|
||||
public static List getCommunityWriteList()
|
||||
{
|
||||
if (sigwritelist_rc==null)
|
||||
if (commwritelist_rc==null)
|
||||
{ // build the return value
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.addAll(global_high);
|
||||
sigwritelist_rc = Collections.unmodifiableList(rc);
|
||||
commwritelist_rc = Collections.unmodifiableList(rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return sigwritelist_rc;
|
||||
return commwritelist_rc;
|
||||
|
||||
} // end getSIGWriteList
|
||||
} // end getCommunityWriteList
|
||||
|
||||
public static List getSIGCreateList()
|
||||
public static List getCommunityCreateList()
|
||||
{
|
||||
if (sigcreatelist_rc==null)
|
||||
if (commcreatelist_rc==null)
|
||||
{ // create the return list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.add(global_low.get(global_low.size()-1));
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.add(unrestricted_user);
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.add(global_high.get(0));
|
||||
sigcreatelist_rc = Collections.unmodifiableList(rc);
|
||||
commcreatelist_rc = Collections.unmodifiableList(rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return sigcreatelist_rc;
|
||||
return commcreatelist_rc;
|
||||
|
||||
} // end getSIGCreateList
|
||||
} // end getCommunityCreateList
|
||||
|
||||
public static List getSIGDeleteList()
|
||||
public static List getCommunityDeleteList()
|
||||
{
|
||||
if (sigdeletelist_rc==null)
|
||||
if (commdeletelist_rc==null)
|
||||
{ // create the return list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.addAll(global_high);
|
||||
rc.add(no_access);
|
||||
sigdeletelist_rc = Collections.unmodifiableList(rc);
|
||||
commdeletelist_rc = Collections.unmodifiableList(rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return sigdeletelist_rc;
|
||||
return commdeletelist_rc;
|
||||
|
||||
} // end getSIGDeleteList
|
||||
} // end getCommunityDeleteList
|
||||
|
||||
public static List getSIGJoinList()
|
||||
public static List getCommunityJoinList()
|
||||
{
|
||||
if (sigjoinlist_rc==null)
|
||||
sigjoinlist_rc = Collections.unmodifiableList(global_low);
|
||||
return sigjoinlist_rc;
|
||||
if (commjoinlist_rc==null)
|
||||
commjoinlist_rc = Collections.unmodifiableList(global_low);
|
||||
return commjoinlist_rc;
|
||||
|
||||
} // end getSIGJoinList
|
||||
} // end getCommunityJoinList
|
||||
|
||||
public static List getSIGMemberLevelChoices()
|
||||
public static List getCommunityMemberLevelChoices()
|
||||
{
|
||||
if (sig_member_levels==null)
|
||||
if (comm_member_levels==null)
|
||||
{ // figure out the member levels list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.add(not_in_list);
|
||||
rc.addAll(global_low);
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.add(unrestricted_user);
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.remove(rc.size()-1);
|
||||
sig_member_levels = Collections.unmodifiableList(rc);
|
||||
comm_member_levels = Collections.unmodifiableList(rc);
|
||||
|
||||
} // end if
|
||||
|
||||
return sig_member_levels;
|
||||
return comm_member_levels;
|
||||
|
||||
} // end getSIGMemberLevelChoices
|
||||
} // end getCommunityMemberLevelChoices
|
||||
|
||||
public static Role getSIGHostRole()
|
||||
public static Role getCommunityHostRole()
|
||||
{
|
||||
return sig_host;
|
||||
return comm_host;
|
||||
|
||||
} // end getSIGHostRole
|
||||
} // end getCommunityHostRole
|
||||
|
||||
public static List getConferenceReadList()
|
||||
{
|
||||
@@ -288,7 +288,7 @@ public class Role implements Comparable, SecLevels
|
||||
{ // precalculate the conference read list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(global_low);
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.addAll(conf_low);
|
||||
rc.add(unrestricted_user);
|
||||
confreadlist_rc = Collections.unmodifiableList(rc);
|
||||
@@ -305,7 +305,7 @@ public class Role implements Comparable, SecLevels
|
||||
{ // precalculate the post list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(global_low);
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.addAll(conf_low);
|
||||
rc.add(unrestricted_user);
|
||||
rc.addAll(conf_high);
|
||||
@@ -329,7 +329,7 @@ public class Role implements Comparable, SecLevels
|
||||
{ // precalculate the hide list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(conf_high);
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.add(global_high.get(0));
|
||||
confhidelist_rc = Collections.unmodifiableList(rc);
|
||||
|
||||
@@ -356,7 +356,7 @@ public class Role implements Comparable, SecLevels
|
||||
if (confdeletelist_rc==null)
|
||||
{ // precalculate the delete list
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.addAll(sig_high);
|
||||
rc.addAll(comm_high);
|
||||
rc.addAll(global_high);
|
||||
rc.add(no_access);
|
||||
confdeletelist_rc = Collections.unmodifiableList(rc);
|
||||
@@ -374,7 +374,7 @@ public class Role implements Comparable, SecLevels
|
||||
ArrayList rc = new ArrayList();
|
||||
rc.add(not_in_list);
|
||||
rc.addAll(global_low);
|
||||
rc.addAll(sig_low);
|
||||
rc.addAll(comm_low);
|
||||
rc.addAll(conf_low);
|
||||
rc.add(unrestricted_user);
|
||||
rc.add(conf_high.get(conf_high.size()-1));
|
||||
@@ -429,25 +429,25 @@ public class Role implements Comparable, SecLevels
|
||||
all_roles.put(new Integer(GLOBAL_BOFH),global_admin);
|
||||
global_high.trimToSize();
|
||||
|
||||
// initialize the "SIG lowband" vector
|
||||
sig_low = new ArrayList(1);
|
||||
tmp = new Role(SIG_MEMBER,"SIG Member");
|
||||
sig_low.add(tmp);
|
||||
all_roles.put(new Integer(SIG_MEMBER),tmp);
|
||||
sig_low.trimToSize();
|
||||
// initialize the "community lowband" vector
|
||||
comm_low = new ArrayList(1);
|
||||
tmp = new Role(COMM_MEMBER,"Community Member");
|
||||
comm_low.add(tmp);
|
||||
all_roles.put(new Integer(COMM_MEMBER),tmp);
|
||||
comm_low.trimToSize();
|
||||
|
||||
// initialize the "SIG highband" vector
|
||||
sig_high = new ArrayList(3);
|
||||
tmp = new Role(SIG_ANYADMIN,"Any SIG Administrator");
|
||||
sig_high.add(tmp);
|
||||
all_roles.put(new Integer(SIG_ANYADMIN),tmp);
|
||||
tmp = new Role(SIG_COHOST,"SIG Co-Host");
|
||||
sig_high.add(tmp);
|
||||
all_roles.put(new Integer(SIG_COHOST),tmp);
|
||||
sig_host = new Role(SIG_HOST,"SIG Host");
|
||||
sig_high.add(sig_host);
|
||||
all_roles.put(new Integer(SIG_HOST),sig_host);
|
||||
sig_high.trimToSize();
|
||||
// initialize the "communtiy highband" vector
|
||||
comm_high = new ArrayList(3);
|
||||
tmp = new Role(COMM_ANYADMIN,"Any Community Administrator");
|
||||
comm_high.add(tmp);
|
||||
all_roles.put(new Integer(COMM_ANYADMIN),tmp);
|
||||
tmp = new Role(COMM_COHOST,"Community Co-Host");
|
||||
comm_high.add(tmp);
|
||||
all_roles.put(new Integer(COMM_COHOST),tmp);
|
||||
comm_host = new Role(COMM_HOST,"Community Host");
|
||||
comm_high.add(comm_host);
|
||||
all_roles.put(new Integer(COMM_HOST),comm_host);
|
||||
comm_high.trimToSize();
|
||||
|
||||
// initialize the "conference lowband" vector
|
||||
conf_low = new ArrayList(1);
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface SecLevels
|
||||
{
|
||||
/**
|
||||
* Indicates "no access" (not even to the global system administrator). Used as the
|
||||
* "delete" level for the Administration SIG, so it can't be accidentally deleted.
|
||||
* "delete" level for the Administration Community, so it can't be accidentally deleted.
|
||||
*/
|
||||
public static final int NO_ACCESS = 65500;
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ public interface SecLevels
|
||||
public static final int UNRESTRICTED_USER = 32500;
|
||||
/**
|
||||
* Indicates a user that has not logged in ("Anonymous Honyak"). Can be used as a
|
||||
* permission level for SIGs and conferences to permit public reading and/or anonymous
|
||||
* permission level for communities and conferences to permit public reading and/or anonymous
|
||||
* posting.
|
||||
*/
|
||||
public static final int GLOBAL_ANONYMOUS = 100;
|
||||
@@ -42,7 +42,7 @@ public interface SecLevels
|
||||
public static final int GLOBAL_UNVERIFIED = 500;
|
||||
/**
|
||||
* Indicates a user that has registered and been verified. Can be used as a permission
|
||||
* level for SIGs and conferences to permit reading and/or posting by nonmembers.
|
||||
* level for communities and conferences to permit reading and/or posting by nonmembers.
|
||||
*/
|
||||
public static final int GLOBAL_NORMAL = 1000;
|
||||
/**
|
||||
@@ -61,26 +61,26 @@ public interface SecLevels
|
||||
*/
|
||||
public static final int GLOBAL_ANYADMIN = 63000;
|
||||
/**
|
||||
* The security level assigned to members of a SIG within that SIG.
|
||||
* The security level assigned to members of a community within that community.
|
||||
*/
|
||||
public static final int SIG_MEMBER = 6500;
|
||||
public static final int COMM_MEMBER = 6500;
|
||||
/**
|
||||
* The security level assigned to cohosts of a SIG within that SIG.
|
||||
* The security level assigned to cohosts of a community within that community.
|
||||
*/
|
||||
public static final int SIG_COHOST = 58000;
|
||||
public static final int COMM_COHOST = 58000;
|
||||
/**
|
||||
* The security level assigned to hosts of a SIG within that SIG.
|
||||
* The security level assigned to hosts of a community within that community.
|
||||
*/
|
||||
public static final int SIG_HOST = 58500;
|
||||
public static final int COMM_HOST = 58500;
|
||||
/**
|
||||
* A security level used to indicate any account with admin privileges over a specific SIG.
|
||||
* A security level used to indicate any account with admin privileges over a specific community.
|
||||
*/
|
||||
public static final int SIG_ANYADMIN = 57000;
|
||||
public static final int COMM_ANYADMIN = 57000;
|
||||
/**
|
||||
* The maximum level in the "high band" of the SIG scope; used to test if a user already has
|
||||
* maximum privs within the SIG (because of being an admin at global scope, perhaps).
|
||||
* The maximum level in the "high band" of the community scope; used to test if a user already has
|
||||
* maximum privs within the community (because of being an admin at global scope, perhaps).
|
||||
*/
|
||||
public static final int SIG_MAXADMIN = 58999;
|
||||
public static final int COMM_MAXADMIN = 58999;
|
||||
/**
|
||||
* The security level assigned to members of a (private) conference within that conference.
|
||||
*/
|
||||
|
||||
@@ -58,12 +58,12 @@ public class Attachment extends VeniceServlet
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
|
||||
// get the conference
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,"top");
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
|
||||
|
||||
// get the message we want to use
|
||||
TopicMessageContext msg = getMessageParameter(request,conf,true,"top");
|
||||
@@ -125,14 +125,14 @@ public class Attachment extends VeniceServlet
|
||||
|
||||
} // end if
|
||||
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(mphandler,user,true,"top");
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(mphandler,user,true,"top");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIG param: #" + sig.getSIGID());
|
||||
changeMenuSIG(request,sig);
|
||||
logger.debug("community param: #" + comm.getCommunityID());
|
||||
changeMenuCommunity(request,comm);
|
||||
|
||||
// get the conference
|
||||
ConferenceContext conf = getConferenceParameter(mphandler,sig,true,"top");
|
||||
ConferenceContext conf = getConferenceParameter(mphandler,comm,true,"top");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Conference param: #" + conf.getConfID());
|
||||
|
||||
|
||||
+117
-104
@@ -27,56 +27,56 @@ import com.silverwrist.venice.ValidationException;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class SIGAdmin extends VeniceServlet
|
||||
public class CommunityAdmin extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static final String DELETE_CONFIRM_ATTR = "servlets.SIGAdmin.delete.confirm";
|
||||
private static final String DELETE_CONFIRM_ATTR = "servlets.CommunityAdmin.delete.confirm";
|
||||
private static final String DELETE_CONFIRM_PARAM = "confirm";
|
||||
|
||||
private static Category logger = Category.getInstance(SIGAdmin.class.getName());
|
||||
private static Category logger = Category.getInstance(CommunityAdmin.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal functions
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGAdminTop makeSIGAdminTop() throws ServletException
|
||||
private CommunityAdminTop makeCommunityAdminTop() throws ServletException
|
||||
{
|
||||
final String desired_name = "SIGAdminTop";
|
||||
final String desired_name = "CommunityAdminTop";
|
||||
MenuPanelCache cache = MenuPanelCache.getMenuPanelCache(getServletContext());
|
||||
|
||||
if (!(cache.isCached(desired_name)))
|
||||
{ // create a template and save it off
|
||||
SIGAdminTop template = new SIGAdminTop();
|
||||
CommunityAdminTop template = new CommunityAdminTop();
|
||||
cache.saveTemplate(template);
|
||||
|
||||
} // end if
|
||||
|
||||
// return a new copy
|
||||
return (SIGAdminTop)(cache.getNewMenuPanel(desired_name));
|
||||
return (CommunityAdminTop)(cache.getNewMenuPanel(desired_name));
|
||||
|
||||
} // end makeSIGAdminTop
|
||||
} // end makeCommunityAdminTop
|
||||
|
||||
private EditSIGProfileDialog makeEditSIGProfileDialog() throws ServletException
|
||||
private EditCommunityProfileDialog makeEditCommunityProfileDialog() throws ServletException
|
||||
{
|
||||
final String desired_name = "EditSIGProfileDialog";
|
||||
final String desired_name = "EditCommunityProfileDialog";
|
||||
DialogCache cache = DialogCache.getDialogCache(getServletContext());
|
||||
|
||||
if (!(cache.isCached(desired_name)))
|
||||
{ // create a template and save it off
|
||||
EditSIGProfileDialog template = new EditSIGProfileDialog(getCountryList(),getLanguageList());
|
||||
EditCommunityProfileDialog template = new EditCommunityProfileDialog(getCountryList(),getLanguageList());
|
||||
cache.saveTemplate(template);
|
||||
|
||||
} // end if
|
||||
|
||||
// return a new copy
|
||||
return (EditSIGProfileDialog)(cache.getNewDialog(desired_name));
|
||||
return (EditCommunityProfileDialog)(cache.getNewDialog(desired_name));
|
||||
|
||||
} // end makeEditSIGProfileDialog
|
||||
} // end makeEditCommunityProfileDialog
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
@@ -85,7 +85,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "SIGAdmin servlet - Administrative functions for SIGs\n"
|
||||
String rc = "CommunityAdmin servlet - Administrative functions for communities\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
@@ -100,47 +100,50 @@ public class SIGAdmin extends VeniceServlet
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG context
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
// get the community context
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
setMyLocation(request,"sigadmin?" + request.getQueryString());
|
||||
String on_error = "sigadmin?sig=" + sig.getSIGID();
|
||||
String on_error = "sigadmin?sig=" + comm.getCommunityID();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIGAdmin/doGet operating on SIG \"" + sig.getName() + "\" (" + sig.getSIGID() + ")");
|
||||
logger.debug("CommunityAdmin/doGet operating on community \"" + comm.getName() + "\" ("
|
||||
+ comm.getCommunityID() + ")");
|
||||
|
||||
// now decide what to do based on the "cmd" parameter
|
||||
String cmd = getStandardCommandParam(request);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIGAdmin/doGet command value = " + cmd);
|
||||
logger.debug("CommunityAdmin/doGet command value = " + cmd);
|
||||
|
||||
if (cmd.equals("P"))
|
||||
{ // "P" = "Edit Profile"
|
||||
if (!(sig.canModifyProfile()))
|
||||
if (!(comm.canModifyProfile()))
|
||||
{ // no access - sorry, dude
|
||||
logger.error("tried to call up SIG profile screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
|
||||
logger.error("tried to call up community profile screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
|
||||
on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
// construct the edit profile dialog and load it up for use
|
||||
EditSIGProfileDialog dlg = makeEditSIGProfileDialog();
|
||||
EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog();
|
||||
|
||||
try
|
||||
{ // load the values for this dialog
|
||||
dlg.setupDialog(engine,sig);
|
||||
dlg.setupDialog(engine,comm);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // we could not load the values because of a data exception
|
||||
logger.error("DB error loading SIG profile: " + de.getMessage(),de);
|
||||
logger.error("DB error loading community profile: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error retrieving profile: " + de.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // we don't have enough privilege
|
||||
logger.error("Access error loading SIG profile: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
|
||||
logger.error("Access error loading community profile: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
|
||||
@@ -150,10 +153,11 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
if (cmd.equals("T"))
|
||||
{ // "T" = "Set Category"
|
||||
if (!(sig.canModifyProfile()))
|
||||
if (!(comm.canModifyProfile()))
|
||||
{ // no access - sorry man
|
||||
logger.error("tried to call up SIG category set screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
|
||||
logger.error("tried to call up community category set screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
|
||||
on_error);
|
||||
|
||||
} // end else
|
||||
|
||||
@@ -168,7 +172,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
throw new NumberFormatException(); // dump the category if it's not valid
|
||||
|
||||
// change the category ID
|
||||
sig.setCategoryID(catid);
|
||||
comm.setCategoryID(catid);
|
||||
|
||||
} // end try
|
||||
catch (NumberFormatException nfe)
|
||||
@@ -177,14 +181,15 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // unable to update the SIG properly
|
||||
logger.error("DB error updating SIG: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error updating SIG: " + de.getMessage(),on_error);
|
||||
{ // unable to update the community properly
|
||||
logger.error("DB error updating community: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // database access error - display an error box
|
||||
logger.error("Access error updating SIG: " + ae.getMessage(),ae);
|
||||
logger.error("Access error updating community: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Access Error",ae.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
@@ -200,7 +205,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
p = request.getParameter("go");
|
||||
int curr_catid;
|
||||
if (StringUtil.isStringEmpty(p))
|
||||
curr_catid = sig.getCategoryID();
|
||||
curr_catid = comm.getCategoryID();
|
||||
else
|
||||
curr_catid = Integer.parseInt(p);
|
||||
|
||||
@@ -208,7 +213,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
throw new NumberFormatException(); // dump the category if it's not valid
|
||||
|
||||
// create the browser panel and let it rip
|
||||
return new SIGCategoryBrowseData(user,sig,curr_catid);
|
||||
return new CommunityCategoryBrowseData(user,comm,curr_catid);
|
||||
|
||||
} // end try
|
||||
catch (NumberFormatException nfe)
|
||||
@@ -230,24 +235,25 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
if (cmd.equals("M"))
|
||||
{ // "M" = Set Membership
|
||||
if (!(sig.canModifyProfile()))
|
||||
if (!(comm.canModifyProfile()))
|
||||
{ // no access - sorry man
|
||||
logger.error("tried to call up membership set screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's membership.",on_error);
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
|
||||
on_error);
|
||||
|
||||
} // end else
|
||||
|
||||
try
|
||||
{ // display the conference member list!
|
||||
SIGMembership m = new SIGMembership(engine,sig);
|
||||
m.doSIGMemberList();
|
||||
setMyLocation(request,"sigadmin?sig=" + sig.getSIGID() + "&cmd=M");
|
||||
CommunityMembership m = new CommunityMembership(engine,comm);
|
||||
m.doCommunityMemberList();
|
||||
setMyLocation(request,"sigadmin?sig=" + comm.getCommunityID() + "&cmd=M");
|
||||
return m;
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // something wrong in the database
|
||||
return new ErrorBox("Database Error","Database error listing SIG members: " + de.getMessage(),
|
||||
return new ErrorBox("Database Error","Database error listing community members: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
@@ -273,12 +279,13 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end catch
|
||||
|
||||
// generate the lists
|
||||
List audit_list = sig.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
|
||||
int audit_count = sig.getAuditRecordCount();
|
||||
List audit_list = comm.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
|
||||
int audit_count = comm.getAuditRecordCount();
|
||||
|
||||
// return the audit viewer
|
||||
return new AuditDataViewer(engine,audit_list,offset,audit_count,"Audit Records for SIG \""
|
||||
+ sig.getName() + "\"","sigadmin?sig=" + sig.getSIGID() + "&cmd=A&ofs=%");
|
||||
return new AuditDataViewer(engine,audit_list,offset,audit_count,"Audit Records for Community \""
|
||||
+ comm.getName() + "\"","sigadmin?sig=" + comm.getCommunityID()
|
||||
+ "&cmd=A&ofs=%");
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
@@ -296,42 +303,44 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end if ("A" command)
|
||||
|
||||
if (cmd.equals("DEL"))
|
||||
{ // "DEL" = "Delete SIG" (requires a confirmation)
|
||||
if (!(sig.canDelete()))
|
||||
{ // we can't delete the SIG, so what are we doing here?
|
||||
logger.error("you can't delete the SIG - not gonna do it, wouldn't be prudent");
|
||||
return new ErrorBox("Access Error","You do not have permission to delete this SIG.",on_error);
|
||||
{ // "DEL" = "Delete Community" (requires a confirmation)
|
||||
if (!(comm.canDelete()))
|
||||
{ // we can't delete the community, so what are we doing here?
|
||||
logger.error("you can't delete the community - not gonna do it, wouldn't be prudent");
|
||||
return new ErrorBox("Access Error","You do not have permission to delete this community.",on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
|
||||
{ // we are confirmed - delete the SIG!
|
||||
{ // we are confirmed - delete the community!
|
||||
try
|
||||
{ // delete the SIG!
|
||||
sig.delete();
|
||||
{ // delete the community!
|
||||
comm.delete();
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // something wrong in the database
|
||||
logger.error("Database error deleting SIG: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error deleting SIG: " + de.getMessage(),on_error);
|
||||
logger.error("Database error deleting community: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error deleting community: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // access error changing the SIG values
|
||||
logger.error("Access error deleting SIG: " + ae.getMessage(),ae);
|
||||
{ // access error changing the community values
|
||||
logger.error("Access error deleting community: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Access Error",ae.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
|
||||
// the SIG is now GONE - there's noplace else to go but back to the Top page
|
||||
// the community is now GONE - there's noplace else to go but back to the Top page
|
||||
throw new RedirectResult("top");
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // throw up a confirm box to let the user think it over
|
||||
String message = "You are about to permanently delete the \"" + sig.getName() + "\" SIG, including "
|
||||
+ "all conferences and other resources it contains! Are you sure you want to do this?";
|
||||
String message = "You are about to permanently delete the \"" + comm.getName() + "\" community, "
|
||||
+ "including all conferences and other resources it contains! Are you sure you want "
|
||||
+ "to do this?";
|
||||
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
|
||||
on_error + "&cmd=DEL",on_error);
|
||||
|
||||
@@ -340,16 +349,16 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end if ("DEL" command)
|
||||
|
||||
// all unknown requests get turned into menu display requests
|
||||
if (!(sig.canAdministerSIG()))
|
||||
if (!(comm.canAdministerCommunity()))
|
||||
{ // no access - sorry buddy
|
||||
logger.error("tried to call up SIG admin menu without access...naughty naughty!");
|
||||
return new ErrorBox("Access Error","You do not have access to administer this SIG.",on_error);
|
||||
logger.error("tried to call up community admin menu without access...naughty naughty!");
|
||||
return new ErrorBox("Access Error","You do not have access to administer this community.",on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
// create a SIG administration menu
|
||||
SIGAdminTop menu = makeSIGAdminTop();
|
||||
menu.setSIG(sig);
|
||||
// create a community administration menu
|
||||
CommunityAdminTop menu = makeCommunityAdminTop();
|
||||
menu.setCommunity(comm);
|
||||
return menu;
|
||||
|
||||
} // end doVeniceGet
|
||||
@@ -358,43 +367,45 @@ public class SIGAdmin extends VeniceServlet
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG context
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
String on_error = "sigadmin?sig=" + sig.getSIGID();
|
||||
// get the community context
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
String on_error = "sigadmin?sig=" + comm.getCommunityID();
|
||||
setMyLocation(request,on_error);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIGAdmin/doPost operating on SIG \"" + sig.getName() + "\" (" + sig.getSIGID() + ")");
|
||||
logger.debug("CommunityAdmin/doPost operating on community \"" + comm.getName() + "\" ("
|
||||
+ comm.getCommunityID() + ")");
|
||||
|
||||
// now decide what to do based on the "cmd" parameter
|
||||
String cmd = getStandardCommandParam(request);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIGAdmin/doPost command value = " + cmd);
|
||||
logger.debug("CommunityAdmin/doPost command value = " + cmd);
|
||||
|
||||
if (cmd.equals("P"))
|
||||
{ // "P" = "Edit Profile"
|
||||
if (!(sig.canModifyProfile()))
|
||||
if (!(comm.canModifyProfile()))
|
||||
{ // no access - sorry, dude
|
||||
logger.error("tried to call up SIG profile screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's profile.",on_error);
|
||||
logger.error("tried to call up community profile screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
|
||||
on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
// construct the edit profile dialog and load it up for use
|
||||
EditSIGProfileDialog dlg = makeEditSIGProfileDialog();
|
||||
dlg.setupDialogBasic(engine,sig);
|
||||
EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog();
|
||||
dlg.setupDialogBasic(engine,comm);
|
||||
|
||||
if (dlg.isButtonClicked(request,"cancel"))
|
||||
throw new RedirectResult(on_error); // go back - they canceled out
|
||||
|
||||
if (dlg.isButtonClicked(request,"update"))
|
||||
{ // begin updating the SIG's contents
|
||||
{ // begin updating the community's contents
|
||||
dlg.loadValues(request); // do value loading now
|
||||
|
||||
try
|
||||
{ // attempt to change the SIG profile now...
|
||||
dlg.doDialog(sig);
|
||||
{ // attempt to change the community profile now...
|
||||
dlg.doDialog(comm);
|
||||
|
||||
// now jump back to the main menu
|
||||
clearMenu(request);
|
||||
@@ -405,18 +416,19 @@ public class SIGAdmin extends VeniceServlet
|
||||
{ // simple validation exception
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("validation failure: " + ve.getMessage());
|
||||
dlg.resetOnError(sig,ve.getMessage() + " Please try again.");
|
||||
dlg.resetOnError(comm,ve.getMessage() + " Please try again.");
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // database error updating the SIG values
|
||||
logger.error("DB error updating SIG: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error updating SIG: " + de.getMessage(),on_error);
|
||||
{ // database error updating the community values
|
||||
logger.error("DB error updating community: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // access error changing the SIG values
|
||||
logger.error("Access error updating SIG: " + ae.getMessage(),ae);
|
||||
{ // access error changing the community values
|
||||
logger.error("Access error updating community: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Access Error",ae.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
@@ -426,20 +438,21 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end if ("update" pressed)
|
||||
|
||||
// what the hell was that button?
|
||||
logger.error("no known button click on SIGAdmin.doPost, cmd=P");
|
||||
logger.error("no known button click on CommunityAdmin.doPost, cmd=P");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
|
||||
|
||||
} // end if ("P" command)
|
||||
|
||||
if (cmd.equals("M"))
|
||||
{ // "M" = Modify SIG Membership
|
||||
{ // "M" = Modify Community Membership
|
||||
on_error += "&cmd=M";
|
||||
setMyLocation(request,on_error);
|
||||
|
||||
if (!(sig.canModifyProfile()))
|
||||
if (!(comm.canModifyProfile()))
|
||||
{ // no access - sorry, dude
|
||||
logger.error("tried to call up SIG membership screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this SIG's membership.",on_error);
|
||||
logger.error("tried to call up community membership screen without access...naughty naughty!");
|
||||
return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
|
||||
on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -496,7 +509,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
Integer new_level = (Integer)(new_vals.get(uid));
|
||||
if (new_level==null)
|
||||
{ // whoops
|
||||
logger.error("new SIG level not found for uid " + uid.intValue());
|
||||
logger.error("new community level not found for uid " + uid.intValue());
|
||||
return new ErrorBox(null,"Invalid new level parameter.",on_error);
|
||||
|
||||
} // end if
|
||||
@@ -507,11 +520,11 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
// call down to set the membership level
|
||||
if (org_level.intValue()!=new_level_x)
|
||||
{ // we need to reset the SIG membership
|
||||
{ // we need to reset the community membership
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("resetting SIG member level for uid " + uid.intValue() + "(old = "
|
||||
logger.debug("resetting community member level for uid " + uid.intValue() + "(old = "
|
||||
+ org_level.intValue() + ", new = " + new_level_x + ")");
|
||||
sig.setMembership(uid.intValue(),new_level_x);
|
||||
comm.setMembership(uid.intValue(),new_level_x);
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -520,19 +533,19 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
{ // some sort of access error - display an error dialog
|
||||
logger.error("AccessError on sig.setMembership: " + ae.getMessage(),ae);
|
||||
logger.error("AccessError on comm.setMembership: " + ae.getMessage(),ae);
|
||||
return new ErrorBox("Access Error",ae.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // database error creating the conference
|
||||
logger.error("DataException on sig.setMembership: " + de.getMessage(),de);
|
||||
logger.error("DataException on comm.setMembership: " + de.getMessage(),de);
|
||||
return new ErrorBox("Database Error","Database error setting memberships: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
|
||||
// trap back to the SIG membership display
|
||||
// trap back to the community membership display
|
||||
throw new RedirectResult(on_error);
|
||||
|
||||
} // end if ("update" clicked)
|
||||
@@ -540,7 +553,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
|
||||
|| isImageButtonClicked(request,"next"))
|
||||
{ // create the new dialog box
|
||||
SIGMembership m = new SIGMembership(engine,sig);
|
||||
CommunityMembership m = new CommunityMembership(engine,comm);
|
||||
|
||||
try
|
||||
{ // perform the search!
|
||||
@@ -569,7 +582,7 @@ public class SIGAdmin extends VeniceServlet
|
||||
} // end if (search function clicked)
|
||||
|
||||
// we don't know what button was pressed
|
||||
logger.error("no known button click on SIGAdmin.doPost, cmd=M");
|
||||
logger.error("no known button click on CommunityAdmin.doPost, cmd=M");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
|
||||
|
||||
} // end if ("M" command)
|
||||
@@ -579,4 +592,4 @@ public class SIGAdmin extends VeniceServlet
|
||||
|
||||
} // end doVenicePost
|
||||
|
||||
} // end class SIGAdmin
|
||||
} // end class CommunityAdmin
|
||||
+11
-11
@@ -23,7 +23,7 @@ import javax.servlet.http.*;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class SIGFrontEnd extends VeniceServlet
|
||||
public class CommunityFrontEnd extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
@@ -32,7 +32,7 @@ public class SIGFrontEnd extends VeniceServlet
|
||||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "SIGFrontEnd servlet - Redirects to the \"default feature\" of a SIG\n"
|
||||
String rc = "CommunityFrontEnd servlet - Redirects to the \"default feature\" of a community\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
@@ -47,19 +47,19 @@ public class SIGFrontEnd extends VeniceServlet
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG alias name from the request path info
|
||||
String sigalias = request.getPathInfo().substring(1);
|
||||
// get the community alias name from the request path info
|
||||
String alias = request.getPathInfo().substring(1);
|
||||
|
||||
try
|
||||
{ // get the SIG's context from the alias name
|
||||
SIGContext sig = user.getSIGContext(sigalias);
|
||||
{ // get the community's context from the alias name
|
||||
CommunityContext comm = user.getCommunityContext(alias);
|
||||
|
||||
// get the default servlet from the SIG context
|
||||
String def_servlet = sig.getDefaultApplet();
|
||||
// get the default servlet from the community context
|
||||
String def_servlet = comm.getDefaultApplet();
|
||||
if (def_servlet==null)
|
||||
{ // return the default servlet
|
||||
changeMenuTop(request);
|
||||
return new ErrorBox("Internal Error","unable to get SIG default servlet","top");
|
||||
return new ErrorBox("Internal Error","unable to get community default servlet","top");
|
||||
|
||||
} // end if
|
||||
|
||||
@@ -70,10 +70,10 @@ public class SIGFrontEnd extends VeniceServlet
|
||||
catch (DataException de)
|
||||
{ // set up to display an ErrorBox
|
||||
changeMenuTop(request);
|
||||
return new ErrorBox("Database Error","Database error finding SIG: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Database error finding community: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end doVeniceGet
|
||||
|
||||
} // end class SIGFrontEnd
|
||||
} // end class CommunityFrontEnd
|
||||
+87
-86
@@ -25,17 +25,17 @@ import com.silverwrist.venice.ValidationException;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class SIGOperations extends VeniceServlet
|
||||
public class CommunityOperations extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static final String UNJOIN_CONFIRM_ATTR = "servlets.SIGOperations.unjoin.confirm";
|
||||
private static final String UNJOIN_CONFIRM_ATTR = "servlets.CommunityOperations.unjoin.confirm";
|
||||
private static final String UNJOIN_CONFIRM_PARAM = "confirm";
|
||||
|
||||
private static Category logger = Category.getInstance(SIGOperations.class.getName());
|
||||
private static Category logger = Category.getInstance(CommunityOperations.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal functions
|
||||
@@ -59,22 +59,22 @@ public class SIGOperations extends VeniceServlet
|
||||
|
||||
} // end makeJoinKeyDialog
|
||||
|
||||
private CreateSIGDialog makeCreateSIGDialog() throws ServletException
|
||||
private CreateCommunityDialog makeCreateCommunityDialog() throws ServletException
|
||||
{
|
||||
final String desired_name = "CreateSIGDialog";
|
||||
final String desired_name = "CreateCommunityDialog";
|
||||
DialogCache cache = DialogCache.getDialogCache(getServletContext());
|
||||
|
||||
if (!(cache.isCached(desired_name)))
|
||||
{ // create a template and save it off
|
||||
CreateSIGDialog template = new CreateSIGDialog(getCountryList(),getLanguageList());
|
||||
CreateCommunityDialog template = new CreateCommunityDialog(getCountryList(),getLanguageList());
|
||||
cache.saveTemplate(template);
|
||||
|
||||
} // end if
|
||||
|
||||
// return a new copy
|
||||
return (CreateSIGDialog)(cache.getNewDialog(desired_name));
|
||||
return (CreateCommunityDialog)(cache.getNewDialog(desired_name));
|
||||
|
||||
} // end makeCreateSIGDialog
|
||||
} // end makeCreateCommunityDialog
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
@@ -83,7 +83,7 @@ public class SIGOperations extends VeniceServlet
|
||||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "SIGOperations servlet - General SIG operations (join, unjoin, etc.)\n"
|
||||
String rc = "CommunityOperations servlet - General community operations (join, unjoin, etc.)\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
@@ -103,70 +103,70 @@ public class SIGOperations extends VeniceServlet
|
||||
setMyLocation(request,"sigops?" + request.getQueryString());
|
||||
|
||||
if (cmd.equals("J"))
|
||||
{ // "J" = "Join" (requires SIG parameter)
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
{ // "J" = "Join" (requires community parameter)
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
|
||||
if (!(sig.canJoin())) // not permitted to join!
|
||||
return new ErrorBox("SIG Error","You are not permitted to join this SIG.","top");
|
||||
if (!(comm.canJoin())) // not permitted to join!
|
||||
return new ErrorBox("Community Error","You are not permitted to join this community.","top");
|
||||
|
||||
if (sig.isPublicSIG())
|
||||
if (comm.isPublicCommunity())
|
||||
{ // attempt to join right now! (no join key required)
|
||||
try
|
||||
{ // call down to join the SIG
|
||||
sig.join(null);
|
||||
{ // call down to join the community
|
||||
comm.join(null);
|
||||
|
||||
// success! display the "welcome" page
|
||||
clearMenu(request); // force the clear to regen the menus
|
||||
changeMenuSIG(request,sig);
|
||||
return new SIGWelcome(sig);
|
||||
changeMenuCommunity(request,comm);
|
||||
return new CommunityWelcome(comm);
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
{ // access error
|
||||
return new ErrorBox("Access Error","Unable to join SIG: " + ae.getMessage(),"top");
|
||||
return new ErrorBox("Access Error","Unable to join community: " + ae.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // data exception doing something
|
||||
return new ErrorBox("Database Error","Database error joining SIG: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Database error joining community: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end if (public SIG)
|
||||
} // end if (public community)
|
||||
else
|
||||
{ // we need to prompt them for the join key....
|
||||
JoinKeyDialog dlg = makeJoinKeyDialog();
|
||||
dlg.setupDialog(sig);
|
||||
changeMenuSIG(request,sig);
|
||||
dlg.setupDialog(comm);
|
||||
changeMenuCommunity(request,comm);
|
||||
return dlg;
|
||||
|
||||
} // end else (private SIG)
|
||||
} // end else (private community)
|
||||
|
||||
} // end if ("J" command)
|
||||
|
||||
if (cmd.equals("U"))
|
||||
{ // "U" = "Unjoin (requires SIG parameter)
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
{ // "U" = "Unjoin (requires community parameter)
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
|
||||
if (!(sig.canUnjoin()))
|
||||