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:
parent
fe352efbd1
commit
dde12bdf2e
17
FAQS
17
FAQS
|
@ -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
|
||||
|
|
18
README
18
README
|
@ -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
|
||||
|
|
4
TODO
4
TODO
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
34
etc/web.xml
34
etc/web.xml
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
|
@ -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
|
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();
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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()))
|
||||
return new ErrorBox("SIG Error","You cannot unjoin this SIG.","top");
|
||||
if (!(comm.canUnjoin()))
|
||||
return new ErrorBox("Community Error","You cannot unjoin this community.","top");
|
||||
|
||||
// OK, let's test for a confirmation...
|
||||
if (ConfirmBox.isConfirmed(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM))
|
||||
{ // OK, if you say so, let's unjoin!
|
||||
try
|
||||
{ // do the unjoin now...
|
||||
sig.unjoin();
|
||||
comm.unjoin();
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
{ // access error
|
||||
return new ErrorBox("Access Error","Unable to unjoin SIG: " + ae.getMessage(),"top");
|
||||
return new ErrorBox("Access Error","Unable to unjoin community: " + ae.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // data exception doing something
|
||||
return new ErrorBox("Database Error","Database error unjoining SIG: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Database error unjoining community: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
|
@ -177,21 +177,21 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end if
|
||||
else
|
||||
{ // not a proper confirmation - display the confirm box
|
||||
String message = "Are you sure you want to unjoin the '" + sig.getName() + "' SIG?";
|
||||
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining SIG",
|
||||
message,"sigops?cmd=U&sig=" + sig.getSIGID(),"sig/" + sig.getAlias());
|
||||
String message = "Are you sure you want to unjoin the '" + comm.getName() + "' community?";
|
||||
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining community",
|
||||
message,"sigops?cmd=U&sig=" + comm.getCommunityID(),"sig/" + comm.getAlias());
|
||||
|
||||
} // end else
|
||||
|
||||
} // end if ("U" command)
|
||||
|
||||
if (cmd.equals("C"))
|
||||
{ // "C" - Create SIG (no parameters)
|
||||
if (!(user.canCreateSIG()))
|
||||
return new ErrorBox("SIG Error","You are not permitted to create SIGs.","top");
|
||||
{ // "C" - Create community (no parameters)
|
||||
if (!(user.canCreateCommunity()))
|
||||
return new ErrorBox("Community Error","You are not permitted to create communities.","top");
|
||||
|
||||
// present the "Create New SIG" dialog
|
||||
CreateSIGDialog dlg = makeCreateSIGDialog();
|
||||
// present the "Create New Community" dialog
|
||||
CreateCommunityDialog dlg = makeCreateCommunityDialog();
|
||||
dlg.setupDialog(engine);
|
||||
dlg.setFieldValue("language","en-US");
|
||||
dlg.setFieldValue("country","US");
|
||||
|
@ -201,21 +201,21 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end if ("C" command)
|
||||
|
||||
if (cmd.equals("I"))
|
||||
{ // "I" - Send Invitation (requires SIG parameter)
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
{ // "I" - Send Invitation (requires community parameter)
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
|
||||
if (!(sig.canSendInvitation()))
|
||||
return new ErrorBox("SIG Error","You are not permitted to send an invitation.",
|
||||
"sig/" + sig.getAlias());
|
||||
if (!(comm.canSendInvitation()))
|
||||
return new ErrorBox("Community Error","You are not permitted to send an invitation.",
|
||||
"sig/" + comm.getAlias());
|
||||
|
||||
// present the "Invitation" dialog
|
||||
return new Invitation(sig);
|
||||
return new Invitation(comm);
|
||||
|
||||
} // end if ("I" command)
|
||||
|
||||
// this is an error!
|
||||
logger.error("invalid command to SIGOperations.doGet: " + cmd);
|
||||
return new ErrorBox("Internal Error","Invalid command to SIGOperations.doGet","top");
|
||||
logger.error("invalid command to CommunityOperations.doGet: " + cmd);
|
||||
return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doGet","top");
|
||||
|
||||
} // end doVeniceGet
|
||||
|
||||
|
@ -228,45 +228,45 @@ public class SIGOperations extends VeniceServlet
|
|||
setMyLocation(request,"sigops?cmd=" + cmd);
|
||||
|
||||
if (cmd.equals("J"))
|
||||
{ // "J" = Join SIG (requires SIG parameter)
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
{ // "J" = Join Community (requires community parameter)
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
JoinKeyDialog dlg = makeJoinKeyDialog();
|
||||
|
||||
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to SIG opening page
|
||||
throw new RedirectResult("sig/" + sig.getAlias());
|
||||
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to community opening page
|
||||
throw new RedirectResult("sig/" + comm.getAlias());
|
||||
|
||||
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 (dlg.isButtonClicked(request,"join"))
|
||||
{ // OK, go join the SIG
|
||||
{ // OK, go join the community
|
||||
dlg.loadValues(request); // load the dialog
|
||||
|
||||
try
|
||||
{ // attempt to join the SIG!
|
||||
dlg.doDialog(sig);
|
||||
{ // attempt to join the community!
|
||||
dlg.doDialog(comm);
|
||||
|
||||
// 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 (ValidationException ve)
|
||||
{ // here, a validation exception causes us to recycle and retry
|
||||
dlg.resetOnError(ve.getMessage() + " Please try again.");
|
||||
changeMenuSIG(request,sig);
|
||||
changeMenuCommunity(request,comm);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // this is probably a bogus key - let them retry
|
||||
dlg.resetOnError(ae.getMessage() + " Please try again.");
|
||||
changeMenuSIG(request,sig);
|
||||
changeMenuCommunity(request,comm);
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // database error joining 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
|
||||
|
||||
|
@ -275,34 +275,34 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end if ("join" clicked)
|
||||
|
||||
// error - don't know what button was clicked
|
||||
logger.error("no known button click on SIGOperations.doPost, cmd=J");
|
||||
logger.error("no known button click on CommunityOperations.doPost, cmd=J");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed","top");
|
||||
|
||||
} // end if ("J" command)
|
||||
|
||||
if (cmd.equals("C"))
|
||||
{ // "C" = Create New SIG
|
||||
if (!(user.canCreateSIG()))
|
||||
return new ErrorBox("SIG Error","You are not permitted to create SIGs.","top");
|
||||
{ // "C" = Create New Community
|
||||
if (!(user.canCreateCommunity()))
|
||||
return new ErrorBox("Community Error","You are not permitted to create communities.","top");
|
||||
|
||||
// load the "Create SIG" dialog
|
||||
CreateSIGDialog dlg = makeCreateSIGDialog();
|
||||
// load the "Create Communities" dialog
|
||||
CreateCommunityDialog dlg = makeCreateCommunityDialog();
|
||||
dlg.setupDialog(engine);
|
||||
|
||||
if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to top
|
||||
throw new RedirectResult("top");
|
||||
|
||||
if (dlg.isButtonClicked(request,"create"))
|
||||
{ // OK, they actually want to create the new SIG...
|
||||
{ // OK, they actually want to create the new community...
|
||||
dlg.loadValues(request); // load the form data
|
||||
|
||||
try
|
||||
{ // attempt to create the SIG!
|
||||
SIGContext sig = dlg.doDialog(user);
|
||||
{ // attempt to create the community!
|
||||
CommunityContext comm = dlg.doDialog(user);
|
||||
|
||||
// created successfully - display a "new SIG welcome" page
|
||||
changeMenuSIG(request,sig); // display menus for the first time!
|
||||
return new NewSIGWelcome(sig);
|
||||
// created successfully - display a "new community welcome" page
|
||||
changeMenuCommunity(request,comm); // display menus for the first time!
|
||||
return new NewCommunityWelcome(comm);
|
||||
|
||||
} // end try
|
||||
catch (ValidationException ve)
|
||||
|
@ -319,7 +319,7 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // database error doing something
|
||||
return new ErrorBox("Database Error","Database error creating SIG: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Database error creating community: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
|
@ -328,24 +328,24 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end if ("create" pressed)
|
||||
|
||||
// error - don't know what button was clicked
|
||||
logger.error("no known button click on SIGOperations.doPost, cmd=C");
|
||||
logger.error("no known button click on CommunityOperations.doPost, cmd=C");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed","top");
|
||||
|
||||
} // end if ("C" command)
|
||||
|
||||
if (cmd.equals("I"))
|
||||
{ // "I" = Send invitation (requires SIG parameter)
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
String on_error = "sig/" + sig.getAlias();
|
||||
{ // "I" = Send invitation (requires community parameter)
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
String on_error = "sig/" + comm.getAlias();
|
||||
|
||||
if (isImageButtonClicked(request,"cancel")) // cancel - go back to SIG opening page
|
||||
if (isImageButtonClicked(request,"cancel")) // cancel - go back to community opening page
|
||||
throw new RedirectResult(on_error);
|
||||
|
||||
if (isImageButtonClicked(request,"send"))
|
||||
{ // the "send" button was pressed
|
||||
try
|
||||
{ // send out the invitation
|
||||
sig.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
comm.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
|
@ -355,7 +355,8 @@ public class SIGOperations extends VeniceServlet
|
|||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // database error doing something
|
||||
return new ErrorBox("Database Error","Database error creating SIG: " + de.getMessage(),on_error);
|
||||
return new ErrorBox("Database Error","Database error sending invitation: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
catch (EmailException ee)
|
||||
|
@ -364,21 +365,21 @@ public class SIGOperations extends VeniceServlet
|
|||
|
||||
} // end catch
|
||||
|
||||
// all sent - go back to SIG profile display
|
||||
// all sent - go back to community profile display
|
||||
throw new RedirectResult(on_error);
|
||||
|
||||
} // end if ("send" pressed)
|
||||
|
||||
// error - don't know what button was clicked
|
||||
logger.error("no known button click on SIGOperations.doPost, cmd=I");
|
||||
logger.error("no known button click on CommunityOperations.doPost, cmd=I");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
|
||||
|
||||
} // end if ("I" command)
|
||||
|
||||
// this is an error!
|
||||
logger.error("invalid command to SIGOperations.doPost: " + cmd);
|
||||
return new ErrorBox("Internal Error","Invalid command to SIGOperations.doPost","top");
|
||||
logger.error("invalid command to CommunityOperations.doPost: " + cmd);
|
||||
return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doPost","top");
|
||||
|
||||
} // end doVenicePost
|
||||
|
||||
} // end class SIGOperations
|
||||
} // end class CommunityOperations
|
|
@ -23,7 +23,7 @@ import javax.servlet.http.*;
|
|||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class SIGProfile extends VeniceServlet
|
||||
public class CommunityProfile extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
|
@ -32,7 +32,7 @@ public class SIGProfile extends VeniceServlet
|
|||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "SIGProfile servlet - Displays the profile of a SIG\n"
|
||||
String rc = "CommunityProfile servlet - Displays the profile of a community\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
|
@ -47,22 +47,22 @@ public class SIGProfile extends VeniceServlet
|
|||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
setMyLocation(request,"sigprofile?sig=" + sig.getSIGID());
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
setMyLocation(request,"sigprofile?sig=" + comm.getCommunityID());
|
||||
|
||||
try
|
||||
{ // create the profile display
|
||||
changeMenuSIG(request,sig);
|
||||
return new SIGProfileData(engine,user,sig);
|
||||
changeMenuCommunity(request,comm);
|
||||
return new CommunityProfileData(engine,user,comm);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // in this case, we had database trouble
|
||||
return new ErrorBox("Database Error","Database error accessing SIG: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Database error accessing community: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end doVeniceGet
|
||||
|
||||
} // end class SIGProfile
|
||||
} // end class CommunityProfile
|
|
@ -340,12 +340,12 @@ public class ConfDisplay 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 topic, if we have it
|
||||
TopicContext topic = getTopicParameter(request,conf,false,"top");
|
||||
|
@ -354,7 +354,7 @@ public class ConfDisplay extends VeniceServlet
|
|||
{ // we're handling messages within a single topic
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("MODE: display messages in topic");
|
||||
String on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
setMyLocation(request,on_error + "&topic=" + topic.getTopicNumber());
|
||||
|
||||
// if this request is restoring the number of unread posts in another topic, try to do so
|
||||
|
@ -369,7 +369,7 @@ public class ConfDisplay extends VeniceServlet
|
|||
TopicPosts tpos = null;
|
||||
try
|
||||
{ // create the display
|
||||
tpos = new TopicPosts(request,engine,sig,conf,topic,piv.getFirst(),piv.getLast(),read_new,show_adv);
|
||||
tpos = new TopicPosts(request,engine,comm,conf,topic,piv.getFirst(),piv.getLast(),read_new,show_adv);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -390,8 +390,8 @@ public class ConfDisplay extends VeniceServlet
|
|||
{ // we're displaying the conference's topic list
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("MODE: display topics in conference");
|
||||
String on_error = "confops?sig=" + sig.getSIGID();
|
||||
String my_location = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
String on_error = "confops?sig=" + comm.getCommunityID();
|
||||
String my_location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
boolean read_new = !(StringUtil.isStringEmpty(request.getParameter("rnm")));
|
||||
if (read_new)
|
||||
my_location += "&rn=1";
|
||||
|
@ -426,14 +426,14 @@ public class ConfDisplay extends VeniceServlet
|
|||
} // end while
|
||||
|
||||
if (topic==null) // no suitable topic found - just create the topic listing
|
||||
return new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
|
||||
return new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
|
||||
opts.getSortOption(conf.getConfID()));
|
||||
|
||||
// determine what the post interval is we want to display
|
||||
PostInterval piv = getInterval(engine,request,topic,on_error);
|
||||
|
||||
// create the topic posts view
|
||||
return new TopicPosts(request,engine,sig,conf,topic,piv.getFirst(),piv.getLast(),true,false);
|
||||
return new TopicPosts(request,engine,comm,conf,topic,piv.getFirst(),piv.getLast(),true,false);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -452,8 +452,8 @@ public class ConfDisplay extends VeniceServlet
|
|||
{ // topic listing only...
|
||||
TopicListing tl = null;
|
||||
try
|
||||
{ // create the topic lict
|
||||
tl = new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
|
||||
{ // create the topic list
|
||||
tl = new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
|
||||
opts.getSortOption(conf.getConfID()));
|
||||
|
||||
} // end try
|
||||
|
|
|
@ -166,31 +166,31 @@ public class ConfOperations extends VeniceServlet
|
|||
* SH = Hide/show conference from sequence manager menu
|
||||
* SS = Change conference sequence from sequence manager menu
|
||||
* T = Create topic (requires conference parameter)
|
||||
* Other = Display list of conferences in SIG
|
||||
* Other = Display list of conferences in community
|
||||
*/
|
||||
|
||||
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
String on_error = "confops?sig=" + sig.getSIGID();
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
String on_error = "confops?sig=" + comm.getCommunityID();
|
||||
|
||||
// get the command we want to use
|
||||
String cmd = getStandardCommandParam(request);
|
||||
|
||||
if (cmd.equals("S"))
|
||||
{ // "S" = Manage conferences sequence
|
||||
if (!(sig.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
|
||||
if (!(comm.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
|
||||
on_error);
|
||||
|
||||
try
|
||||
{ // display the Conference Sequence screen
|
||||
setMyLocation(request,"confops?cmd=S&sig=" + sig.getSIGID());
|
||||
return new ConferenceSequence(sig);
|
||||
setMyLocation(request,"confops?cmd=S&sig=" + comm.getCommunityID());
|
||||
return new ConferenceSequence(comm);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -209,12 +209,12 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("SH"))
|
||||
{ // "SH" = Hide/show conference (requires conference parameter)
|
||||
if (!(sig.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
|
||||
if (!(comm.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
|
||||
on_error);
|
||||
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
|
||||
|
||||
if (!(conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
|
||||
|
@ -244,15 +244,15 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("SS"))
|
||||
{ // "SS" = Change conference sequence (requires conference parameter)
|
||||
if (!(sig.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
|
||||
if (!(comm.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
|
||||
on_error);
|
||||
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
|
||||
|
||||
// we need a second conference parameter to exchange with
|
||||
ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),sig,true,on_error);
|
||||
ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),comm,true,on_error);
|
||||
|
||||
if (!(conf.canChangeConference()) || !(other_conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
|
||||
|
@ -297,12 +297,12 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("SDEL"))
|
||||
{ // "SDEL" = Delete conference (requires conference parameter)
|
||||
if (!(sig.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this SIG.",
|
||||
if (!(comm.canManageConferences()))
|
||||
return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
|
||||
on_error);
|
||||
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
|
||||
|
||||
if (!(conf.canDeleteConference()))
|
||||
return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
|
||||
|
@ -335,7 +335,7 @@ public class ConfOperations extends VeniceServlet
|
|||
String message = "You are about to permanently delete the \"" + conf.getName() + "\" conference! "
|
||||
+ "Are you sure you want to do this?";
|
||||
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
|
||||
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=SDEL",
|
||||
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=SDEL",
|
||||
on_error);
|
||||
|
||||
} // end else
|
||||
|
@ -344,13 +344,13 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("C"))
|
||||
{ // "C" = "Create conference"
|
||||
if (!(sig.canCreateConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to create conferences in this SIG.",
|
||||
if (!(comm.canCreateConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
|
||||
on_error);
|
||||
|
||||
// make the "create" dialog
|
||||
CreateConferenceDialog dlg = makeCreateConferenceDialog();
|
||||
dlg.setupDialog(engine,sig);
|
||||
dlg.setupDialog(engine,comm);
|
||||
setMyLocation(request,on_error + "&cmd=C");
|
||||
return dlg;
|
||||
|
||||
|
@ -358,32 +358,32 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("T"))
|
||||
{ // "T" = "Create topic" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
// Create the new topic form.
|
||||
NewTopicForm ntf = new NewTopicForm(sig,conf);
|
||||
NewTopicForm ntf = new NewTopicForm(comm,conf);
|
||||
ntf.setupNewRequest();
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=T");
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
|
||||
return ntf;
|
||||
|
||||
} // end if ("T" command)
|
||||
|
||||
if (cmd.equals("Q"))
|
||||
{ // "Q" = display Manage menu (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
// display the "Manage Conference" display
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q");
|
||||
return new ManageConference(sig,conf);
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
|
||||
return new ManageConference(comm,conf);
|
||||
|
||||
} // end if ("Q" command)
|
||||
|
||||
if (cmd.equals("FX"))
|
||||
{ // "FX" = the dreaded fixseen :-) - catches up the entire conference
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
try
|
||||
{ // do the fixseen operation
|
||||
|
@ -408,8 +408,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("E"))
|
||||
{ // "E" = "Edit Conference Settings" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
if (!(conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
|
||||
|
@ -419,8 +419,8 @@ public class ConfOperations extends VeniceServlet
|
|||
EditConferenceDialog dlg = makeEditConferenceDialog();
|
||||
try
|
||||
{ // set up and return the dialog
|
||||
dlg.setupDialog(sig,conf);
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=E");
|
||||
dlg.setupDialog(comm,conf);
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
|
||||
return dlg;
|
||||
|
||||
} // end try
|
||||
|
@ -440,8 +440,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("A"))
|
||||
{ // "A" = "Manage Aliases" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
if (!(conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to change this conference's aliases.",
|
||||
|
@ -473,8 +473,8 @@ public class ConfOperations extends VeniceServlet
|
|||
// display the "Manage Conference Aliases" display
|
||||
try
|
||||
{ // generate the display box
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=A");
|
||||
return new ManageConferenceAliases(sig,conf);
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A");
|
||||
return new ManageConferenceAliases(comm,conf);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -488,13 +488,13 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("QR"))
|
||||
{ // "QR" = "Reports Menu" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
try
|
||||
{ // display the "Conference Reports" display
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=QR");
|
||||
return new ReportConferenceMenu(sig,conf);
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=QR");
|
||||
return new ReportConferenceMenu(comm,conf);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -512,17 +512,17 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("RP") || cmd.equals("RR"))
|
||||
{ // "RP" = "Report Posters," "RR" = "Report Readers" (requires conference parameter, optional topic)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
TopicContext topic = getTopicParameter(request,conf,false,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=QR";
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=QR";
|
||||
|
||||
try
|
||||
{ // generate the listing on this page
|
||||
String my_loc = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
String my_loc = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
if (topic!=null)
|
||||
my_loc += ("&top=" + topic.getTopicNumber());
|
||||
setMyLocation(request,my_loc + "&cmd=" + cmd);
|
||||
return new ConferenceActivity(sig,conf,topic,cmd.equals("RP"));
|
||||
return new ConferenceActivity(comm,conf,topic,cmd.equals("RP"));
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -541,14 +541,14 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("M"))
|
||||
{ // "M" - Manage Conference Membership (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
try
|
||||
{ // display the conference member list!
|
||||
ConferenceMembership m = new ConferenceMembership(engine,sig,conf);
|
||||
ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
|
||||
m.doConferenceMemberList();
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=M");
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M");
|
||||
return m;
|
||||
|
||||
} // end try
|
||||
|
@ -568,8 +568,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("H"))
|
||||
{ // "H" = "Add Conference To Hotlist" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
try
|
||||
{ // add to the hotlist
|
||||
|
@ -590,8 +590,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("DEL"))
|
||||
{ // "DEL" = "Delete Conference (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
if (!(conf.canDeleteConference()))
|
||||
return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
|
||||
|
@ -616,7 +616,7 @@ public class ConfOperations extends VeniceServlet
|
|||
} // end catch
|
||||
|
||||
// that's it - trap back to the main conference list
|
||||
throw new RedirectResult("confops?sig=" + sig.getSIGID());
|
||||
throw new RedirectResult("confops?sig=" + comm.getCommunityID());
|
||||
|
||||
} // end if
|
||||
else
|
||||
|
@ -624,7 +624,7 @@ public class ConfOperations extends VeniceServlet
|
|||
String message = "You are about to permanently delete the \"" + conf.getName() + "\" conference! "
|
||||
+ "Are you sure you want to do this?";
|
||||
return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
|
||||
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=DEL",
|
||||
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=DEL",
|
||||
on_error);
|
||||
|
||||
} // end else
|
||||
|
@ -632,11 +632,11 @@ public class ConfOperations extends VeniceServlet
|
|||
} // end if ("DEL" command)
|
||||
|
||||
// Any unrecognized command shows us the conference list.
|
||||
on_error = "sigprofile?sig=" + sig.getSIGID();
|
||||
on_error = "sigprofile?sig=" + comm.getCommunityID();
|
||||
try
|
||||
{ // make a conference listing
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID());
|
||||
return new ConferenceListing(sig);
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID());
|
||||
return new ConferenceListing(comm);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
|
@ -656,23 +656,23 @@ public class ConfOperations extends VeniceServlet
|
|||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
String on_error = "confops?sig=" + sig.getSIGID();
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
String on_error = "confops?sig=" + comm.getCommunityID();
|
||||
|
||||
// get the command we want to use
|
||||
String cmd = getStandardCommandParam(request);
|
||||
|
||||
if (cmd.equals("C"))
|
||||
{ // "C" = "Create Conference"
|
||||
if (!(sig.canCreateConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to create conferences in this SIG.",
|
||||
if (!(comm.canCreateConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
|
||||
on_error);
|
||||
|
||||
// load up the create conference dialog!
|
||||
CreateConferenceDialog dlg = makeCreateConferenceDialog();
|
||||
dlg.setupDialog(engine,sig);
|
||||
dlg.setupDialog(engine,comm);
|
||||
|
||||
if (dlg.isButtonClicked(request,"cancel"))
|
||||
throw new RedirectResult(on_error); // they chickened out - go back to the conference list
|
||||
|
@ -683,10 +683,10 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
try
|
||||
{ // attempt to create the conference!
|
||||
ConferenceContext conf = dlg.doDialog(sig);
|
||||
ConferenceContext conf = dlg.doDialog(comm);
|
||||
|
||||
// success! redirect to the conference's topic list
|
||||
throw new RedirectResult("confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID());
|
||||
throw new RedirectResult("confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID());
|
||||
|
||||
} // end try
|
||||
catch (ValidationException ve)
|
||||
|
@ -719,8 +719,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("T"))
|
||||
{ // "T" command = Create New Topic (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
// determine what to do based on the button pressed
|
||||
if (isImageButtonClicked(request,"cancel"))
|
||||
|
@ -728,7 +728,7 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (isImageButtonClicked(request,"preview"))
|
||||
{ // generate a preview and redisplay the form
|
||||
NewTopicForm ntf = new NewTopicForm(sig,conf);
|
||||
NewTopicForm ntf = new NewTopicForm(comm,conf);
|
||||
|
||||
try
|
||||
{ // generate a preview display
|
||||
|
@ -747,7 +747,7 @@ public class ConfOperations extends VeniceServlet
|
|||
return null; // no title or text specified - "204 No Content"
|
||||
-- end removed code */
|
||||
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=T");
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
|
||||
return ntf;
|
||||
|
||||
} // end if ("preview" clicked)
|
||||
|
@ -766,7 +766,7 @@ public class ConfOperations extends VeniceServlet
|
|||
if (yes.equals(request.getParameter("attach")))
|
||||
{ // we need to upload an attachment for this post
|
||||
setMyLocation(request,on_error);
|
||||
return new AttachmentForm(sig,conf,topic.getMessage(0),on_error);
|
||||
return new AttachmentForm(comm,conf,topic.getMessage(0),on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -795,8 +795,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("P"))
|
||||
{ // "P" = Set default pseud (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
try
|
||||
{ // go set the pseud!
|
||||
|
@ -817,8 +817,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("E"))
|
||||
{ // "E" = "Edit Conference Settings" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
if (!(conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
|
||||
|
@ -844,7 +844,7 @@ public class ConfOperations extends VeniceServlet
|
|||
} // end try
|
||||
catch (ValidationException ve)
|
||||
{ // validation error - throw it back to the user
|
||||
dlg.resetOnError(sig,conf,ve.getMessage() + " Please try again.");
|
||||
dlg.resetOnError(comm,conf,ve.getMessage() + " Please try again.");
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
|
@ -859,7 +859,7 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
} // end catch
|
||||
|
||||
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=E");
|
||||
setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
|
||||
return dlg; // redisplay the dialog
|
||||
|
||||
} // end if
|
||||
|
@ -868,8 +868,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("A"))
|
||||
{ // "A" = "Add Alias" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
|
||||
|
||||
if (!(conf.canChangeConference()))
|
||||
return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
|
||||
|
@ -879,7 +879,7 @@ public class ConfOperations extends VeniceServlet
|
|||
if (StringUtil.isStringEmpty(new_alias))
|
||||
return null; // this is a no-op
|
||||
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=A";
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A";
|
||||
String error_message = null;
|
||||
|
||||
if (IDUtils.isValidVeniceID(new_alias))
|
||||
|
@ -909,13 +909,13 @@ public class ConfOperations extends VeniceServlet
|
|||
try
|
||||
{ // generate the display box
|
||||
setMyLocation(request,on_error);
|
||||
return new ManageConferenceAliases(sig,conf);
|
||||
return new ManageConferenceAliases(comm,conf);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // error generating the display box
|
||||
return new ErrorBox("Database Error","Database error displaying aliases: " + de.getMessage(),
|
||||
"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=Q");
|
||||
"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
|
||||
|
||||
} // end catch
|
||||
|
||||
|
@ -923,8 +923,8 @@ public class ConfOperations extends VeniceServlet
|
|||
|
||||
if (cmd.equals("M"))
|
||||
{ // "M" - Manage Conference Membership (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=M";
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
|
||||
on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M";
|
||||
|
||||
if (isImageButtonClicked(request,"update"))
|
||||
{ // the "update" command that changes all the security levels
|
||||
|
@ -1004,7 +1004,7 @@ public class ConfOperations extends VeniceServlet
|
|||
if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
|
||||
|| isImageButtonClicked(request,"next"))
|
||||
{ // create the new dialog box
|
||||
ConferenceMembership m = new ConferenceMembership(engine,sig,conf);
|
||||
ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
|
||||
|
||||
try
|
||||
{ // perform the search!
|
||||
|
|
|
@ -126,7 +126,7 @@ public class Find extends VeniceServlet
|
|||
|
||||
// figure out the category ID parameter
|
||||
int cat = -1;
|
||||
if (disp==FindData.FD_SIGS)
|
||||
if (disp==FindData.FD_COMMUNITIES)
|
||||
cat = getCategoryParam(engine,request);
|
||||
|
||||
try
|
||||
|
|
|
@ -81,17 +81,17 @@ public class PostMessage 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 topic
|
||||
TopicContext topic = getTopicParameter(request,conf,true,"top");
|
||||
|
||||
String on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
|
||||
String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
|
||||
+ topic.getTopicNumber();
|
||||
|
||||
if (isImageButtonClicked(request,"cancel"))
|
||||
|
@ -110,7 +110,7 @@ public class PostMessage extends VeniceServlet
|
|||
final String yes = "Y";
|
||||
|
||||
if (isImageButtonClicked(request,"preview")) // generate a preview
|
||||
return new PostPreview(engine,sig,conf,topic,request.getParameter("pseud"),raw_postdata,
|
||||
return new PostPreview(engine,comm,conf,topic,request.getParameter("pseud"),raw_postdata,
|
||||
request.getParameter("next"),getPostNumber(request,on_error),
|
||||
yes.equals(request.getParameter("attach")),
|
||||
yes.equals(request.getParameter("slip")));
|
||||
|
@ -125,7 +125,7 @@ public class PostMessage extends VeniceServlet
|
|||
try
|
||||
{ // first check for slippage
|
||||
if (pn!=topic.getTotalMessages()) // slippage detected! display the slippage screen
|
||||
return new PostSlippage(engine,sig,conf,topic,pn,request.getParameter("next"),
|
||||
return new PostSlippage(engine,comm,conf,topic,pn,request.getParameter("next"),
|
||||
request.getParameter("pseud"),raw_postdata,
|
||||
yes.equals(request.getParameter("attach")));
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class PostMessage extends VeniceServlet
|
|||
// where do we want to go now?
|
||||
String target;
|
||||
if (go_topics)
|
||||
target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
else
|
||||
{ // figure out what topic to go to next
|
||||
short next;
|
||||
|
@ -163,13 +163,13 @@ public class PostMessage extends VeniceServlet
|
|||
|
||||
} // end catch
|
||||
|
||||
target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
|
||||
target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
|
||||
+ next + "&rnm=1";
|
||||
|
||||
} // end else
|
||||
|
||||
if (yes.equals(request.getParameter("attach")))
|
||||
return new AttachmentForm(sig,conf,msg,target); // go to upload an attachment
|
||||
return new AttachmentForm(comm,conf,msg,target); // go to upload an attachment
|
||||
|
||||
// no attachment - redirect where we need to go
|
||||
throw new RedirectResult(target);
|
||||
|
|
|
@ -61,14 +61,14 @@ public class PostOperations extends VeniceServlet
|
|||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
String locator = "sig=" + sig.getSIGID();
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
String locator = "sig=" + comm.getCommunityID();
|
||||
String location = "sigprofile?" + locator;
|
||||
|
||||
// get the conference
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,location);
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,location);
|
||||
locator += "&conf=" + conf.getConfID();
|
||||
location = "confdisp?" + locator;
|
||||
|
||||
|
|
|
@ -64,30 +64,30 @@ public class PostShortcut extends VeniceServlet
|
|||
|
||||
} // end catch
|
||||
|
||||
if (decoder.getSIG()==null) // it must include the SIG
|
||||
if (decoder.getCommunity()==null) // it must include the community
|
||||
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link
|
||||
+ "\": ambiguous post link (no SIG)",null);
|
||||
+ "\": ambiguous post link (no community)",null);
|
||||
|
||||
SIGContext sig;
|
||||
CommunityContext comm;
|
||||
try
|
||||
{ // get the SIG represented by that alias
|
||||
sig = user.getSIGContext(decoder.getSIG());
|
||||
{ // get the community represented by that alias
|
||||
comm = user.getCommunityContext(decoder.getCommunity());
|
||||
|
||||
} // end try
|
||||
catch (DataException e)
|
||||
{ // can't find the SIG - we're screwed
|
||||
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link + "\": cannot find SIG: "
|
||||
{ // can't find the community - we're screwed
|
||||
return new ErrorBox("Invalid Post Link","Invalid post link \"" + raw_link + "\": cannot find community: "
|
||||
+ e.getMessage(),null);
|
||||
|
||||
} // end catch
|
||||
|
||||
if (decoder.getConference()==null) // it's a SIG link only - redirect to the SIG's default page
|
||||
throw new RedirectResult("sig/" + decoder.getSIG());
|
||||
if (decoder.getConference()==null) // it's a community link only - redirect to the default page
|
||||
throw new RedirectResult("sig/" + decoder.getCommunity());
|
||||
|
||||
ConferenceContext conf;
|
||||
try
|
||||
{ // get the conference represented by that alias
|
||||
conf = sig.getConferenceContext(decoder.getConference());
|
||||
conf = comm.getConferenceContext(decoder.getConference());
|
||||
|
||||
} // end try
|
||||
catch (DataException e)
|
||||
|
@ -103,7 +103,7 @@ public class PostShortcut extends VeniceServlet
|
|||
} // end catch
|
||||
|
||||
// compute an elementary "locator"
|
||||
String locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
String locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
if (decoder.getTopic()==-1) // just a conference link - go to the top-level display
|
||||
throw new RedirectResult("confdisp?" + locator);
|
||||
|
|
|
@ -47,10 +47,10 @@ public class Settings extends VeniceServlet
|
|||
String foo = request.getParameter("sig");
|
||||
if (foo==null)
|
||||
throw new ErrorBox(null,"Parameter not specified!","settings?cmd=H");
|
||||
int sigid;
|
||||
int cid;
|
||||
try
|
||||
{ // this is the SIG id of the hotlist entry
|
||||
sigid = Integer.parseInt(foo);
|
||||
{ // this is the community id of the hotlist entry
|
||||
cid = Integer.parseInt(foo);
|
||||
|
||||
} // end try
|
||||
catch (NumberFormatException nfe)
|
||||
|
@ -78,7 +78,7 @@ public class Settings extends VeniceServlet
|
|||
{ // look at the hotlist entries to find the right index
|
||||
ConferenceHotlistEntry hle = (ConferenceHotlistEntry)(hotlist.get(i));
|
||||
if ( (hle.getConference().getConfID()==confid)
|
||||
&& (hle.getConference().getEnclosingSIG().getSIGID()==sigid))
|
||||
&& (hle.getConference().getEnclosingCommunity().getCommunityID()==cid))
|
||||
return i;
|
||||
|
||||
} // end for
|
||||
|
@ -220,44 +220,45 @@ public class Settings extends VeniceServlet
|
|||
} // end if (one of the "H" subcommands)
|
||||
|
||||
if (cmd.equals("S"))
|
||||
{ // "S" - display the user's SIG list
|
||||
{ // "S" - display the user's community list
|
||||
try
|
||||
{ // return the SIG list viewer
|
||||
{ // return the community list viewer
|
||||
setMyLocation(request,"settings?cmd=S");
|
||||
return new UserSIGList(user);
|
||||
return new UserCommunityList(user);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // oops...can't get it!
|
||||
return new ErrorBox("Database Error","Error getting SIGs list: " + de.getMessage(),"top");
|
||||
return new ErrorBox("Database Error","Error getting communities list: " + de.getMessage(),"top");
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end if ("S" command)
|
||||
|
||||
if (cmd.equals("SX"))
|
||||
{ // "SX" - unjoin the specified SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"settings?cmd=S");
|
||||
{ // "SX" - unjoin the specified community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"settings?cmd=S");
|
||||
|
||||
if (!(sig.canUnjoin()))
|
||||
return new ErrorBox("SIG Error","You cannot unjoin this SIG.","settings?cmd=S");
|
||||
if (!(comm.canUnjoin()))
|
||||
return new ErrorBox("Community Error","You cannot unjoin this community.","settings?cmd=S");
|
||||
|
||||
// OK, let's test for a confirmation...
|
||||
if (ConfirmBox.isConfirmed(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM))
|
||||
{ // OK, if you say so, let's unjoin!
|
||||
try
|
||||
{ // do the unjoin now...
|
||||
sig.unjoin();
|
||||
comm.unjoin();
|
||||
|
||||
} // end try
|
||||
catch (AccessError ae)
|
||||
{ // access error
|
||||
return new ErrorBox("Access Error","Unable to unjoin SIG: " + ae.getMessage(),"settings?cmd=S");
|
||||
return new ErrorBox("Access Error","Unable to unjoin community: " + ae.getMessage(),
|
||||
"settings?cmd=S");
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // data exception doing something
|
||||
return new ErrorBox("Database Error","Database error unjoining SIG: " + de.getMessage(),
|
||||
return new ErrorBox("Database Error","Database error unjoining community: " + de.getMessage(),
|
||||
"settings?cmd=S");
|
||||
|
||||
} // end catch
|
||||
|
@ -268,9 +269,9 @@ public class Settings extends VeniceServlet
|
|||
} // end if
|
||||
else
|
||||
{ // not a proper confirmation - display the confirm box
|
||||
String message = "Are you sure you want to unjoin the '" + sig.getName() + "' SIG?";
|
||||
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining SIG",
|
||||
message,"settings?cmd=SX&sig=" + sig.getSIGID(),"settings?cmd=S");
|
||||
String message = "Are you sure you want to unjoin the '" + comm.getName() + "' community?";
|
||||
return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining Community",
|
||||
message,"settings?cmd=SX&sig=" + comm.getCommunityID(),"settings?cmd=S");
|
||||
|
||||
} // end else
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class SystemAdmin extends VeniceServlet
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(SIGAdmin.class.getName());
|
||||
private static Category logger = Category.getInstance(SystemAdmin.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal functions
|
||||
|
|
|
@ -60,14 +60,14 @@ public class TopicOperations extends VeniceServlet
|
|||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(request,user,true,"top");
|
||||
changeMenuSIG(request,sig);
|
||||
String locator = "sig=" + sig.getSIGID();
|
||||
// get the community
|
||||
CommunityContext comm = getCommunityParameter(request,user,true,"top");
|
||||
changeMenuCommunity(request,comm);
|
||||
String locator = "sig=" + comm.getCommunityID();
|
||||
String location = "sigprofile?" + locator;
|
||||
|
||||
// get the conference
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,location);
|
||||
ConferenceContext conf = getConferenceParameter(request,comm,true,location);
|
||||
locator += "&conf=" + conf.getConfID();
|
||||
location = "confdisp?" + locator;
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class TopicOperations extends VeniceServlet
|
|||
{ // Delete Topic requires a confirmation!
|
||||
if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
|
||||
{ // OK, go ahead, delete the topic!
|
||||
location = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
try
|
||||
{ // delete the bloody topic!
|
||||
|
|
|
@ -255,27 +255,27 @@ public class Variables
|
|||
|
||||
} // end setMenuTop
|
||||
|
||||
public static void setMenuSIG(HttpSession session, SIGContext sig)
|
||||
public static void setMenuCommunity(HttpSession session, CommunityContext comm)
|
||||
{
|
||||
Object obj = session.getAttribute(MENU_ATTRIBUTE);
|
||||
boolean do_change;
|
||||
if ((obj==null) || !(obj instanceof MenuSIG))
|
||||
if ((obj==null) || !(obj instanceof MenuCommunity))
|
||||
do_change = true;
|
||||
else
|
||||
{ // look at the actual SIGIDs underlying the MenuSIG
|
||||
MenuSIG tmp = (MenuSIG)obj;
|
||||
do_change = (tmp.getID()!=sig.getSIGID());
|
||||
{ // look at the actual community IDs underlying the MenuCommunity
|
||||
MenuCommunity tmp = (MenuCommunity)obj;
|
||||
do_change = (tmp.getID()!=comm.getCommunityID());
|
||||
|
||||
} // end else
|
||||
|
||||
if (do_change)
|
||||
{ // switch to the appropriate MenuSIG
|
||||
MenuSIG ms = new MenuSIG(sig);
|
||||
session.setAttribute(MENU_ATTRIBUTE,ms);
|
||||
{ // switch to the appropriate MenuCommunity
|
||||
MenuCommunity mc = new MenuCommunity(comm);
|
||||
session.setAttribute(MENU_ATTRIBUTE,mc);
|
||||
|
||||
} // end if
|
||||
|
||||
} // end setMenuSIG
|
||||
} // end setMenuCommunity
|
||||
|
||||
public static void clearMenu(HttpSession session)
|
||||
{
|
||||
|
|
|
@ -54,57 +54,58 @@ public abstract class VeniceServlet extends HttpServlet
|
|||
|
||||
} // end notSupported
|
||||
|
||||
private static final SIGContext getSIGParameter(String str, UserContext user, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
private static final CommunityContext getCommunityParameter(String str, UserContext user, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
{
|
||||
if (StringUtil.isStringEmpty(str))
|
||||
{ // there's no SIG parameter
|
||||
{ // there's no community parameter
|
||||
if (required)
|
||||
{ // no SIG parameter - bail out now!
|
||||
logger.error("SIG parameter not specified!");
|
||||
throw new ErrorBox(null,"No SIG specified.",on_error);
|
||||
{ // no communty parameter - bail out now!
|
||||
logger.error("community parameter not specified!");
|
||||
throw new ErrorBox(null,"No community specified.",on_error);
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // a null SIGContext is permitted
|
||||
logger.debug("no SIG specified");
|
||||
{ // a null CommunityContext is permitted
|
||||
logger.debug("no community specified");
|
||||
return null;
|
||||
|
||||
} // end else
|
||||
|
||||
} // end if
|
||||
|
||||
SIGContext rc = null;
|
||||
CommunityContext rc = null;
|
||||
try
|
||||
{ // turn the string into a SIGID, and thence to a SIGContext
|
||||
{ // turn the string into a community ID, and thence to a CommunityContext
|
||||
int tmp_id = Integer.parseInt(str);
|
||||
rc = user.getSIGContext(tmp_id);
|
||||
rc = user.getCommunityContext(tmp_id);
|
||||
if (rc==null)
|
||||
{ // trap any null results (may not be possible with SIGs, but you never know)
|
||||
logger.error("SIG #" + tmp_id + " was not found!");
|
||||
throw new ErrorBox(null,"The specified SIG (#" + tmp_id + ") was not found in the database.",on_error);
|
||||
{ // trap any null results (may not be possible with communities, but you never know)
|
||||
logger.error("Community #" + tmp_id + " was not found!");
|
||||
throw new ErrorBox(null,"The specified community (#" + tmp_id + ") was not found in the database.",
|
||||
on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("found SIG #" + rc.getSIGID());
|
||||
logger.debug("found community #" + rc.getCommunityID());
|
||||
|
||||
} // end try
|
||||
catch (NumberFormatException nfe)
|
||||
{ // error in Integer.parseInt
|
||||
logger.error("Cannot convert SIG parameter '" + str + "'!");
|
||||
throw new ErrorBox(null,"Invalid SIG parameter.",on_error);
|
||||
logger.error("Cannot convert community parameter '" + str + "'!");
|
||||
throw new ErrorBox(null,"Invalid community parameter.",on_error);
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // error looking up the SIG
|
||||
throw new ErrorBox("Database Error","Database error finding SIG: " + de.getMessage(),on_error);
|
||||
{ // error looking up the community
|
||||
throw new ErrorBox("Database Error","Database error finding community: " + de.getMessage(),on_error);
|
||||
|
||||
} // end catch
|
||||
|
||||
return rc;
|
||||
|
||||
} // end getSIGParameter
|
||||
} // end getCommunityParameter
|
||||
|
||||
private static TopicContext getTopicParameter(String str, ConferenceContext conf, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
|
@ -341,11 +342,11 @@ public abstract class VeniceServlet extends HttpServlet
|
|||
|
||||
} // end changeMenuTop
|
||||
|
||||
protected final void changeMenuSIG(HttpServletRequest request, SIGContext sig)
|
||||
protected final void changeMenuCommunity(HttpServletRequest request, CommunityContext comm)
|
||||
{
|
||||
Variables.setMenuSIG(request.getSession(true),sig);
|
||||
Variables.setMenuCommunity(request.getSession(true),comm);
|
||||
|
||||
} // end changeMenuSIG
|
||||
} // end changeMenuCommunity
|
||||
|
||||
protected final void clearMenu(HttpServletRequest request)
|
||||
{
|
||||
|
@ -369,24 +370,26 @@ public abstract class VeniceServlet extends HttpServlet
|
|||
|
||||
} // end setMyLocation
|
||||
|
||||
protected final static SIGContext getSIGParameter(ServletRequest request, UserContext user, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
protected final static CommunityContext getCommunityParameter(ServletRequest request, UserContext user,
|
||||
boolean required, String on_error)
|
||||
throws ErrorBox
|
||||
{
|
||||
return getSIGParameter(request.getParameter("sig"),user,required,on_error);
|
||||
return getCommunityParameter(request.getParameter("sig"),user,required,on_error);
|
||||
|
||||
} // end getSIGParameter
|
||||
} // end getCommunityParameter
|
||||
|
||||
protected final static SIGContext getSIGParameter(ServletMultipartHandler mphandler, UserContext user,
|
||||
boolean required, String on_error) throws ErrorBox
|
||||
protected final static CommunityContext getCommunityParameter(ServletMultipartHandler mphandler,
|
||||
UserContext user, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
{
|
||||
if (mphandler.isFileParam("sig"))
|
||||
throw new ErrorBox(null,"Internal Error: SIG should be a normal param",on_error);
|
||||
return getSIGParameter(mphandler.getValue("sig"),user,required,on_error);
|
||||
throw new ErrorBox(null,"Internal Error: community should be a normal param",on_error);
|
||||
return getCommunityParameter(mphandler.getValue("sig"),user,required,on_error);
|
||||
|
||||
} // end getSIGParameter
|
||||
} // end getCommunityParameter
|
||||
|
||||
protected static ConferenceContext getConferenceParameter(String str, SIGContext sig, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
protected static ConferenceContext getConferenceParameter(String str, CommunityContext comm,
|
||||
boolean required, String on_error) throws ErrorBox
|
||||
{
|
||||
if (StringUtil.isStringEmpty(str))
|
||||
{ // there's no conference parameter
|
||||
|
@ -409,12 +412,12 @@ public abstract class VeniceServlet extends HttpServlet
|
|||
try
|
||||
{ // turn the string into a ConfID, and thence to a ConferenceContext
|
||||
int tmp_id = Integer.parseInt(str);
|
||||
rc = sig.getConferenceContext(tmp_id);
|
||||
rc = comm.getConferenceContext(tmp_id);
|
||||
if (rc==null)
|
||||
{ // couldn't find the conference
|
||||
logger.error("SIG #" + sig.getSIGID() + " does not contain conference #" + tmp_id);
|
||||
throw new ErrorBox(null,"The conference #" + tmp_id + " could not be found in the '" + sig.getName()
|
||||
+ "' SIG.",on_error);
|
||||
logger.error("community #" + comm.getCommunityID() + " does not contain conference #" + tmp_id);
|
||||
throw new ErrorBox(null,"The conference #" + tmp_id + " could not be found in the '" + comm.getName()
|
||||
+ "' community.",on_error);
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -443,21 +446,21 @@ public abstract class VeniceServlet extends HttpServlet
|
|||
|
||||
} // end getConferenceParameter
|
||||
|
||||
protected final static ConferenceContext getConferenceParameter(ServletRequest request, SIGContext sig,
|
||||
boolean required, String on_error)
|
||||
throws ErrorBox
|
||||
protected final static ConferenceContext getConferenceParameter(ServletRequest request,
|
||||
CommunityContext comm, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
{
|
||||
return getConferenceParameter(request.getParameter("conf"),sig,required,on_error);
|
||||
return getConferenceParameter(request.getParameter("conf"),comm,required,on_error);
|
||||
|
||||
} // end getConferenceParameter
|
||||
|
||||
protected final static ConferenceContext getConferenceParameter(ServletMultipartHandler mphandler,
|
||||
SIGContext sig, boolean required,
|
||||
CommunityContext comm, boolean required,
|
||||
String on_error) throws ErrorBox
|
||||
{
|
||||
if (mphandler.isFileParam("conf"))
|
||||
throw new ErrorBox(null,"Internal Error: conference should be a normal param",on_error);
|
||||
return getConferenceParameter(mphandler.getValue("conf"),sig,required,on_error);
|
||||
return getConferenceParameter(mphandler.getValue("conf"),comm,required,on_error);
|
||||
|
||||
} // end getConferenceParameter
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class AttachmentForm implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private int sigid;
|
||||
private int cid;
|
||||
private int confid;
|
||||
private long postid;
|
||||
private String target;
|
||||
|
@ -49,9 +49,9 @@ public class AttachmentForm implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public AttachmentForm(SIGContext sig, ConferenceContext conf, TopicMessageContext msg, String target)
|
||||
public AttachmentForm(CommunityContext comm, ConferenceContext conf, TopicMessageContext msg, String target)
|
||||
{
|
||||
this.sigid = sig.getSIGID();
|
||||
this.cid = comm.getCommunityID();
|
||||
this.confid = conf.getConfID();
|
||||
this.postid = msg.getPostID();
|
||||
this.target = target;
|
||||
|
@ -108,11 +108,11 @@ public class AttachmentForm implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sigid;
|
||||
return cid;
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ public class AuditDataViewer implements ContentRender, ColorSelectors
|
|||
+ tb_font + "<B>Date/Time</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>"
|
||||
+ tb_font + "<B>Description</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>"
|
||||
+ tb_font + "<B>User</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ "<B>SIG</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ "<B>Community</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ "<B>IP Address</B></FONT></TH>\n<TH ALIGN=LEFT CLASS=\"content\" COLSPAN=4 NOWRAP>"
|
||||
+ tb_font + "<B>Additional Data</B></FONT></TH>\n</TR>\n");
|
||||
Iterator it = audit_list.iterator();
|
||||
|
@ -132,7 +132,7 @@ public class AuditDataViewer implements ContentRender, ColorSelectors
|
|||
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ StringUtil.encodeHTML(dat.getUserName())
|
||||
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ StringUtil.encodeHTML(dat.getSIGName())
|
||||
+ StringUtil.encodeHTML(dat.getCommunityName())
|
||||
+ "</FONT></TD>\n<TD ALIGN=LEFT CLASS=\"content\" NOWRAP>" + tb_font
|
||||
+ StringUtil.encodeHTML(dat.getIPAddress()) + "</FONT></TD>\n");
|
||||
for (int i=0; i<AuditData.DATA_COUNT; i++)
|
||||
|
|
|
@ -20,29 +20,29 @@ package com.silverwrist.venice.servlets.format;
|
|||
import java.util.*;
|
||||
import java.io.Writer;
|
||||
import java.io.IOException;
|
||||
import com.silverwrist.venice.core.SIGContext;
|
||||
import com.silverwrist.venice.core.CommunityContext;
|
||||
|
||||
public class SIGAdminTop extends ContentMenuPanel
|
||||
public class CommunityAdminTop extends ContentMenuPanel
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGAdminTop()
|
||||
public CommunityAdminTop()
|
||||
{
|
||||
super("SIG Administration:",null);
|
||||
addChoice("SIG Profile","sigadmin?sig=$s&cmd=P");
|
||||
addChoice("Set SIG Category","sigadmin?sig=$s&cmd=T");
|
||||
addChoice("Set SIG Features","sigadmin?sig=$s&cmd=F");
|
||||
super("Community Administration:",null);
|
||||
addChoice("Community Profile","sigadmin?sig=$s&cmd=P");
|
||||
addChoice("Set Community Category","sigadmin?sig=$s&cmd=T");
|
||||
addChoice("Set Community Features","sigadmin?sig=$s&cmd=F");
|
||||
addChoice("Membership Control","sigadmin?sig=$s&cmd=M");
|
||||
addChoice("Display Audit Records","sigadmin?sig=$s&cmd=A");
|
||||
// TODO: More options
|
||||
addChoice("Delete SIG","sigadmin?sig=$s&cmd=DEL");
|
||||
addChoice("Delete Community","sigadmin?sig=$s&cmd=DEL");
|
||||
|
||||
} // end constructor
|
||||
|
||||
protected SIGAdminTop(SIGAdminTop other)
|
||||
protected CommunityAdminTop(CommunityAdminTop other)
|
||||
{
|
||||
super(other);
|
||||
|
||||
|
@ -53,17 +53,17 @@ public class SIGAdminTop extends ContentMenuPanel
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void setSIG(SIGContext sig)
|
||||
public void setCommunity(CommunityContext comm)
|
||||
{
|
||||
setSubtitle(sig.getName());
|
||||
setParameter("s",String.valueOf(sig.getSIGID()));
|
||||
setSubtitle(comm.getName());
|
||||
setParameter("s",String.valueOf(comm.getCommunityID()));
|
||||
|
||||
} // end setSIG
|
||||
} // end setCommunity
|
||||
|
||||
public Object clone()
|
||||
{
|
||||
return new SIGAdminTop(this);
|
||||
return new CommunityAdminTop(this);
|
||||
|
||||
} // end clone
|
||||
|
||||
} // end class SIGAdminTop
|
||||
} // end class CommunityAdminTop
|
|
@ -21,7 +21,7 @@ import java.util.*;
|
|||
import javax.servlet.ServletRequest;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class SIGCategoryBrowseData implements JSPRender
|
||||
public class CommunityCategoryBrowseData implements JSPRender
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
|
@ -29,7 +29,7 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
*/
|
||||
|
||||
// Attribute name for request attribute
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGCategoryBrowseData";
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityCategoryBrowseData";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -47,11 +47,12 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGCategoryBrowseData(UserContext user, SIGContext sig, int current_id) throws DataException
|
||||
public CommunityCategoryBrowseData(UserContext user, CommunityContext comm, int current_id)
|
||||
throws DataException
|
||||
{
|
||||
name = sig.getName();
|
||||
base_applet = "sigadmin?sig=" + String.valueOf(sig.getSIGID());
|
||||
prev_cat = sig.getCategory();
|
||||
name = comm.getName();
|
||||
base_applet = "sigadmin?sig=" + String.valueOf(comm.getCommunityID());
|
||||
prev_cat = comm.getCategory();
|
||||
if (prev_cat.getCategoryID()==current_id)
|
||||
curr_cat = prev_cat;
|
||||
else
|
||||
|
@ -65,9 +66,9 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static SIGCategoryBrowseData retrieve(ServletRequest request)
|
||||
public static CommunityCategoryBrowseData retrieve(ServletRequest request)
|
||||
{
|
||||
return (SIGCategoryBrowseData)(request.getAttribute(ATTR_NAME));
|
||||
return (CommunityCategoryBrowseData)(request.getAttribute(ATTR_NAME));
|
||||
|
||||
} // end retrieve
|
||||
|
||||
|
@ -78,7 +79,7 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
|
||||
public String getPageTitle(RenderData rdat)
|
||||
{
|
||||
return "Set SIG Category";
|
||||
return "Set Community Category";
|
||||
|
||||
} // end getPageTitle
|
||||
|
||||
|
@ -101,7 +102,7 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
|
||||
public String getTargetJSPName()
|
||||
{
|
||||
return "sigcatbrowser.jsp";
|
||||
return "commcatbrowser.jsp";
|
||||
|
||||
} // end getTargetJSPName
|
||||
|
||||
|
@ -110,7 +111,7 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return name;
|
||||
|
||||
|
@ -158,4 +159,4 @@ public class SIGCategoryBrowseData implements JSPRender
|
|||
|
||||
} // end hasSubcategories
|
||||
|
||||
} // end class SIGCategoryBrowseData
|
||||
} // end class CommunityCategoryBrowseData
|
|
@ -26,7 +26,7 @@ import com.silverwrist.venice.ValidationException;
|
|||
import com.silverwrist.venice.security.Role;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class SIGMembership implements JSPRender, SearchMode
|
||||
public class CommunityMembership implements JSPRender, SearchMode
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
|
@ -34,7 +34,7 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
*/
|
||||
|
||||
// Attribute name for request attribute
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceMembership";
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityMembership";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -42,28 +42,28 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
*/
|
||||
|
||||
private VeniceEngine engine; // reference to the engine
|
||||
private SIGContext sig; // the SIG we're in
|
||||
private CommunityContext comm; // the community we're in
|
||||
private List display_list = null; // list of members to display
|
||||
private boolean sig_members = false; // is this a list of SIG members?
|
||||
private boolean comm_members = false; // is this a list of community members?
|
||||
private int field = -1; // search field
|
||||
private int mode = -1; // search mode
|
||||
private String term = null; // search term
|
||||
private int offset = 0; // search result offset
|
||||
private int find_count = -1; // search results count
|
||||
private List role_choices; // the list of security roles
|
||||
private Role role_sig_host; // the "SIG Host" security role
|
||||
private Role role_comm_host; // the "Community Host" security role
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGMembership(VeniceEngine engine, SIGContext sig)
|
||||
public CommunityMembership(VeniceEngine engine, CommunityContext comm)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.role_choices = Role.getSIGMemberLevelChoices();
|
||||
this.role_sig_host = Role.getSIGHostRole();
|
||||
this.comm = comm;
|
||||
this.role_choices = Role.getCommunityMemberLevelChoices();
|
||||
this.role_comm_host = Role.getCommunityHostRole();
|
||||
|
||||
} // end constructor
|
||||
|
||||
|
@ -103,9 +103,9 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static SIGMembership retrieve(ServletRequest request)
|
||||
public static CommunityMembership retrieve(ServletRequest request)
|
||||
{
|
||||
return (SIGMembership)(request.getAttribute(ATTR_NAME));
|
||||
return (CommunityMembership)(request.getAttribute(ATTR_NAME));
|
||||
|
||||
} // end retrieve
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
|
||||
public String getPageTitle(RenderData rdat)
|
||||
{
|
||||
return "Membership in SIG " + sig.getName();
|
||||
return "Membership in Community " + comm.getName();
|
||||
|
||||
} // end getPageTitle
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
|
||||
public String getTargetJSPName()
|
||||
{
|
||||
return "sig_member.jsp";
|
||||
return "comm_member.jsp";
|
||||
|
||||
} // end getTargetJSPName
|
||||
|
||||
|
@ -148,13 +148,13 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void doSIGMemberList() throws DataException
|
||||
public void doCommunityMemberList() throws DataException
|
||||
{
|
||||
this.display_list = sig.getMemberList();
|
||||
this.sig_members = true;
|
||||
this.display_list = comm.getMemberList();
|
||||
this.comm_members = true;
|
||||
this.term = "";
|
||||
|
||||
} // end doSIGMemberList
|
||||
} // end doCommunityMemberList
|
||||
|
||||
public void doSearch(ServletRequest request) throws ValidationException, DataException, AccessError
|
||||
{
|
||||
|
@ -199,13 +199,13 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
if (find_count<0)
|
||||
find_count = engine.getSearchUserCount(field,mode,term);
|
||||
|
||||
// Create the real display list by getting the SIG security levels.
|
||||
// Create the real display list by getting the community security levels.
|
||||
Iterator it = intermediate.iterator();
|
||||
Vector rc = new Vector(count+1);
|
||||
while (it.hasNext())
|
||||
{ // loop around and find the member level of every one
|
||||
UserFound uf = (UserFound)(it.next());
|
||||
int new_level = sig.getMemberLevel(uf.getUID());
|
||||
int new_level = comm.getMemberLevel(uf.getUID());
|
||||
if (new_level==-1)
|
||||
new_level = 0;
|
||||
rc.add(uf.createNewLevel(new_level));
|
||||
|
@ -216,21 +216,21 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
|
||||
} // end doSearch
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return sig.getName();
|
||||
return comm.getName();
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
public String getLocator()
|
||||
{
|
||||
return "sig=" + sig.getSIGID();
|
||||
return "sig=" + comm.getCommunityID();
|
||||
|
||||
} // end getLocator
|
||||
|
||||
|
@ -238,17 +238,17 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
{
|
||||
if ((display_list==null) || (display_list.size()==0))
|
||||
return false;
|
||||
if (sig_members && (display_list.size()>engine.getMaxNumSIGMembersDisplay()))
|
||||
if (comm_members && (display_list.size()>engine.getMaxNumCommunityMembersDisplay()))
|
||||
return false;
|
||||
return true;
|
||||
|
||||
} // end displayList
|
||||
|
||||
public boolean isSIGMemberList()
|
||||
public boolean isCommunityMemberList()
|
||||
{
|
||||
return sig_members;
|
||||
return comm_members;
|
||||
|
||||
} // end isSIGMemberList
|
||||
} // end isCommunityMemberList
|
||||
|
||||
public int getSearchField()
|
||||
{
|
||||
|
@ -314,9 +314,9 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
{
|
||||
out.write("<INPUT TYPE=HIDDEN NAME=\"zxcur_" + uid + "\" VALUE=\"" + cur_level + "\">\n");
|
||||
out.write("<SELECT NAME=\"zxnew_" + uid + "\" SIZE=1>\n");
|
||||
if (cur_level==role_sig_host.getLevel()) // cheat and put in just the host level
|
||||
out.write("<OPTION VALUE=\"" + role_sig_host.getLevel() + "\" SELECTED>"
|
||||
+ StringUtil.encodeHTML(role_sig_host.getName()) + "</OPTION>\n");
|
||||
if (cur_level==role_comm_host.getLevel()) // cheat and put in just the host level
|
||||
out.write("<OPTION VALUE=\"" + role_comm_host.getLevel() + "\" SELECTED>"
|
||||
+ StringUtil.encodeHTML(role_comm_host.getName()) + "</OPTION>\n");
|
||||
else
|
||||
{ // display all the level choices properly
|
||||
Iterator it = role_choices.iterator();
|
||||
|
@ -336,4 +336,4 @@ public class SIGMembership implements JSPRender, SearchMode
|
|||
|
||||
} // end outputDropDown
|
||||
|
||||
} // end class SIGMembership
|
||||
} // end class CommunityMembership
|
|
@ -21,7 +21,7 @@ import javax.servlet.ServletRequest;
|
|||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class SIGProfileData implements JSPRender
|
||||
public class CommunityProfileData implements JSPRender
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
|
@ -29,7 +29,7 @@ public class SIGProfileData implements JSPRender
|
|||
*/
|
||||
|
||||
// Attribute name for request attribute
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGProfileData";
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityProfileData";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -38,21 +38,22 @@ public class SIGProfileData implements JSPRender
|
|||
|
||||
private VeniceEngine engine; // the Venice engine
|
||||
private UserContext user; // the current user managing this
|
||||
private SIGContext sig; // the SIG being displayed
|
||||
private ContactInfo ci; // SIG's contact info
|
||||
private UserProfile host_prof; // SIG host's user profile
|
||||
private CategoryDescriptor cat; // SIG's full category descriptor
|
||||
private CommunityContext comm; // the community being displayed
|
||||
private ContactInfo ci; // community's contact info
|
||||
private UserProfile host_prof; // community host's user profile
|
||||
private CategoryDescriptor cat; // community's full category descriptor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGProfileData(VeniceEngine engine, UserContext user, SIGContext ctxt) throws DataException
|
||||
public CommunityProfileData(VeniceEngine engine, UserContext user, CommunityContext ctxt)
|
||||
throws DataException
|
||||
{
|
||||
this.engine = engine;
|
||||
this.user = user;
|
||||
this.sig = ctxt;
|
||||
this.comm = ctxt;
|
||||
this.ci = ctxt.getContactInfo();
|
||||
this.host_prof = ctxt.getHostProfile();
|
||||
this.cat = ctxt.getCategory();
|
||||
|
@ -64,9 +65,9 @@ public class SIGProfileData implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static SIGProfileData retrieve(ServletRequest request)
|
||||
public static CommunityProfileData retrieve(ServletRequest request)
|
||||
{
|
||||
return (SIGProfileData)(request.getAttribute(ATTR_NAME));
|
||||
return (CommunityProfileData)(request.getAttribute(ATTR_NAME));
|
||||
|
||||
} // end retrieve
|
||||
|
||||
|
@ -77,13 +78,13 @@ public class SIGProfileData implements JSPRender
|
|||
|
||||
public String getPageTitle(RenderData rdat)
|
||||
{
|
||||
return "SIG Profile: " + sig.getName();
|
||||
return "Community Profile: " + comm.getName();
|
||||
|
||||
} // end getPageTitle
|
||||
|
||||
public String getPageQID()
|
||||
{
|
||||
return "go/" + sig.getAlias() + "!";
|
||||
return "go/" + comm.getAlias() + "!";
|
||||
|
||||
} // end getPageQID
|
||||
|
||||
|
@ -100,7 +101,7 @@ public class SIGProfileData implements JSPRender
|
|||
|
||||
public String getTargetJSPName()
|
||||
{
|
||||
return "sigprofile.jsp";
|
||||
return "commprofile.jsp";
|
||||
|
||||
} // end getTargetJSPName
|
||||
|
||||
|
@ -109,20 +110,20 @@ public class SIGProfileData implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGContext getSIGContext()
|
||||
public CommunityContext getCommunityContext()
|
||||
{
|
||||
return sig;
|
||||
return comm;
|
||||
|
||||
} // end getSIGContext
|
||||
} // end getCommunityContext
|
||||
|
||||
public String getSIGLogoURL(RenderData rdat)
|
||||
public String getCommunityLogoURL(RenderData rdat)
|
||||
{
|
||||
String tmp = ci.getPhotoURL();
|
||||
if (StringUtil.isStringEmpty(tmp))
|
||||
tmp = rdat.getFullImagePath("sig_other.jpg");
|
||||
return tmp;
|
||||
|
||||
} // end getSIGLogoURL
|
||||
} // end getCommunityLogoURL
|
||||
|
||||
public boolean isUserLoggedIn()
|
||||
{
|
||||
|
@ -136,11 +137,11 @@ public class SIGProfileData implements JSPRender
|
|||
|
||||
} // end getHostUserName
|
||||
|
||||
public ContactInfo getSIGContactInfo()
|
||||
public ContactInfo getCommunityContactInfo()
|
||||
{
|
||||
return ci;
|
||||
|
||||
} // end getSIGContactInfo
|
||||
} // end getCommunityContactInfo
|
||||
|
||||
public String getAddressLastLine()
|
||||
{
|
||||
|
@ -172,4 +173,4 @@ public class SIGProfileData implements JSPRender
|
|||
|
||||
} // end getCategory
|
||||
|
||||
} // end class SIGProfileData
|
||||
} // end class CommunityProfileData
|
|
@ -18,9 +18,9 @@
|
|||
package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import com.silverwrist.venice.core.SIGContext;
|
||||
import com.silverwrist.venice.core.CommunityContext;
|
||||
|
||||
public class SIGWelcome implements JSPRender
|
||||
public class CommunityWelcome implements JSPRender
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
|
@ -28,7 +28,7 @@ public class SIGWelcome implements JSPRender
|
|||
*/
|
||||
|
||||
// Attribute name for request attribute
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.SIGWelcome";
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityWelcome";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -43,10 +43,10 @@ public class SIGWelcome implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SIGWelcome(SIGContext sig)
|
||||
public CommunityWelcome(CommunityContext comm)
|
||||
{
|
||||
name = sig.getName();
|
||||
entry_url = "sig/" + sig.getAlias();
|
||||
name = comm.getName();
|
||||
entry_url = "sig/" + comm.getAlias();
|
||||
|
||||
} // end constructor
|
||||
|
||||
|
@ -55,9 +55,9 @@ public class SIGWelcome implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static SIGWelcome retrieve(ServletRequest request)
|
||||
public static CommunityWelcome retrieve(ServletRequest request)
|
||||
{
|
||||
return (SIGWelcome)(request.getAttribute(ATTR_NAME));
|
||||
return (CommunityWelcome)(request.getAttribute(ATTR_NAME));
|
||||
|
||||
} // end retrieve
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class SIGWelcome implements JSPRender
|
|||
|
||||
public String getTargetJSPName()
|
||||
{
|
||||
return "sigwelcome.jsp";
|
||||
return "commwelcome.jsp";
|
||||
|
||||
} // end getTargetJSPName
|
||||
|
||||
|
@ -100,11 +100,11 @@ public class SIGWelcome implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return name;
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
public String getEntryURL(RenderData rdat)
|
||||
{
|
||||
|
@ -112,4 +112,4 @@ public class SIGWelcome implements JSPRender
|
|||
|
||||
} // end getEntryURL
|
||||
|
||||
} // end class SIGWelcome
|
||||
} // end class CommunityWelcome
|
|
@ -37,7 +37,7 @@ public class ConferenceActivity implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig; // the SIG we're in
|
||||
private CommunityContext comm; // the community we're in
|
||||
private ConferenceContext conf; // the conference being listed
|
||||
private TopicContext topic; // the topic being listed
|
||||
private boolean posters; // is this a list of posters?
|
||||
|
@ -49,10 +49,10 @@ public class ConferenceActivity implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ConferenceActivity(SIGContext sig, ConferenceContext conf, TopicContext topic, boolean posters)
|
||||
public ConferenceActivity(CommunityContext comm, ConferenceContext conf, TopicContext topic, boolean posters)
|
||||
throws DataException, AccessError
|
||||
{
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
this.topic = topic;
|
||||
this.posters = posters;
|
||||
|
@ -158,7 +158,7 @@ public class ConferenceActivity implements JSPRender
|
|||
public String getLocator()
|
||||
{
|
||||
if (locator==null)
|
||||
locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
return locator;
|
||||
|
||||
} // end getLocator
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ConferenceListing implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig;
|
||||
private CommunityContext comm;
|
||||
private List conferences;
|
||||
private List[] hosts;
|
||||
|
||||
|
@ -45,10 +45,10 @@ public class ConferenceListing implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ConferenceListing(SIGContext sig) throws DataException, AccessError
|
||||
public ConferenceListing(CommunityContext comm) throws DataException, AccessError
|
||||
{
|
||||
this.sig = sig;
|
||||
this.conferences = sig.getConferences();
|
||||
this.comm = comm;
|
||||
this.conferences = comm.getConferences();
|
||||
this.hosts = new List[this.conferences.size()];
|
||||
for (int i=0; i<this.conferences.size(); i++)
|
||||
this.hosts[i] = ((ConferenceContext)(this.conferences.get(i))).getHosts();
|
||||
|
@ -73,13 +73,13 @@ public class ConferenceListing implements JSPRender
|
|||
|
||||
public String getPageTitle(RenderData rdat)
|
||||
{
|
||||
return "Conference Listing: " + sig.getName();
|
||||
return "Conference Listing: " + comm.getName();
|
||||
|
||||
} // end getPageTitle
|
||||
|
||||
public String getPageQID()
|
||||
{
|
||||
return "go/" + sig.getAlias() + "!";
|
||||
return "go/" + comm.getAlias() + "!";
|
||||
|
||||
} // end getPageQID
|
||||
|
||||
|
@ -105,17 +105,17 @@ public class ConferenceListing implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return sig.getName();
|
||||
return comm.getName();
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
public int getNumConferences()
|
||||
{
|
||||
|
@ -167,13 +167,13 @@ public class ConferenceListing implements JSPRender
|
|||
|
||||
public boolean canCreateConference()
|
||||
{
|
||||
return sig.canCreateConference();
|
||||
return comm.canCreateConference();
|
||||
|
||||
} // end canCreateConference
|
||||
|
||||
public boolean canManageConferences()
|
||||
{
|
||||
return sig.canManageConferences();
|
||||
return comm.canManageConferences();
|
||||
|
||||
} // end canManageConferences
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
*/
|
||||
|
||||
private VeniceEngine engine; // reference to the engine
|
||||
private SIGContext sig; // the SIG we're in
|
||||
private CommunityContext comm; // the community we're in
|
||||
private ConferenceContext conf; // the conference being listed
|
||||
private List display_list = null; // list of members to display
|
||||
private boolean conf_members = false; // is this a list of conference members?
|
||||
|
@ -58,10 +58,10 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ConferenceMembership(VeniceEngine engine, SIGContext sig, ConferenceContext conf)
|
||||
public ConferenceMembership(VeniceEngine engine, CommunityContext comm, ConferenceContext conf)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
this.role_choices = Role.getConferenceMemberLevelChoices();
|
||||
|
||||
|
@ -195,9 +195,9 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
throw new ValidationException("Unable to determine what action triggered the form.");
|
||||
|
||||
// Perform the search!
|
||||
List intermediate = sig.searchForMembers(field,mode,term,offset,count);
|
||||
List intermediate = comm.searchForMembers(field,mode,term,offset,count);
|
||||
if (find_count<0)
|
||||
find_count = sig.getSearchMemberCount(field,mode,term);
|
||||
find_count = comm.getSearchMemberCount(field,mode,term);
|
||||
|
||||
// Create the real display list by getting the conference security levels.
|
||||
Iterator it = intermediate.iterator();
|
||||
|
@ -216,11 +216,11 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
|
||||
} // end doSearch
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
{
|
||||
|
@ -228,11 +228,11 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
|
||||
} // end getConfID
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return sig.getName();
|
||||
return comm.getName();
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
public String getConfName()
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ public class ConferenceMembership implements JSPRender, SearchMode
|
|||
|
||||
public String getLocator()
|
||||
{
|
||||
return "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
} // end getLocator
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ConferenceSequence implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig;
|
||||
private CommunityContext comm;
|
||||
private List conf_list;
|
||||
private Hashtable hidden_stat = new Hashtable();
|
||||
private Hashtable next_id = new Hashtable();
|
||||
|
@ -48,10 +48,10 @@ public class ConferenceSequence implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ConferenceSequence(SIGContext sig) throws DataException, AccessError
|
||||
public ConferenceSequence(CommunityContext comm) throws DataException, AccessError
|
||||
{
|
||||
this.sig = sig;
|
||||
this.conf_list = sig.getConferences();
|
||||
this.comm = comm;
|
||||
this.conf_list = comm.getConferences();
|
||||
|
||||
Integer last_id = null;
|
||||
for (int i=0; i<conf_list.size(); i++)
|
||||
|
@ -125,11 +125,11 @@ public class ConferenceSequence implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public int getNumConferences()
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.silverwrist.util.StringUtil;
|
|||
import com.silverwrist.venice.ValidationException;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class CreateSIGDialog extends ContentDialog
|
||||
public class CreateCommunityDialog extends ContentDialog
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -36,9 +36,9 @@ public class CreateSIGDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public CreateSIGDialog(List country_list, List language_list)
|
||||
public CreateCommunityDialog(List country_list, List language_list)
|
||||
{
|
||||
super("Create New SIG",null,"createsigform","sigops");
|
||||
super("Create New Community",null,"createcommform","sigops");
|
||||
setHiddenField("cmd","C");
|
||||
|
||||
Vector vec_pubpriv = new Vector(2);
|
||||
|
@ -47,14 +47,15 @@ public class CreateSIGDialog extends ContentDialog
|
|||
vec_pubpriv.trimToSize();
|
||||
|
||||
Vector vec_hidemode = new Vector(3);
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_NONE) + "|Show in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_DIRECTORY) + "|Hide in directory, but not in search");
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_BOTH) + "|Hide in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
|
||||
+ "|Hide in directory, but not in search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
|
||||
vec_hidemode.trimToSize();
|
||||
|
||||
addFormField(new CDFormCategoryHeader("Basic Information"));
|
||||
addFormField(new CDTextFormField("name","SIG Name",null,true,32,128));
|
||||
addFormField(new CDVeniceIDFormField("alias","SIG Alias",null,true,32,32));
|
||||
addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
|
||||
addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
|
||||
addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
|
||||
addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
|
||||
addFormField(new CDLanguageListFormField("language","Primary language",null,true,language_list));
|
||||
|
@ -64,19 +65,19 @@ public class CreateSIGDialog extends ContentDialog
|
|||
addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
|
||||
addFormField(new CDCountryListFormField("country","Country",null,true,country_list));
|
||||
addFormField(new CDFormCategoryHeader("Security"));
|
||||
addFormField(new CDSimplePickListFormField("comtype","SIG type:",null,true,vec_pubpriv,'|'));
|
||||
addFormField(new CDTextFormField("joinkey","Join key","(for private SIGs)",false,32,64));
|
||||
addFormField(new CDSimplePickListFormField("hidemode","SIG visibility:",null,true,vec_hidemode,'|'));
|
||||
addFormField(new CDSimplePickListFormField("comtype","Community type:",null,true,vec_pubpriv,'|'));
|
||||
addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
|
||||
addFormField(new CDSimplePickListFormField("hidemode","Community visibility:",null,true,vec_hidemode,'|'));
|
||||
addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
|
||||
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
|
||||
|
||||
} // end constructor
|
||||
|
||||
protected CreateSIGDialog(CreateSIGDialog other)
|
||||
protected CreateCommunityDialog(CreateCommunityDialog other)
|
||||
{
|
||||
super(other);
|
||||
|
||||
} // end CreateSIGDialog
|
||||
} // end CreateCommunityDialog
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class ContentDialog
|
||||
|
@ -86,12 +87,12 @@ public class CreateSIGDialog extends ContentDialog
|
|||
protected void validateWholeForm() throws ValidationException
|
||||
{
|
||||
if (engine.aliasExists(getFieldValue("alias"),-1))
|
||||
throw new ValidationException("That alias is already used by another SIG on the system.");
|
||||
throw new ValidationException("That alias is already used by another community on the system.");
|
||||
|
||||
if (getFieldValue("comtype").equals("1"))
|
||||
{ // make sure if they flagged it as Private that they specified a join key
|
||||
if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
|
||||
throw new ValidationException("Private SIGs must specify a join key value.");
|
||||
throw new ValidationException("Private communities must specify a join key value.");
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -108,7 +109,7 @@ public class CreateSIGDialog extends ContentDialog
|
|||
|
||||
} // end setupDialog
|
||||
|
||||
public SIGContext doDialog(UserContext user) throws ValidationException, DataException, AccessError
|
||||
public CommunityContext doDialog(UserContext user) throws ValidationException, DataException, AccessError
|
||||
{
|
||||
validate(); // validate the dialog entries
|
||||
|
||||
|
@ -132,11 +133,12 @@ public class CreateSIGDialog extends ContentDialog
|
|||
else
|
||||
jkey = null;
|
||||
|
||||
// Create the new SIG context.
|
||||
SIGContext rc = user.createSIG(getFieldValue("name"),getFieldValue("alias"),getFieldValue("language"),
|
||||
getFieldValue("synopsis"),getFieldValue("rules"),jkey,hidemode);
|
||||
// Create the new community context.
|
||||
CommunityContext rc = user.createCommunity(getFieldValue("name"),getFieldValue("alias"),
|
||||
getFieldValue("language"),getFieldValue("synopsis"),
|
||||
getFieldValue("rules"),jkey,hidemode);
|
||||
|
||||
// Get the new SIG's contact record and fill in the pieces of info we know.
|
||||
// Get the new community's contact record and fill in the pieces of info we know.
|
||||
ContactInfo ci = rc.getContactInfo();
|
||||
ci.setLocality(getFieldValue("loc"));
|
||||
ci.setRegion(getFieldValue("reg"));
|
||||
|
@ -156,8 +158,8 @@ public class CreateSIGDialog extends ContentDialog
|
|||
|
||||
public Object clone()
|
||||
{
|
||||
return new CreateSIGDialog(this);
|
||||
return new CreateCommunityDialog(this);
|
||||
|
||||
} // end clone
|
||||
|
||||
} // end class CreateSIGDialog
|
||||
} // end class CreateCommunityDialog
|
|
@ -50,7 +50,8 @@ public class CreateConferenceDialog extends ContentDialog
|
|||
addFormField(new CDVeniceIDFormField("alias","Conference Alias",null,true,32,64));
|
||||
addFormField(new CDTextFormField("descr","Description",null,false,32,255));
|
||||
addFormField(new CDSimplePickListFormField("ctype","Conference type",null,true,vec_pubpriv,'|'));
|
||||
addFormField(new CDCheckBoxFormField("hide","Hide conference in the SIG's conference list",null,"Y"));
|
||||
addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
|
||||
null,"Y"));
|
||||
addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
|
||||
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
|
||||
|
||||
|
@ -79,14 +80,15 @@ public class CreateConferenceDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void setupDialog(VeniceEngine engine, SIGContext sig)
|
||||
public void setupDialog(VeniceEngine engine, CommunityContext comm)
|
||||
{
|
||||
this.engine = engine;
|
||||
setHiddenField("sig",String.valueOf(sig.getSIGID()));
|
||||
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
|
||||
|
||||
} // end setupDialog
|
||||
|
||||
public ConferenceContext doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
|
||||
public ConferenceContext doDialog(CommunityContext comm)
|
||||
throws ValidationException, DataException, AccessError
|
||||
{
|
||||
validate(); // validate the form
|
||||
|
||||
|
@ -96,7 +98,7 @@ public class CreateConferenceDialog extends ContentDialog
|
|||
boolean hide_list = yes.equals(getFieldValue("hide"));
|
||||
|
||||
// create the conference!
|
||||
return sig.createConference(getFieldValue("name"),getFieldValue("alias"),getFieldValue("descr"),pvt,
|
||||
return comm.createConference(getFieldValue("name"),getFieldValue("alias"),getFieldValue("descr"),pvt,
|
||||
hide_list);
|
||||
|
||||
} // end if
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.silverwrist.venice.ValidationException;
|
|||
import com.silverwrist.venice.security.Role;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class EditSIGProfileDialog extends ContentDialog
|
||||
public class EditCommunityProfileDialog extends ContentDialog
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -31,16 +31,16 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
*/
|
||||
|
||||
private VeniceEngine engine;
|
||||
private int sigid;
|
||||
private int cid;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public EditSIGProfileDialog(List country_list, List language_list)
|
||||
public EditCommunityProfileDialog(List country_list, List language_list)
|
||||
{
|
||||
super("Edit SIG Profile:",null,"sigprofform","sigadmin");
|
||||
super("Edit Community Profile:",null,"commprofform","sigadmin");
|
||||
setHiddenField("cmd","P");
|
||||
setHiddenField("sig","");
|
||||
|
||||
|
@ -50,14 +50,15 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
vec_pubpriv.trimToSize();
|
||||
|
||||
Vector vec_hidemode = new Vector(3);
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_NONE) + "|Show in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_DIRECTORY) + "|Hide in directory, but not in search");
|
||||
vec_hidemode.add(String.valueOf(SIGContext.HIDE_BOTH) + "|Hide in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
|
||||
+ "|Hide in directory, but not in search");
|
||||
vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
|
||||
vec_hidemode.trimToSize();
|
||||
|
||||
addFormField(new CDFormCategoryHeader("Basic Information"));
|
||||
addFormField(new CDTextFormField("name","SIG Name",null,true,32,128));
|
||||
addFormField(new CDVeniceIDFormField("alias","SIG Alias",null,true,32,32));
|
||||
addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
|
||||
addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
|
||||
addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
|
||||
addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
|
||||
addFormField(new CDLanguageListFormField("language","Primary language",null,true,language_list));
|
||||
|
@ -71,27 +72,28 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
|
||||
addFormField(new CDCountryListFormField("country","Country",null,true,country_list));
|
||||
addFormField(new CDFormCategoryHeader("Security"));
|
||||
addFormField(new CDSimplePickListFormField("comtype","SIG type",null,true,vec_pubpriv,'|'));
|
||||
addFormField(new CDTextFormField("joinkey","Join key","(for private SIGs)",false,32,64));
|
||||
addFormField(new CDCheckBoxFormField("membersonly","Allow only members to access this SIG",null,"Y"));
|
||||
addFormField(new CDSimplePickListFormField("hidemode","SIG visibility",null,true,vec_hidemode,'|'));
|
||||
addFormField(new CDSimplePickListFormField("comtype","Communty type",null,true,vec_pubpriv,'|'));
|
||||
addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
|
||||
addFormField(new CDCheckBoxFormField("membersonly","Allow only members to access this community",
|
||||
null,"Y"));
|
||||
addFormField(new CDSimplePickListFormField("hidemode","Community visibility",null,true,vec_hidemode,'|'));
|
||||
addFormField(new CDRoleListFormField("read_lvl","Security level required to read contents",null,true,
|
||||
Role.getSIGReadList()));
|
||||
Role.getCommunityReadList()));
|
||||
addFormField(new CDRoleListFormField("write_lvl","Security level required to update profile",null,true,
|
||||
Role.getSIGWriteList()));
|
||||
Role.getCommunityWriteList()));
|
||||
addFormField(new CDRoleListFormField("create_lvl","Security level required to create new subobjects",
|
||||
null,true,Role.getSIGCreateList()));
|
||||
addFormField(new CDRoleListFormField("delete_lvl","Security level required to delete SIG",null,true,
|
||||
Role.getSIGDeleteList()));
|
||||
addFormField(new CDRoleListFormField("join_lvl","Security level required to join SIG",null,true,
|
||||
Role.getSIGJoinList()));
|
||||
null,true,Role.getCommunityCreateList()));
|
||||
addFormField(new CDRoleListFormField("delete_lvl","Security level required to delete community",null,true,
|
||||
Role.getCommunityDeleteList()));
|
||||
addFormField(new CDRoleListFormField("join_lvl","Security level required to join community",null,true,
|
||||
Role.getCommunityJoinList()));
|
||||
// TODO: add logo selection/uploading method here
|
||||
addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
|
||||
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
|
||||
|
||||
} // end EditSIGProfileDialog
|
||||
} // end EditCommunityProfileDialog
|
||||
|
||||
protected EditSIGProfileDialog(EditSIGProfileDialog other)
|
||||
protected EditCommunityProfileDialog(EditCommunityProfileDialog other)
|
||||
{
|
||||
super(other);
|
||||
|
||||
|
@ -102,10 +104,10 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private void doDisable(SIGContext sig)
|
||||
private void doDisable(CommunityContext comm)
|
||||
{
|
||||
if (sig.isAdminSIG())
|
||||
{ // make sure certain fields are disabled for admin SIGs
|
||||
if (comm.isAdminCommunity())
|
||||
{ // make sure certain fields are disabled for admin community
|
||||
setFieldEnabled("comtype",false);
|
||||
setFieldEnabled("joinkey",false);
|
||||
setFieldEnabled("membersonly",false);
|
||||
|
@ -127,13 +129,13 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
|
||||
protected void validateWholeForm() throws ValidationException
|
||||
{
|
||||
if (engine.aliasExists(getFieldValue("alias"),sigid))
|
||||
throw new ValidationException("That alias is already used by another SIG on the system.");
|
||||
if (engine.aliasExists(getFieldValue("alias"),cid))
|
||||
throw new ValidationException("That alias is already used by another community on the system.");
|
||||
|
||||
if (getFieldValue("comtype").equals("1"))
|
||||
{ // make sure if they flagged it as Private that they specified a join key
|
||||
if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
|
||||
throw new ValidationException("Private SIGs must specify a join key value.");
|
||||
throw new ValidationException("Private communities must specify a join key value.");
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -144,24 +146,24 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void setupDialogBasic(VeniceEngine engine, SIGContext sig)
|
||||
public void setupDialogBasic(VeniceEngine engine, CommunityContext comm)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.sigid = sig.getSIGID();
|
||||
this.cid = comm.getCommunityID();
|
||||
|
||||
} // end setupDialogBasic
|
||||
|
||||
public void setupDialog(VeniceEngine engine, SIGContext sig) throws DataException, AccessError
|
||||
public void setupDialog(VeniceEngine engine, CommunityContext comm) throws DataException, AccessError
|
||||
{
|
||||
setupDialogBasic(engine,sig);
|
||||
ContactInfo ci = sig.getContactInfo();
|
||||
setupDialogBasic(engine,comm);
|
||||
ContactInfo ci = comm.getContactInfo();
|
||||
|
||||
setHiddenField("sig",String.valueOf(sig.getSIGID()));
|
||||
setFieldValue("name",sig.getName());
|
||||
setFieldValue("alias",sig.getAlias());
|
||||
setFieldValue("synopsis",sig.getSynopsis());
|
||||
setFieldValue("rules",sig.getRules());
|
||||
setFieldValue("language",sig.getLanguageCode());
|
||||
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
|
||||
setFieldValue("name",comm.getName());
|
||||
setFieldValue("alias",comm.getAlias());
|
||||
setFieldValue("synopsis",comm.getSynopsis());
|
||||
setFieldValue("rules",comm.getRules());
|
||||
setFieldValue("language",comm.getLanguageCode());
|
||||
setFieldValue("url",ci.getURL());
|
||||
setFieldValue("company",ci.getCompany());
|
||||
setFieldValue("addr1",ci.getAddressLine1());
|
||||
|
@ -170,33 +172,33 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
setFieldValue("reg",ci.getRegion());
|
||||
setFieldValue("pcode",ci.getPostalCode());
|
||||
setFieldValue("country",ci.getCountry());
|
||||
if (sig.isPublicSIG())
|
||||
{ // public SIG - no join key
|
||||
if (comm.isPublicCommunity())
|
||||
{ // public community - no join key
|
||||
setFieldValue("comtype","0");
|
||||
setFieldValue("joinkey","");
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // private SIG - display the join key
|
||||
{ // private community - display the join key
|
||||
setFieldValue("comtype","1");
|
||||
setFieldValue("joinkey",sig.getJoinKey());
|
||||
setFieldValue("joinkey",comm.getJoinKey());
|
||||
|
||||
} // end else
|
||||
|
||||
if (sig.getMembersOnly())
|
||||
if (comm.getMembersOnly())
|
||||
setFieldValue("membersonly","Y");
|
||||
setFieldValue("hidemode",String.valueOf(sig.getHideMode()));
|
||||
setFieldValue("read_lvl",String.valueOf(sig.getReadLevel()));
|
||||
setFieldValue("write_lvl",String.valueOf(sig.getWriteLevel()));
|
||||
setFieldValue("create_lvl",String.valueOf(sig.getCreateLevel()));
|
||||
setFieldValue("delete_lvl",String.valueOf(sig.getDeleteLevel()));
|
||||
setFieldValue("join_lvl",String.valueOf(sig.getJoinLevel()));
|
||||
setFieldValue("hidemode",String.valueOf(comm.getHideMode()));
|
||||
setFieldValue("read_lvl",String.valueOf(comm.getReadLevel()));
|
||||
setFieldValue("write_lvl",String.valueOf(comm.getWriteLevel()));
|
||||
setFieldValue("create_lvl",String.valueOf(comm.getCreateLevel()));
|
||||
setFieldValue("delete_lvl",String.valueOf(comm.getDeleteLevel()));
|
||||
setFieldValue("join_lvl",String.valueOf(comm.getJoinLevel()));
|
||||
|
||||
doDisable(sig);
|
||||
doDisable(comm);
|
||||
|
||||
} // end setupDialog
|
||||
|
||||
public void doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
|
||||
public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
|
||||
{
|
||||
final String yes = "Y"; // the "yes" string
|
||||
validate(); // validate the dialog entries
|
||||
|
@ -219,7 +221,7 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
} // end catch
|
||||
|
||||
// save off the ContactInfo-related fields first
|
||||
ContactInfo ci = sig.getContactInfo();
|
||||
ContactInfo ci = comm.getContactInfo();
|
||||
ci.setURL(getFieldValue("url"));
|
||||
ci.setCompany(getFieldValue("company"));
|
||||
ci.setAddressLine1(getFieldValue("addr1"));
|
||||
|
@ -228,43 +230,43 @@ public class EditSIGProfileDialog extends ContentDialog
|
|||
ci.setRegion(getFieldValue("reg"));
|
||||
ci.setPostalCode(getFieldValue("pcode"));
|
||||
ci.setCountry(getFieldValue("country"));
|
||||
sig.putContactInfo(ci);
|
||||
comm.putContactInfo(ci);
|
||||
|
||||
// now save the big text fields
|
||||
sig.setName(getFieldValue("name"));
|
||||
sig.setAlias(getFieldValue("alias"));
|
||||
sig.setSynopsis(getFieldValue("synopsis"));
|
||||
sig.setRules(getFieldValue("rules"));
|
||||
sig.setLanguage(getFieldValue("language"));
|
||||
comm.setName(getFieldValue("name"));
|
||||
comm.setAlias(getFieldValue("alias"));
|
||||
comm.setSynopsis(getFieldValue("synopsis"));
|
||||
comm.setRules(getFieldValue("rules"));
|
||||
comm.setLanguage(getFieldValue("language"));
|
||||
|
||||
if (!(sig.isAdminSIG()))
|
||||
if (!(comm.isAdminCommunity()))
|
||||
{ // save off the security information
|
||||
String jkey;
|
||||
if (getFieldValue("comtype").equals("1"))
|
||||
jkey = getFieldValue("joinkey");
|
||||
else
|
||||
jkey = null;
|
||||
sig.setJoinKey(jkey);
|
||||
sig.setMembersOnly(yes.equals(getFieldValue("membersonly")));
|
||||
sig.setHideMode(hidemode);
|
||||
sig.setSecurityLevels(read_lvl,write_lvl,create_lvl,delete_lvl,join_lvl);
|
||||
comm.setJoinKey(jkey);
|
||||
comm.setMembersOnly(yes.equals(getFieldValue("membersonly")));
|
||||
comm.setHideMode(hidemode);
|
||||
comm.setSecurityLevels(read_lvl,write_lvl,create_lvl,delete_lvl,join_lvl);
|
||||
|
||||
} // end if
|
||||
|
||||
} // end doDialog
|
||||
|
||||
public void resetOnError(SIGContext sig, String message)
|
||||
public void resetOnError(CommunityContext comm, String message)
|
||||
{
|
||||
setErrorMessage(message);
|
||||
doDisable(sig);
|
||||
doDisable(comm);
|
||||
|
||||
} // end resetOnError
|
||||
|
||||
public Object clone()
|
||||
{
|
||||
return new EditSIGProfileDialog(this);
|
||||
return new EditCommunityProfileDialog(this);
|
||||
|
||||
} // end clone
|
||||
|
||||
} // end class EditSIGProfileDialog
|
||||
} // end class EditCommunityProfileDialog
|
||||
|
|
@ -40,7 +40,8 @@ public class EditConferenceDialog extends ContentDialog
|
|||
addFormField(new CDFormCategoryHeader("Basic Information"));
|
||||
addFormField(new CDTextFormField("name","Conference Name",null,true,32,128));
|
||||
addFormField(new CDTextFormField("descr","Description",null,false,32,255));
|
||||
addFormField(new CDCheckBoxFormField("hide","Hide conference in the SIG's conference list",null,"Y"));
|
||||
addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
|
||||
null,"Y"));
|
||||
addFormField(new CDFormCategoryHeader("Security Information"));
|
||||
addFormField(new CDRoleListFormField("read_lvl","Security level required to read conference",null,true,
|
||||
Role.getConferenceReadList()));
|
||||
|
@ -79,9 +80,9 @@ public class EditConferenceDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void setupDialog(SIGContext sig, ConferenceContext conf) throws DataException, AccessError
|
||||
public void setupDialog(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
|
||||
{
|
||||
setHiddenField("sig",String.valueOf(sig.getSIGID()));
|
||||
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
|
||||
setHiddenField("conf",String.valueOf(conf.getConfID()));
|
||||
setTitle("Edit Conference: " + conf.getName());
|
||||
setFieldValue("name",conf.getName());
|
||||
|
@ -131,9 +132,9 @@ public class EditConferenceDialog extends ContentDialog
|
|||
|
||||
} // end doDialog
|
||||
|
||||
public void resetOnError(SIGContext sig, ConferenceContext conf, String message)
|
||||
public void resetOnError(CommunityContext comm, ConferenceContext conf, String message)
|
||||
{
|
||||
setHiddenField("sig",String.valueOf(sig.getSIGID()));
|
||||
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
|
||||
setHiddenField("conf",String.valueOf(conf.getConfID()));
|
||||
setTitle("Edit Conference: " + conf.getName());
|
||||
setErrorMessage(message);
|
||||
|
|
|
@ -36,7 +36,7 @@ public class FindData implements JSPRender, SearchMode
|
|||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.FindData";
|
||||
|
||||
// The various display categories
|
||||
public static final int FD_SIGS = 0;
|
||||
public static final int FD_COMMUNITIES = 0;
|
||||
public static final int FD_USERS = 1;
|
||||
public static final int FD_CATEGORIES = 2;
|
||||
|
||||
|
@ -75,13 +75,13 @@ public class FindData implements JSPRender, SearchMode
|
|||
if (header_titles==null)
|
||||
{ // construct the title and URL vectors
|
||||
header_titles = new Vector();
|
||||
header_titles.add("SIGs");
|
||||
header_titles.add("Communities");
|
||||
header_titles.add("Users");
|
||||
header_titles.add("Categories");
|
||||
header_titles.trimToSize();
|
||||
|
||||
header_urls = new Vector();
|
||||
header_urls.add("find?disp=" + String.valueOf(FD_SIGS));
|
||||
header_urls.add("find?disp=" + String.valueOf(FD_COMMUNITIES));
|
||||
header_urls.add("find?disp=" + String.valueOf(FD_USERS));
|
||||
header_urls.add("find?disp=" + String.valueOf(FD_CATEGORIES));
|
||||
header_urls.trimToSize();
|
||||
|
@ -257,17 +257,17 @@ public class FindData implements JSPRender, SearchMode
|
|||
|
||||
public void loadGet(int catid) throws DataException
|
||||
{
|
||||
if (disp==FD_SIGS)
|
||||
{ // fill in the list of subcategories and of SIGs in this category
|
||||
if (disp==FD_COMMUNITIES)
|
||||
{ // fill in the list of subcategories and of communities in this category
|
||||
cat = user.getCategoryDescriptor(catid);
|
||||
subcats = cat.getSubCategories();
|
||||
if (cat.getCategoryID()>=0)
|
||||
{ // fill in the SIGs that are in this category
|
||||
results = user.getSIGsInCategory(cat,offset,getNumResultsDisplayed());
|
||||
find_count = user.getNumSIGsInCategory(cat);
|
||||
{ // fill in the communities that are in this category
|
||||
results = user.getCommunitiesInCategory(cat,offset,getNumResultsDisplayed());
|
||||
find_count = user.getNumCommunitiesInCategory(cat);
|
||||
|
||||
} // end if
|
||||
field = FIELD_SIG_NAME;
|
||||
field = FIELD_COMMUNITY_NAME;
|
||||
|
||||
} // end if
|
||||
else if (disp==FD_USERS)
|
||||
|
@ -286,12 +286,12 @@ public class FindData implements JSPRender, SearchMode
|
|||
// category ID (if specified) and the field identifier.
|
||||
switch (disp)
|
||||
{
|
||||
case FD_SIGS:
|
||||
case FD_COMMUNITIES:
|
||||
catid = getParamInt(request,"cat",-1);
|
||||
if (!engine.isValidCategoryID(catid))
|
||||
throw new ValidationException("The category ID parameter is not valid.");
|
||||
field = getParamInt(request,"field",FIELD_SIG_NAME);
|
||||
if ((field!=FIELD_SIG_NAME) && (field!=FIELD_SIG_SYNOPSIS))
|
||||
field = getParamInt(request,"field",FIELD_COMMUNITY_NAME);
|
||||
if ((field!=FIELD_COMMUNITY_NAME) && (field!=FIELD_COMMUNITY_SYNOPSIS))
|
||||
throw new ValidationException("The field search parameter is not valid.");
|
||||
break;
|
||||
|
||||
|
@ -344,25 +344,25 @@ public class FindData implements JSPRender, SearchMode
|
|||
// Run the actual search.
|
||||
switch (disp)
|
||||
{
|
||||
case FD_SIGS:
|
||||
case FD_COMMUNITIES:
|
||||
if (catid>=0)
|
||||
{ // retrieve the category descriptor and the subcategory list
|
||||
cat = user.getCategoryDescriptor(catid);
|
||||
subcats = cat.getSubCategories();
|
||||
if (cat.getCategoryID()>=0)
|
||||
{ // fill in the SIGs that are in this category
|
||||
results = user.getSIGsInCategory(cat,offset,count);
|
||||
{ // fill in the communities that are in this category
|
||||
results = user.getCommunitiesInCategory(cat,offset,count);
|
||||
if (find_count<0)
|
||||
find_count = user.getNumSIGsInCategory(cat);
|
||||
find_count = user.getNumCommunitiesInCategory(cat);
|
||||
|
||||
} // end if
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // retrieve the SIG search data
|
||||
results = user.searchForSIGs(field,mode,term,offset,count);
|
||||
{ // retrieve the community search data
|
||||
results = user.searchForCommunities(field,mode,term,offset,count);
|
||||
if (find_count<0)
|
||||
find_count = user.getSearchSIGCount(field,mode,term);
|
||||
find_count = user.getSearchCommunityCount(field,mode,term);
|
||||
|
||||
} // end else
|
||||
break;
|
||||
|
@ -385,7 +385,7 @@ public class FindData implements JSPRender, SearchMode
|
|||
|
||||
public static String getCatJumpLink(RenderData rdat, int catid)
|
||||
{
|
||||
return rdat.getEncodedServletPath("find?disp=" + String.valueOf(FD_SIGS) + "&cat="
|
||||
return rdat.getEncodedServletPath("find?disp=" + String.valueOf(FD_COMMUNITIES) + "&cat="
|
||||
+ String.valueOf(catid));
|
||||
|
||||
} // end getCatJumpLink
|
||||
|
|
|
@ -36,16 +36,16 @@ public class Invitation implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig; // the SIG context
|
||||
private CommunityContext comm; // the community context
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public Invitation(SIGContext sig)
|
||||
public Invitation(CommunityContext comm)
|
||||
{
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
|
||||
} // end constructor
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class Invitation implements JSPRender
|
|||
|
||||
public String getPageQID()
|
||||
{
|
||||
return "sigops?cmd=I&sig=" + sig.getSIGID();
|
||||
return "sigops?cmd=I&sig=" + comm.getCommunityID();
|
||||
|
||||
} // end getPageQID
|
||||
|
||||
|
@ -99,16 +99,16 @@ public class Invitation implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public String getSIGName()
|
||||
public String getCommunityName()
|
||||
{
|
||||
return sig.getName();
|
||||
return comm.getName();
|
||||
|
||||
} // end getSIGName
|
||||
} // end getCommunityName
|
||||
|
||||
} // end class Invitation
|
||||
|
|
|
@ -33,8 +33,8 @@ public class JoinKeyDialog extends ContentDialog
|
|||
super("Join Key Required",null,"joinkeyform","sigops");
|
||||
setHiddenField("cmd","J");
|
||||
setHiddenField("sig","");
|
||||
setInstructions("You must specify a join key before you can join this SIG. You might have received "
|
||||
+ "the join key from the SIG's host, or via an invitation e-mail message. Please "
|
||||
setInstructions("You must specify a join key before you can join this community. You might have received "
|
||||
+ "the join key from the community's host, or via an invitation e-mail message. Please "
|
||||
+ "enter it in the box below.");
|
||||
addFormField(new CDTextFormField("key","Join key",null,false,32,64));
|
||||
addCommandButton(new CDImageButton("join","bn_join_now.gif","Join Now",80,24));
|
||||
|
@ -65,16 +65,16 @@ public class JoinKeyDialog extends ContentDialog
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void setupDialog(SIGContext sig)
|
||||
public void setupDialog(CommunityContext comm)
|
||||
{
|
||||
setHiddenField("sig",String.valueOf(sig.getSIGID()));
|
||||
setHiddenField("sig",String.valueOf(comm.getCommunityID()));
|
||||
|
||||
} // end setupDialog
|
||||
|
||||
public void doDialog(SIGContext sig) throws ValidationException, DataException, AccessError
|
||||
public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
|
||||
{
|
||||
validate();
|
||||
sig.join(getFieldValue("key"));
|
||||
comm.join(getFieldValue("key"));
|
||||
|
||||
} // end doDialog
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ManageConference implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig; // the SIG we're in
|
||||
private CommunityContext comm; // the community we're in
|
||||
private ConferenceContext conf; // the conference being listed
|
||||
private String locator = null; // the locator we use
|
||||
|
||||
|
@ -46,9 +46,9 @@ public class ManageConference implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ManageConference(SIGContext sig, ConferenceContext conf)
|
||||
public ManageConference(CommunityContext comm, ConferenceContext conf)
|
||||
{
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
|
||||
} // end constructor
|
||||
|
@ -103,11 +103,11 @@ public class ManageConference implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ public class ManageConference implements JSPRender
|
|||
public String getLocator()
|
||||
{
|
||||
if (locator==null)
|
||||
locator = "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
return locator;
|
||||
|
||||
} // end getLocator
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ManageConferenceAliases implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private SIGContext sig; // the SIG we're in
|
||||
private CommunityContext comm; // the community we're in
|
||||
private ConferenceContext conf; // the conference being listed
|
||||
private List aliases; // list of aliases generated
|
||||
private String error_message; // error message to display
|
||||
|
@ -47,18 +47,19 @@ public class ManageConferenceAliases implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ManageConferenceAliases(SIGContext sig, ConferenceContext conf) throws DataException
|
||||
public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf) throws DataException
|
||||
{
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
this.aliases = conf.getAliases();
|
||||
this.error_message = null;
|
||||
|
||||
} // end constructor
|
||||
|
||||
public ManageConferenceAliases(SIGContext sig, ConferenceContext conf, String message) throws DataException
|
||||
public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf, String message)
|
||||
throws DataException
|
||||
{
|
||||
this.sig = sig;
|
||||
this.comm = comm;
|
||||
this.conf = conf;
|
||||
this.aliases = conf.getAliases();
|
||||
this.error_message = message;
|
||||
|
@ -115,11 +116,11 @@ public class ManageConferenceAliases implements JSPRender
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public int getSIGID()
|
||||
public int getCommunityID()
|
||||
{
|
||||
return sig.getSIGID();
|
||||
return comm.getCommunityID();
|
||||
|
||||
} // end getSIGID
|
||||
} // end getCommunityID
|
||||
|
||||
public int getConfID()
|
||||
{
|
||||
|
@ -135,7 +136,7 @@ public class ManageConferenceAliases implements JSPRender
|
|||
|
||||
public String getLocator()
|
||||
{
|
||||
return "sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
|
||||
|
||||
} // end getLocator
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.*;
|
|||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class MenuSIG implements ComponentRender, ColorSelectors
|
||||
public class MenuCommunity implements ComponentRender, ColorSelectors
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
@ -34,7 +34,7 @@ public class MenuSIG implements ComponentRender, ColorSelectors
|
|||
private boolean image_url_needs_fixup = false; // do we need to fix image path up?
|
||||
private String title; // title for menu
|
||||
private List items_list; // list of menu items
|
||||
private int sigid; // SIG ID
|
||||
private int cid; // community ID
|
||||
private boolean show_unjoin; // show the "Unjoin" menu choice?
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
|
@ -42,7 +42,7 @@ public class MenuSIG implements ComponentRender, ColorSelectors
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MenuSIG(SIGContext ctxt)
|
||||
public MenuCommunity(CommunityContext ctxt)
|
||||
{
|
||||
try
|
||||
{ // retrieve the contact info for this puppy
|
||||
|
@ -63,8 +63,8 @@ public class MenuSIG implements ComponentRender, ColorSelectors
|
|||
} // end catch
|
||||
|
||||
title = ctxt.getName();
|
||||
items_list = ctxt.getSIGFeaturesList();
|
||||
sigid = ctxt.getSIGID();
|
||||
items_list = ctxt.getCommunityFeaturesList();
|
||||
cid = ctxt.getCommunityID();
|
||||
show_unjoin = ctxt.canUnjoin();
|
||||
|
||||
} // end constructor
|
||||
|
@ -95,19 +95,19 @@ public class MenuSIG implements ComponentRender, ColorSelectors
|
|||
|
||||
// display the menu items
|
||||
Iterator it = items_list.iterator();
|
||||
String sigparm = "sig=" + sigid;
|
||||
String cparm = "sig=" + cid;
|
||||
while (it.hasNext())
|
||||
{ // display each menu item in turn
|
||||
SIGFeature ftr = (SIGFeature)(it.next());
|
||||
CommunityFeature ftr = (CommunityFeature)(it.next());
|
||||
out.write("<BR>\n<A CLASS=\"lbar\" HREF=\""
|
||||
+ rdat.getEncodedServletPath(ftr.getApplet() + "?" + sigparm) + "\">" + hilite
|
||||
+ rdat.getEncodedServletPath(ftr.getApplet() + "?" + cparm) + "\">" + hilite
|
||||
+ StringUtil.encodeHTML(ftr.getName()) + "</FONT></A>\n");
|
||||
|
||||
} // end while
|
||||
|
||||
if (show_unjoin)
|
||||
out.write("<P>\n<A CLASS=\"lbar\" HREF=\""
|
||||
+ rdat.getEncodedServletPath("sigops?cmd=U&" + sigparm) + "\">"
|
||||
+ rdat.getEncodedServletPath("sigops?cmd=U&" + cparm) + "\">"
|
||||
+ hilite + "Unjoin</FONT></A>\n");
|
||||
|
||||
out.write("\n"); // all done...
|
||||
|
@ -121,8 +121,8 @@ public class MenuSIG implements ComponentRender, ColorSelectors
|
|||
|
||||
public int getID()
|
||||
{
|
||||
return sigid;
|
||||
return cid;
|
||||
|
||||
} // end getID
|
||||
|
||||
} // end class MenuTop
|
||||
} // end class MenuCommunity
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user