From bda25d9aa2280d6a8940f185a8b340d39beed67e Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Fri, 16 Feb 2001 05:51:20 +0000 Subject: [PATCH] gave the "top" page the makeover it so richly deserved - now, instead of an array of content panels, we have a big content panel (use to come later) plus a set of configurable "sideboxes" that look kind of like Slashboxes... --- TODO | 5 - setup/database.sql | 38 ++- .../silverwrist/venice/core/SIGFeature.java | 2 +- ...ViewConfig.java => SideBoxDescriptor.java} | 20 +- .../silverwrist/venice/core/UserContext.java | 8 +- .../silverwrist/venice/core/VeniceEngine.java | 4 +- .../venice/core/impl/EngineBackend.java | 3 + .../core/impl/FrontPageViewConfigImpl.java | 273 ------------------ .../core/impl/SideBoxDescriptorImpl.java | 87 ++++++ .../venice/core/impl/UserContextImpl.java | 111 +++---- .../venice/core/impl/VeniceEngineImpl.java | 151 ++++++++-- src/com/silverwrist/venice/servlets/Top.java | 7 +- .../venice/servlets/VeniceServlet.java | 31 -- .../venice/servlets/format/RenderData.java | 6 + .../servlets/format/SideBoxConferences.java | 80 +++++ .../venice/servlets/format/SideBoxSIGs.java | 103 +++++++ .../servlets/format/TCPanelConferences.java | 67 ----- .../venice/servlets/format/TCPanelSIGs.java | 92 ------ .../servlets/format/TCStandardPanel.java | 184 ------------ .../venice/servlets/format/TopContent.java | 142 --------- .../servlets/format/TopContentPanel.java | 50 ---- .../venice/servlets/format/TopDisplay.java | 245 ++++++++++++++++ web/format/top_content.jsp | 30 ++ 23 files changed, 776 insertions(+), 963 deletions(-) rename src/com/silverwrist/venice/core/{FrontPageViewConfig.java => SideBoxDescriptor.java} (61%) delete mode 100644 src/com/silverwrist/venice/core/impl/FrontPageViewConfigImpl.java create mode 100644 src/com/silverwrist/venice/core/impl/SideBoxDescriptorImpl.java create mode 100644 src/com/silverwrist/venice/servlets/format/SideBoxConferences.java create mode 100644 src/com/silverwrist/venice/servlets/format/SideBoxSIGs.java delete mode 100644 src/com/silverwrist/venice/servlets/format/TCPanelConferences.java delete mode 100644 src/com/silverwrist/venice/servlets/format/TCPanelSIGs.java delete mode 100644 src/com/silverwrist/venice/servlets/format/TCStandardPanel.java delete mode 100644 src/com/silverwrist/venice/servlets/format/TopContent.java delete mode 100644 src/com/silverwrist/venice/servlets/format/TopContentPanel.java create mode 100644 src/com/silverwrist/venice/servlets/format/TopDisplay.java create mode 100644 web/format/top_content.jsp diff --git a/TODO b/TODO index 5bb3ef2..bf439b0 100644 --- a/TODO +++ b/TODO @@ -15,11 +15,6 @@ Lots! - Implement quick e-mail from the user profile display (engine support and UI). -- The whole "top" display thing needs a serious realignment. The present - system is a bit klunky and will be tough to implement Customize. We need - the capability to support JSP-based rendering in the individual "top" content - panes as well. - - 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 diff --git a/setup/database.sql b/setup/database.sql index 2305ba8..c3bd195 100644 --- a/setup/database.sql +++ b/setup/database.sql @@ -89,14 +89,22 @@ CREATE TABLE userprefs ( localeid VARCHAR(64) DEFAULT 'en-US-' ); -# Indicates what the "top" page configuration is for any given user. -CREATE TABLE topconfig ( +# Indicates what the top-level "sidebox" configuration is for any given user. +CREATE TABLE sideboxes ( uid INT NOT NULL, - row SMALLINT NOT NULL, - col SMALLINT NOT NULL, - partid CHAR(4) NOT NULL, + boxid INT NOT NULL, + sequence INT NOT NULL, param VARCHAR(255), - PRIMARY KEY (uid, row, col) + UNIQUE INDEX userboxes (uid, boxid), + INDEX inorder (uid, sequence) +); + +# A reference to the available sideboxes. +CREATE TABLE refsidebox ( + boxid INT NOT NULL PRIMARY KEY, + classname VARCHAR(255), + description VARCHAR(255), + param_descr VARCHAR(255) ); # The contact information table. This is used for both users and SIGs. @@ -435,6 +443,12 @@ INSERT INTO refaudit (type, descr) VALUES (315, 'Delete Conference'), (9999999, 'DUMMY'); +# Which side boxes are defined. The class names MUST match implementations in the +# com.silverwrist.venice.servlets.format package!!! +INSERT INTO refsidebox (boxid, classname, description, param_descr) VALUES + (1, 'SideBoxSIGs', 'Your SIGs', NULL), + (2, 'SideBoxConferences', 'Your Conference Hotlist', NULL); + # The ISO 3166 two-letter country codes. Source is # . INSERT INTO refcountry (code, name) VALUES @@ -1309,8 +1323,8 @@ INSERT INTO contacts (contactid, given_name, family_name, locality, region, pcod # Provide the default view for Anonymous Honyak. This view will be copied to all # new users. -INSERT INTO topconfig (uid, row, col, partid, param) - VALUES (1, 0, 0, 'SIGS', NULL), (1, 0, 1, 'CONF', NULL); +INSERT INTO sideboxes (uid, boxid, sequence, param) + VALUES (1, 1, 100, NULL), (1, 2, 200, NULL); # Add the 'Administrator' user to the users table. # (UID = 2, CONTACTID = 2) @@ -1321,8 +1335,8 @@ INSERT INTO contacts (contactid, given_name, family_name, locality, region, pcod VALUES (2, 'System', 'Administrator', 'Anywhere', '', '', 'US', 'root@your.box.com', 2); # Create the default view for Administrator. -INSERT INTO topconfig (uid, row, col, partid, param) - VALUES (2, 0, 0, 'SIGS', NULL), (2, 0, 1, 'CONF', NULL); +INSERT INTO sideboxes (uid, boxid, sequence, param) + VALUES (2, 1, 100, NULL), (2, 2, 200, NULL); # Add the administration SIG to the SIGs table. # (SIGID = 1, CONTACTID = 3) @@ -1416,8 +1430,8 @@ INSERT INTO users (uid, username, passhash, contactid, verify_email, base_lvl, c INSERT INTO userprefs (uid) VALUES (3); INSERT INTO contacts (contactid, given_name, family_name, locality, region, pcode, country, email, owner_uid) VALUES (5, 'Test', 'User', 'Denver', 'CO', '80231', 'US', 'testuser@example.com', 3); -INSERT INTO topconfig (uid, row, col, partid, param) - VALUES (3, 0, 0, 'SIGS', NULL), (3, 0, 1, 'CONF', NULL); +INSERT INTO sideboxes (uid, boxid, sequence, param) + VALUES (3, 1, 100, NULL), (3, 2, 200, NULL); INSERT INTO sigmember (sigid, uid, granted_lvl, locked) VALUES (2, 3, 6500, 1); diff --git a/src/com/silverwrist/venice/core/SIGFeature.java b/src/com/silverwrist/venice/core/SIGFeature.java index 4368358..3d5be66 100644 --- a/src/com/silverwrist/venice/core/SIGFeature.java +++ b/src/com/silverwrist/venice/core/SIGFeature.java @@ -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 , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are diff --git a/src/com/silverwrist/venice/core/FrontPageViewConfig.java b/src/com/silverwrist/venice/core/SideBoxDescriptor.java similarity index 61% rename from src/com/silverwrist/venice/core/FrontPageViewConfig.java rename to src/com/silverwrist/venice/core/SideBoxDescriptor.java index c355744..f4b3d5b 100644 --- a/src/com/silverwrist/venice/core/FrontPageViewConfig.java +++ b/src/com/silverwrist/venice/core/SideBoxDescriptor.java @@ -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 , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are @@ -17,20 +17,18 @@ */ package com.silverwrist.venice.core; -public interface FrontPageViewConfig +public interface SideBoxDescriptor { - public abstract int getNumRows(); + public abstract int getID(); - public abstract int getNumColumns(); + public abstract int getSequence(); - public abstract String getPartID(int row, int column); + public abstract String getParameter(); - public abstract void setPartID(int row, int column, String partid); + public abstract String getDescription(); - public abstract String getParameter(int row, int column); + public abstract String getParamDescription(); - public abstract void setParameter(int row, int column, String param); + public abstract String getClassname(); - public abstract boolean getModified(); - -} // end interface FrontPageViewConfig +} // end interface SideBoxDescriptor diff --git a/src/com/silverwrist/venice/core/UserContext.java b/src/com/silverwrist/venice/core/UserContext.java index 6ceb50b..297877b 100644 --- a/src/com/silverwrist/venice/core/UserContext.java +++ b/src/com/silverwrist/venice/core/UserContext.java @@ -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 , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are @@ -52,10 +52,6 @@ public interface UserContext extends SearchMode public abstract void setDescription(String new_descr) throws DataException; - public abstract FrontPageViewConfig getFrontPageViewConfig(int max_cols) throws DataException; - - public abstract void putFrontPageViewConfig(FrontPageViewConfig cfg) throws DataException; - public abstract List getMemberSIGs() throws DataException; public abstract SIGContext getSIGContext(int sigid) throws DataException; @@ -89,4 +85,6 @@ public interface UserContext extends SearchMode public abstract boolean canCreateSIG(); + public abstract List getSideBoxList() throws DataException; + } // end interface UserContext diff --git a/src/com/silverwrist/venice/core/VeniceEngine.java b/src/com/silverwrist/venice/core/VeniceEngine.java index 05df082..2f3f247 100644 --- a/src/com/silverwrist/venice/core/VeniceEngine.java +++ b/src/com/silverwrist/venice/core/VeniceEngine.java @@ -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 , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are @@ -71,4 +71,6 @@ public interface VeniceEngine extends SearchMode public abstract int getMaxNumSIGMembersDisplay(); + public abstract List getMasterSideBoxList(); + } // end interface VeniceEngine diff --git a/src/com/silverwrist/venice/core/impl/EngineBackend.java b/src/com/silverwrist/venice/core/impl/EngineBackend.java index d5747fc..fbb7dde 100644 --- a/src/com/silverwrist/venice/core/impl/EngineBackend.java +++ b/src/com/silverwrist/venice/core/impl/EngineBackend.java @@ -22,6 +22,7 @@ import java.util.List; import com.silverwrist.venice.security.AuditRecord; import com.silverwrist.venice.htmlcheck.HTMLChecker; import com.silverwrist.venice.core.DataException; +import com.silverwrist.venice.core.SideBoxDescriptor; public interface EngineBackend { @@ -80,4 +81,6 @@ public interface EngineBackend public abstract void forceParamReload() throws DataException; + public abstract SideBoxDescriptor getMasterSideBoxDescriptor(int id); + } // end interface EngineBackend diff --git a/src/com/silverwrist/venice/core/impl/FrontPageViewConfigImpl.java b/src/com/silverwrist/venice/core/impl/FrontPageViewConfigImpl.java deleted file mode 100644 index aaff16c..0000000 --- a/src/com/silverwrist/venice/core/impl/FrontPageViewConfigImpl.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * 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 . - * - * 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 Community System. - * - * The Initial Developer of the Original Code is Eric J. Bowersox , - * 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.core.impl; - -import java.sql.*; -import java.util.*; -import com.silverwrist.venice.core.*; -import com.silverwrist.venice.db.*; - -class FrontPageViewConfigImpl implements FrontPageViewConfig, Stashable -{ - private int my_uid; - private int num_cols; - private Vector v_parts = new Vector(); - private Vector v_params = new Vector(); - private boolean is_modified = false; - - FrontPageViewConfigImpl(Connection conn, int uid, int max_cols) throws DataException, SQLException - { - my_uid = uid; - num_cols = max_cols; - StringBuffer sql = new StringBuffer("SELECT row, col, partid, param FROM topconfig WHERE uid = "); - sql.append(uid).append(';'); - - Statement stmt = conn.createStatement(); - ResultSet rs = stmt.executeQuery(sql.toString()); - while (rs.next()) - { // make sure the column is in range first - int col = rs.getInt("col"); - if ((col>=0) && (col=0) - { // now look for the right arrays to store into - String[] a_part = null; - String[] a_param = null; - - if (row>=v_parts.size()) - { // need to extend the vector contents - while (row>=v_parts.size()) - { // append new arrays onto the config - a_part = new String[num_cols]; - a_param = new String[num_cols]; - for (int i=0; i=v_parts.size())) - throw new IndexOutOfBoundsException("invalid row specified to FrontPageViewConfig.getPartID"); - if ((column<0) || (column>=num_cols)) - throw new IndexOutOfBoundsException("invalid column specified to FrontPageViewConfig.getPartID"); - - String[] array = (String[])(v_parts.elementAt(row)); - return array[column]; - - } // end getPartID - - public void setPartID(int row, int column, String partid) - { - if (row<0) - throw new IndexOutOfBoundsException("invalid row specified to FrontPageViewConfig.setPartID"); - if ((column<0) || (column>=num_cols)) - throw new IndexOutOfBoundsException("invalid column specified to FrontPageViewConfig.setPartID"); - - String[] a_part = null; - String[] a_param = null; - - if (row>=v_parts.size()) - { // need to extend the vector contents - while (row>=v_parts.size()) - { // append new arrays onto the config - a_part = new String[num_cols]; - a_param = new String[num_cols]; - for (int i=0; i=v_params.size())) - throw new IndexOutOfBoundsException("invalid row specified to FrontPageViewConfig.getParameter"); - if ((column<0) || (column>=num_cols)) - throw new IndexOutOfBoundsException("invalid column specified to FrontPageViewConfig.getParameter"); - - String[] array = (String[])(v_params.elementAt(row)); - return array[column]; - - } // end getParameter - - public void setParameter(int row, int column, String param) - { - if (row<0) - throw new IndexOutOfBoundsException("invalid row specified to FrontPageViewConfig.setParameter"); - if ((column<0) || (column>=num_cols)) - throw new IndexOutOfBoundsException("invalid column specified to FrontPageViewConfig.setParameter"); - - String[] a_part = null; - String[] a_param = null; - - if (row>=v_parts.size()) - { // need to extend the vector contents - while (row>=v_parts.size()) - { // append new arrays onto the config - a_part = new String[num_cols]; - a_param = new String[num_cols]; - for (int i=0; i0) - { // we've got the insert command - buf.append(';'); - insert_cmd = buf.toString(); - buf.setLength(0); - - } // end if - - // now create the DELETE command - buf.append("DELETE FROM topconfig WHERE uid = ").append(my_uid).append(';'); - - // we need to lock the topconfig table while we do this - Statement stmt = conn.createStatement(); - stmt.executeUpdate("LOCK TABLES topconfig WRITE;"); - - try - { // delete all existing records - stmt.executeUpdate(buf.toString()); - - // now insert the new records - if (insert_cmd!=null) - stmt.executeUpdate(insert_cmd); - - } // end try - finally - { // make sure to unlock the tables when we're done - Statement ulk_stmt = conn.createStatement(); - ulk_stmt.executeUpdate("UNLOCK TABLES;"); - - } // end finally - - } // end stash - -} // end class FrontPageViewConfigImpl diff --git a/src/com/silverwrist/venice/core/impl/SideBoxDescriptorImpl.java b/src/com/silverwrist/venice/core/impl/SideBoxDescriptorImpl.java new file mode 100644 index 0000000..295466a --- /dev/null +++ b/src/com/silverwrist/venice/core/impl/SideBoxDescriptorImpl.java @@ -0,0 +1,87 @@ +/* + * The contents of this file are subject to the Mozilla Public License Version 1.1 + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at . + * + * 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 , + * 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.core.impl; + +import com.silverwrist.venice.core.SideBoxDescriptor; + +class SideBoxDescriptorImpl implements SideBoxDescriptor +{ + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private SideBoxDescriptor parent; + private int sequence; + private String param; + + /*-------------------------------------------------------------------------------- + * Constructor + *-------------------------------------------------------------------------------- + */ + + SideBoxDescriptorImpl(SideBoxDescriptor parent, int sequence, String param) + { + this.parent = parent; + this.sequence = sequence; + this.param = param; + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Implementations from interface SideBoxDescriptor + *-------------------------------------------------------------------------------- + */ + + public int getID() + { + return parent.getID(); + + } // end getID + + public int getSequence() + { + return sequence; + + } // end getSequence + + public String getParameter() + { + return param; + + } // end getParameter + + public String getDescription() + { + return parent.getDescription(); + + } // end getDescription + + public String getParamDescription() + { + return parent.getParamDescription(); + + } // end getParamDescription + + public String getClassname() + { + return parent.getClassname(); + + } // end getClassname + +} // end class SideBoxDescriptorImpl diff --git a/src/com/silverwrist/venice/core/impl/UserContextImpl.java b/src/com/silverwrist/venice/core/impl/UserContextImpl.java index d452b71..a05be7d 100644 --- a/src/com/silverwrist/venice/core/impl/UserContextImpl.java +++ b/src/com/silverwrist/venice/core/impl/UserContextImpl.java @@ -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 , * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are @@ -710,76 +710,6 @@ class UserContextImpl implements UserContext, UserBackend } // end setDescription - public FrontPageViewConfig getFrontPageViewConfig(int max_cols) throws DataException - { - Connection conn = null; - - try - { // retrieve a connection from the data pool - conn = datapool.getConnection(); - - // create new object - return new FrontPageViewConfigImpl(conn,uid,max_cols); - - } // end try - catch (SQLException e) - { // turn SQLException into data exception - logger.error("DB error getting front page view config: " + e.getMessage(),e); - throw new DataException("unable to retrieve front page view config: " + e.getMessage(),e); - - } // end catch - finally - { // make sure the connection is released before we go - if (conn!=null) - datapool.releaseConnection(conn); - - } // end finally - - } // end getFrontPageViewConfig - - public void putFrontPageViewConfig(FrontPageViewConfig cfg) throws DataException - { - Connection conn = null; - - try - { // coerce the value to a Stashable first - Stashable obj = (Stashable)cfg; - if (obj.getStashableUID()!=uid) - { // wrong UID for configuration - this is bogus - logger.error("invalid ownership of FrontPageViewConfig (was " - + String.valueOf(obj.getStashableUID()) + ", should be " + String.valueOf(uid) + ")"); - throw new DataException("invalid front page view config record"); - - } // end if - - // retrieve a connection from the data pool - conn = datapool.getConnection(); - - // stash the object - obj.stash(conn); - - } // end try - catch (ClassCastException cce) - { // we need to be able to coerce the FrontPageViewConfig to a Stashable - logger.error("FrontPageViewConfig was not a Stashable"); - throw new DataException("improper front page view config record"); - - } // end catch - catch (SQLException e) - { // turn SQLException into data exception - logger.error("DB error saving front page view config: " + e.getMessage(),e); - throw new DataException("unable to save front page view config: " + e.getMessage(),e); - - } // end catch - finally - { // make sure the connection is released before we go - if (conn!=null) - datapool.releaseConnection(conn); - - } // end finally - - } // end putFrontPageViewConfig - public List getMemberSIGs() throws DataException { return SIGUserContextImpl.getMemberSIGEntries(engine,this,datapool); @@ -893,6 +823,45 @@ class UserContextImpl implements UserContext, UserBackend } // end canCreateSIG + public List getSideBoxList() throws DataException + { + Connection conn = null; + Vector rc = new Vector(); + + try + { // retrieve a connection from the data pool + conn = datapool.getConnection(); + Statement stmt = conn.createStatement(); + + // retrieve the necessary rows from the sideboxes table + ResultSet rs = stmt.executeQuery("SELECT boxid, sequence, param FROM sideboxes WHERE uid = " + uid + + " ORDER BY sequence;"); + while (rs.next()) + { // create the implementation objects and return them all + SideBoxDescriptor sbd = new SideBoxDescriptorImpl(engine.getMasterSideBoxDescriptor(rs.getInt(1)), + rs.getInt(2),rs.getString(3)); + rc.add(sbd); + + } // end while + + } // end try + catch (SQLException e) + { // turn SQLException into data exception + logger.error("DB error getting side box config: " + e.getMessage(),e); + throw new DataException("unable to retrieve side box config: " + e.getMessage(),e); + + } // end catch + finally + { // make sure the connection is released before we go + if (conn!=null) + datapool.releaseConnection(conn); + + } // end finally + + return new ReadOnlyVector(rc); + + } // end getSideBoxList + /*-------------------------------------------------------------------------------- * Implementations from interface UserBackend *-------------------------------------------------------------------------------- diff --git a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java index 8be4278..201a99b 100644 --- a/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java +++ b/src/com/silverwrist/venice/core/impl/VeniceEngineImpl.java @@ -190,6 +190,94 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend } // end class VeniceFeatureDef + /*-------------------------------------------------------------------------------- + * Internal class storing side box information. + *-------------------------------------------------------------------------------- + */ + + class MasterSideBox implements SideBoxDescriptor + { + private int id; + private String description; + private String param_descr; + private String classname; + + MasterSideBox(ResultSet rs) throws SQLException + { + this.id = rs.getInt("boxid"); + this.description = rs.getString("description"); + this.param_descr = rs.getString("param_descr"); + this.classname = rs.getString("classname"); + + } // end constructor + + public int getID() + { + return id; + + } // end getID + + public int getSequence() + { + return -1; + + } // end getSequence + + public String getParameter() + { + return null; + + } // end getParameter + + public String getDescription() + { + return description; + + } // end getDescription + + public String getParamDescription() + { + return param_descr; + + } // end getParamDescription + + public String getClassname() + { + return classname; + + } // end getClassname + + } // end class MasterSideBox + + /*-------------------------------------------------------------------------------- + * Internal class for returning side box information. + *-------------------------------------------------------------------------------- + */ + + static class MasterSideBoxList extends AbstractList + { + private MasterSideBox[] array; + + MasterSideBoxList(MasterSideBox[] array) + { + this.array = array; + + } // end constructor + + public Object get(int index) + { + return array[index]; + + } // end get + + public int size() + { + return array.length; + + } // end size + + } // end class MasterSideBoxList + /*-------------------------------------------------------------------------------- * Static data values *-------------------------------------------------------------------------------- @@ -214,6 +302,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend private Hashtable conf_objects = new Hashtable(); // holder for ConferenceCoreData objects private HTMLCheckerConfig[] html_configs; // holder for HTML checker configurations private int[] gp_ints; // global integer parameters + private MasterSideBox[] sideboxes; // master sidebox table + private Hashtable sidebox_ids = new Hashtable(); // maps sidebox IDs to MasterSideBox objects /*-------------------------------------------------------------------------------- * Constructor @@ -274,6 +364,8 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend */ public void initialize(Document config) throws ConfigException, DataException { + int i; // loop counter + if (this.config!=null) { // already configured! logger.error("Venice engine already initialized"); @@ -345,10 +437,9 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend // Retrieve the list of dictionary files to load into the spellchecker. dictionary_tmp = new Vector(); NodeList dict_nodes = dict_sect.getChildNodes(); - int j; - for (j=0; j element looking for elements - Node dn = dict_nodes.item(j); + Node dn = dict_nodes.item(i); if ((dn.getNodeType()==Node.ELEMENT_NODE) && (dn.getNodeName().equals("file"))) { // store the file name as a vector element Element del = (Element)dn; @@ -370,9 +461,9 @@ public class VeniceEngineImpl implements VeniceEngine, EngineBackend // Initialize the stock messages list. stock_messages = new Hashtable(); NodeList msg_nodes = msg_sect.getChildNodes(); - for (j=0; j. + * + * 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 , + * 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.io.*; +import java.util.*; +import com.silverwrist.venice.core.*; + +public class SideBoxConferences implements ContentRender +{ + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private UserContext uc; + + /*-------------------------------------------------------------------------------- + * Constructor + *-------------------------------------------------------------------------------- + */ + + public SideBoxConferences(UserContext uc, String parameter) + { + this.uc = uc; + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Implementations from interface VeniceContent + *-------------------------------------------------------------------------------- + */ + + public String getPageTitle(RenderData rdat) + { + if (uc.isLoggedIn()) + return "Your Conference Hotlist:"; + else + return "Featured Conferences:"; + + } // end getPageTitle + + /*-------------------------------------------------------------------------------- + * Implementations from interface ContentRender + *-------------------------------------------------------------------------------- + */ + + public void renderHere(Writer out, RenderData rdat) throws IOException + { + /* BEGIN TEMP */ + out.write("
    \n"); + out.write("
  • BOFH (Benevolent Dictators)
  • \n"); + out.write("
  • Playground (Electric Minds)
  • \n"); + out.write("
  • Commons (Electric Minds)
  • \n"); + out.write("
  • Top Ten Lists (Pamela's Lounge)
  • \n"); + out.write("
\n"); + /* END TEMP */ + + // write the link at the end + out.write("

" + rdat.getStdFontTag(null,1) + "[ Manage ]"); + + } // end renderHere + +} // end class SideBoxConferences diff --git a/src/com/silverwrist/venice/servlets/format/SideBoxSIGs.java b/src/com/silverwrist/venice/servlets/format/SideBoxSIGs.java new file mode 100644 index 0000000..99263d8 --- /dev/null +++ b/src/com/silverwrist/venice/servlets/format/SideBoxSIGs.java @@ -0,0 +1,103 @@ +/* + * 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 . + * + * 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 , + * 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.io.*; +import java.util.*; +import com.silverwrist.util.StringUtil; +import com.silverwrist.venice.core.*; + +public class SideBoxSIGs implements ContentRender +{ + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private UserContext uc; + private List sig_list; + + /*-------------------------------------------------------------------------------- + * Constructor + *-------------------------------------------------------------------------------- + */ + + public SideBoxSIGs(UserContext uc, String parameter) throws DataException + { + this.uc = uc; + this.sig_list = uc.getMemberSIGs(); + + } // end constructor + + /*-------------------------------------------------------------------------------- + * Implementations from interface VeniceContent + *-------------------------------------------------------------------------------- + */ + + public String getPageTitle(RenderData rdat) + { + if (uc.isLoggedIn()) + return "Your SIGs:"; + else + return "Featured SIGs:"; + + } // end getPageTitle + + /*-------------------------------------------------------------------------------- + * Implementations from interface ContentRender + *-------------------------------------------------------------------------------- + */ + + public void renderHere(Writer out, RenderData rdat) throws IOException + { + out.write(rdat.getStdFontTag(null,2) + "\n"); + if (sig_list.size()>0) + { // display the list of available SIGs + out.write("\n"); + Iterator it = sig_list.iterator(); + while (it.hasNext()) + { // display the names of the SIGs one by one + SIGContext sig = (SIGContext)(it.next()); + out.write("\n\n"); + out.write("\n\n"); + + } // end while + + out.write("
\"*\"\n" + rdat.getStdFontTag(null,2) + "" + + StringUtil.encodeHTML(sig.getName()) + "\n"); + if (sig.isAdmin()) + out.write(" \"Host!\"\n"); + out.write("
\n"); + + } // end if + else + out.write(rdat.getStdFontTag(null,2) + "You are not a member of any SIGs.\n"); + + // write the two links at the end + out.write("

" + rdat.getStdFontTag(null,1) + "[ Manage | Create New ]"); + + } // end renderHere + +} // end class SideBoxSIGs + diff --git a/src/com/silverwrist/venice/servlets/format/TCPanelConferences.java b/src/com/silverwrist/venice/servlets/format/TCPanelConferences.java deleted file mode 100644 index bd4e10c..0000000 --- a/src/com/silverwrist/venice/servlets/format/TCPanelConferences.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 . - * - * 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 Community System. - * - * The Initial Developer of the Original Code is Eric J. Bowersox , - * 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.io.Writer; -import java.io.IOException; -import com.silverwrist.venice.core.UserContext; -import com.silverwrist.venice.core.DataException; - -public class TCPanelConferences extends TCStandardPanel -{ - public TCPanelConferences() - { - super("Your Favorite Conferences:",null); - addButton("bn_manage.gif","Manage",null,true,80,24); - - } // end constructor - - public TCPanelConferences(TCPanelConferences other) - { - super(other); - - } // end constructor - - public void renderContent(Writer out, RenderData rdat) throws IOException - { - /* BEGIN TEMP */ - out.write("

    \n"); - out.write("
  • BOFH (Benevolent Dictators)
  • \n"); - out.write("
  • Playground (Electric Minds)
  • \n"); - out.write("
  • Commons (Electric Minds)
  • \n"); - out.write("
  • Top Ten Lists (Pamela's Lounge)
  • \n"); - out.write("
\n"); - /* END TEMP */ - - } // end renderHere - - public void configure(UserContext uc, String parameter) throws DataException - { // TEMP - do nothing - super.configure(uc,parameter); - if (!(uc.isLoggedIn())) - setTitle("Featured Conferences:"); - - } // end configure - - public Object clone() - { - return new TCPanelConferences(this); - - } // end clone - -} // end class TCPanelSIGs diff --git a/src/com/silverwrist/venice/servlets/format/TCPanelSIGs.java b/src/com/silverwrist/venice/servlets/format/TCPanelSIGs.java deleted file mode 100644 index d63cf14..0000000 --- a/src/com/silverwrist/venice/servlets/format/TCPanelSIGs.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 . - * - * 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 Community System. - * - * The Initial Developer of the Original Code is Eric J. Bowersox , - * 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.io.Writer; -import java.io.IOException; -import java.util.List; -import java.util.Iterator; -import com.silverwrist.venice.core.SIGContext; -import com.silverwrist.venice.core.UserContext; -import com.silverwrist.venice.core.DataException; - -public class TCPanelSIGs extends TCStandardPanel -{ - private List my_sigs = null; - - public TCPanelSIGs() - { - super("Your SIGs:",null); - addButton("bn_manage.gif","Manage",null,true,80,24); - addButton("bn_create_new.gif","Create New","sigops?cmd=C",true,80,24); - - } // end constructor - - protected TCPanelSIGs(TCPanelSIGs other) - { - super(other); - - } // end constructor - - public void renderContent(Writer out, RenderData rdat) throws IOException - { - out.write(rdat.getStdFontTag(null,2) + "\n"); - if (my_sigs.size()>0) - { // display the list of available SIGs - out.write("
    \n"); - - Iterator it = my_sigs.iterator(); - while (it.hasNext()) - { // display the names of the SIGs one by one - SIGContext sig = (SIGContext)(it.next()); - // TODO: make this fancier than just an unordered list - out.write("
  • " + sig.getName() + ""); - if (sig.isAdmin()) - out.write(" \"Host!\""); - out.write("
  • \n"); - - } // end while - - out.write("
\n"); - - } // end if - else - out.write("You are not a member of any SIGs.\n"); - - out.write("\n"); - - } // end renderContent - - public void configure(UserContext uc, String parameter) throws DataException - { - super.configure(uc,parameter); - if (!(uc.isLoggedIn())) - setTitle("Featured SIGs:"); - my_sigs = uc.getMemberSIGs(); - - } // end configure - - public Object clone() - { - return new TCPanelSIGs(this); - - } // end clone - -} // end class TCPanelSIGs diff --git a/src/com/silverwrist/venice/servlets/format/TCStandardPanel.java b/src/com/silverwrist/venice/servlets/format/TCStandardPanel.java deleted file mode 100644 index d042852..0000000 --- a/src/com/silverwrist/venice/servlets/format/TCStandardPanel.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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 . - * - * 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 Community System. - * - * The Initial Developer of the Original Code is Eric J. Bowersox , - * 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.io.Writer; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Vector; -import com.silverwrist.venice.core.UserContext; -import com.silverwrist.venice.core.DataException; - -public abstract class TCStandardPanel extends TopContentPanel -{ - class TCButton implements ComponentRender - { - private String image; - private String alt_text; - private String url; - private boolean login_only; - private int width; - private int height; - - public TCButton(String image, String alt_text, String url, boolean login_only, int width, int height) - { - this.image = image; - this.alt_text = alt_text; - this.url = url; - this.login_only = login_only; - this.width = width; - this.height = height; - - } // end constructor - - public void renderHere(Writer out, RenderData rdat) throws IOException - { - if (url!=null) - out.write(""); - out.write("\"""); - if (url!=null) - out.write(""); - - } // end renderHere - - public boolean isLoginOnly() - { - return login_only; - - } // end isLoginOnly - - } // end class TCButton - - // Attributes - private String title; - private String subtitle; - private Vector buttons; - - private String real_title; - private String real_subtitle; - private boolean logged_in; - - protected TCStandardPanel(String title, String subtitle) - { - this.title = title; - this.subtitle = subtitle; - this.buttons = new Vector(); - this.real_title = title; - this.real_subtitle = subtitle; - - } // end constructor - - protected TCStandardPanel(TCStandardPanel other) - { - super(other); - this.title = other.title; - this.subtitle = other.subtitle; - this.buttons = other.buttons; - this.real_title = other.title; - this.real_subtitle = other.subtitle; - - } // end constructor - - private boolean displayButtons() - { - if (buttons.size()==0) - return false; - else if (logged_in) - return true; - - boolean login_only = true; - Enumeration enum = buttons.elements(); - while (login_only && enum.hasMoreElements()) - { // attempt to determine if there are any non-"login only" buttons - TCButton bn = (TCButton)(enum.nextElement()); - login_only = bn.isLoginOnly(); - - } // end while - - return !login_only; - - } // end displayButtons - - protected void addButton(String image, String alt_text, String url, boolean login_only, int width, - int height) - { - buttons.addElement(new TCButton(image,alt_text,url,login_only,width,height)); - - } // end addButton - - protected abstract void renderContent(Writer out, RenderData rdat) throws IOException; - - public void renderHere(Writer out, RenderData rdat) throws IOException - { - rdat.writeContentHeader(out,real_title,real_subtitle); - - if (displayButtons()) - { // want to print the buttons - out.write("
\n"); - Enumeration enum = buttons.elements(); - - boolean first_post = true; - while (enum.hasMoreElements()) - { // figure out whether to display this button - TCButton bn = (TCButton)(enum.nextElement()); - boolean display_me = logged_in; - if (logged_in) - display_me = true; - else - display_me = !(bn.isLoginOnly()); - - if (display_me) - { // display this button - if (first_post) - first_post = false; - else - out.write("  "); - bn.renderHere(out,rdat); - - } // end if - - } // end while - - out.write("\n
\n"); - - } // end if - - renderContent(out,rdat); - - } // end renderHere - - public void configure(UserContext uc, String parameter) throws DataException - { - logged_in = uc.isLoggedIn(); - - } // end configure - - public void setTitle(String title) - { - this.real_title = title; - - } // end setTitle - - public void setSubtitle(String title) - { - this.real_subtitle = subtitle; - - } // end setTitle - -} // end class TCPanelSIGs diff --git a/src/com/silverwrist/venice/servlets/format/TopContent.java b/src/com/silverwrist/venice/servlets/format/TopContent.java deleted file mode 100644 index 16c8aaa..0000000 --- a/src/com/silverwrist/venice/servlets/format/TopContent.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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 . - * - * 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 , - * 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.io.Writer; -import java.io.IOException; -import java.util.*; -import com.silverwrist.venice.core.*; - -public class TopContent implements ContentRender -{ - /*-------------------------------------------------------------------------------- - * Static data members - *-------------------------------------------------------------------------------- - */ - - public static final int MAX_COLS = 2; - - /*-------------------------------------------------------------------------------- - * Attributes - *-------------------------------------------------------------------------------- - */ - - private int actual_cols = MAX_COLS; - private int[] col_sizes; - private Vector panels = new Vector(); - private boolean display_configure; - - /*-------------------------------------------------------------------------------- - * Constructor - *-------------------------------------------------------------------------------- - */ - - public TopContent(UserContext uc) throws DataException - { - int i; // loop counter - - // get the current view configuration - FrontPageViewConfig vconfig = uc.getFrontPageViewConfig(MAX_COLS); - if (vconfig.getNumColumns()\n"); - - Enumeration enum = panels.elements(); - while (enum.hasMoreElements()) - { // output each row in turn - TopContentPanel[] rowarray = (TopContentPanel[])(enum.nextElement()); - out.write("\n"); - - for (int i=0; i\n"); - rowarray[i].renderHere(out,rdat); - out.write("\n"); - - } // end for - - out.write("\n"); - - } // end while - - out.write("\n"); - - if (display_configure) - { // display the Configure button - out.write("
\n\"Configure\"\n
\n"); - - } // end if - - rdat.writeFooter(out); - - } // end renderHere - -} // end class TopContent diff --git a/src/com/silverwrist/venice/servlets/format/TopContentPanel.java b/src/com/silverwrist/venice/servlets/format/TopContentPanel.java deleted file mode 100644 index a12949c..0000000 --- a/src/com/silverwrist/venice/servlets/format/TopContentPanel.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 . - * - * 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 Community System. - * - * The Initial Developer of the Original Code is Eric J. Bowersox , - * 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.io.Writer; -import java.io.IOException; -import com.silverwrist.venice.core.UserContext; -import com.silverwrist.venice.core.DataException; - -public abstract class TopContentPanel implements ComponentRender, Cloneable -{ - protected TopContentPanel() - { // do nothing - } // end constructor - - protected TopContentPanel(TopContentPanel other) - { // do nothing - } // end constructor - - public abstract void renderHere(Writer out, RenderData rdat) throws IOException; - - public abstract void configure(UserContext uc, String parameter) throws DataException; - - public static TopContentPanel create(String partid) - { - if (partid.equals("SIGS")) - return new TCPanelSIGs(); - if (partid.equals("CONF")) - return new TCPanelConferences(); - return null; - - } // end create - -} // end class TopContentPanel - diff --git a/src/com/silverwrist/venice/servlets/format/TopDisplay.java b/src/com/silverwrist/venice/servlets/format/TopDisplay.java new file mode 100644 index 0000000..237954d --- /dev/null +++ b/src/com/silverwrist/venice/servlets/format/TopDisplay.java @@ -0,0 +1,245 @@ +/* + * 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 . + * + * 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 , + * 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.io.Writer; +import java.io.IOException; +import java.util.*; +import javax.servlet.*; +import javax.servlet.http.*; +import com.silverwrist.util.StringUtil; +import com.silverwrist.venice.core.*; + +public class TopDisplay implements ContentRender +{ + /*-------------------------------------------------------------------------------- + * Static data values + *-------------------------------------------------------------------------------- + */ + + private static final String ATTR_NAME = "com.silverwrist.venice.TopDisplay"; + + /*-------------------------------------------------------------------------------- + * Attributes + *-------------------------------------------------------------------------------- + */ + + private ServletContext ctxt; + private UserContext uc; + private List descrs; + private VeniceContent[] sideboxes; + + /*-------------------------------------------------------------------------------- + * Constructor + *-------------------------------------------------------------------------------- + */ + + public TopDisplay(ServletContext ctxt, UserContext uc) throws DataException, AccessError, ErrorBox + { + // Stash some basic information. + this.ctxt = ctxt; + this.uc = uc; + this.descrs = uc.getSideBoxList(); + + // Create the arrays used to construct sideboxes. + Class[] ctor_argtypes = new Class[2]; + ctor_argtypes[0] = UserContext.class; + ctor_argtypes[1] = String.class; + Object[] ctor_args = new Object[2]; + ctor_args[0] = uc; + + // Create the actual sideboxes. + sideboxes = new VeniceContent[descrs.size()]; + for (int i=0; i\n"); + out.write("\n"); + + // The top content is a JSP page, so include it here. + rdat.setRequestAttribute(ATTR_NAME,this); + RequestDispatcher dispatcher = ctxt.getRequestDispatcher(rdat.getFormatJSPPath("top_content.jsp")); + out.flush(); + rdat.flushOutput(); // make sure the stuff to be output first is output + try + { // include me! + rdat.includeDispatch(dispatcher); + + } // end try + catch (ServletException se) + { // since we can't throw ServletException, we throw IOException + throw new IOException("Failure including top_content.jsp"); + + } // end catch + + rdat.flushOutput(); // now make sure the included page is properly flushed + + out.write("\n\n"); // break to the sidebox column + + for (int i=0; i" + + "\n"); + out.write(rdat.getStdFontTag("white",3) + "" + StringUtil.encodeHTML(sideboxes[i].getPageTitle(rdat)) + + "\n"); + out.write("\n"); + + // Fill in the sidebox by calling down to the base. + if (sideboxes[i] instanceof ContentRender) + { // we have a direct-rendering component here - do it + ContentRender cr = (ContentRender)(sideboxes[i]); + cr.renderHere(out,rdat); + + } // end if + else if (sideboxes[i] instanceof JSPRender) + { // we have a JSP rendering component here - bounce to the appropriate JSP file + JSPRender jr = (JSPRender)(sideboxes[i]); + rdat.storeJSPRender(jr); + dispatcher = ctxt.getRequestDispatcher(rdat.getFormatJSPPath(jr.getTargetJSPName())); + out.flush(); + rdat.flushOutput(); // make sure the stuff to be output first is output + try + { // include me! + rdat.includeDispatch(dispatcher); + + } // end try + catch (ServletException se) + { // since we can't throw ServletException, we throw IOException + out.write(rdat.getStdFontTag(null,2) + "failure rendering class " + + sideboxes[i].getClass().getName() + ": " + StringUtil.encodeHTML(se.getMessage()) + + "\n"); + out.flush(); + + } // end catch + + rdat.flushOutput(); // now make sure the included page is properly flushed + + } // end else if + else // this is bogus - just display a little error here + out.write(rdat.getStdFontTag(null,2) + "cannot display sidebox of class: " + + sideboxes[i].getClass().getName() + "\n"); + + // close up the framework of this sidebox + out.write("

\n"); + + } // end for + + if (uc.isLoggedIn()) + { // write the Configure button below the sideboxes + out.write("\"Configure\"\n"); + + } // end if + + // Finish up. + out.write("\n"); + rdat.writeFooter(out); + + } // end renderHere + +} // end class TopDisplay diff --git a/web/format/top_content.jsp b/web/format/top_content.jsp new file mode 100644 index 0000000..385cfce --- /dev/null +++ b/web/format/top_content.jsp @@ -0,0 +1,30 @@ +<%-- + 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 . + + 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 , + 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.*" %> +<% + TopDisplay data = TopDisplay.retrieve(request); + Variables.failIfNull(data); + RenderData rdat = RenderConfig.createRenderData(application,request,response); +%> +<% if (rdat.useHTMLComments()) { %><% } %> +<% rdat.writeContentHeader(out,"Venice Currents",null); %> +TODO: Something profound goes here. :-) \ No newline at end of file