implemented conference hotlists and SIG list management from the Top page;

cleaned up remaining SQL statements using text columns instead of column
indexes with the ResultSet; fleshed out specifics in the TODO for
SIG administration
This commit is contained in:
Eric J. Bowersox 2001-02-19 02:56:16 +00:00
parent 7b7e6be996
commit e23de5dae6
32 changed files with 1400 additions and 111 deletions

24
TODO
View File

@ -1,8 +1,11 @@
Lots! Lots!
- A bunch of the SIG-level functionality is not fully implemented. We need - Unimplemented functions on the SIG Administration page:
invites, some admin functions, and the "Manage" button on the "top Set SIG Features (sigadmin, command=F)
content" window to work. Membership Control (sigadmin, command=M)
Delete SIG (sigadmin, command=DEL)
- Implement SIG invitations ("Invite" button on the profile).
- Should we provide the sysadmin the ability to disable SIG creation for - Should we provide the sysadmin the ability to disable SIG creation for
non-admin users? Maybe there needs to be a "global" set of levels that non-admin users? Maybe there needs to be a "global" set of levels that
@ -13,8 +16,6 @@ Lots!
before we go live. (It plugs into the Administrative SIG features.) before we go live. (It plugs into the Administrative SIG features.)
- Unimplemented functions on the Top page: - Unimplemented functions on the Top page:
Manage SIG list (SIG sidebox)
Manage Conference Hotlist (Conference sidebox)
Customize Sideboxes Customize Sideboxes
- The plan for the "main" part of the Top page is to let a sysadmin put - The plan for the "main" part of the Top page is to let a sysadmin put
@ -25,21 +26,8 @@ Lots!
- Implement quick e-mail from the user profile display (engine support and - Implement quick e-mail from the user profile display (engine support and
UI). UI).
- More SELECT queries that specify discrete columns need to start using
numeric indexes to retrieve the column data, instead of names. This will
make the retrieval process more efficient, and make for shorter SQL
statements in the case of joined queries (no need to SELECT table.column
AS name).
- Slippage during posting is still untested. - Slippage during posting is still untested.
- We need a "manage" button at conference list level so we can use that to
manage the ordering of conferences. This operation should be accessible
only to users with "create" privilege on the SIG.
- Conference hotlist is now partially implemented, but we need some more work
at engine level.
- Not everybody likes purple. Provide a way to change the default colors. - Not everybody likes purple. Provide a way to change the default colors.
Probably via entries in render-config.xml. Of course, if we go to a Probably via entries in render-config.xml. Of course, if we go to a
different rendering system eventually, we won't need this. different rendering system eventually, we won't need this.

View File

@ -72,11 +72,19 @@
<servlet> <servlet>
<servlet-name>account</servlet-name> <servlet-name>account</servlet-name>
<description> <description>
Displays the "accounts" page of the Venice application. Account management operations - login, logout, create, verify email, enter profile.
</description> </description>
<servlet-class>com.silverwrist.venice.servlets.Account</servlet-class> <servlet-class>com.silverwrist.venice.servlets.Account</servlet-class>
</servlet> </servlet>
<servlet>
<servlet-name>settings</servlet-name>
<description>
User customization and settings operations.
</description>
<servlet-class>com.silverwrist.venice.servlets.Settings</servlet-class>
</servlet>
<servlet> <servlet>
<servlet-name>userdisplay</servlet-name> <servlet-name>userdisplay</servlet-name>
<description> <description>
@ -200,6 +208,11 @@
<url-pattern>/account</url-pattern> <url-pattern>/account</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping>
<servlet-name>settings</servlet-name>
<url-pattern>/settings</url-pattern>
</servlet-mapping>
<servlet-mapping> <servlet-mapping>
<servlet-name>userdisplay</servlet-name> <servlet-name>userdisplay</servlet-name>
<url-pattern>/user/*</url-pattern> <url-pattern>/user/*</url-pattern>

View File

@ -306,7 +306,8 @@ CREATE TABLE confhotlist (
sequence SMALLINT NOT NULL, sequence SMALLINT NOT NULL,
sigid INT NOT NULL, sigid INT NOT NULL,
confid INT NOT NULL, confid INT NOT NULL,
PRIMARY KEY (uid, sequence) PRIMARY KEY (uid, sigid, confid),
INDEX inorder (uid, sequence)
); );
# The "bozo filter" list for a conference, for use by users in filtering out # The "bozo filter" list for a conference, for use by users in filtering out
@ -1368,7 +1369,7 @@ INSERT INTO confs (confid, createdate, read_lvl, post_lvl, create_lvl, hide_lvl,
delete_lvl, top_topic, name, descr) delete_lvl, top_topic, name, descr)
VALUES (1, '2000-12-01 00:00:00', 63000, 63000, 63000, 63000, 64999, 64999, 65500, 0, VALUES (1, '2000-12-01 00:00:00', 63000, 63000, 63000, 63000, 64999, 64999, 65500, 0,
'Administrative Notes', 'Used to store notes and discussions between the site administrators.'); 'Administrative Notes', 'Used to store notes and discussions between the site administrators.');
INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (1, 1, 100); INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (1, 1, 10);
INSERT INTO confalias (confid, alias) VALUES (1, 'Admin_Notes'); INSERT INTO confalias (confid, alias) VALUES (1, 'Admin_Notes');
# Make the Administrator the host-of-record of the "Administrative Notes" conference. # Make the Administrator the host-of-record of the "Administrative Notes" conference.
@ -1405,7 +1406,7 @@ INSERT INTO confs (confid, createdate, read_lvl, post_lvl, create_lvl, hide_lvl,
delete_lvl, top_topic, name, descr) delete_lvl, top_topic, name, descr)
VALUES (2, '2000-12-01 00:00:00', 6500, 6500, 6500, 52500, 52500, 52500, 58000, 0, 'General Discussion', VALUES (2, '2000-12-01 00:00:00', 6500, 6500, 6500, 52500, 52500, 52500, 58000, 0, 'General Discussion',
'Your place for general discussion about the system and general topics.'); 'Your place for general discussion about the system and general topics.');
INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (2, 2, 100); INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (2, 2, 10);
INSERT INTO confalias (confid, alias) VALUES (2, 'General'); INSERT INTO confalias (confid, alias) VALUES (2, 'General');
# Make the Administrator the host-of-record of the "General Discussion" conference. # Make the Administrator the host-of-record of the "General Discussion" conference.
@ -1417,7 +1418,7 @@ INSERT INTO confs (confid, createdate, read_lvl, post_lvl, create_lvl, hide_lvl,
delete_lvl, top_topic, name, descr) delete_lvl, top_topic, name, descr)
VALUES (3, '2000-12-01 00:00:00', 6500, 6500, 6500, 52500, 52500, 52500, 58000, 0, 'Test Postings', VALUES (3, '2000-12-01 00:00:00', 6500, 6500, 6500, 52500, 52500, 52500, 58000, 0, 'Test Postings',
'Use this conference to test the conferencing system.'); 'Use this conference to test the conferencing system.');
INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (2, 3, 200); INSERT INTO sigtoconf (sigid, confid, sequence) VALUES (2, 3, 20);
INSERT INTO confalias (confid, alias) VALUES (3, 'Test'); INSERT INTO confalias (confid, alias) VALUES (3, 'Test');
# Make the Administrator the host-of-record of the "Test Postings" conference. # Make the Administrator the host-of-record of the "Test Postings" conference.

View File

@ -149,4 +149,8 @@ public interface ConferenceContext
public abstract SIGContext getEnclosingSIG(); public abstract SIGContext getEnclosingSIG();
public abstract void removeFromHotlist() throws DataException;
public abstract void setHotlistSequence(int seq) throws DataException;
} // end interface ConferenceContext } // end interface ConferenceContext

View File

@ -151,4 +151,6 @@ public interface SIGContext extends SearchMode
public abstract List getMemberList() throws DataException; public abstract List getMemberList() throws DataException;
public abstract boolean canManageConferences();
} // end interface SIGContext } // end interface SIGContext

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License. * 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>, * 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 * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
@ -520,7 +520,7 @@ class CategoryDescriptorImpl implements CategoryDescriptor, Cloneable
{ // get a database connection { // get a database connection
conn = datapool.getConnection(); conn = datapool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("SELECT COUNT(*) AS total FROM refcategory WHERE name "); StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM refcategory WHERE name ");
switch (mode) switch (mode)
{ // compose SQL in different ways depending on the search term { // compose SQL in different ways depending on the search term
@ -556,7 +556,7 @@ class CategoryDescriptorImpl implements CategoryDescriptor, Cloneable
if (!(rs.next())) if (!(rs.next()))
throw new InternalStateError("getSearchCategoryCount search failure (MUST have 1 row!)"); throw new InternalStateError("getSearchCategoryCount search failure (MUST have 1 row!)");
return rs.getInt("total"); return rs.getInt(1);
} // end try } // end try
catch (SQLException e) catch (SQLException e)

View File

@ -1288,7 +1288,7 @@ class ConferenceCoreData implements ConferenceData
rs = stmt.executeQuery(sql.toString()); rs = stmt.executeQuery(sql.toString());
if (!(rs.next())) if (!(rs.next()))
throw new InternalStateError("bogus query in createConference - must return at least 1 row!"); throw new InternalStateError("bogus query in createConference - must return at least 1 row!");
new_sequence = (short)(rs.getShort(1) + 100); new_sequence = (short)(rs.getShort(1) + 10);
// insert the record into the conferences table! // insert the record into the conferences table!
sql.setLength(0); sql.setLength(0);

View File

@ -572,9 +572,23 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
public void setHideList(SIGBackend sig, boolean flag) throws DataException public void setHideList(SIGBackend sig, boolean flag) throws DataException
{ {
if (logger.isDebugEnabled())
logger.debug("setHideList(conf #" + confid + ", " + flag + ")");
if (deleted) if (deleted)
{ // aiyaiyai - we're deleted
logger.error("conference deleted, can't change a thing");
throw new DataException("This conference has been deleted."); throw new DataException("This conference has been deleted.");
} // end if
if (flag==hide_list)
{ // this is a no-op
logger.warn("setHideList for this conference is a no-op");
return;
} // end if
Connection conn = null; // database connection Connection conn = null; // database connection
AuditRecord ar = null; // audit record AuditRecord ar = null; // audit record
@ -585,8 +599,10 @@ class ConferenceSIGContextImpl implements ConferenceSIGContext
// create the SQL statement // create the SQL statement
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("UPDATE sigtoconf SET hide_list = "); StringBuffer sql = new StringBuffer("UPDATE sigtoconf SET hide_list = ");
sql.append(hide_list ? '1' : '0').append(" WHERE sigid = ").append(this.sig.realSIGID()); sql.append(flag ? '1' : '0').append(" WHERE sigid = ").append(this.sig.realSIGID());
sql.append(" AND confid = ").append(confid).append(';'); sql.append(" AND confid = ").append(confid).append(';');
if (logger.isDebugEnabled())
logger.debug("SQL: " + sql.toString());
// execute the update // execute the update
stmt.executeUpdate(sql.toString()); stmt.executeUpdate(sql.toString());

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License. * 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>, * 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 * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
@ -1359,6 +1359,70 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
} // end getEnclosingSIG } // end getEnclosingSIG
public void removeFromHotlist() throws DataException
{
Connection conn = null;
try
{ // retrieve a connection from the datapool
conn = datapool.getConnection();
Statement stmt = conn.createStatement();
// 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(';');
stmt.executeUpdate(sql.toString());
} // end try
catch (SQLException e)
{ // this becomes a DataException
logger.error("DB error removing from hotlist: " + e.getMessage(),e);
throw new DataException("error removing from hotlist: " + e.getMessage(),e);
} // end catch
finally
{ // make sure we release the connection before we go
if (conn!=null)
datapool.releaseConnection(conn);
} // end finally
} // end removeFromHotlist
public void setHotlistSequence(int seq) throws DataException
{
Connection conn = null;
try
{ // retrieve a connection from the datapool
conn = datapool.getConnection();
Statement stmt = conn.createStatement();
// 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(';');
stmt.executeUpdate(sql.toString());
} // end try
catch (SQLException e)
{ // this becomes a DataException
logger.error("DB error setting hotlist sequence: " + e.getMessage(),e);
throw new DataException("error setting hotlist sequence: " + e.getMessage(),e);
} // end catch
finally
{ // make sure we release the connection before we go
if (conn!=null)
datapool.releaseConnection(conn);
} // end finally
} // end setHotlistSequence
/*-------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------
* Implementations from interface UserBackend * Implementations from interface UserBackend
*-------------------------------------------------------------------------------- *--------------------------------------------------------------------------------

View File

@ -651,9 +651,9 @@ class ContactInfoImpl implements ContactInfo, Stashable
// now read back the contact ID we just added // now read back the contact ID we just added
int new_contactid; int new_contactid;
ResultSet rs = stmt.executeQuery("SELECT LAST_INSERT_ID() AS blort;"); ResultSet rs = stmt.executeQuery("SELECT LAST_INSERT_ID();");
if (rs.next()) if (rs.next())
new_contactid = rs.getInt("blort"); new_contactid = rs.getInt(1);
else else
throw new DataException("unable to read back new contact ID"); throw new DataException("unable to read back new contact ID");

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License. * 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>, * 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 * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
@ -1280,7 +1280,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
{ // get a database connection and create the appropriate SELECT statement { // get a database connection and create the appropriate SELECT statement
conn = datapool.getConnection(); conn = datapool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("SELECT COUNT(*) AS total FROM sigmember WHERE sigid = "); StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM sigmember WHERE sigid = ");
sql.append(sigid); sql.append(sigid);
if (!include_hidden) if (!include_hidden)
sql.append(" AND hidden = 0"); sql.append(" AND hidden = 0");
@ -1291,7 +1291,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
if (!(rs.next())) if (!(rs.next()))
throw new InternalStateError("getMemberCount query failure - must have ONE row!"); throw new InternalStateError("getMemberCount query failure - must have ONE row!");
return rs.getInt("total"); return rs.getInt(1);
} // end try } // end try
catch (SQLException e) catch (SQLException e)
@ -1709,9 +1709,9 @@ class SIGCoreData implements SIGData, SIGDataBackend
stmt.executeUpdate(sql.toString()); // here we go! stmt.executeUpdate(sql.toString()); // here we go!
// Get the SIGID of the new SIG! // Get the SIGID of the new SIG!
rs = stmt.executeQuery("SELECT LAST_INSERT_ID() AS blort;"); rs = stmt.executeQuery("SELECT LAST_INSERT_ID();");
if (rs.next()) if (rs.next())
new_sigid = rs.getInt("blort"); new_sigid = rs.getInt(1);
else else
{ // we should have gotten a SIGID back! { // we should have gotten a SIGID back!
logger.error("readback of new SIGID failed!"); logger.error("readback of new SIGID failed!");

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License. * 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>, * 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 * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
@ -1124,6 +1124,20 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
} // end getMemberList } // end getMemberList
public boolean canManageConferences()
{
SIGData sd = getSIGDataNE();
if (sd==null)
return false;
if (!(sd.checkMembership(level,is_member)))
return false;
if (sd.isFeaturePresent("CONF"))
return sd.canCreateSIGSubObjects(level);
else
return false;
} // end canManageConferences
/*-------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------
* Implementations from interface UserBackend * Implementations from interface UserBackend
*-------------------------------------------------------------------------------- *--------------------------------------------------------------------------------
@ -1241,20 +1255,18 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
{ // get a database connection { // get a database connection
conn = datapool.getConnection(); conn = datapool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("SELECT sm.sigid AS sigid, sm.granted_lvl AS level, " StringBuffer sql = new StringBuffer("SELECT sm.sigid, sm.granted_lvl, sm.locked, s.signame, s.alias "
+ "sm.locked AS locked, s.signame AS name, s.alias AS alias "
+ "FROM sigmember sm, sigs s WHERE sm.sigid = s.sigid " + "FROM sigmember sm, sigs s WHERE sm.sigid = s.sigid "
+ "AND sm.uid = "); + "AND sm.uid = ");
sql.append(user.realUID()).append(" ORDER BY s.signame;"); sql.append(user.realUID()).append(" ORDER BY s.signame;");
ResultSet rs = stmt.executeQuery(sql.toString()); ResultSet rs = stmt.executeQuery(sql.toString());
while (rs.next()) while (rs.next())
{ // create the user contexts and add them to the return vector { // create the user contexts and add them to the return vector
int the_sigid = rs.getInt("sigid"); int the_sigid = rs.getInt(1);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("...found SIG #" + String.valueOf(the_sigid)); logger.debug("...found SIG #" + String.valueOf(the_sigid));
SIGContext tmp = new SIGUserContextImpl(engine,user,datapool,the_sigid,rs.getInt("level"), SIGContext tmp = new SIGUserContextImpl(engine,user,datapool,the_sigid,rs.getInt(2),rs.getBoolean(3),
rs.getBoolean("locked"),rs.getString("name"), rs.getString(4),rs.getString(5));
rs.getString("alias"));
rc.add(tmp); rc.add(tmp);
} // end while } // end while
@ -1457,7 +1469,7 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
{ // get a database connection { // get a database connection
conn = datapool.getConnection(); conn = datapool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("SELECT COUNT(*) AS total FROM sigs WHERE "); StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM sigs WHERE ");
switch (field) switch (field)
{ {
@ -1506,7 +1518,7 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
if (!(rs.next())) if (!(rs.next()))
throw new InternalStateError("getSearchSIGCount search failure (MUST have 1 row!)"); throw new InternalStateError("getSearchSIGCount search failure (MUST have 1 row!)");
return rs.getInt("total"); return rs.getInt(1);
} // end try } // end try
catch (SQLException e) catch (SQLException e)
@ -1590,7 +1602,7 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
{ // get a database connection { // get a database connection
conn = datapool.getConnection(); conn = datapool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
StringBuffer sql = new StringBuffer("SELECT COUNT(*) AS total FROM sigs WHERE catid = "); StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM sigs WHERE catid = ");
sql.append(catid); sql.append(catid);
if (Capability.hideHiddenDirectorySIGs(user.realBaseLevel())) if (Capability.hideHiddenDirectorySIGs(user.realBaseLevel()))
sql.append(" AND hide_dir = 0"); sql.append(" AND hide_dir = 0");
@ -1605,7 +1617,7 @@ class SIGUserContextImpl implements SIGContext, SIGBackend
if (!(rs.next())) if (!(rs.next()))
throw new InternalStateError("getNumSIGsInCategory search failure (MUST have 1 row!)"); throw new InternalStateError("getNumSIGsInCategory search failure (MUST have 1 row!)");
return rs.getInt("total"); return rs.getInt(1);
} // end try } // end try
catch (SQLException e) catch (SQLException e)

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License. * 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>, * 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 * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are

View File

@ -100,6 +100,33 @@ public class ConfOperations extends VeniceServlet
} // end validateNewTopic } // end validateNewTopic
private static boolean getFlag(ServletRequest request, String param, String on_error) throws ErrorBox
{
String foo = request.getParameter(param);
if (foo==null)
throw new ErrorBox(null,"Parameter not specified!",on_error);
int value;
try
{ // try to get a numeric value
value = Integer.parseInt(foo);
} // end try
catch (NumberFormatException nfe)
{ // unable to decode value
throw new ErrorBox(null,"Invalid parameter value!",on_error);
} // end catch
if (value==0)
return false;
else if (value==1)
return true;
else
throw new ErrorBox(null,"Invalid parameter value!",on_error);
} // end getFlag
/*-------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------
* Overrides from class HttpServlet * Overrides from class HttpServlet
*-------------------------------------------------------------------------------- *--------------------------------------------------------------------------------
@ -118,6 +145,26 @@ public class ConfOperations extends VeniceServlet
*-------------------------------------------------------------------------------- *--------------------------------------------------------------------------------
*/ */
/*
* ConfOperations commands:
* A = Manage Conference Aliases (requires conference parameter)
* C = Create conference
* DEL = Delete conference (requires conference parameter)
* E = Edit Conference Settings (requires conference parameter)
* FX = Fixseen (requires conference parameter)
* H = Add Conference to Hotlist (requires conference parameter)
* M = Manage Conference Membership (requires conference parameter)
* Q = Display Conference Manage menu (requires conference parameter)
* RP = Report on Posters (requires conference parameter)
* RR = Report on Readers (requires conference parameter)
* S = Manage conference ordering/sequence
* SDEL = Delete conference from sequence manager menu
* 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
*/
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine, protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
UserContext user, RenderData rdat) UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult throws ServletException, IOException, VeniceServletResult
@ -130,6 +177,167 @@ public class ConfOperations extends VeniceServlet
// get the command we want to use // get the command we want to use
String cmd = getStandardCommandParam(request); 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.",
on_error);
try
{ // display the Conference Sequence screen
setMyLocation(request,"confops?cmd=S&sig=" + sig.getSIGID());
return new ConferenceSequence(sig);
} // end try
catch (DataException de)
{ // oops - database error here
return new ErrorBox("Database Error","Database error getting conference list: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // some sort of access error - display an error dialog
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
} // end if ("S" command)
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.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
if (!(conf.canChangeConference()))
return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
boolean new_flag = getFlag(request,"flag",on_error);
try
{ // go set the hide flag
conf.setHideList(new_flag);
} // end try
catch (DataException de)
{ // database error - display appropriate dialog
return new ErrorBox("Database Error","Database error setting hide flag: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // some sort of access error - display an error dialog
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
throw new RedirectResult(on_error); // trap back to the main display
} // end if ("SH" command)
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.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
// we need a second conference parameter to exchange with
ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),sig,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);
try
{ // get the two sequences
short this_seq = conf.getSequence();
short other_seq = other_conf.getSequence();
// now exchange them
conf.setSequence(other_seq);
boolean restore = true;
try
{ // set the second conference sequence
other_conf.setSequence(this_seq);
restore = false;
} // end try
finally
{ // undo first set on error
if (restore)
conf.setSequence(this_seq);
} // end finally
} // end try
catch (DataException de)
{ // database error - display appropriate dialog
return new ErrorBox("Database Error","Database error changing sequence: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // some sort of access error - display an error dialog
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
throw new RedirectResult(on_error); // trap back to the main display
} // end if ("SS" command)
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.",
on_error);
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
on_error = "confops?sig=" + sig.getSIGID() + "&cmd=S";
if (!(conf.canDeleteConference()))
return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
{ // we are confirmed - delete the conference!
try
{ // tell it to go away
conf.delete();
} // end try
catch (DataException de)
{ // something wrong in the database
return new ErrorBox("Database Error","Database error deleting conference: " + de.getMessage(),
on_error);
} // end catch
catch (AccessError ae)
{ // some lack of access is causing problems
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
// that's it - trap back to the main display
throw new RedirectResult(on_error);
} // end if
else
{ // generate a confirmation box and wait for confirmation
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",
on_error);
} // end else
} // end if ("SDEL" command)
if (cmd.equals("C")) if (cmd.equals("C"))
{ // "C" = "Create conference" { // "C" = "Create conference"
if (!(sig.canCreateConference())) if (!(sig.canCreateConference()))

View File

@ -0,0 +1,267 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.servlets;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.log4j.*;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.servlets.format.*;
public class Settings extends VeniceServlet
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static final String UNJOIN_CONFIRM_ATTR = "servlets.Settings.unjoin.confirm";
private static final String UNJOIN_CONFIRM_PARAM = "confirm";
private static Category logger = Category.getInstance(Settings.class.getName());
/*--------------------------------------------------------------------------------
* Internal functions
*--------------------------------------------------------------------------------
*/
private static int findHotlistIndex(List hotlist, ServletRequest request) throws ErrorBox
{
String foo = request.getParameter("sig");
if (foo==null)
throw new ErrorBox(null,"Parameter not specified!","settings?cmd=H");
int sigid;
try
{ // this is the SIG id of the hotlist entry
sigid = Integer.parseInt(foo);
} // end try
catch (NumberFormatException nfe)
{ // conversion error...
throw new ErrorBox(null,"Parameter invalid!","settings?cmd=H");
} // end catch
foo = request.getParameter("conf");
if (foo==null)
throw new ErrorBox(null,"Parameter not specified!","settings?cmd=H");
int confid;
try
{ // this is the conference id of the hotlist entry
confid = Integer.parseInt(foo);
} // end try
catch (NumberFormatException nfe)
{ // conversion error...
throw new ErrorBox(null,"Parameter invalid!","settings?cmd=H");
} // end catch
for (int i=0; i<hotlist.size(); i++)
{ // 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))
return i;
} // end for
throw new ErrorBox(null,"Hotlist entry not found!","settings?cmd=H");
} // end findHotlistIndex
/*--------------------------------------------------------------------------------
* Overrides from class HttpServlet
*--------------------------------------------------------------------------------
*/
public String getServletInfo()
{
String rc = "Settings servlet - Handles per-user customization and settings information\n"
+ "Part of the Venice Web Communities System\n";
return rc;
} // end getServletInfo
/*--------------------------------------------------------------------------------
* Overrides from class VeniceServlet
*--------------------------------------------------------------------------------
*/
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
UserContext user, RenderData rdat)
throws ServletException, IOException, VeniceServletResult
{
String cmd = getStandardCommandParam(request);
if (cmd.equals("H"))
{ // "H" - Manage Conference Hotlist
try
{ // return the hotlist viewer
setMyLocation(request,"settings?cmd=H");
return new Hotlist(user);
} // end try
catch (DataException de)
{ // oops...can't get it!
return new ErrorBox("Database Error","Error getting hotlist: " + de.getMessage(),"top");
} // end catch
} // end if ("H" command)
if (cmd.equals("HU") || cmd.equals("HD") || cmd.equals("HX"))
{ // one of the commands for modifying the user hotlist
try
{ // start by getting the hotlist and localizing the entry we want to modify
List hotlist = user.getConferenceHotlist();
int ndx = findHotlistIndex(hotlist,request);
ConferenceHotlistEntry hle = (ConferenceHotlistEntry)(hotlist.get(ndx));
ConferenceContext conf = hle.getConference();
if (cmd.equals("HX"))
conf.removeFromHotlist(); // pretty straightforward
else
{ // moving up or down - find the entry to switch places with
int other_ndx;
if (cmd.equals("HU"))
{ // moving up!
if (ndx==0)
return null; // can't move up from here
other_ndx = ndx - 1;
} // end if
else
{ // moving down
other_ndx = ndx + 1;
if (other_ndx==hotlist.size())
return null; // can't move down from here
} // end else
// find the sequence numbers and the other conference object
int my_seq = hle.getSequence();
hle = (ConferenceHotlistEntry)(hotlist.get(other_ndx));
ConferenceContext other_conf = hle.getConference();
int other_seq = hle.getSequence();
// now reset the sequences
conf.setHotlistSequence(other_seq);
boolean restore = true;
try
{ // reset the other conference sequence, too
other_conf.setHotlistSequence(my_seq);
restore = false;
} // end try
finally
{ // restore the original conference sequence on error
if (restore)
conf.setHotlistSequence(my_seq);
} // end finally
} // end else (moving up or down)
} // end try
catch (DataException de)
{ // there's a data exception somewhere
return new ErrorBox("Database Error","Error adjusting hotlist: " + de.getMessage(),"settings?cmd=H");
} // end catch
try
{ // return the hotlist viewer
setMyLocation(request,"settings?cmd=H");
return new Hotlist(user);
} // end try
catch (DataException de)
{ // oops...can't get it!
return new ErrorBox("Database Error","Error getting hotlist: " + de.getMessage(),"top");
} // end catch
} // end if (one of the "H" subcommands)
if (cmd.equals("S"))
{ // "S" - display the user's SIG list
try
{ // return the SIG list viewer
setMyLocation(request,"settings?cmd=S");
return new UserSIGList(user);
} // end try
catch (DataException de)
{ // oops...can't get it!
return new ErrorBox("Database Error","Error getting SIGs 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");
if (!(sig.canUnjoin()))
return new ErrorBox("SIG Error","You cannot unjoin this SIG.","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();
} // end try
catch (AccessError ae)
{ // access error
return new ErrorBox("Access Error","Unable to unjoin SIG: " + 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(),
"settings?cmd=S");
} // end catch
// after which, redirect back to the top
throw new RedirectResult("settings?cmd=S");
} // 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");
} // end else
} // end if ("SX" command)
// command not found!
logger.error("invalid command to Settings.doGet: " + cmd);
return new ErrorBox("Internal Error","Invalid command to Settings.doGet","top");
} // end doVeniceGet
} // end class Settings

View File

@ -99,56 +99,6 @@ public abstract class VeniceServlet extends HttpServlet
} // end getSIGParameter } // end getSIGParameter
private static ConferenceContext getConferenceParameter(String str, SIGContext sig, boolean required,
String on_error) throws ErrorBox
{
if (StringUtil.isStringEmpty(str))
{ // there's no conference parameter
if (required)
{ // no conference parameter - bail out now!
logger.error("Conference parameter not specified!");
throw new ErrorBox(null,"No conference specified.",on_error);
} // end if
else
{ // a null ConferenceContext is permitted
if (logger.isDebugEnabled())
logger.debug("no conference specified");
return null;
} // end else
} // end if
ConferenceContext rc = null;
try
{ // turn the string into a ConfID, and thence to a ConferenceContext
rc = sig.getConferenceContext(Integer.parseInt(str));
if (logger.isDebugEnabled())
logger.debug("found conf #" + rc.getConfID());
} // end try
catch (NumberFormatException nfe)
{ // error in Integer.parseInt
logger.error("Cannot convert conference parameter '" + str + "'!");
throw new ErrorBox(null,"Invalid conference parameter.",on_error);
} // end catch
catch (AccessError ae)
{ // these all get handled in pretty much the same way
throw new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
catch (DataException de)
{ // error looking up the conference
throw new ErrorBox("Database Error","Database error finding conference: " + de.getMessage(),on_error);
} // end catch
return rc;
} // end getConferenceParameter
private static TopicContext getTopicParameter(String str, ConferenceContext conf, boolean required, private static TopicContext getTopicParameter(String str, ConferenceContext conf, boolean required,
String on_error) throws ErrorBox String on_error) throws ErrorBox
{ {
@ -397,6 +347,56 @@ public abstract class VeniceServlet extends HttpServlet
} // end getSIGParameter } // end getSIGParameter
protected static ConferenceContext getConferenceParameter(String str, SIGContext sig, boolean required,
String on_error) throws ErrorBox
{
if (StringUtil.isStringEmpty(str))
{ // there's no conference parameter
if (required)
{ // no conference parameter - bail out now!
logger.error("Conference parameter not specified!");
throw new ErrorBox(null,"No conference specified.",on_error);
} // end if
else
{ // a null ConferenceContext is permitted
if (logger.isDebugEnabled())
logger.debug("no conference specified");
return null;
} // end else
} // end if
ConferenceContext rc = null;
try
{ // turn the string into a ConfID, and thence to a ConferenceContext
rc = sig.getConferenceContext(Integer.parseInt(str));
if (logger.isDebugEnabled())
logger.debug("found conf #" + rc.getConfID());
} // end try
catch (NumberFormatException nfe)
{ // error in Integer.parseInt
logger.error("Cannot convert conference parameter '" + str + "'!");
throw new ErrorBox(null,"Invalid conference parameter.",on_error);
} // end catch
catch (AccessError ae)
{ // these all get handled in pretty much the same way
throw new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
catch (DataException de)
{ // error looking up the conference
throw new ErrorBox("Database Error","Database error finding conference: " + de.getMessage(),on_error);
} // end catch
return rc;
} // end getConferenceParameter
protected final static ConferenceContext getConferenceParameter(ServletRequest request, SIGContext sig, protected final static ConferenceContext getConferenceParameter(ServletRequest request, SIGContext sig,
boolean required, String on_error) boolean required, String on_error)
throws ErrorBox throws ErrorBox

View File

@ -159,4 +159,10 @@ public class ConferenceListing implements JSPRender
} // end canCreateConference } // end canCreateConference
public boolean canManageConferences()
{
return sig.canManageConferences();
} // end canManageConferences
} // end class ConferenceListing } // end class ConferenceListing

View File

@ -0,0 +1,170 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.servlets.format;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
public class ConferenceSequence implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.Hotlist";
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private SIGContext sig;
private List conf_list;
private Hashtable hidden_stat = new Hashtable();
private Hashtable next_id = new Hashtable();
private Hashtable prev_id = new Hashtable();
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public ConferenceSequence(SIGContext sig) throws DataException, AccessError
{
this.sig = sig;
this.conf_list = sig.getConferences();
Integer last_id = null;
for (int i=0; i<conf_list.size(); i++)
{ // build up the "next_id" and "prev_id" mappings
ConferenceContext conf = (ConferenceContext)(conf_list.get(i));
Integer this_id = new Integer(conf.getConfID());
// save conference "hidden" status
hidden_stat.put(this_id,new Boolean(conf.getHideList()));
if (last_id!=null)
{ // establish the "next" and "prev" IDs for the conferences
next_id.put(last_id,this_id);
prev_id.put(this_id,last_id);
} // end if
last_id = this_id;
} // end for
} // end constructor
/*--------------------------------------------------------------------------------
* External static functions
*--------------------------------------------------------------------------------
*/
public static ConferenceSequence retrieve(ServletRequest request)
{
return (ConferenceSequence)(request.getAttribute(ATTR_NAME));
} // end retrieve
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceContent
*--------------------------------------------------------------------------------
*/
public String getPageTitle(RenderData rdat)
{
return "Manage Conference List";
} // end getPageTitle
/*--------------------------------------------------------------------------------
* Implementations from interface JSPRender
*--------------------------------------------------------------------------------
*/
public void store(ServletRequest request)
{
request.setAttribute(ATTR_NAME,this);
} // end store
public String getTargetJSPName()
{
return "conf_sequence.jsp";
} // end getTargetJSPName
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public int getSIGID()
{
return sig.getSIGID();
} // end getSIGID
public int getNumConferences()
{
return conf_list.size();
} // end getNumConferences
public ConferenceContext getConference(int ndx)
{
return (ConferenceContext)(conf_list.get(ndx));
} // end getConference
public boolean isConferenceHidden(ConferenceContext conf)
{
Boolean value = (Boolean)(hidden_stat.get(new Integer(conf.getConfID())));
if (value==null)
return false;
else
return value.booleanValue();
} // end isConferenceHidden
public int getNextConfID(ConferenceContext conf)
{
Integer value = (Integer)(next_id.get(new Integer(conf.getConfID())));
if (value==null)
return 0;
else
return value.intValue();
} // end getNextConfID
public int getPrevConfID(ConferenceContext conf)
{
Integer value = (Integer)(prev_id.get(new Integer(conf.getConfID())));
if (value==null)
return 0;
else
return value.intValue();
} // end getPrevConfID
} // end class ConferenceSequence

View File

@ -0,0 +1,112 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.servlets.format;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
public class Hotlist implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.Hotlist";
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private UserContext uc;
private List hotlist;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public Hotlist(UserContext uc) throws DataException
{
this.uc = uc;
this.hotlist = uc.getConferenceHotlist();
} // end constructor
/*--------------------------------------------------------------------------------
* External static functions
*--------------------------------------------------------------------------------
*/
public static Hotlist retrieve(ServletRequest request)
{
return (Hotlist)(request.getAttribute(ATTR_NAME));
} // end retrieve
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceContent
*--------------------------------------------------------------------------------
*/
public String getPageTitle(RenderData rdat)
{
return "Your Conference Hotlist";
} // end getPageTitle
/*--------------------------------------------------------------------------------
* Implementations from interface JSPRender
*--------------------------------------------------------------------------------
*/
public void store(ServletRequest request)
{
request.setAttribute(ATTR_NAME,this);
} // end store
public String getTargetJSPName()
{
return "hotlist.jsp";
} // end getTargetJSPName
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public int getHotlistSize()
{
return hotlist.size();
} // end getHotlistSize
public ConferenceContext getConference(int ndx)
{
ConferenceHotlistEntry tmp = (ConferenceHotlistEntry)(hotlist.get(ndx));
return tmp.getConference();
} // end getConference
} // end class Hotlist

View File

@ -94,9 +94,12 @@ public class SideBoxConferences implements ContentRender
else else
out.write(rdat.getStdFontTag(null,2) + "<EM>You have no conferences in your hotlist.</EM></FONT>\n"); out.write(rdat.getStdFontTag(null,2) + "<EM>You have no conferences in your hotlist.</EM></FONT>\n");
// write the link at the end if (uc.isLoggedIn())
out.write("<P>" + rdat.getStdFontTag(null,1) + "<B>[ <A HREF=\"" + rdat.getEncodedServletPath("TODO") { // write the link at the end
+ "\">Manage</A> ]</B></FONT>"); out.write("<P>" + rdat.getStdFontTag(null,1) + "<B>[ <A HREF=\""
+ rdat.getEncodedServletPath("settings?cmd=H") + "\">Manage</A> ]</B></FONT>");
} // end if
} // end renderHere } // end renderHere

View File

@ -92,10 +92,12 @@ public class SideBoxSIGs implements ContentRender
else else
out.write(rdat.getStdFontTag(null,2) + "<EM>You are not a member of any SIGs.</EM></FONT>\n"); out.write(rdat.getStdFontTag(null,2) + "<EM>You are not a member of any SIGs.</EM></FONT>\n");
// write the two links at the end if (uc.isLoggedIn())
out.write("<P>" + rdat.getStdFontTag(null,1) + "<B>[ <A HREF=\"" + rdat.getEncodedServletPath("TODO") { // write the two links at the end
+ "\">Manage</A> | <A HREF=\"" + rdat.getEncodedServletPath("sigops?cmd=C") out.write("<P>" + rdat.getStdFontTag(null,1) + "<B>[ <A HREF=\""
+ "\">Create New</A> ]</B></FONT>"); + rdat.getEncodedServletPath("settings?cmd=S") + "\">Manage</A> | <A HREF=\""
+ rdat.getEncodedServletPath("sigops?cmd=C") + "\">Create New</A> ]</B></FONT>");
} // end if
} // end renderHere } // end renderHere

View File

@ -0,0 +1,111 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.servlets.format;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.silverwrist.venice.core.*;
public class UserSIGList implements JSPRender
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.Hotlist";
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private UserContext uc;
private List sig_list;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public UserSIGList(UserContext uc) throws DataException
{
this.uc = uc;
this.sig_list = uc.getMemberSIGs();
} // end constructor
/*--------------------------------------------------------------------------------
* External static functions
*--------------------------------------------------------------------------------
*/
public static UserSIGList retrieve(ServletRequest request)
{
return (UserSIGList)(request.getAttribute(ATTR_NAME));
} // end retrieve
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceContent
*--------------------------------------------------------------------------------
*/
public String getPageTitle(RenderData rdat)
{
return "Your SIGs";
} // end getPageTitle
/*--------------------------------------------------------------------------------
* Implementations from interface JSPRender
*--------------------------------------------------------------------------------
*/
public void store(ServletRequest request)
{
request.setAttribute(ATTR_NAME,this);
} // end store
public String getTargetJSPName()
{
return "siglist.jsp";
} // end getTargetJSPName
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public int getNumSIGs()
{
return sig_list.size();
} // end getNumSIGs
public SIGContext getSIG(int ndx)
{
return (SIGContext)(sig_list.get(ndx));
} // end getSIG
} // end class UserSIGList

View File

@ -0,0 +1,140 @@
<%--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.util.StringUtil" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.servlets.Variables" %>
<%@ page import = "com.silverwrist.venice.servlets.format.*" %>
<%
ConferenceSequence data = ConferenceSequence.retrieve(request);
Variables.failIfNull(data);
RenderData rdat = RenderConfig.createRenderData(application,request,response);
%>
<% if (rdat.useHTMLComments()) { %><!-- Manage conference list for SIG #<%= data.getSIGID() %> --><% } %>
<% rdat.writeContentHeader(out,"Manage Conference List",null); %>
<%= rdat.getStdFontTag(null,2) %>
<A HREF="<%= rdat.getEncodedServletPath("confops?sig=" + data.getSIGID()) %>">Return to Conference List</A>
</FONT><P>
<% if (data.getNumConferences()>0) { %>
<TABLE BORDER=0 ALIGN=CENTER CELLPADDING=0 CELLSPACING=2>
<% for (int i=0; i<data.getNumConferences(); i++) { %>
<%
ConferenceContext conf = data.getConference(i);
String partial = "confops?sig=" + data.getSIGID() + "&conf=" + conf.getConfID();
String tail, image, alt;
%>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<%
if (data.isConferenceHidden(conf))
{ // conference is hidden - this command will show it
tail = "&cmd=SH&flag=0";
image = "icn_off.gif";
alt = "Hidden (toggle)";
} // end if
else
{ // conference is non-hidden - this command will hide it
tail = "&cmd=SH&flag=1";
image = "icn_on.gif";
alt = "Displayed (toggle)";
} // end else
%>
<A HREF="<%= rdat.getEncodedServletPath(partial + tail) %>"><IMG
SRC="<%= rdat.getFullImagePath(image) %>" ALT="<%= alt %>" WIDTH=16 HEIGHT=16 BORDER=0></A>
</TD>
<TD ALIGN=CENTER WIDTH=16>
<% if (i==(data.getNumConferences()-1)) { %>&nbsp;<% } else { %>
<% tail = "&cmd=SS&oc=" + data.getNextConfID(conf); %>
<A HREF="<%= rdat.getEncodedServletPath(partial + tail) %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_down.gif") %> ALT="Move Down" BORDER=0 WIDTH=16
HEIGHT=16></A>
<% } // end if %>
</TD>
<TD ALIGN=CENTER WIDTH=16>
<% if (i==0) { %>&nbsp;<% } else { %>
<% tail = "&cmd=SS&oc=" + data.getPrevConfID(conf); %>
<A HREF="<%= rdat.getEncodedServletPath(partial + tail) %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_up.gif") %> ALT="Move Up" BORDER=0 WIDTH=16
HEIGHT=16></A>
<% } // end if %>
</TD>
<TD ALIGN=CENTER WIDTH=16>
<A HREF="<%= rdat.getEncodedServletPath(partial + "&cmd=SDEL") %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Remove" BORDER=0 WIDTH=16
HEIGHT=16></A>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<%= StringUtil.encodeHTML(conf.getName()) %>
</FONT></TD>
</TR>
<% } // end for %>
</TABLE><P>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_on.gif") %> ALT="Displayed (toggle)" BORDER=0 WIDTH=16
HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
This indicates that the conference is displayed in the SIG's conference list. Click the symbol
to hide it.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_off.gif") %> ALT="Hidden (toggle)" BORDER=0 WIDTH=16
HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
This indicates that the conference is hidden in the SIG's conference list. Click the symbol
to display it.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_down.gif") %> ALT="Move Down" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to move the specified conference down in the SIG's conference list.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_up.gif") %> ALT="Move Up" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to move the specified conference up in the SIG's conference list.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Remove" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to delete the specified conference. You will be prompted to confirm this
action.
</FONT></TD>
</TR>
</TABLE>
<% } else { %>
<%= rdat.getStdFontTag(null,2) %><EM>There are no conferences in this SIG.</EM></FONT>
<% } // end if %>
<% rdat.writeFooter(out); %>

View File

@ -55,11 +55,17 @@
<% } else { %> <% } else { %>
<EM>No conferences found in this SIG.</EM><BR> <EM>No conferences found in this SIG.</EM><BR>
<% } // end if (conferences present) %> <% } // end if (conferences present) %>
<% if (data.canCreateConference()) { %> <P>
<P> <DIV ALIGN="LEFT">
<DIV ALIGN="LEFT"> <% if (data.canManageConferences()) { %>
<A HREF="<%= rdat.getEncodedServletPath("confops?cmd=S&sig=" + data.getSIGID()) %>"><IMG
SRC="<%= rdat.getFullImagePath("bn_manage.gif") %>" ALT="Manage" WIDTH=80 HEIGHT=24
BORDER=0></A>&nbsp;
<% } // end if %>
<% if (data.canCreateConference()) { %>
<A HREF="<%= rdat.getEncodedServletPath("confops?cmd=C&sig=" + data.getSIGID()) %>"><IMG <A HREF="<%= rdat.getEncodedServletPath("confops?cmd=C&sig=" + data.getSIGID()) %>"><IMG
SRC="<%= rdat.getFullImagePath("bn_create_new.gif") %>" ALT="Create New" WIDTH=80 HEIGHT=24 BORDER=0></A> SRC="<%= rdat.getFullImagePath("bn_create_new.gif") %>" ALT="Create New" WIDTH=80 HEIGHT=24
</DIV> BORDER=0></A>&nbsp;
<% } // end if %> <% } // end if %>
</DIV>
<% rdat.writeFooter(out); %> <% rdat.writeFooter(out); %>

99
web/format/hotlist.jsp Normal file
View File

@ -0,0 +1,99 @@
<%--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.util.StringUtil" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.servlets.Variables" %>
<%@ page import = "com.silverwrist.venice.servlets.format.*" %>
<%
Hotlist data = Hotlist.retrieve(request);
Variables.failIfNull(data);
RenderData rdat = RenderConfig.createRenderData(application,request,response);
%>
<% if (rdat.useHTMLComments()) { %><!-- User conference hotlist --><% } %>
<% rdat.writeContentHeader(out,"Your Conference Hotlist",null); %>
<%= rdat.getStdFontTag(null,2) %>
<A HREF="<%= rdat.getEncodedServletPath("top") %>">Return to Front Page</A>
</FONT><P>
<% if (data.getHotlistSize()>0) { %>
<TABLE BORDER=0 ALIGN=CENTER CELLPADDING=0 CELLSPACING=2>
<% for (int i=0; i<data.getHotlistSize(); i++) { %>
<%
ConferenceContext conf = data.getConference(i);
String partial = "settings?sig=" + conf.getEnclosingSIG().getSIGID() + "&conf=" + conf.getConfID();
%>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<% if (i==(data.getHotlistSize()-1)) { %>&nbsp;<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(partial + "&cmd=HD") %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_down.gif") %> ALT="Move Down" BORDER=0 WIDTH=16
HEIGHT=16></A>
<% } // end if %>
</TD>
<TD ALIGN=CENTER WIDTH=16>
<% if (i==0) { %>&nbsp;<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(partial + "&cmd=HU") %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_up.gif") %> ALT="Move Up" BORDER=0 WIDTH=16
HEIGHT=16></A>
<% } // end if %>
</TD>
<TD ALIGN=CENTER WIDTH=16>
<A HREF="<%= rdat.getEncodedServletPath(partial + "&cmd=HX") %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Remove" BORDER=0 WIDTH=16
HEIGHT=16></A>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<%= StringUtil.encodeHTML(conf.getName()) %>
(<%= StringUtil.encodeHTML(conf.getEnclosingSIG().getName()) %>)
</FONT></TD>
</TR>
<% } // end for %>
</TABLE><P>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_down.gif") %> ALT="Move Down" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to move the specified conference down in your hotlist.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_up.gif") %> ALT="Move Up" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to move the specified conference up in your hotlist.
</FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Remove" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to remove the specified conference from your hotlist.
</FONT></TD>
</TR>
</TABLE>
<% } else { %>
<%= rdat.getStdFontTag(null,2) %><EM>
You have no conferences in your conference hotlist. You can add conferences to your hotlist
by visiting the conferences and pressing the "Add to Hotlist" button.
</EM></FONT>
<% } // end if %>
<% rdat.writeFooter(out); %>

65
web/format/siglist.jsp Normal file
View File

@ -0,0 +1,65 @@
<%--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.util.StringUtil" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.servlets.Variables" %>
<%@ page import = "com.silverwrist.venice.servlets.format.*" %>
<%
UserSIGList data = UserSIGList.retrieve(request);
Variables.failIfNull(data);
RenderData rdat = RenderConfig.createRenderData(application,request,response);
%>
<% if (rdat.useHTMLComments()) { %><!-- User conference hotlist --><% } %>
<% rdat.writeContentHeader(out,"Your SIGs",null); %>
<%= rdat.getStdFontTag(null,2) %>
<A HREF="<%= rdat.getEncodedServletPath("top") %>">Return to Front Page</A>
</FONT><P>
<% if (data.getNumSIGs()>0) { %>
<TABLE BORDER=0 ALIGN=CENTER CELLPADDING=0 CELLSPACING=2>
<% for (int i=0; i<data.getNumSIGs(); i++) { %>
<% SIGContext sig = data.getSIG(i); %>
<TR>
<TD ALIGN=CENTER WIDTH=16>
<% if (sig.canUnjoin()) { %>
<A HREF="<%= rdat.getEncodedServletPath("settings?cmd=SX&sig=" + sig.getSIGID()) %>"><IMG
SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Unjoin" BORDER=0 WIDTH=16
HEIGHT=16></A>
<% } else { %>&nbsp;<% } %>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<A HREF="<%= rdat.getEncodedServletPath("sig/" + sig.getAlias()) %>"><%= StringUtil.encodeHTML(sig.getName()) %></A>
</FONT></TD>
</TR>
<% } // end for %>
</TABLE><P>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP>
<TD ALIGN=CENTER WIDTH=16>
<IMG SRC="<%= rdat.getFullImagePath("icn_x.gif") %> ALT="Unjoin" BORDER=0 WIDTH=16 HEIGHT=16>
</TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
Click this symbol to unjoin the specified SIG.
</FONT></TD>
</TR>
</TABLE>
<% } else { %>
<%= rdat.getStdFontTag(null,2) %><EM>You are not a member of any SIGs.</EM></FONT>
<% } // end if %>
<% rdat.writeFooter(out); %>

BIN
web/images/icn_down.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

BIN
web/images/icn_off.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
web/images/icn_on.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 B

BIN
web/images/icn_up.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

BIN
web/images/icn_x.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B