"
+} else {
+ set part1 ""
+} ;# end if
+
+$vlib output "$part1 In the house!"
\ No newline at end of file
diff --git a/scripts/test/test2.jacl b/scripts/test/test2.jacl
new file mode 100644
index 0000000..1cb755b
--- /dev/null
+++ b/scripts/test/test2.jacl
@@ -0,0 +1,10 @@
+# Script for testing the View mechanism
+package require java
+java::import com.silverwrist.venice.ui.LinkTypes
+
+set rc [java::new com.silverwrist.venice.ui.view.TextMessage "Test Display" "subtitle"]
+set blort "If this had been an actual emergency we would all be dead by now."
+java::prop $rc text "This is a test. This is only a test. $blort"
+$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "ok"
+$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "cancel"
+$vlib output $rc
\ No newline at end of file
diff --git a/scripts/test/test2.js b/scripts/test/test2.js
new file mode 100644
index 0000000..dea10d3
--- /dev/null
+++ b/scripts/test/test2.js
@@ -0,0 +1,12 @@
+// Script for testing the View mechanism
+// Translation of test2.jacl
+
+importPackage(Packages.com.silverwrist.venice.ui);
+importClass(Packages.com.silverwrist.venice.ui.view.TextMessage);
+
+rc = new TextMessage("Test Display","JavaScript subtitle");
+blort = "If this had been an actual emergency we would all be dead by now."
+rc.text = "This is a test. This is only a test. " + blort;
+rc.addButton(LinkTypes.ABSOLUTE,"TODO","ok");
+rc.addButton(LinkTypes.ABSOLUTE,"TODO","cancel");
+vlib.output(rc);
diff --git a/scripts/test/test3.jacl b/scripts/test/test3.jacl
new file mode 100644
index 0000000..a9e3995
--- /dev/null
+++ b/scripts/test/test3.jacl
@@ -0,0 +1,17 @@
+# Script for testing the sidebox framework
+# Translated from test3.js
+
+package require java
+java::import com.silverwrist.venice.ui.LinkTypes
+java::import com.silverwrist.venice.ui.view.SideBoxNestedView
+java::import com.silverwrist.venice.ui.view.TextMessage
+
+set rinput [bsf lookupBean "request"]
+set rc [java::new TextMessage "Test Display" "Jacl subtitle"]
+set blort "If this had been an actual emergency we would all be dead by now."
+java::prop $rc text "This is a test. This is only a test. $blort"
+$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "ok"
+$rc addButton [java::field LinkTypes ABSOLUTE] "TODO" "cancel"
+
+set rc2 [java::new SideBoxNestedView $rinput $rc]
+$vlib output $rc2
\ No newline at end of file
diff --git a/scripts/test/test3.js b/scripts/test/test3.js
new file mode 100644
index 0000000..80d16bf
--- /dev/null
+++ b/scripts/test/test3.js
@@ -0,0 +1,13 @@
+// Script for testing the sidebox framework
+
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.view);
+
+rinput = bsf.lookupBean("request");
+rc = new TextMessage("Test Display","JavaScript subtitle");
+blort = "If this had been an actual emergency we would all be dead by now."
+rc.text = "This is a test. This is only a test. " + blort;
+rc.addButton(LinkTypes.ABSOLUTE,"TODO","ok");
+rc.addButton(LinkTypes.ABSOLUTE,"TODO","cancel");
+rc2 = new SideBoxNestedView(rinput,rc);
+vlib.output(rc2);
diff --git a/scripts/top.js b/scripts/top.js
new file mode 100644
index 0000000..533a23a
--- /dev/null
+++ b/scripts/top.js
@@ -0,0 +1,73 @@
+// The contents of this file are subject to the Mozilla Public License Version 1.1
+// (the "License"); you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at .
+//
+// 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):
+
+importPackage(java.util);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+importPackage(Packages.com.silverwrist.venice.ui.view);
+
+rinput = bsf.lookupBean("request");
+rc = null;
+try
+{ // get the list of front page posts!
+ post_list = rinput.engine.getPublishedMessages(false);
+
+ // precalculate the message text and poster names of the front-page messages
+ poster_names = new ArrayList(post_list.size());
+ message_text = new ArrayList(post_list.size());
+ topic_names = new ArrayList(post_list.size());
+ topic_links = new ArrayList(post_list.size());
+ for (i=0; i.
+//
+// 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):
+
+importPackage(java.util);
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+importPackage(Packages.com.silverwrist.venice.ui.view);
+
+rinput = bsf.lookupBean("request");
+
+rc = null;
+try
+{ // generate the list of sideboxes we have
+ in_list = rinput.user.getSideBoxList();
+ ids = new HashSet(in_list.size());
+ it = in_list.iterator();
+ while (it.hasNext())
+ { // add the IDs of all the sideboxes to the set
+ descr = vlib.castSideBoxDescriptor(it.next());
+ ids.add(descr.sideBoxID);
+
+ } // end for
+
+ all_list = rinput.engine.getMasterSideBoxList();
+ out_list = null;
+ if (all_list.size()>in_list.size())
+ { // allocate an ArrayList to hold the sideboxes
+ out_list = new ArrayList(all_list.size()-in_list.size());
+ it = all_list.iterator();
+ while (it.hasNext())
+ { // get all sideboxes not on the "in" list and put them on the "out" list
+ descr = vlib.castSideBoxDescriptor(it.next());
+ if (!(ids.contains(descr.sideBoxID)))
+ out_list.add(descr);
+
+ } // end while
+
+ } // end if
+ else // nothing in the "out list"
+ out_list = Collections.EMPTY_LIST;
+
+ // save off the two lists as request parameters
+ rinput.setRequestAttribute("sideboxes.included",in_list);
+ rinput.setRequestAttribute("sideboxes.excluded",out_list);
+
+ // create a new JSPView for this
+ rc = new JSPView("Your Front Page Configuration","user/sidebox.jsp");
+ rc.menuSelector = Content.MENU_SELECTOR_TOP;
+
+} // end try
+catch (e)
+{ // we got some sort of exception here
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Error getting sidebox list: " + e.message(),"top.js.vs");
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc); // all done!
diff --git a/scripts/usr/sidebox_add.js b/scripts/usr/sidebox_add.js
new file mode 100644
index 0000000..fa97887
--- /dev/null
+++ b/scripts/usr/sidebox_add.js
@@ -0,0 +1,52 @@
+// 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):
+
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+rinput = bsf.lookupBean("request");
+
+boxid = rinput.getParameterInt("box",0);
+if (boxid==0)
+{ // the box ID parameter is invalid
+ vlib.output(new ErrorBox(null,"Box parameter invalid!","usr/sidebox.js.vs"));
+ vlib.done();
+
+} // end if
+
+rc = null;
+try
+{ // add the sidebox
+ rinput.user.addSideBox(boxid);
+
+ // now execute the "sidebox.js" script to do the redisplay
+ rc = vlib.exec("usr/sidebox.js");
+ rinput.location = "usr/sidebox.js.vs";
+
+} // end try
+catch (e)
+{ // exception adding to the sidebox list
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Error adding to sidebox list: " + e.message,"usr/sidebox.js.vs");
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc);
\ No newline at end of file
diff --git a/scripts/usr/sidebox_delete.js b/scripts/usr/sidebox_delete.js
new file mode 100644
index 0000000..78c7286
--- /dev/null
+++ b/scripts/usr/sidebox_delete.js
@@ -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 .
+//
+// 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):
+
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+rinput = bsf.lookupBean("request");
+
+boxid = rinput.getParameterInt("box",0);
+if (boxid==0)
+{ // the box ID parameter is invalid
+ vlib.output(new ErrorBox(null,"Box parameter invalid!","usr/sidebox.js.vs"));
+ vlib.done();
+
+} // end if
+
+rc = null;
+try
+{ // locate the specified sidebox in the list
+ sidebox_list = rinput.user.getSideBoxList();
+ curr = null;
+ it = sidebox_list.iterator();
+ found = false;
+ while (!found && it.hasNext())
+ { // look for the right descriptor
+ curr = vlib.castUserSideBoxDescriptor(it.next());
+ if (boxid==curr.sideBoxID) // found the current one
+ found = true;
+
+ } // end while
+
+ if (found)
+ curr.remove(); // remove the sidebox
+
+ // now execute the "sidebox.js" script to do the redisplay
+ rc = vlib.exec("usr/sidebox.js");
+ rinput.location = "usr/sidebox.js.vs";
+
+} // end try
+catch (e)
+{ // exception modifying the sidebox list
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Error adjusting sidebox list: " + e.message,"usr/sidebox.js.vs");
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc);
diff --git a/scripts/usr/sidebox_down.js b/scripts/usr/sidebox_down.js
new file mode 100644
index 0000000..6742a65
--- /dev/null
+++ b/scripts/usr/sidebox_down.js
@@ -0,0 +1,90 @@
+// 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):
+
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+rinput = bsf.lookupBean("request");
+
+boxid = rinput.getParameterInt("box",0);
+if (boxid==0)
+{ // the box ID parameter is invalid
+ vlib.output(new ErrorBox(null,"Box parameter invalid!","usr/sidebox.js.vs"));
+ vlib.done();
+
+} // end if
+
+rc = null;
+try
+{ // locate the specified sidebox in the list
+ sidebox_list = rinput.user.getSideBoxList();
+ next = null;
+ curr = null;
+ it = sidebox_list.iterator();
+ found = false;
+ while (!found && it.hasNext())
+ { // look for the right descriptor
+ curr = vlib.castUserSideBoxDescriptor(it.next());
+ if (boxid==curr.sideBoxID)
+ { // found the current one - get the next one as well
+ found = true;
+ if (it.hasNext())
+ next = vlib.castUserSideBoxDescriptor(it.next());
+
+ } // end if
+
+ } // end while
+
+ if (found && (next!=null))
+ { // exchange sequence numbers between curr and next
+ seq_curr = curr.sequence;
+ seq_next = next.sequence;
+ curr.sequence = seq_next; // first "set"
+ restore = true;
+ try
+ { // do the second "set"
+ next.sequence = seq_curr;
+ restore = false;
+
+ } // end try
+ finally
+ { // restore first if second failed
+ if (restore)
+ curr.sequence = seq_curr;
+
+ } // end finally
+
+ } // end if
+ // else just fall out and don't do anything
+
+ // now execute the "sidebox.js" script to do the redisplay
+ rc = vlib.exec("usr/sidebox.js");
+ rinput.location = "usr/sidebox.js.vs";
+
+} // end try
+catch (e)
+{ // exception modifying the sidebox list
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Error adjusting sidebox list: " + e.message,"usr/sidebox.js.vs");
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc);
diff --git a/scripts/usr/sidebox_up.js b/scripts/usr/sidebox_up.js
new file mode 100644
index 0000000..de1212d
--- /dev/null
+++ b/scripts/usr/sidebox_up.js
@@ -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):
+
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+rinput = bsf.lookupBean("request");
+
+boxid = rinput.getParameterInt("box",0);
+if (boxid==0)
+{ // the box ID parameter is invalid
+ vlib.output(new ErrorBox(null,"Box parameter invalid!","usr/sidebox.js.vs"));
+ vlib.done();
+
+} // end if
+
+rc = null;
+try
+{ // locate the specified sidebox in the list
+ sidebox_list = rinput.user.getSideBoxList();
+ prev = null;
+ current = null;
+ it = sidebox_list.iterator();
+ found = false;
+ while (!found && it.hasNext())
+ { // look for the right descriptor
+ prev = current;
+ current = vlib.castUserSideBoxDescriptor(it.next());
+ if (boxid==current.sideBoxID) // found the current one
+ found = true;
+
+ } // end while
+
+ if (found && (prev!=null))
+ { // exchange sequence numbers between current and prev
+ seq_curr = current.sequence;
+ seq_prev = prev.sequence;
+ current.sequence = seq_prev; // first "set"
+ restore = true;
+ try
+ { // do the second "set"
+ prev.sequence = seq_curr;
+ restore = false;
+
+ } // end try
+ finally
+ { // restore first if second failed
+ if (restore)
+ current.sequence = seq_curr;
+
+ } // end finally
+
+ } // end if
+ else
+ logger.debug("sidebox_up.js not doing anything");
+
+ // now execute the "sidebox.js" script to do the redisplay
+ rc = vlib.exec("usr/sidebox.js");
+ rinput.location = "usr/sidebox.js.vs";
+
+} // end try
+catch (e)
+{ // exception modifying the sidebox list
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Error adjusting sidebox list: " + e.message,"usr/sidebox.js.vs");
+ else
+ rc = e;
+
+} // end catch
+
+vlib.output(rc);
diff --git a/scripts/verify_email.js b/scripts/verify_email.js
new file mode 100644
index 0000000..834afc4
--- /dev/null
+++ b/scripts/verify_email.js
@@ -0,0 +1,145 @@
+// 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):
+
+importPackage(Packages.com.silverwrist.venice.core);
+importPackage(Packages.com.silverwrist.venice.except);
+importPackage(Packages.com.silverwrist.venice.ui);
+importPackage(Packages.com.silverwrist.venice.ui.dlg);
+importPackage(Packages.com.silverwrist.venice.ui.helpers);
+
+// Get the request object and the target URI.
+rinput = bsf.lookupBean("request");
+target = rinput.getParameter("tgt");
+if (target==null)
+ target = "top.js.vs";
+
+// If the user is not logged in, this is an error.
+user = rinput.user;
+if (!(user.isLoggedIn()))
+{ // user not logged in - just bail on this
+ vlib.output(new ErrorBox(null,"You must log in before you can verify your account's email address."));
+ vlib.done();
+
+} // end if
+
+// If the user's E-mail address is already verified, this is a no-op.
+if (user.isEmailVerified())
+{ // user already verified - just bail on this
+ vlib.output(new Redirect(target,LinkTypes.SERVLET));
+ vlib.done();
+
+} // end if
+
+dlg = rinput.getDialog("verify"); // retrieve the verification dialog
+
+if ("GET"==rinput.verb)
+{ // display the dialog and have done with it
+ dlg.setValue("tgt",target);
+ rinput.location = target;
+ rinput.displayLogin = false;
+ vlib.output(dlg);
+ vlib.done();
+
+} // end if
+
+// everything that follows is for a POST operation
+op = dlg.whichButton(rinput) + "";
+if (op=="cancel")
+{ // user cancelled verify - bounce back to the target
+ vlib.output(new Redirect(target,LinkTypes.SERVLET));
+ vlib.done();
+
+} // end if
+
+dlg.load(rinput); // load the dialog parameters
+rc = null; // return from this script
+if (op=="sendagain")
+{ // we want to resend the E-mail confirmation
+ try
+ { // do the resend!
+ user.resendEmailConfirmation();
+
+ // now display the dialog again
+ dlg.clear();
+ dlg.setValue("tgt",target);
+ rinput.location = target;
+ rinput.displayLogin = false;
+ rc = dlg;
+
+ } // end try
+ catch (e)
+ { // exception when resending the email confirmation
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Database error sending confirmation: " + e.message,target);
+ else if (etype.match("EmailException"))
+ rc = new ErrorBox("E-mail Error","E-mail error sending confirmation: " + e.message,target);
+ else
+ rc = e;
+
+ } // end catch
+
+} // end if
+else if (op=="ok")
+{ // actually perform the confirmation
+ try
+ { // validate the dialog first
+ dlg.validate();
+
+ // now attempt the confirmation
+ user.confirmEmail(dlg.getValue("num"));
+
+ // all done - go back to where we want to be
+ rc = new Redirect(target,LinkTypes.SERVLET);
+
+ } // end try
+ catch (e)
+ { // exception when confirming...
+ etype = vlib.exceptionType(e) + "";
+ if (etype.match("ValidationException"))
+ { // validation error thrown by dialog
+ dlg.setErrorMessage(e.message + " Please try again.");
+ dlg.setValue("num",null);
+ rinput.location = target;
+ rinput.displayLogin = false;
+ rc = dlg;
+
+ } // end if
+ else if (etype.match("DataException"))
+ rc = new ErrorBox("Database Error","Database error verifying email: " + e.message,target);
+ else if (etype.match("AccessError"))
+ { // invalid confirmation number, perhaps?
+ dlg.setErrorMessage(e.message);
+ dlg.setValue("num",null);
+ rinput.location = target;
+ rinput.displayLogin = false;
+ rc = dlg;
+
+ } // end if
+ else
+ rc = e;
+
+ } // end catch
+
+} // end else if
+else
+{ // button not found...
+ logger.error("no known button click on POST to verify_email.js");
+ rc = new ErrorBox("Internal Error","Unknown command button pressed",target);
+
+} // end else
+
+vlib.output(rc); // all done!
diff --git a/src/com/silverwrist/venice/servlets/Account.java b/src/com/silverwrist/venice/servlets/Account.java
deleted file mode 100644
index c9e1949..0000000
--- a/src/com/silverwrist/venice/servlets/Account.java
+++ /dev/null
@@ -1,535 +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;
-
-import java.io.*;
-import java.net.URLEncoder;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class Account extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String DISPLAY_LOGIN_ATTR = "com.silverwrist.venice.servlets.internal.DisplayLogin";
-
- private static final int COOKIE_LIFETIME = 60*60*24*365; // one year
-
- private static Category logger = Category.getInstance(Account.class);
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private void setDisplayLogins(ServletRequest request)
- {
- request.setAttribute(DISPLAY_LOGIN_ATTR,new Integer(0));
-
- } // end setDisplayLogins
-
- private NewAccountDialog makeNewAccountDialog() throws ServletException
- {
- final String desired_name = "NewAccountDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- NewAccountDialog template = new NewAccountDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (NewAccountDialog)(cache.getNewDialog(desired_name));
-
- } // end makeNewAccountDialog
-
- private LoginDialog makeLoginDialog()
- {
- final String desired_name = "LoginDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- LoginDialog template = new LoginDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (LoginDialog)(cache.getNewDialog(desired_name));
-
- } // end makeLoginDialog
-
- private VerifyEmailDialog makeVerifyEmailDialog()
- {
- final String desired_name = "VerifyEmailDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- VerifyEmailDialog template = new VerifyEmailDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (VerifyEmailDialog)(cache.getNewDialog(desired_name));
-
- } // end makeVerifyEmailDialog
-
- private EditProfileDialog makeEditProfileDialog() throws ServletException
- {
- final String desired_name = "EditProfileDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- EditProfileDialog template = new EditProfileDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (EditProfileDialog)(cache.getNewDialog(desired_name));
-
- } // end makeEditProfileDialog
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "Account servlet - Handles login, logout, account creation, and profiles\n"
- + "Part of the Venice Web Communities System\n";
- return rc;
-
- } // end getServletInfo
-
- /*--------------------------------------------------------------------------------
- * Overrides from class VeniceServlet
- *--------------------------------------------------------------------------------
- */
-
- protected String getMyLocation(HttpServletRequest request, VeniceEngine engine, UserContext user,
- RenderData rdat)
- {
- String rc = super.getMyLocation(request,engine,user,rdat);
- if (rc!=null)
- return rc;
- if (request.getAttribute(DISPLAY_LOGIN_ATTR)!=null)
- return "account?cmd=" + getStandardCommandParam(request);
- else
- return null;
-
- } // end getMyLocation
-
- protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- String tgt = request.getParameter("tgt"); // target location
- if (tgt==null)
- tgt = "top"; // go back to the Top screen if nothing else
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("L"))
- { // "L" = Log In/Out
- if (user.isLoggedIn())
- { // this is a Logout command
- clearUserContext(request);
-
- // delete the "login" cookie
- Cookie del_login_info = rdat.createCookie(Variables.LOGIN_COOKIE,"",0);
- Variables.saveCookie(request,del_login_info);
-
- throw new RedirectResult("top"); // take 'em back to the "top" page
-
- } // end if
-
- // this is a Login command - display the Login page
- LoginDialog dlg = makeLoginDialog();
- dlg.setupNew(tgt);
- setMyLocation(request,tgt); // fake out the location so we can display the "Log In/Create Account" links
- return dlg;
-
- } // end if ("L" command)
-
- if (cmd.equals("C"))
- { // "C" = create new account
- if (user.isLoggedIn()) // you can't create a new account while logged in on an existing one!
- return new ErrorBox("Error","You cannot create a new account while logged in on an existing "
- + "one. You must log out first.",tgt);
-
- final String yes = "yes";
- if (yes.equals(request.getParameter("agree")))
- { // display the "Create Account" dialog
- NewAccountDialog dlg = makeNewAccountDialog();
- dlg.setEngine(engine);
- dlg.setTarget(tgt);
- dlg.setFieldValue("country","US");
- return dlg;
-
- } // end if
- else
- { // display the account terms dialog
- String[] choices = new String[2];
- choices[0] = "account?cmd=C&agree=yes&tgt=" + URLEncoder.encode(tgt);
- choices[1] = "top";
- return new TextMessageDialog(TextMessageDialog.TYPE_ACCEPT_DECLINE,
- rdat.getStockMessage("user-agreement-title"),
- rdat.getStockMessage("user-agreement-subtitle"),
- rdat.getStockMessage("user-agreement"),choices);
-
- } // end else
-
- } // end if ("C" command)
-
- if (cmd.equals("P"))
- { // "P" = user profile
- if (!(user.isLoggedIn())) // you have to be logged in for this one!
- return new ErrorBox("Error","You must log in before you can modify the profile "
- + "on your account.",tgt);
-
- // set up the Edit Profile dialog
- EditProfileDialog dlg = makeEditProfileDialog();
- try
- { /// set up the profile information for the dialog
- dlg.setupDialog(user,tgt);
-
- } // end try
- catch (DataException e)
- { // unable to load the contact info for the profile
- return new ErrorBox("Database Error","Database error retrieving profile: " + e.getMessage(),tgt);
-
- } // end catch
-
- return dlg; // display dialog
-
- } // end if ("P" command)
-
- if (cmd.equals("V"))
- { // "V" = verify email address
- setDisplayLogins(request);
- if (!(user.isLoggedIn())) // you have to be logged in for this one!
- return new ErrorBox("Error","You must log in before you can verify your account's "
- + "email address.",tgt);
-
- // display the "verify email" dialog
- VerifyEmailDialog dlg = makeVerifyEmailDialog();
- dlg.setTarget(tgt);
- return dlg;
-
- } // end if ("V" command)
-
- // command not found!
- logger.error("invalid command to Account.doGet: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to Account.doGet",tgt);
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- changeMenuTop(request); // this is "top" menus
- String tgt = request.getParameter("tgt"); // target location
- if (tgt==null)
- tgt = "top"; // go back to the Top screen if nothing else
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("L"))
- { // "L" = login the user
- LoginDialog dlg = makeLoginDialog();
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(tgt); // we decided not to log in - go back where we came from
-
- if (dlg.isButtonClicked(request,"remind"))
- { // this will email a password reminder to the owner's account
- dlg.loadValues(request); // load the dialog values
-
- try
- { // send the password reminder
- engine.sendPasswordReminder(dlg.getFieldValue("user"));
-
- // recycle and redisplay the dialog box
- dlg.resetOnError("Password reminder has been sent to your e-mail address.");
-
- } // end try
- catch (DataException de)
- { // there was a database error finding your email address
- return new ErrorBox("Database Error","Database error finding user: " + de.getMessage(),tgt);
-
- } // end catch
- catch (AccessError ae)
- { // this indicates a problem with the user account or password
- return new ErrorBox("User E-mail Address Not Found",ae.getMessage(),tgt);
-
- } // end catch
- catch (EmailException ee)
- { // error sending the confirmation email
- return new ErrorBox("E-mail Error","E-mail error sending reminder: " + ee.getMessage(),tgt);
-
- } // end catch
-
- setMyLocation(request,tgt); // fake out the location
- return dlg; // redisplay the dialog
-
- } // end if ("remind" button clicked)
-
- if (dlg.isButtonClicked(request,"login"))
- { // we actually want to try and log in! imagine that!
- dlg.loadValues(request); // load the values
-
- try
- { // use the user context to authenticate
- user.authenticate(dlg.getFieldValue("user"),dlg.getFieldValue("pass"));
-
- // If they want a cookie, give it to them!
- final String yes = "Y";
- if (yes.equals(dlg.getFieldValue("saveme")))
- { // create the authentication cookie and save it
- Cookie auth_cookie = rdat.createCookie(Variables.LOGIN_COOKIE,user.getAuthenticationToken(),
- COOKIE_LIFETIME);
- Variables.saveCookie(request,auth_cookie);
-
- } // end if
-
- // assuming it worked OK, redirect them back where they came from
- // (or to the verification page if they need to go there)
- clearMenu(request);
- if (user.isEmailVerified())
- throw new RedirectResult(tgt);
- else // they haven't verified yet - remind them to do so
- throw new RedirectResult("account?cmd=V&tgt=" + URLEncoder.encode(tgt));
-
- } // end try
- catch (DataException de)
- { // this indicates a database error - display an ErrorBox
- return new ErrorBox("Database Error","Database error logging in: " + de.getMessage(),tgt);
-
- } // end catch
- catch (AccessError ae)
- { // this indicates a problem with the user account or password
- dlg.resetOnError(ae.getMessage());
-
- } // end catch
-
- setMyLocation(request,tgt); // fake out the location
- return dlg; // go back and redisplay the dialog
-
- } // end if ("login" button clicked)
-
- // the button must be wrong!
- logger.error("no known button click on Account.doPost, cmd=L");
- return new ErrorBox("Internal Error","Unknown command button pressed",tgt);
-
- } // end if ("L" command)
-
- if (cmd.equals("C"))
- { // "C" = Create New Account
- NewAccountDialog dlg = makeNewAccountDialog();
- dlg.setEngine(engine);
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(tgt); // we decided not to create account - go back where we came from
-
- if (dlg.isButtonClicked(request,"create"))
- { // OK, actually want to create the account!
- dlg.loadValues(request); // load field values
-
- try
- { // attempt to create the account
- UserContext uc = dlg.doDialog(request);
- putUserContext(request,uc); // effectively logging in the new user
-
- // now jump to the Verify page
- throw new RedirectResult("account?cmd=V&tgt=" + URLEncoder.encode(tgt));
-
- } // end try
- catch (ValidationException ve)
- { // unable to validate some of the data in the form
- dlg.resetOnError(ve.getMessage() + " Please try again.");
-
- } // end catch
- catch (DataException de)
- { // data error in setting up account
- return new ErrorBox("Database Error","Database error creating account: " + de.getMessage(),tgt);
-
- } // end catch
- catch (AccessError ae)
- { // access error in setting up the account
- dlg.resetOnError(ae.getMessage());
-
- } // end catch
- catch (EmailException ee)
- { // error sending the confirmation email
- return new ErrorBox("E-mail Error","E-mail error creating account: " + ee.getMessage(),tgt);
-
- } // end catch
-
- return dlg; // redisplay me
-
- } // end if ("create" button pressed)
-
- // the button must be wrong!
- logger.error("no known button click on Account.doPost, cmd=C");
- return new ErrorBox("Internal Error","Unknown command button pressed",tgt);
-
- } // end if ("C" command)
-
- if (cmd.equals("V"))
- { // "V" = Verify E-mail Address
- setDisplayLogins(request);
- VerifyEmailDialog dlg = makeVerifyEmailDialog();
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(tgt); // we decided not to bother - go back where we came from
-
- if (dlg.isButtonClicked(request,"again"))
- { // send the confirmation message again
- try
- { // resend the email confirmation
- user.resendEmailConfirmation();
-
- // now force the form to be redisplayed
- dlg.clearAllFields();
- dlg.setTarget(tgt);
-
- } // end try
- catch (DataException de)
- { // database error resending confirmation
- return new ErrorBox("Database Error","Database error sending confirmation: " + de.getMessage(),tgt);
-
- } // end catch
- catch (EmailException ee)
- { // error sending the confirmation email
- return new ErrorBox("E-mail Error","E-mail error sending confirmation: " + ee.getMessage(),tgt);
-
- } // end catch
-
- return dlg; // redisplay the dialog
-
- } // end if ("again" button clicked)
-
- if (dlg.isButtonClicked(request,"ok"))
- { // try to verify the confirmation number
- dlg.loadValues(request); // load field values
-
- try
- { // validate that we have a good number
- dlg.validate();
- user.confirmEmail(dlg.getConfirmationNumber());
-
- // go back to our desired location
- throw new RedirectResult(tgt);
-
- } // end try
- catch (ValidationException ve)
- { // there was a validation error...
- dlg.resetOnError(ve.getMessage() + " Please try again.");
-
- } // end catch
- catch (DataException de)
- { // data error in confirming account
- return new ErrorBox("Database Error","Database error verifying email: " + de.getMessage(),tgt);
-
- } // end catch
- catch (AccessError ae)
- { // invalid confirmation number, perhaps?
- dlg.resetOnError(ae.getMessage());
-
- } // end catch
-
- return dlg; // redisplay the dialog
-
- } // end if ("ok" button clicked)
-
- // the button must be wrong!
- logger.error("no known button click on Account.doPost, cmd=V");
- return new ErrorBox("Internal Error","Unknown command button pressed",tgt);
-
- } // end if ("V" command)
-
- if (cmd.equals("P"))
- { // "P" = Edit User Profile
- setDisplayLogins(request);
- EditProfileDialog dlg = makeEditProfileDialog();
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(tgt); // we decided not to bother - go back where we came from
-
- if (dlg.isButtonClicked(request,"update"))
- { // we're ready to update the user profile
- dlg.loadValues(request); // load field values
-
- boolean photo_flag = true;
- try
- { // validate the dialog and reset profile info
- photo_flag = user.canSetUserPhoto();
- if (dlg.doDialog(user)) // need to reconfirm email address
- throw new RedirectResult("account?cmd=V&tgt=" + URLEncoder.encode(tgt));
- else
- throw new RedirectResult(tgt); // just go straight on back
-
- } // end try
- catch (ValidationException ve)
- { // there was a validation error...
- dlg.resetOnError(photo_flag,ve.getMessage() + " Please try again.");
-
- } // end catch
- catch (DataException de)
- { // data error in changing profile
- return new ErrorBox("Database Error","Database error updating profile: " + de.getMessage(),tgt);
-
- } // end catch
- catch (EmailException ee)
- { // error sending the confirmation email
- return new ErrorBox("E-mail Error","E-mail error sending confirmation: " + ee.getMessage(),tgt);
-
- } // end catch
-
- return dlg; // redisplay dialog
-
- } // end if ("update" button clicked)
-
- // the button must be wrong!
- logger.error("no known button click on Account.doPost, cmd=P");
- return new ErrorBox("Internal Error","Unknown command button pressed",tgt);
-
- } // end if
-
- // unknown command
- logger.error("invalid command to Account.doPost: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to Account.doPost",tgt);
-
- } // end doVenicePost
-
-} // end class Account
diff --git a/src/com/silverwrist/venice/servlets/AdminUserPhoto.java b/src/com/silverwrist/venice/servlets/AdminUserPhoto.java
deleted file mode 100644
index 67f3fae..0000000
--- a/src/com/silverwrist/venice/servlets/AdminUserPhoto.java
+++ /dev/null
@@ -1,203 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.util.image.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class AdminUserPhoto extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(AdminUserPhoto.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "AdminUserPhoto servlet - changes the user photo for a user\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
- {
- try
- { // get the user to be modified
- AdminOperations adm = user.getAdminInterface();
- String s_uid = request.getParameter("uid");
- if (s_uid==null)
- throw new ErrorBox(null,"User ID parameter not found.","sysadmin?cmd=UF");
- AdminUserContext admuser = adm.getUserContext(Integer.parseInt(s_uid));
-
- if (request.getParameter("null")!=null)
- { // null the photo out and return
- ContactInfo ci = admuser.getContactInfo();
- ci.setPhotoURL(null);
- admuser.putContactInfo(ci);
- throw new RedirectResult("sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end if
-
- return new AdminUserPhotoData(engine,admuser,rdat);
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to retrieve user information: " + de.getMessage(),
- "sysadmin?cmd=UF");
-
- } // end catch
- catch (NumberFormatException nfe)
- { // this is if we get a bogus UID
- return new ErrorBox(null,"Invalid user ID parameter.","sysadmin?cmd=UF");
-
- } // end catch
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- AdminUserContext admuser;
- try
- { // get the user to be modified
- AdminOperations adm = user.getAdminInterface();
- String s_uid = mphandler.getValue("uid");
- if (s_uid==null)
- throw new ErrorBox(null,"User ID parameter not found.","sysadmin?cmd=UF");
- admuser = adm.getUserContext(Integer.parseInt(s_uid));
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to retrieve user information: " + de.getMessage(),
- "sysadmin?cmd=UF");
-
- } // end catch
- catch (NumberFormatException nfe)
- { // this is if we get a bogus UID
- return new ErrorBox(null,"Invalid user ID parameter.","sysadmin?cmd=UF");
-
- } // end catch
-
- if (isImageButtonClicked(mphandler,"cancel"))
- throw new RedirectResult("sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- if (isImageButtonClicked(mphandler,"upload"))
- { // uploading the image here!
- // also check on file parameter status
- if (!(mphandler.isFileParam("thepic")))
- { // bogus file parameter
- logger.error("Internal Error: 'thepic' should be a file param");
- return new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
- "sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end if
-
- if (!(mphandler.getContentType("thepic").startsWith("image/")))
- { // must be an image type we uploaded!
- logger.error("Error: 'thepic' not an image type");
- return new ErrorBox(null,"You did not upload an image file. Try again.",
- "sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end if
-
- try
- { // get the real picture (normalized to 100x100 size)
- ImageLengthPair real_pic = ImageNormalizer.normalizeImage(mphandler.getFileContentStream("thepic"),
- engine.getUserPhotoSize(),"jpeg");
-
- // set the user photo data!
- ContactInfo ci = admuser.getContactInfo();
- ci.setPhotoData(request.getContextPath() + "/imagedata/","image/jpeg",real_pic.getLength(),
- real_pic.getData());
- admuser.putContactInfo(ci);
-
- // Jump back to the profile form.
- throw new RedirectResult("sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end try
- catch (ServletMultipartException smpe)
- { // the servlet multipart parser screwed up
- logger.error("Servlet multipart error:",smpe);
- return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),
- "sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end catch
- catch (ImageNormalizerException ine)
- { // the image was not valid
- logger.error("Image normalizer error:",ine);
- return new ErrorBox(null,ine.getMessage(),"admuserphoto?uid=" + admuser.getUID());
-
- } // end catch
- catch (DataException de)
- { // error in the database!
- logger.error("DataException:",de);
- return new ErrorBox("Database Error","Database error storing user photo: " + de.getMessage(),
- "sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end catch
-
- } // end if
- else
- { // the button must be wrong!
- logger.error("no known button click on AdminUserPhoto.doPost");
- return new ErrorBox("Internal Error","Unknown command button pressed",
- "sysadmin?cmd=UM&uid=" + admuser.getUID());
-
- } // end else
-
- } // end doVenicePost
-
-} // end class AdminUserPhoto
diff --git a/src/com/silverwrist/venice/servlets/Attachment.java b/src/com/silverwrist/venice/servlets/Attachment.java
deleted file mode 100644
index 26208f5..0000000
--- a/src/com/silverwrist/venice/servlets/Attachment.java
+++ /dev/null
@@ -1,175 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class Attachment extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(Attachment.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "Attachment servlet - Handles uploading and downloading attachments\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
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
-
- // get the message we want to use
- TopicMessageContext msg = getMessageParameter(request,conf,true,"top");
-
- String type, filename;
- int length;
- InputStream data;
-
- try
- { // retrieve the information about the attachment
- type = msg.getAttachmentType();
- filename = msg.getAttachmentFilename();
- length = msg.getAttachmentLength();
- if (logger.isInfoEnabled())
- logger.info("Uploaded file: " + filename + "(type " + type + ", " + length + " bytes)");
- data = msg.getAttachmentData();
-
- } // end try
- catch (AccessError ae)
- { // unable to access the data stream
- return new ErrorBox("Access Error",ae.getMessage(),"top");
-
- } // end catch
- catch (DataException de)
- { // error getting at the data stream from the attachment
- return new ErrorBox("Database Error","Database error retrieving attachment: " + de.getMessage(),"top");
-
- } // end catch
-
- // now we want to send that data back to the user!
- throw new SendFileResult(type,filename,length,data);
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- logger.debug("Attachment.doVenicePost: entry");
-
- // Get target URL for the operation
- if (mphandler.isFileParam("target"))
- { // bogus target URL
- logger.error("Internal Error: 'target' should be a normal param");
- return new ErrorBox(null,"Internal Error: 'target' should be a normal param","top");
-
- } // end if
-
- String target = mphandler.getValue("target");
- if (logger.isDebugEnabled())
- logger.debug("Target URL: " + target);
- setMyLocation(request,target);
-
- // also check on file parameter status
- if (!(mphandler.isFileParam("thefile")))
- { // bogus file parameter
- logger.error("Internal Error: 'thefile' should be a file param");
- return new ErrorBox(null,"Internal Error: 'thefile' should be a file param",target);
-
- } // end if
-
- // get the community
- CommunityContext comm = getCommunityParameter(mphandler,user,true,"top");
- if (logger.isDebugEnabled())
- logger.debug("community param: #" + comm.getCommunityID());
- changeMenuCommunity(request,comm);
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(mphandler,comm,true,"top");
- if (logger.isDebugEnabled())
- logger.debug("Conference param: #" + conf.getConfID());
-
- // get the message we want to use
- TopicMessageContext msg = getMessageParameter(mphandler,conf,true,"top");
- if (logger.isDebugEnabled())
- logger.debug("Message param: #" + msg.getPostID());
-
- try
- { // attach the data to the message!
- msg.attachData(mphandler.getContentType("thefile"),mphandler.getValue("thefile"),
- mphandler.getContentSize("thefile"),mphandler.getFileContentStream("thefile"));
-
- } // end try
- catch (ServletMultipartException smpe)
- { // error processing the file parameter data
- logger.error("Servlet multipart error:",smpe);
- return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),target);
-
- } // end catch
- catch (AccessError ae)
- { // access error posting the attachment data
- logger.error("Access error:",ae);
- return new ErrorBox("Access Error",ae.getMessage(),target);
-
- } // end catch
- catch (DataException de)
- { // error storing the attachment in the database
- logger.error("DataException:",de);
- return new ErrorBox("Database Error","Database error storing attachment: " + de.getMessage(),target);
-
- } // end catch
-
- logger.debug("Attachment.doVenicePost: done!");
- throw new RedirectResult(target); // get back, get back, get back to where you once belonged
-
- } // end doVenicePost
-
-} // end class Attachment
diff --git a/src/com/silverwrist/venice/servlets/CommunityAdmin.java b/src/com/silverwrist/venice/servlets/CommunityAdmin.java
deleted file mode 100644
index ff82171..0000000
--- a/src/com/silverwrist/venice/servlets/CommunityAdmin.java
+++ /dev/null
@@ -1,649 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class CommunityAdmin extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String DELETE_CONFIRM_ATTR = "servlets.CommunityAdmin.delete.confirm";
- private static final String DELETE_CONFIRM_PARAM = "confirm";
-
- private static Category logger = Category.getInstance(CommunityAdmin.class);
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private CommunityAdminTop makeCommunityAdminTop() throws ServletException
- {
- final String desired_name = "CommunityAdminTop";
- MenuPanelCache cache = MenuPanelCache.getMenuPanelCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- CommunityAdminTop template = new CommunityAdminTop();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (CommunityAdminTop)(cache.getNewMenuPanel(desired_name));
-
- } // end makeCommunityAdminTop
-
- private EditCommunityProfileDialog makeEditCommunityProfileDialog(SecurityInfo sinf) throws ServletException
- {
- final String desired_name = "EditCommunityProfileDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- EditCommunityProfileDialog template = new EditCommunityProfileDialog(sinf);
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (EditCommunityProfileDialog)(cache.getNewDialog(desired_name));
-
- } // end makeEditCommunityProfileDialog
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "CommunityAdmin servlet - Administrative functions for communities\n"
- + "Part of the Venice Web Communities System\n";
- return rc;
-
- } // end getServletInfo
-
- /*--------------------------------------------------------------------------------
- * Overrides from class VeniceServlet
- *--------------------------------------------------------------------------------
- */
-
- /* Command values for CommunityAdmin:
- * A = Display Audit Records
- * DEL = Delete Community
- * F = Set Features/Services (not implemented yet)
- * I = E-Mail to All Members
- * M = Membership Control
- * P = Edit Profile
- * T = Set Category
- */
- protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the community context
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- setMyLocation(request,"sigadmin?" + request.getQueryString());
- String on_error = "sigadmin?sig=" + comm.getCommunityID();
-
- if (logger.isDebugEnabled())
- logger.debug("CommunityAdmin/doGet operating on community \"" + comm.getName() + "\" ("
- + comm.getCommunityID() + ")");
-
- // now decide what to do based on the "cmd" parameter
- String cmd = getStandardCommandParam(request);
- if (logger.isDebugEnabled())
- logger.debug("CommunityAdmin/doGet command value = " + cmd);
-
- if (cmd.equals("P"))
- { // "P" = "Edit Profile"
- if (!(comm.canModifyProfile()))
- { // no access - sorry, dude
- logger.error("tried to call up community profile screen without access...naughty naughty!");
- return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
- on_error);
-
- } // end if
-
- // construct the edit profile dialog and load it up for use
- EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog(comm.getSecurityInfo());
-
- try
- { // load the values for this dialog
- dlg.setupDialog(engine,comm);
-
- } // end try
- catch (DataException de)
- { // we could not load the values because of a data exception
- logger.error("DB error loading community profile: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error retrieving profile: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // we don't have enough privilege
- logger.error("Access error loading community profile: " + ae.getMessage(),ae);
- return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
- on_error);
-
- } // end catch
-
- return dlg; // display me!
-
- } // end if ("P" command)
-
- if (cmd.equals("T"))
- { // "T" = "Set Category"
- if (!(comm.canModifyProfile()))
- { // no access - sorry man
- logger.error("tried to call up community category set screen without access...naughty naughty!");
- return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
- on_error);
-
- } // end else
-
- // did they actually send a "set" parameter?
- String p = request.getParameter("set");
- if (!(StringUtil.isStringEmpty(p)))
- { // OK, we're setting the category ID...
- try
- { // get the new category ID and set it
- int catid = Integer.parseInt(p);
- if (!(engine.isValidCategoryID(catid)))
- throw new NumberFormatException(); // dump the category if it's not valid
-
- // change the category ID
- comm.setCategoryID(catid);
-
- } // end try
- catch (NumberFormatException nfe)
- { // we got an invalid category value...
- return new ErrorBox("Invalid Input","Invalid category ID passed to category browser.",on_error);
-
- } // end catch
- catch (DataException de)
- { // unable to update the community properly
- logger.error("DB error updating community: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
- on_error);
-
- } // end catch
- catch (AccessError ae)
- { // database access error - display an error box
- logger.error("Access error updating community: " + ae.getMessage(),ae);
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
-
- // now that it's set, go back to the admin menu
- throw new RedirectResult(on_error);
-
- } // end if (setting category ID)
- else
- { // we're browsing - try and figure out what to display
- try
- { // get the "go" parameter to see what the current category ID is
- p = request.getParameter("go");
- int curr_catid;
- if (StringUtil.isStringEmpty(p))
- curr_catid = comm.getCategoryID();
- else
- curr_catid = Integer.parseInt(p);
-
- if (!(engine.isValidCategoryID(curr_catid)))
- throw new NumberFormatException(); // dump the category if it's not valid
-
- // create the browser panel and let it rip
- return new CommunityCategoryBrowseData(user,comm,curr_catid);
-
- } // end try
- catch (NumberFormatException nfe)
- { // we got an invalid category value...
- return new ErrorBox("Invalid Input","Invalid category ID passed to category browser.",on_error);
-
- } // end catch
- catch (DataException de)
- { // unable to get the categories properly
- logger.error("DB error browsing categories: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error browsing categories: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end else
-
- } // end if ("T" command)
-
- if (cmd.equals("M"))
- { // "M" = Set Membership
- if (!(comm.canModifyProfile()))
- { // no access - sorry man
- logger.error("tried to call up membership set screen without access...naughty naughty!");
- return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
- on_error);
-
- } // end else
-
- try
- { // display the conference member list!
- CommunityMembership m = new CommunityMembership(engine,comm);
- m.doCommunityMemberList();
- setMyLocation(request,"sigadmin?sig=" + comm.getCommunityID() + "&cmd=M");
- return m;
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error listing community members: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if ("M" command)
-
- if (cmd.equals("A"))
- { // "A" = "Display Audit Records"
- try
- {
- int offset = 0;
- try
- { // convert the offset parameter
- String s_ofs = request.getParameter("ofs");
- if (!StringUtil.isStringEmpty(s_ofs))
- offset = Integer.parseInt(s_ofs);
-
- } // end try
- catch (NumberFormatException nfe)
- { // if it's untranslatable, set it at 0
- offset = 0;
-
- } // end catch
-
- // generate the lists
- List audit_list = comm.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
- int audit_count = comm.getAuditRecordCount();
-
- // return the audit viewer
- return new AuditDataViewer(engine,audit_list,offset,audit_count,"Audit Records for Community \""
- + comm.getName() + "\"","sigadmin?sig=" + comm.getCommunityID()
- + "&cmd=A&ofs=%");
-
- } // end try
- catch (AccessError ae)
- { // you don't have access
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error getting audit records: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if ("A" command)
-
- if (cmd.equals("I"))
- { // "I" = "Send E-Mail To All Members"
- if (!(comm.canMassMail()))
- { // we can't send mass mail to the community, so what are we doing here?
- logger.error("you can't mass-mail the community - not gonna do it, wouldn't be prudent");
- return new ErrorBox("Access Error","You do not have permission to sent mass mail to this community.",
- on_error);
-
- } // end if
-
- return new CommunityEMail(comm); // return the view object
-
- } // end if ("I" command)
-
- if (cmd.equals("DEL"))
- { // "DEL" = "Delete Community" (requires a confirmation)
- if (!(comm.canDelete()))
- { // we can't delete the community, so what are we doing here?
- logger.error("you can't delete the community - not gonna do it, wouldn't be prudent");
- return new ErrorBox("Access Error","You do not have permission to delete this community.",on_error);
-
- } // end if
-
- if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
- { // we are confirmed - delete the community!
- try
- { // delete the community!
- comm.delete();
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- logger.error("Database error deleting community: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error deleting community: " + de.getMessage(),
- on_error);
-
- } // end catch
- catch (AccessError ae)
- { // access error changing the community values
- logger.error("Access error deleting community: " + ae.getMessage(),ae);
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
-
- // the community is now GONE - there's noplace else to go but back to the Top page
- throw new RedirectResult("top");
-
- } // end if
- else
- { // throw up a confirm box to let the user think it over
- String message = "You are about to permanently delete the \"" + comm.getName() + "\" community, "
- + "including all conferences and other resources it contains! Are you sure you want "
- + "to do this?";
- return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Conference",message,
- on_error + "&cmd=DEL",on_error);
-
- } // end else
-
- } // end if ("DEL" command)
-
- // all unknown requests get turned into menu display requests
- if (!(comm.canAdministerCommunity()))
- { // no access - sorry buddy
- logger.error("tried to call up community admin menu without access...naughty naughty!");
- return new ErrorBox("Access Error","You do not have access to administer this community.",on_error);
-
- } // end if
-
- // create a community administration menu
- CommunityAdminTop menu = makeCommunityAdminTop();
- menu.setCommunity(comm);
- return menu;
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the community context
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String on_error = "sigadmin?sig=" + comm.getCommunityID();
- setMyLocation(request,on_error);
-
- if (logger.isDebugEnabled())
- logger.debug("CommunityAdmin/doPost operating on community \"" + comm.getName() + "\" ("
- + comm.getCommunityID() + ")");
-
- // now decide what to do based on the "cmd" parameter
- String cmd = getStandardCommandParam(request);
- if (logger.isDebugEnabled())
- logger.debug("CommunityAdmin/doPost command value = " + cmd);
-
- if (cmd.equals("P"))
- { // "P" = "Edit Profile"
- if (!(comm.canModifyProfile()))
- { // no access - sorry, dude
- logger.error("tried to call up community profile screen without access...naughty naughty!");
- return new ErrorBox("Unauthorized","You do not have access to modify this community's profile.",
- on_error);
-
- } // end if
-
- // construct the edit profile dialog and load it up for use
- EditCommunityProfileDialog dlg = makeEditCommunityProfileDialog(comm.getSecurityInfo());
- dlg.setupDialogBasic(engine,comm);
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(on_error); // go back - they canceled out
-
- if (dlg.isButtonClicked(request,"update"))
- { // begin updating the community's contents
- dlg.loadValues(request); // do value loading now
-
- try
- { // attempt to change the community profile now...
- dlg.doDialog(comm);
-
- // now jump back to the main menu
- clearMenu(request);
- throw new RedirectResult(on_error);
-
- } // end try
- catch (ValidationException ve)
- { // simple validation exception
- if (logger.isDebugEnabled())
- logger.debug("validation failure: " + ve.getMessage());
- dlg.resetOnError(comm,ve.getMessage() + " Please try again.");
-
- } // end catch
- catch (DataException de)
- { // database error updating the community values
- logger.error("DB error updating community: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error updating community: " + de.getMessage(),
- on_error);
-
- } // end catch
- catch (AccessError ae)
- { // access error changing the community values
- logger.error("Access error updating community: " + ae.getMessage(),ae);
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
-
- return dlg;
-
- } // end if ("update" pressed)
-
- // what the hell was that button?
- logger.error("no known button click on CommunityAdmin.doPost, cmd=P");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("P" command)
-
- if (cmd.equals("M"))
- { // "M" = Modify Community Membership
- on_error += "&cmd=M";
- setMyLocation(request,on_error);
-
- if (!(comm.canModifyProfile()))
- { // no access - sorry, dude
- logger.error("tried to call up community membership screen without access...naughty naughty!");
- return new ErrorBox("Unauthorized","You do not have access to modify this community's membership.",
- on_error);
-
- } // end if
-
- if (isImageButtonClicked(request,"update"))
- { // the "update" command that changes all the security levels
- HashMap org_vals = new HashMap();
- HashMap new_vals = new HashMap();
- try
- { // retrieve all parameters and filter them for the levels
- Enumeration p_names = request.getParameterNames();
- while (p_names.hasMoreElements())
- { // examine each parameter name in turn
- String p_name = (String)(p_names.nextElement());
- if (p_name.startsWith("zxcur_"))
- { // this is a current value (from a hidden field)
- int uid = Integer.parseInt(p_name.substring(6));
- int level = Integer.parseInt(request.getParameter(p_name));
- org_vals.put(new Integer(uid),new Integer(level));
-
- } // end if
- else if (p_name.startsWith("zxnew_"))
- { // this is a new value (from a dropdown list box)
- int uid = Integer.parseInt(p_name.substring(6));
- int level = Integer.parseInt(request.getParameter(p_name));
- new_vals.put(new Integer(uid),new Integer(level));
-
- } // end else if
-
- } // end while
-
- if (org_vals.size()!=new_vals.size())
- { // we read the wrong number of parameters - this is bad
- logger.error("level parameters mismatch (" + org_vals.size() + " old, " + new_vals.size()
- + " new)");
- return new ErrorBox(null,"Invalid parameters.",on_error);
-
- } // end if
-
- } // end try
- catch (NumberFormatException nfe)
- { // error converting the parameters
- logger.error("got number format exception parsing a level parameter");
- return new ErrorBox(null,"Invalid parameter conversion.",on_error);
-
- } // end catch
-
- try
- { // loop through the hashmaps and set the value
- Iterator it = org_vals.keySet().iterator();
- while (it.hasNext())
- { // extract the UID, old level, and new level
- Integer uid = (Integer)(it.next());
- Integer org_level = (Integer)(org_vals.get(uid));
- Integer new_level = (Integer)(new_vals.get(uid));
- if (new_level==null)
- { // whoops
- logger.error("new community level not found for uid " + uid.intValue());
- return new ErrorBox(null,"Invalid new level parameter.",on_error);
-
- } // end if
-
- int new_level_x = new_level.intValue();
- if (new_level_x==0)
- new_level_x = -1;
-
- // call down to set the membership level
- if (org_level.intValue()!=new_level_x)
- { // we need to reset the community membership
- if (logger.isDebugEnabled())
- logger.debug("resetting community member level for uid " + uid.intValue() + "(old = "
- + org_level.intValue() + ", new = " + new_level_x + ")");
- comm.setMembership(uid.intValue(),new_level_x);
-
- } // end if
-
- } // end while
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- logger.error("AccessError on comm.setMembership: " + ae.getMessage(),ae);
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- logger.error("DataException on comm.setMembership: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error setting memberships: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- // trap back to the community membership display
- throw new RedirectResult(on_error);
-
- } // end if ("update" clicked)
-
- if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
- || isImageButtonClicked(request,"next"))
- { // create the new dialog box
- CommunityMembership m = new CommunityMembership(engine,comm);
-
- try
- { // perform the search!
- m.doSearch(request);
-
- } // end try
- catch (ValidationException ve)
- { // validation error - throw it back to the user
- return new ErrorBox(null,ve.getMessage() + " Please try again.",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
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error searching for users: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- return m;
-
- } // end if (search function clicked)
-
- // we don't know what button was pressed
- logger.error("no known button click on CommunityAdmin.doPost, cmd=M");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("M" command)
-
- if (cmd.equals("I"))
- { // "I" - "Send E-Mail To Community"
- if (!(comm.canMassMail()))
- { // we can't send mass mail to the community, so what are we doing here?
- logger.error("you can't mass-mail the community - not gonna do it, wouldn't be prudent");
- return new ErrorBox("Access Error","You do not have permission to sent mass mail to this community.",
- on_error);
-
- } // end if
-
- try
- { // attempt to do the mass mailing!
- comm.massMail(request.getParameter("subj"),request.getParameter("pb"));
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error getting mailing list: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- throw new RedirectResult(on_error); // bounce back to the menu
-
- } // end if ("I" command)
-
- // on unknown command, redirect to the GET function
- return doVeniceGet(request,engine,user,rdat);
-
- } // end doVenicePost
-
-} // end class CommunityAdmin
diff --git a/src/com/silverwrist/venice/servlets/CommunityLogo.java b/src/com/silverwrist/venice/servlets/CommunityLogo.java
deleted file mode 100644
index 3f0e48b..0000000
--- a/src/com/silverwrist/venice/servlets/CommunityLogo.java
+++ /dev/null
@@ -1,169 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.util.image.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class CommunityLogo extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(CommunityLogo.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "CommunityLogo servlet - changes the community logo for a community\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
- {
- // Get the community.
- CommunityContext comm = getCommunityParameter(request,user,true,null);
- changeMenuCommunity(request,comm);
- if (!(comm.canModifyProfile()))
- return new ErrorBox("Community Error","You are not permitted to modify this community's profile.",null);
-
- try
- { // create the display
- return new CommunityLogoData(engine,comm,rdat);
-
- } // end try
- catch (DataException de)
- { // error getting at the data stream from the attachment
- return new ErrorBox("Database Error","Database error generating display: " + de.getMessage(),
- "sigadmin?cmd=P&sig=" + comm.getCommunityID());
-
- } // end catch
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // Get the community.
- CommunityContext comm = getCommunityParameter(mphandler,user,true,null);
- changeMenuCommunity(request,comm);
- String target = "sigadmin?cmd=P&sig=" + comm.getCommunityID();
- if (!(comm.canModifyProfile()))
- return new ErrorBox("Community Error","You are not permitted to modify this community's profile.",
- target);
-
- if (isImageButtonClicked(mphandler,"cancel"))
- throw new RedirectResult(target);
-
- if (isImageButtonClicked(mphandler,"upload"))
- { // uploading the image here!
- // also check on file parameter status
- if (!(mphandler.isFileParam("thepic")))
- { // bogus file parameter
- logger.error("Internal Error: 'thepic' should be a file param");
- return new ErrorBox(null,"Internal Error: 'thepic' should be a file param",target);
-
- } // end if
-
- if (!(mphandler.getContentType("thepic").startsWith("image/")))
- { // must be an image type we uploaded!
- logger.error("Error: 'thepic' not an image type");
- return new ErrorBox(null,"You did not upload an image file. Try again.",
- "commlogo?sig=" + comm.getCommunityID());
-
- } // end if
-
- try
- { // get the real picture (normalized to 110x65 size)
- ImageLengthPair real_pic = ImageNormalizer.normalizeImage(mphandler.getFileContentStream("thepic"),
- engine.getCommunityLogoSize(),"jpeg");
-
- // set the community logo data!
- ContactInfo ci = comm.getContactInfo();
- ci.setPhotoData(request.getContextPath() + "/imagedata/","image/jpeg",real_pic.getLength(),
- real_pic.getData());
- comm.putContactInfo(ci);
-
- // Jump back to the profile form.
- clearMenu(request); // allow the menu to be redisplayed
- throw new RedirectResult(target);
-
- } // end try
- catch (ServletMultipartException smpe)
- { // the servlet multipart parser screwed up
- logger.error("Servlet multipart error:",smpe);
- return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),target);
-
- } // end catch
- catch (ImageNormalizerException ine)
- { // the image was not valid
- logger.error("Image normalizer error:",ine);
- return new ErrorBox(null,ine.getMessage(),"commlogo?sig=" + comm.getCommunityID());
-
- } // end catch
- catch (DataException de)
- { // error in the database!
- logger.error("DataException:",de);
- return new ErrorBox("Database Error","Database error storing community logo: " + de.getMessage(),
- target);
-
- } // end catch
- catch (AccessError ae)
- { // email exception (WTF?)
- logger.error("Access error:",ae);
- return new ErrorBox(null,"Access error: " + ae.getMessage(),target);
-
- } // end catch
-
- } // end if
- else
- { // the button must be wrong!
- logger.error("no known button click on CommunityLogo.doPost");
- return new ErrorBox("Internal Error","Unknown command button pressed",target);
-
- } // end else
-
- } // end doVenicePost
-
-} // end class CommunityLogo
diff --git a/src/com/silverwrist/venice/servlets/CommunityOperations.java b/src/com/silverwrist/venice/servlets/CommunityOperations.java
deleted file mode 100644
index 13c3077..0000000
--- a/src/com/silverwrist/venice/servlets/CommunityOperations.java
+++ /dev/null
@@ -1,476 +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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class CommunityOperations extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String UNJOIN_CONFIRM_ATTR = "servlets.CommunityOperations.unjoin.confirm";
- private static final String UNJOIN_CONFIRM_PARAM = "confirm";
-
- private static Category logger = Category.getInstance(CommunityOperations.class);
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private JoinKeyDialog makeJoinKeyDialog()
- {
- final String desired_name = "JoinKeyDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- JoinKeyDialog template = new JoinKeyDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (JoinKeyDialog)(cache.getNewDialog(desired_name));
-
- } // end makeJoinKeyDialog
-
- private CreateCommunityDialog makeCreateCommunityDialog() throws ServletException
- {
- final String desired_name = "CreateCommunityDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- CreateCommunityDialog template = new CreateCommunityDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (CreateCommunityDialog)(cache.getNewDialog(desired_name));
-
- } // end makeCreateCommunityDialog
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "CommunityOperations servlet - General community operations (join, unjoin, etc.)\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
- {
- // get the command we want to use
- String cmd = getStandardCommandParam(request);
- setMyLocation(request,"sigops?" + request.getQueryString());
-
- if (cmd.equals("J"))
- { // "J" = "Join" (requires community parameter)
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
-
- if (!(comm.canJoin())) // not permitted to join!
- return new ErrorBox("Community Error","You are not permitted to join this community.","top");
-
- if (comm.isPublicCommunity())
- { // attempt to join right now! (no join key required)
- try
- { // call down to join the community
- comm.join(null);
-
- // success! display the "welcome" page
- clearMenu(request); // force the clear to regen the menus
- changeMenuCommunity(request,comm);
- return new CommunityWelcome(comm);
-
- } // end try
- catch (AccessError ae)
- { // access error
- return new ErrorBox("Access Error","Unable to join community: " + ae.getMessage(),"top");
-
- } // end catch
- catch (DataException de)
- { // data exception doing something
- return new ErrorBox("Database Error","Database error joining community: " + de.getMessage(),"top");
-
- } // end catch
-
- } // end if (public community)
- else
- { // we need to prompt them for the join key....
- JoinKeyDialog dlg = makeJoinKeyDialog();
- dlg.setupDialog(comm);
- changeMenuCommunity(request,comm);
- return dlg;
-
- } // end else (private community)
-
- } // end if ("J" command)
-
- if (cmd.equals("U"))
- { // "U" = "Unjoin (requires community parameter)
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
-
- if (!(comm.canUnjoin()))
- return new ErrorBox("Community Error","You cannot unjoin this community.","top");
-
- // OK, let's test for a confirmation...
- if (ConfirmBox.isConfirmed(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM))
- { // OK, if you say so, let's unjoin!
- try
- { // do the unjoin now...
- comm.unjoin();
-
- } // end try
- catch (AccessError ae)
- { // access error
- return new ErrorBox("Access Error","Unable to unjoin community: " + ae.getMessage(),"top");
-
- } // end catch
- catch (DataException de)
- { // data exception doing something
- return new ErrorBox("Database Error","Database error unjoining community: " + de.getMessage(),"top");
-
- } // end catch
-
- // after which, redirect back to the top
- clearMenu(request);
- throw new RedirectResult("top");
-
- } // end if
- else
- { // not a proper confirmation - display the confirm box
- String message = "Are you sure you want to unjoin the '" + comm.getName() + "' community?";
- return new ConfirmBox(request,UNJOIN_CONFIRM_ATTR,UNJOIN_CONFIRM_PARAM,"Unjoining community",
- message,"sigops?cmd=U&sig=" + comm.getCommunityID(),"sig/" + comm.getAlias());
-
- } // end else
-
- } // end if ("U" command)
-
- if (cmd.equals("C"))
- { // "C" - Create community (no parameters)
- if (!(user.canCreateCommunity()))
- return new ErrorBox("Community Error","You are not permitted to create communities.","top");
-
- // present the "Create New Community" dialog
- CreateCommunityDialog dlg = makeCreateCommunityDialog();
- dlg.setupDialog(engine);
- dlg.setFieldValue("language","en-US");
- dlg.setFieldValue("country","US");
- changeMenuTop(request);
- return dlg;
-
- } // end if ("C" command)
-
- if (cmd.equals("I"))
- { // "I" - Send Invitation (requires community parameter)
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
-
- if (!(comm.canSendInvitation()))
- return new ErrorBox("Community Error","You are not permitted to send an invitation.",
- "sig/" + comm.getAlias());
-
- // get conference and topic parameters
- ConferenceContext conf = getConferenceParameter(request,comm,false,"sig/" + comm.getAlias());
- TopicContext topic = null;
- if (conf!=null)
- topic = getTopicParameter(request,conf,false,
- "confops?cmd=Q&sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID());
-
- // present the "Invitation" dialog
- return new Invitation(comm,conf,topic);
-
- } // end if ("I" command)
-
- if (cmd.equals("M"))
- { // "M" = List Members
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- if (logger.isDebugEnabled())
- logger.debug("Member list for community: " + comm.getName());
-
- try
- { // return the view dialog
- ViewCommunityMembers view = new ViewCommunityMembers(engine,comm);
- view.doInitialList();
- changeMenuCommunity(request,comm);
- return view;
-
- } // end try
- catch (DataException de)
- { // unable to get community members list
- return new ErrorBox("Database Error","Database error getting community members list: "
- + de.getMessage(),"top");
-
- } // end catch
-
- } // end if ("M" command)
-
- // this is an error!
- logger.error("invalid command to CommunityOperations.doGet: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doGet","top");
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the command we want to use
- String cmd = getStandardCommandParam(request);
- setMyLocation(request,"sigops?cmd=" + cmd);
-
- if (cmd.equals("J"))
- { // "J" = Join Community (requires community parameter)
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- setMyLocation(request,"sigops?cmd=J&sig=" + comm.getCommunityID());
- JoinKeyDialog dlg = makeJoinKeyDialog();
-
- if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to community opening page
- throw new RedirectResult("sig/" + comm.getAlias());
-
- if (!(comm.canJoin())) // not permitted to join!
- return new ErrorBox("Community Error","You are not permitted to join this community.","top");
-
- if (dlg.isButtonClicked(request,"join"))
- { // OK, go join the community
- dlg.loadValues(request); // load the dialog
-
- try
- { // attempt to join the community!
- dlg.doDialog(comm);
-
- // success! display the "welcome" page
- clearMenu(request); // force the clear to regen the menus
- changeMenuCommunity(request,comm);
- return new CommunityWelcome(comm);
-
- } // end try
- catch (ValidationException ve)
- { // here, a validation exception causes us to recycle and retry
- dlg.resetOnError(ve.getMessage() + " Please try again.");
- changeMenuCommunity(request,comm);
-
- } // end catch
- catch (AccessError ae)
- { // this is probably a bogus key - let them retry
- dlg.resetOnError(ae.getMessage() + " Please try again.");
- changeMenuCommunity(request,comm);
-
- } // end catch
- catch (DataException de)
- { // database error joining something
- return new ErrorBox("Database Error","Database error joining community: " + de.getMessage(),"top");
-
- } // end catch
-
- return dlg; // recycle and try aagin
-
- } // end if ("join" clicked)
-
- // error - don't know what button was clicked
- logger.error("no known button click on CommunityOperations.doPost, cmd=J");
- return new ErrorBox("Internal Error","Unknown command button pressed","top");
-
- } // end if ("J" command)
-
- if (cmd.equals("C"))
- { // "C" = Create New Community
- if (!(user.canCreateCommunity()))
- { // EJB 11/25/2001 - give a different error message if they're not logged in
- if (user.isLoggedIn())
- return new ErrorBox("Community Error","You are not permitted to create communities.","top");
- else
- return new LogInOrCreate("sigops?cmd=C");
-
- } // end if
-
- // load the "Create Communities" dialog
- CreateCommunityDialog dlg = makeCreateCommunityDialog();
- dlg.setupDialog(engine);
-
- if (dlg.isButtonClicked(request,"cancel")) // cancel - go back to top
- throw new RedirectResult("top");
-
- if (dlg.isButtonClicked(request,"create"))
- { // OK, they actually want to create the new community...
- dlg.loadValues(request); // load the form data
-
- try
- { // attempt to create the community!
- CommunityContext comm = dlg.doDialog(user);
-
- // created successfully - display a "new community welcome" page
- changeMenuCommunity(request,comm); // display menus for the first time!
- return new NewCommunityWelcome(comm);
-
- } // end try
- catch (ValidationException ve)
- { // here, a validation exception causes us to recycle and retry
- dlg.resetOnError(ve.getMessage() + " Please try again.");
- changeMenuTop(request);
-
- } // end catch
- catch (AccessError ae)
- { // this is probably a bogus key - let them retry
- dlg.resetOnError(ae.getMessage() + " Please try again.");
- changeMenuTop(request);
-
- } // end catch
- catch (DataException de)
- { // database error doing something
- return new ErrorBox("Database Error","Database error creating community: " + de.getMessage(),"top");
-
- } // end catch
-
- return dlg; // put the dialog back up
-
- } // end if ("create" pressed)
-
- // error - don't know what button was clicked
- logger.error("no known button click on CommunityOperations.doPost, cmd=C");
- return new ErrorBox("Internal Error","Unknown command button pressed","top");
-
- } // end if ("C" command)
-
- if (cmd.equals("I"))
- { // "I" = Send invitation (requires community parameter)
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- setMyLocation(request,"sigops?cmd=I&sig=" + comm.getCommunityID());
- String on_error = "sig/" + comm.getAlias();
-
- // get conference and topic parameters
- ConferenceContext conf = getConferenceParameter(request,comm,false,on_error);
- if (conf!=null)
- on_error = "confops?cmd=Q&sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- TopicContext topic = null;
- if (conf!=null)
- { // try and get a topic parameter
- topic = getTopicParameter(request,conf,false,on_error);
- if (topic!=null)
- on_error = "topicops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
- + topic.getTopicNumber();
-
- } // end if
-
- if (isImageButtonClicked(request,"cancel")) // cancel - go back to community opening page
- throw new RedirectResult(on_error);
-
- if (isImageButtonClicked(request,"send"))
- { // the "send" button was pressed
- try
- { // send out the invitation
- if (topic!=null)
- topic.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
- else if (conf!=null)
- conf.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
- else
- comm.sendInvitation(request.getParameter("addr"),request.getParameter("pb"));
-
- } // end try
- catch (AccessError ae)
- { // access error - display error box
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error doing something
- return new ErrorBox("Database Error","Database error sending invitation: " + de.getMessage(),
- on_error);
-
- } // end catch
- catch (EmailException ee)
- { // error sending the email message
- return new ErrorBox("E-Mail Error","Error sending e-mail: " + ee.getMessage(),on_error);
-
- } // end catch
-
- // all sent - go back to community profile display
- throw new RedirectResult(on_error);
-
- } // end if ("send" pressed)
-
- // error - don't know what button was clicked
- logger.error("no known button click on CommunityOperations.doPost, cmd=I");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("I" command)
-
- if (cmd.equals("M"))
- { // "M" = Display Members List
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- setMyLocation(request,"sigops?cmd=M&sig=" + comm.getCommunityID());
- String on_error = "sig/" + comm.getAlias();
- if (logger.isDebugEnabled())
- logger.debug("Member list for community: " + comm.getName());
-
- try
- { // generate the members list
- ViewCommunityMembers view = new ViewCommunityMembers(engine,comm);
- view.doSearch(request);
- changeMenuCommunity(request,comm);
- return view;
-
- } // end try
- catch (ValidationException ve)
- { // validation error - throw it back to the user
- return new ErrorBox(null,ve.getMessage() + " Please try again.",
- "sigops?cmd=M&sig=" + comm.getCommunityID());
-
- } // end catch
- catch (DataException de)
- { // unable to get community members list
- return new ErrorBox("Database Error","Database error getting community members list: "
- + de.getMessage(),on_error);
-
- } // end catch
-
- } // end if ("M" command)
-
- // this is an error!
- logger.error("invalid command to CommunityOperations.doPost: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to CommunityOperations.doPost","top");
-
- } // end doVenicePost
-
-} // end class CommunityOperations
-
-
-
diff --git a/src/com/silverwrist/venice/servlets/ConfDisplay.java b/src/com/silverwrist/venice/servlets/ConfDisplay.java
deleted file mode 100644
index 6e17250..0000000
--- a/src/com/silverwrist/venice/servlets/ConfDisplay.java
+++ /dev/null
@@ -1,487 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class ConfDisplay extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Internal class used to get post number defaults
- *--------------------------------------------------------------------------------
- */
-
- static class PostInterval
- {
- private int first;
- private int last;
-
- public PostInterval(int f, int l)
- {
- if (f<=l)
- { // the sort is good
- first = f;
- last = l;
-
- } // end if
- else
- { // reverse the order
- first = l;
- last = f;
-
- } // end else
-
- } // end constructor
-
- public int getFirst()
- {
- return first;
-
- } // end getFirst
-
- public int getLast()
- {
- return last;
-
- } // end getLast
-
- } // end class PostInterval
-
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(ConfDisplay.class);
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static void getViewSortDefaults(ServletRequest request, int confid, TopicSortHolder tsc,
- String on_error) throws ErrorBox
- {
- String str = request.getParameter("view");
- if (!(StringUtil.isStringEmpty(str)))
- { // we need to change the view parameter
- try
- { // convert the parameter to an integer and then check it against defined values
- int p = Integer.parseInt(str);
- switch (p)
- {
- case ConferenceContext.DISPLAY_NEW:
- case ConferenceContext.DISPLAY_ACTIVE:
- case ConferenceContext.DISPLAY_ALL:
- case ConferenceContext.DISPLAY_HIDDEN:
- case ConferenceContext.DISPLAY_ARCHIVED:
- tsc.setViewOption(confid,p);
- break;
-
- default:
- throw new ErrorBox(null,"Invalid view parameter.",on_error);
-
- } // end switch
-
- } // end try
- catch (NumberFormatException nfe)
- { // failure in parseInt
- logger.error("Cannot convert view parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid view parameter.",on_error);
-
- } // end catch
-
- } // end if
-
- str = request.getParameter("sort");
- if (!(StringUtil.isStringEmpty(str)))
- { // we need to change the sort parameter
- try
- { // convert the parameter to an integer and then check it against defined values
- int p = Integer.parseInt(str);
- int real_p = ((p<0) ? -p : p);
- switch (real_p)
- {
- case ConferenceContext.SORT_NUMBER:
- case ConferenceContext.SORT_NAME:
- case ConferenceContext.SORT_UNREAD:
- case ConferenceContext.SORT_TOTAL:
- case ConferenceContext.SORT_DATE:
- tsc.setSortOption(confid,p);
- break;
-
- default:
- throw new ErrorBox(null,"Invalid sort parameter.",on_error);
-
- } // end switch
-
- } // end try
- catch (NumberFormatException nfe)
- { // failure in parseInt
- logger.error("Cannot convert sort parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid sort parameter.",on_error);
-
- } // end catch
-
- } // end if
-
- } // end getViewSortDefaults
-
- private static PostInterval getInterval(VeniceEngine engine, ServletRequest request, TopicContext topic,
- String on_error) throws ErrorBox
- {
- int first, last;
-
- String foo = request.getParameter("pxg");
- if (!(StringUtil.isStringEmpty(foo)))
- { // we have a Go box parameter - try and decode it
- try
- { // look for a range specifier
- int p = foo.indexOf('-');
- if (p<0)
- { // single post number - try and use it
- first = Integer.parseInt(foo);
- last = first;
-
- } // end if
- else if (p==0)
- { // "-number" - works like "0-number"
- last = Integer.parseInt(foo.substring(1));
- first = 0;
-
- } // end if
- else if (p==(foo.length()-1))
- { // "number-" - works like "number-end"
- first = Integer.parseInt(foo.substring(0,p));
- last = topic.getTotalMessages() - 1;
-
- } // end else if
- else
- { // two numbers to decode
- first = Integer.parseInt(foo.substring(0,p));
- last = Integer.parseInt(foo.substring(p+1));
-
- } // end else
-
- return new PostInterval(first,last);
-
- } // end try
- catch (NumberFormatException nfe)
- { // if numeric conversion fails, just fall out and try to redisplay the other way
- } // end catch
-
- } // end if
-
- foo = request.getParameter("p1");
- if (StringUtil.isStringEmpty(foo))
- { // no range specified - cook up a default one
- last = topic.getTotalMessages();
- int ur = topic.getUnreadMessages();
- if ((ur==0) || (ur>=engine.getNumPostsPerPage()))
- first = last - engine.getNumPostsPerPage();
- else
- first = last - (ur + engine.getNumOldPostsBeforeNew());
- last--;
-
- } // end if
- else
- { // we have at least one parameter...
- try
- { // convert it to an integer and range-limit it
- first = Integer.parseInt(foo);
- if (first<0)
- first = 0;
- else if (first>=topic.getTotalMessages())
- first = topic.getTotalMessages() - 1;
-
- } // end try
- catch (NumberFormatException nfe)
- { // we could not translate the parameter to a number
- throw new ErrorBox(null,"Message parameter is invalid.",on_error);
-
- } // end catch
-
- foo = request.getParameter("p2");
- if (StringUtil.isStringEmpty(foo))
- last = first; // just specify ONE post...
- else
- { // OK, we have an actual "last message" parameter...
- try
- { // convert it to an integer and range-limit it
- last = Integer.parseInt(foo);
- if ((last<0) || (last>=topic.getTotalMessages()))
- last = topic.getTotalMessages() - 1;
-
- } // end try
- catch (NumberFormatException nfe)
- { // we could not translate the parameter to a number
- throw new ErrorBox(null,"Message parameter is invalid.",on_error);
-
- } // end catch
-
- } // end else
-
- } // end else
-
- return new PostInterval(first,last);
-
- } // end getInterval
-
- private static boolean restorePosts(ServletRequest request, ConferenceContext conf, TopicContext curr_topic)
- {
- String xtopic = request.getParameter("rtop");
- if (StringUtil.isStringEmpty(xtopic))
- return true;
- String xcount = request.getParameter("rct");
- if (StringUtil.isStringEmpty(xcount))
- return true;
-
- TopicContext topic;
- try
- { // get the topic corresponding to the first parameter
- topic = conf.getTopic(Short.parseShort(xtopic));
-
- } // end try
- catch (NumberFormatException nfe)
- { // the topic number was invalid - forget it
- logger.warn("restorePosts: error translating topic number");
- return true;
-
- } // end catch
- catch (DataException de)
- { // could not get the topic...
- logger.warn("restorePosts: DataException getting topic - " + de.getMessage(),de);
- return true;
-
- } // end catch
- catch (AccessError ae)
- { // no access to the topic
- logger.warn("restorePosts: AccessError getting topic - " + ae.getMessage(),ae);
- return true;
-
- } // end catch
-
- int nunread;
- try
- { // translate the number of unread posts to set
- nunread = Integer.parseInt(xcount);
- if ((nunread<=0) || (nunread>topic.getTotalMessages()))
- { // must be in the range [1, #messages]...
- logger.warn("restorePosts: unread post count out of range");
- return true;
-
- } // end if
-
- } // end try
- catch (NumberFormatException nfe)
- { // the number of unread posts was invalid - forget it
- logger.warn("restorePosts: error translating unread post count");
- return true;
-
- } // end catch
-
- try
- { // now try to set the unread messages
- topic.setUnreadMessages(nunread);
-
- } // end try
- catch (DataException de)
- { // could not get the topic...
- logger.warn("restorePosts: DataException setting unread messages - " + de.getMessage(),de);
-
- } // end catch
-
- return (topic.getTopicID()!=curr_topic.getTopicID());
-
- } // end restorePosts
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "ConfDisplay servlet - Display of conference topic and message lists\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
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
-
- // get the topic, if we have it
- TopicContext topic = getTopicParameter(request,user,conf,false,"top",
- "confdisp?" + request.getQueryString());
-
- if (topic!=null)
- { // we're handling messages within a single topic
- if (logger.isDebugEnabled())
- logger.debug("MODE: display messages in topic");
- String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- setMyLocation(request,on_error + "&top=" + topic.getTopicNumber());
-
- // if this request is restoring the number of unread posts in another topic, try to do so
- boolean do_readnew = restorePosts(request,conf,topic);
-
- // determine what the post interval is we want to display
- PostInterval piv = getInterval(engine,request,topic,on_error);
- boolean read_new = do_readnew && !(StringUtil.isStringEmpty(request.getParameter("rnm")));
- boolean show_adv = !(StringUtil.isStringEmpty(request.getParameter("shac")));
- boolean no_bozos = !(StringUtil.isStringEmpty(request.getParameter("nbz")));
-
- // Create the post display.
- try
- { // create the display
- return new TopicPosts(request,engine,user,comm,conf,topic,piv.getFirst(),piv.getLast(),read_new,
- show_adv,no_bozos);
-
- } // end try
- catch (DataException de)
- { // there was a database error retrieving messages
- return new ErrorBox("Database Error","Database error listing messages: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // we were unable to retrieve the message list
- if (user.isLoggedIn())
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
- else
- return new LogInOrCreate(getMyLocation(request));
-
- } // end catch
-
- } // end if (messages in a topic)
- else
- { // we're displaying the conference's topic list
- if (logger.isDebugEnabled())
- logger.debug("MODE: display topics in conference");
- String on_error = "confops?sig=" + comm.getCommunityID();
- String my_location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- boolean read_new = !(StringUtil.isStringEmpty(request.getParameter("rnm")));
- if (read_new)
- my_location += "&rnm=1";
- setMyLocation(request,my_location);
-
- // get any changes to view or sort options
- TopicSortHolder opts = TopicSortHolder.retrieve(request.getSession(true));
- getViewSortDefaults(request,conf.getConfID(),opts,on_error);
-
- if (read_new)
- { // we need to generate a TopicPosts view
- try
- { // generate a topic list first
- List topic_list = conf.getTopicList(opts.getViewOption(conf.getConfID()),
- opts.getSortOption(conf.getConfID()));
-
- // now generate the topic visit order
- TopicVisitOrder ord = TopicVisitOrder.initialize(request.getSession(true),conf.getConfID(),
- topic_list);
-
- // use the new visit order to get the topic we need to visit
- short topic_nbr = ord.getNext();
- Iterator it = topic_list.iterator();
- while (it.hasNext())
- { // locate the first topic to be read
- topic = (TopicContext)(it.next());
- if (topic.getTopicNumber()==topic_nbr)
- break;
-
- } // end while
-
- if (topic==null) // no suitable topic found - just create the topic listing
- return new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
- opts.getSortOption(conf.getConfID()));
-
- // determine what the post interval is we want to display
- PostInterval piv = getInterval(engine,request,topic,on_error);
-
- // create the topic posts view
- return new TopicPosts(request,engine,user,comm,conf,topic,piv.getFirst(),piv.getLast(),true,
- false,false);
-
- } // end try
- catch (DataException de)
- { // there was a database error retrieving messages
- return new ErrorBox("Database Error","Database error listing messages: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // we were unable to retrieve the message list
- if (user.isLoggedIn())
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
- else
- return new LogInOrCreate(getMyLocation(request));
-
- } // end catch
-
- } // end if (creating a "read new" topic list view)
- else
- { // topic listing only...
- TopicListing tl = null;
- try
- { // create the topic list
- tl = new TopicListing(request,comm,conf,opts.getViewOption(conf.getConfID()),
- opts.getSortOption(conf.getConfID()));
-
- } // end try
- catch (DataException de)
- { // there was a database error retrieving topics
- return new ErrorBox("Database Error","Database error listing topics: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // we were unable to retrieve the topic list
- if (user.isLoggedIn())
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
- else
- return new LogInOrCreate(getMyLocation(request));
-
- } // end catch
-
- return tl;
-
- } // end else (not reading new messages, but just displaying topics)
-
- } // end else (topics in a conference)
-
- } // end doVeniceGet
-
-} // end class ConfDisplay
diff --git a/src/com/silverwrist/venice/servlets/ConfOperations.java b/src/com/silverwrist/venice/servlets/ConfOperations.java
deleted file mode 100644
index 4a12109..0000000
--- a/src/com/silverwrist/venice/servlets/ConfOperations.java
+++ /dev/null
@@ -1,1260 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-import com.silverwrist.venice.util.IDUtils;
-
-public class ConfOperations extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String DELETE_CONFIRM_ATTR = "servlets.ConfOperations.delete.confirm";
- private static final String DELETE_CONFIRM_PARAM = "confirm";
-
- private static Category logger = Category.getInstance(ConfOperations.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private CreateConferenceDialog makeCreateConferenceDialog() throws ServletException
- {
- final String desired_name = "CreateConferenceDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- CreateConferenceDialog template = new CreateConferenceDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (CreateConferenceDialog)(cache.getNewDialog(desired_name));
-
- } // end makeCreateConferenceDialog
-
- private EditConferenceDialog makeEditConferenceDialog(SecurityInfo sinf) throws ServletException
- {
- final String desired_name = "EditConferenceDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- EditConferenceDialog template = new EditConferenceDialog(sinf);
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (EditConferenceDialog)(cache.getNewDialog(desired_name));
-
- } // end makeEditConferenceDialog
-
- private static boolean validateNewTopic(ServletRequest request, String on_error) throws ErrorBox
- {
- //boolean is_title_null, is_zp_null;
-
- String foo = request.getParameter("title");
- if (foo==null)
- throw new ErrorBox(null,"Title parameter was not specified.",on_error);
- //is_title_null = (foo.length()==0);
-
- foo = request.getParameter("pseud");
- if (foo==null)
- throw new ErrorBox(null,"Pseud parameter was not specified.",on_error);
-
- foo = request.getParameter("pb");
- if (foo==null)
- throw new ErrorBox(null,"Body text was not specified.",on_error);
- //is_zp_null = (foo.length()==0);
-
- /* EJB 4/5/2001 - remove this for consistency. FUTURE: bring it back under a global option?
- return is_title_null || is_zp_null;
- -- end removed code */
-
- return false;
-
- } // 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
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "ConfOperations servlet - General conference operations (list, create, etc.)\n"
- + "Part of the Venice Web Communities System\n";
- return rc;
-
- } // end getServletInfo
-
- /*--------------------------------------------------------------------------------
- * Overrides from class 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)
- * I = Conference E-Mail (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)
- * U = Customize Conference Display (requires conference parameter)
- * UX = Remove all custom blocks (requires conference parameter)
- * Other = Display list of conferences in community
- */
-
- protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String on_error = "confops?sig=" + comm.getCommunityID();
-
- // get the command we want to use
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("S"))
- { // "S" = Manage conferences sequence
- if (!(comm.canManageConferences()))
- return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
- on_error);
-
- try
- { // display the Conference Sequence screen
- setMyLocation(request,"confops?cmd=S&sig=" + comm.getCommunityID());
- return new ConferenceSequence(comm);
-
- } // 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 (!(comm.canManageConferences()))
- return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
- on_error);
-
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
-
- 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 (!(comm.canManageConferences()))
- return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
- on_error);
-
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
-
- // we need a second conference parameter to exchange with
- ConferenceContext other_conf = getConferenceParameter(request.getParameter("oc"),comm,true,on_error);
-
- if (!(conf.canChangeConference()) || !(other_conf.canChangeConference()))
- return new ErrorBox("Access Error","You do not have permission to modify this conference.",on_error);
-
- 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 (!(comm.canManageConferences()))
- return new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
- on_error);
-
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&cmd=S";
-
- if (!(conf.canDeleteConference()))
- return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
-
- 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=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=SDEL",on_error);
-
- } // end else
-
- } // end if ("SDEL" command)
-
- if (cmd.equals("C"))
- { // "C" = "Create conference"
- if (!(comm.canCreateConference()))
- return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
- on_error);
-
- // make the "create" dialog
- CreateConferenceDialog dlg = makeCreateConferenceDialog();
- dlg.setupDialog(engine,comm);
- setMyLocation(request,on_error + "&cmd=C");
- return dlg;
-
- } // end if ("C" command)
-
- if (cmd.equals("T"))
- { // "T" = "Create topic" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- // Create the new topic form.
- NewTopicForm ntf = new NewTopicForm(comm,conf);
- ntf.setupNewRequest();
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
- return ntf;
-
- } // end if ("T" command)
-
- if (cmd.equals("Q"))
- { // "Q" = display Manage menu (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- // display the "Manage Conference" display
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
- return new ManageConference(comm,conf);
-
- } // end if ("Q" command)
-
- if (cmd.equals("FX"))
- { // "FX" = the dreaded fixseen :-) - catches up the entire conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- try
- { // do the fixseen operation
- conf.fixSeen();
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // some sort of error in the database
- return new ErrorBox("Database Error","Database error catching up conference: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- return null; // null response here
-
- } // end if ("FX" command)
-
- if (cmd.equals("E"))
- { // "E" = "Edit Conference Settings" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
- on_error);
-
- // create and return the Edit Conference dialog
- EditConferenceDialog dlg = makeEditConferenceDialog(conf.getSecurityInfo());
- try
- { // set up and return the dialog
- dlg.setupDialog(comm,conf);
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
- return dlg;
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error retrieving the conference information
- return new ErrorBox("Database Error","Database error getting conference information: "
- + de.getMessage(),on_error);
-
- } // end catch
-
- } // end if ("E" command)
-
- if (cmd.equals("A"))
- { // "A" = "Manage Aliases" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's aliases.",
- on_error);
-
- // process alias removal link
- String remove = request.getParameter("rem");
- if (!(StringUtil.isStringEmpty(remove)))
- { // do removal of an alias
- try
- { // go ahead and remove the alias!
- conf.removeAlias(remove);
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error removing alias: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if (removing an alias)
-
- // display the "Manage Conference Aliases" display
- try
- { // generate the display box
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A");
- return new ManageConferenceAliases(comm,conf);
-
- } // end try
- catch (DataException de)
- { // error generating the display box
- return new ErrorBox("Database Error","Database error displaying aliases: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if ("A" command)
-
- if (cmd.equals("QR"))
- { // "QR" = "Reports Menu" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- try
- { // display the "Conference Reports" display
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=QR");
- return new ReportConferenceMenu(comm,conf);
-
- } // end try
- catch (DataException de)
- { // unable to get the data for the list
- return new ErrorBox("Database Error","Database error getting topic 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 ("QR" command)
-
- if (cmd.equals("RP") || cmd.equals("RR"))
- { // "RP" = "Report Posters," "RR" = "Report Readers" (requires conference parameter, optional topic)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- TopicContext topic = getTopicParameter(request,conf,false,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=QR";
-
- try
- { // generate the listing on this page
- String my_loc = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- if (topic!=null)
- my_loc += ("&top=" + topic.getTopicNumber());
- setMyLocation(request,my_loc + "&cmd=" + cmd);
- return new ConferenceActivity(comm,conf,topic,cmd.equals("RP"));
-
- } // end try
- catch (DataException de)
- { // unable to get the data for the list
- return new ErrorBox("Database Error","Database error displaying conference users: " + 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 ("RP" and "RR" commands)
-
- if (cmd.equals("M"))
- { // "M" - Manage Conference Membership (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- try
- { // display the conference member list!
- ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
- m.doConferenceMemberList();
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M");
- return m;
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error listing conference members: " + 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
-
- } // end if ("M" command)
-
- if (cmd.equals("H"))
- { // "H" = "Add Conference To Hotlist" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- try
- { // add to the hotlist
- conf.addToHotlist();
-
- // and trap back to the conference display
- throw new RedirectResult(on_error);
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error adding to hotlist: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if ("H" command)
-
- if (cmd.equals("I"))
- { // "I" = "Conference E-Mail" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- try
- { // return the conference E-mail view
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=I");
- return new ConferenceEMail(comm,conf);
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error getting topic list: " + 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
-
- } // end if ("I" command)
-
- if (cmd.equals("U"))
- { // "U" = Customize Conference Displays (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's customizations.",
- on_error);
-
- try
- { // return the conference custom blocks view
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=U");
- return new ConferenceCustomBlocks(comm,conf);
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error getting custom blocks: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if ("U" command)
-
- if (cmd.equals("UX"))
- { // "UX" = Customize Conference Displays (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=U";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's customizations.",
- on_error);
-
- try
- { // zap the custom blocks
- conf.removeCustomBlocks();
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error removing custom blocks: " + 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
-
- // all done - bounce back to the menu
- throw new RedirectResult("confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=Q");
-
- } // end if ("UX" command)
-
- if (cmd.equals("DEL"))
- { // "DEL" = "Delete Conference (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canDeleteConference()))
- return new ErrorBox("Access Error","You do not have permission to delete this conference.",on_error);
-
- 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 conference list
- throw new RedirectResult("confops?sig=" + comm.getCommunityID());
-
- } // 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=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=DEL",on_error);
-
- } // end else
-
- } // end if ("DEL" command)
-
- // Any unrecognized command shows us the conference list.
- on_error = "sigprofile?sig=" + comm.getCommunityID();
- try
- { // make a conference listing
- setMyLocation(request,"confops?sig=" + comm.getCommunityID());
- return new ConferenceListing(comm);
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error finding conferences: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // some lack of access is causing problems
- if (user.isLoggedIn())
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
- else
- { // they might need to log in first
- setMyLocation(request,"confops?sig=" + comm.getCommunityID());
- return new LogInOrCreate("confops?sig=" + comm.getCommunityID());
-
- } // end else
-
- } // end catch
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String on_error = "confops?sig=" + comm.getCommunityID();
-
- // get the command we want to use
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("C"))
- { // "C" = "Create Conference"
- if (!(comm.canCreateConference()))
- return new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
- on_error);
-
- // load up the create conference dialog!
- CreateConferenceDialog dlg = makeCreateConferenceDialog();
- dlg.setupDialog(engine,comm);
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(on_error); // they chickened out - go back to the conference list
-
- if (dlg.isButtonClicked(request,"create"))
- { // OK, they actually want to create the new conference...
- dlg.loadValues(request); // load the form data
-
- try
- { // attempt to create the conference!
- ConferenceContext conf = dlg.doDialog(comm);
-
- // success! redirect to the conference's topic list
- throw new RedirectResult("confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID());
-
- } // end try
- catch (ValidationException ve)
- { // validation error - throw it back to the user
- dlg.resetOnError(ve.getMessage() + " Please try again.");
-
- } // 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
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error creating conference: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- setMyLocation(request,on_error + "&cmd=C");
- return dlg; // redisplay the dialog
-
- } // end if ("create" button clicked)
-
- // error - don't know what button was clicked
- logger.error("no known button click on ConfOperations.doPost, cmd=C");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("C" command)
-
- if (cmd.equals("T"))
- { // "T" command = Create New Topic (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- // determine what to do based on the button pressed
- if (isImageButtonClicked(request,"cancel"))
- throw new RedirectResult(on_error); // the user chickened out - go back to the conference display
-
- if (isImageButtonClicked(request,"preview"))
- { // generate a preview and redisplay the form
- NewTopicForm ntf = new NewTopicForm(comm,conf);
-
- try
- { // generate a preview display
- ntf.generatePreview(engine,conf,request);
-
- } // end try
- catch (ValidationException ve)
- { // something messed up in the preview generation
- return new ErrorBox(null,ve.getMessage(),on_error);
-
- } // end catch
-
- /* EJB 4/5/2001 - code removed for consistency - FUTURE: bring it back controlled by
- a global option?
- if (ntf.isNullRequest())
- return null; // no title or text specified - "204 No Content"
- -- end removed code */
-
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=T");
- return ntf;
-
- } // end if ("preview" clicked)
-
- if (isImageButtonClicked(request,"post"))
- { // first validate that we've got all the parameters
- if (validateNewTopic(request,on_error))
- return null; // this is a null request - send a null response
-
- try
- { // add the new topic!
- TopicContext topic = conf.addTopic(request.getParameter("title"),request.getParameter("pseud"),
- request.getParameter("pb"));
-
- final String yes = "Y";
- if (yes.equals(request.getParameter("attach")))
- { // we need to upload an attachment for this post
- setMyLocation(request,on_error);
- return new AttachmentForm(comm,conf,topic.getMessage(0),on_error);
-
- } // end if
-
- } // end try
- catch (DataException de)
- { // display a database error
- return new ErrorBox("Database Error","Database error adding topic: " + de.getMessage(),on_error);
-
- } // end catch
- catch (AccessError ae)
- { // some sort of access problem
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
-
- // jump back to the form under normal circumstances
- throw new RedirectResult(on_error);
-
- } // end if ("post" clicked)
-
- // we don't know what button was pressed
- logger.error("no known button click on ConfOperations.doPost, cmd=T");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("T" command)
-
- if (cmd.equals("P"))
- { // "P" = Set default pseud (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- try
- { // go set the pseud!
- String pseud = request.getParameter("pseud");
- if (pseud!=null)
- conf.setDefaultPseud(pseud);
-
- } // end try
- catch (DataException de)
- { // oops - there was a problem!
- return new ErrorBox("Database Error","Database error setting pseud: " + de.getMessage(),on_error);
-
- } // end catch
-
- return null; // don't change the view
-
- } // end if ("P" command)
-
- if (cmd.equals("E"))
- { // "E" = "Edit Conference Settings" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
- on_error);
-
- // create the dialog class
- EditConferenceDialog dlg = makeEditConferenceDialog(conf.getSecurityInfo());
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult(on_error); // they chickened out - go back to the conference list
-
- if (dlg.isButtonClicked(request,"update"))
- { // they're changing the conference - do what you have to
- dlg.loadValues(request); // load the form data
-
- try
- { // run that baby!
- dlg.doDialog(conf);
-
- // success - return back to where we started from
- throw new RedirectResult(on_error);
-
- } // end try
- catch (ValidationException ve)
- { // validation error - throw it back to the user
- dlg.resetOnError(comm,conf,ve.getMessage() + " Please try again.");
-
- } // 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
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error updating conference: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- setMyLocation(request,"confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=E");
- return dlg; // redisplay the dialog
-
- } // end if
-
- } // end if ("E" command)
-
- if (cmd.equals("A"))
- { // "A" = "Add Alias" (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's settings.",
- on_error);
-
- String new_alias = request.getParameter("alias");
- if (StringUtil.isStringEmpty(new_alias))
- return null; // this is a no-op
-
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=A";
- String error_message = null;
-
- if (IDUtils.isValidVeniceID(new_alias))
- { // the alias we have netered is perfectly valid...
- try
- { // go ahead and add the alias!
- conf.addAlias(new_alias);
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error adding alias: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- } // end if
- else // alias is not valid
- error_message = "The alias you have entered is not a valid identifier. Please try again.";
-
- // redisplay the "Manage Conference Aliases" display
- try
- { // generate the display box
- setMyLocation(request,on_error);
- return new ManageConferenceAliases(comm,conf);
-
- } // end try
- catch (DataException de)
- { // error generating the display box
- return new ErrorBox("Database Error","Database error displaying aliases: " + de.getMessage(),
- "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=Q");
-
- } // end catch
-
- } // end if ("A" command)
-
- if (cmd.equals("M"))
- { // "M" - Manage Conference Membership (requires conference parameter)
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=M";
-
- if (isImageButtonClicked(request,"update"))
- { // the "update" command that changes all the security levels
- HashMap org_vals = new HashMap();
- HashMap new_vals = new HashMap();
- try
- { // retrieve all parameters and filter them for the levels
- Enumeration p_names = request.getParameterNames();
- while (p_names.hasMoreElements())
- { // examine each parameter name in turn
- String p_name = (String)(p_names.nextElement());
- if (p_name.startsWith("zxcur_"))
- { // this is a current value (from a hidden field)
- int uid = Integer.parseInt(p_name.substring(6));
- int level = Integer.parseInt(request.getParameter(p_name));
- org_vals.put(new Integer(uid),new Integer(level));
-
- } // end if
- else if (p_name.startsWith("zxnew_"))
- { // this is a new value (from a dropdown list box)
- int uid = Integer.parseInt(p_name.substring(6));
- int level = Integer.parseInt(request.getParameter(p_name));
- new_vals.put(new Integer(uid),new Integer(level));
-
- } // end else if
-
- } // end while
-
- if (org_vals.size()!=new_vals.size())
- return new ErrorBox(null,"Invalid parameters.",on_error);
-
- } // end try
- catch (NumberFormatException nfe)
- { // error converting the parameters
- return new ErrorBox(null,"Invalid parameter conversion.",on_error);
-
- } // end catch
-
- try
- { // loop through the hashmaps and set the value
- Iterator it = org_vals.keySet().iterator();
- while (it.hasNext())
- { // extract the UID, old level, and new level
- Integer uid = (Integer)(it.next());
- Integer org_level = (Integer)(org_vals.get(uid));
- Integer new_level = (Integer)(new_vals.get(uid));
- if (new_level==null) // whoops
- return new ErrorBox(null,"Invalid new level parameter.",on_error);
- int new_level_x = new_level.intValue();
- if (new_level_x==0)
- new_level_x = -1;
-
- // call down to set the membership level
- if (org_level.intValue()!=new_level_x)
- conf.setMembership(uid.intValue(),new_level_x);
-
- } // end while
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error setting memberships: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- // trap back to the conference membership display
- throw new RedirectResult(on_error);
-
- } // end if ("update" clicked)
-
- if ( isImageButtonClicked(request,"search") || isImageButtonClicked(request,"previous")
- || isImageButtonClicked(request,"next"))
- { // create the new dialog box
- ConferenceMembership m = new ConferenceMembership(engine,comm,conf);
-
- try
- { // perform the search!
- m.doSearch(request);
-
- } // end try
- catch (ValidationException ve)
- { // validation error - throw it back to the user
- return new ErrorBox(null,ve.getMessage() + " Please try again.",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
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error updating conference: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- setMyLocation(request,on_error);
- return m;
-
- } // end if (search function clicked)
-
- // we don't know what button was pressed
- logger.error("no known button click on ConfOperations.doPost, cmd=M");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("M" command)
-
- if (cmd.equals("I"))
- { // "I" = "Conference E-Mail"
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=I";
-
- if (isImageButtonClicked(request,"cancel")) // "Cancel" button pressed - bail out
- throw new RedirectResult("confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=Q");
-
- if (isImageButtonClicked(request,"send"))
- { // OK, figure out who we want to send E-mail to
- try
- { // retrieve the topic we want to send to
- TopicContext topic = null;
- String s = request.getParameter("top");
- if ((s!=null) && !(s.equals("0")))
- topic = conf.getTopic(Short.parseShort(s));
-
- // retrieve other parameters
- final String ZERO = "0";
- boolean posters = ZERO.equals(request.getParameter("porl"));
- final String YES = "Y";
- int ndays = -1;
- if (YES.equals(request.getParameter("xday")))
- { // they selected "within the last X days"
- try
- { // parse the number of days
- s = request.getParameter("day");
- if (s!=null)
- ndays = Integer.parseInt(s);
- else
- ndays = 0;
-
- } // end try
- catch (NumberFormatException nfe)
- { // always fail safe when doing e-mail parameters!
- ndays = 0;
-
- } // end catch
-
- } // end if
-
- if (topic!=null)
- topic.sendMailToParticipants(posters,ndays,request.getParameter("subj"),
- request.getParameter("pb"));
- else
- conf.sendMailToParticipants(posters,ndays,request.getParameter("subj"),
- request.getParameter("pb"));
-
- } // end try
- catch (AccessError ae)
- { // some sort of access error - display an error dialog
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error creating the conference
- return new ErrorBox("Database Error","Database error sending E-mail: " + de.getMessage(),
- on_error);
-
- } // end catch
-
- // all done - bounce back to the menu
- throw new RedirectResult("confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=Q");
-
- } // end if ("send" pressed)
-
- // we don't know what button was pressed
- logger.error("no known button click on ConfOperations.doPost, cmd=I");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("I" command)
-
- if (cmd.equals("U"))
- { // "U" command - Customize Conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,on_error);
- on_error = "confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&cmd=U";
-
- if (!(conf.canChangeConference()))
- return new ErrorBox("Access Error","You are not permitted to change this conference's customizations.",
- on_error);
-
- if (isImageButtonClicked(request,"cancel")) // cancel - bounce back to the menu
- throw new RedirectResult("confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=Q");
-
- if (isImageButtonClicked(request,"update"))
- { // OK, actually update the operation
- try
- { // reset the custom blocks
- conf.setCustomBlock(ConferenceContext.CUST_BLOCK_TOP,request.getParameter("tx"));
- conf.setCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM,request.getParameter("bx"));
-
- } // end try
- catch (DataException de)
- { // something wrong in the database
- return new ErrorBox("Database Error","Database error setting custom blocks: " + 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
-
- // all done - bounce back to the menu
- throw new RedirectResult("confops?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID()
- + "&cmd=Q");
-
- } // end if
-
- // we don't know what button was pressed
- logger.error("no known button click on ConfOperations.doPost, cmd=U");
- return new ErrorBox("Internal Error","Unknown command button pressed",on_error);
-
- } // end if ("U" command)
-
- // unrecognized command!
- logger.error("invalid command to ConfOperations.doPost: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to ConfOperations.doPost",on_error);
-
- } // end doVenicePost
-
-} // end class ConfOperations
diff --git a/src/com/silverwrist/venice/servlets/Find.java b/src/com/silverwrist/venice/servlets/Find.java
deleted file mode 100644
index cecc660..0000000
--- a/src/com/silverwrist/venice/servlets/Find.java
+++ /dev/null
@@ -1,179 +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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class Find extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- protected static final String DISPLAY_PARAM_ATTRIBUTE = "servlet.Find.display";
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getDisplayParam(HttpServletRequest request, int nchoices)
- {
- HttpSession session = request.getSession(true);
-
- try
- { // attempt to get the display parameter
- String dp_str = request.getParameter("disp");
- if (dp_str!=null)
- { // attempt to convert to an integer and range-check it
- int dp = Integer.parseInt(dp_str);
- if ((dp>=0) && (dp.
- *
- * 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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class FindPost extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "FindPost servlet - Searches for posts in communities, conferences, and/or topics\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
- {
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String locator = "sig=" + comm.getCommunityID();
-
- ConferenceContext conf = getConferenceParameter(request,comm,false,"confops?" + locator);
- TopicContext topic = null;
- if (conf!=null)
- { // find the topic parameter
- locator += ("&conf=" + conf.getConfID());
- topic = getTopicParameter(request,conf,false,"confdisp?" + locator);
- if (topic!=null)
- locator += ("&top=" + topic.getTopicNumber());
-
- } // end if
-
- setMyLocation(request,"findpost?" + locator);
- return new FindPostData(comm,conf,topic);
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String locator = "sig=" + comm.getCommunityID();
-
- ConferenceContext conf = getConferenceParameter(request,comm,false,"confops?" + locator);
- TopicContext topic = null;
- if (conf!=null)
- { // find the topic parameter
- locator += ("&conf=" + conf.getConfID());
- topic = getTopicParameter(request,conf,false,"confdisp?" + locator);
- if (topic!=null)
- locator += ("&top=" + topic.getTopicNumber());
-
- } // end if
-
- setMyLocation(request,"findpost?" + locator);
- FindPostData data = new FindPostData(comm,conf,topic);
-
- try
- { // attempt to configure the display
- data.doSearch(request,engine);
-
- } // end try
- catch (AccessError ae)
- { // error in find parameters
- return new ErrorBox("Find Error",ae.getMessage(),"top");
-
- } // end catch
- catch (DataException de)
- { // database error, man
- return new ErrorBox("Database Error","Database error on find: " + de.getMessage(),"top");
-
- } // end catch
-
- return data;
-
- } // end doVenicePost
-
-} // end class FindPost
diff --git a/src/com/silverwrist/venice/servlets/Gateway.java b/src/com/silverwrist/venice/servlets/Gateway.java
deleted file mode 100644
index 5e3ccf1..0000000
--- a/src/com/silverwrist/venice/servlets/Gateway.java
+++ /dev/null
@@ -1,71 +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;
-
-import java.io.*;
-import java.net.URLEncoder;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class Gateway extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(Gateway.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "Gateway servlet - \"Gates\" a URL request based on whether or not the user is logged in\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 target = request.getQueryString();
- if (target==null)
- throw new ErrorResult(HttpServletResponse.SC_BAD_REQUEST,"no parameter specified");
- if (logger.isDebugEnabled())
- logger.debug("they want to redirect to: " + target);
- if (user.isLoggedIn())
- throw new RedirectResult(target);
- else
- throw new RedirectResult("account?cmd=L&tgt=" + URLEncoder.encode(target));
-
- } // end doVeniceGet
-
-} // end class Gateway
diff --git a/src/com/silverwrist/venice/servlets/ImageRetrieve.java b/src/com/silverwrist/venice/servlets/ImageRetrieve.java
deleted file mode 100644
index acee26d..0000000
--- a/src/com/silverwrist/venice/servlets/ImageRetrieve.java
+++ /dev/null
@@ -1,99 +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;
-
-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.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class ImageRetrieve extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(ImageRetrieve.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "ImageRetrieve servlet - Displays images from the database image store\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
- {
- int imgid; // image ID to retrieve.
-
- try
- { // parse the image ID
- imgid = Integer.parseInt(request.getPathInfo().substring(1));
-
- } // end try
- catch (NumberFormatException nfe)
- { // invalid image URL
- return new ErrorBox(null,"Invalid image URL.",null);
-
- } // end catch
-
- // the parameters of the response
- String type, filename;
- int length;
- InputStream data;
-
- try
- { // load the image from the database
- BinaryData image = engine.loadImage(imgid);
-
- type = image.getMIMEType();
- filename = image.getFilename();
- length = image.getLength();
- data = image.getData();
-
- } // end try
- catch (DataException de)
- { // unable to get the user name
- return new ErrorBox("Database Error","Database error retrieving image: " + de.getMessage(),null);
-
- } // end catch
-
- // now we want to send that data back to the user!
- throw new SendFileResult(type,filename,length,data);
-
- } // end doVeniceGet
-
-} // end class ImageRetrieve
diff --git a/src/com/silverwrist/venice/servlets/PostMessage.java b/src/com/silverwrist/venice/servlets/PostMessage.java
deleted file mode 100644
index 593fcab..0000000
--- a/src/com/silverwrist/venice/servlets/PostMessage.java
+++ /dev/null
@@ -1,197 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class PostMessage extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(PostMessage.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getPostNumber(ServletRequest request, String on_error) throws ErrorBox
- {
- String str = request.getParameter("sd");
- if (StringUtil.isStringEmpty(str))
- throw new ErrorBox(null,"Invalid parameter.",on_error);
- try
- { // get the number of posts we think he topic has
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // not a good integer...
- throw new ErrorBox(null,"Invalid parameter.",on_error);
-
- } // end catch
-
- } // end getPostNumber
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "PostMessage servlet - Handles posting messages to a conference\n"
- + "Part of the Venice Web Communities System\n";
- return rc;
-
- } // end getServletInfo
-
- /*--------------------------------------------------------------------------------
- * Overrides from class VeniceServlet
- *--------------------------------------------------------------------------------
- */
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,"top");
-
- // get the topic
- TopicContext topic = getTopicParameter(request,conf,true,"top");
-
- String on_error = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
- + topic.getTopicNumber();
-
- if (isImageButtonClicked(request,"cancel"))
- throw new RedirectResult(on_error); // canceled posting - take us back
-
- // make sure we've got some post data
- String raw_postdata = request.getParameter("pb");
- /* EJB 4/4/2001 - take this code out, FUTURE: maybe make it a global setting?
- if (StringUtil.isStringEmpty(raw_postdata))
- return null; // don't allow zero-size posts
- -- end removed code */
-
- if (raw_postdata==null)
- raw_postdata = "";
-
- final String yes = "Y";
-
- if (isImageButtonClicked(request,"preview")) // generate a preview
- return new PostPreview(engine,comm,conf,topic,request.getParameter("pseud"),raw_postdata,
- request.getParameter("next"),getPostNumber(request,on_error),
- yes.equals(request.getParameter("attach")),
- yes.equals(request.getParameter("slip")));
-
- if ( isImageButtonClicked(request,"post") || isImageButtonClicked(request,"postnext")
- || isImageButtonClicked(request,"posttopics"))
- { // post the message, and then either go back to the same topic or on to the next one
- boolean go_next = isImageButtonClicked(request,"postnext");
- boolean go_topics = isImageButtonClicked(request,"posttopics");
- int pn = getPostNumber(request,on_error);
-
- try
- { // first check for slippage
- if (pn!=topic.getTotalMessages()) // slippage detected! display the slippage screen
- return new PostSlippage(engine,comm,conf,topic,pn,request.getParameter("next"),
- request.getParameter("pseud"),raw_postdata,
- yes.equals(request.getParameter("attach")));
-
- // post the darn thing!
- TopicMessageContext msg = topic.postNewMessage(0,request.getParameter("pseud"),raw_postdata);
-
- if (!(yes.equals(request.getParameter("slip"))))
- topic.fixSeen(); // no slippage = make sure we mark all as read
-
- // where do we want to go now?
- String target;
- if (go_topics)
- target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- else
- { // figure out what topic to go to next
- short next;
- try
- { // attempt to get the value of the "next topic" parameter
- if (go_next)
- { // get the "next topic" parameter
- String foo = request.getParameter("next");
- if (StringUtil.isStringEmpty(foo))
- next = topic.getTopicNumber();
- else
- next = Short.parseShort(foo);
-
- } // end if
- else
- next = topic.getTopicNumber();
-
- } // end try
- catch (NumberFormatException nfe)
- { // just default me
- next = topic.getTopicNumber();
-
- } // end catch
-
- target = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
- + next + "&rnm=1";
-
- } // end else
-
- if (yes.equals(request.getParameter("attach")))
- return new AttachmentForm(comm,conf,msg,target); // go to upload an attachment
-
- // no attachment - redirect where we need to go
- throw new RedirectResult(target);
-
- } // end try
- catch (DataException de)
- { // there was a database error posting the message
- return new ErrorBox("Database Error","Database error posting message: " + de.getMessage(),"top");
-
- } // end catch
- catch (AccessError ae)
- { // we were unable to post the message
- return new ErrorBox("Access Error",ae.getMessage(),"top");
-
- } // end catch
-
- } // end if
-
- // unknown button clicked
- logger.error("no known button click on PostMessage.doPost");
- return new ErrorBox("Internal Error","Unknown command button pressed","top");
-
- } // end doVenicePost
-
-} // end class PostMessage
diff --git a/src/com/silverwrist/venice/servlets/PostOperations.java b/src/com/silverwrist/venice/servlets/PostOperations.java
deleted file mode 100644
index d8e8b6a..0000000
--- a/src/com/silverwrist/venice/servlets/PostOperations.java
+++ /dev/null
@@ -1,224 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class PostOperations extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String NUKE_CONFIRM_ATTR = "servlets.PostOperations.nuke.confirm";
- private static final String NUKE_CONFIRM_PARAM = "confirm";
-
- private static Category logger = Category.getInstance(TopicOperations.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "PostOperations servlet - General post operations (hide, scribble, etc.)\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
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String locator = "sig=" + comm.getCommunityID();
- String location = "sigprofile?" + locator;
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,location);
- locator += "&conf=" + conf.getConfID();
- location = "confdisp?" + locator;
-
- // get the topic
- TopicContext topic = getTopicParameter(request,conf,true,location);
- locator += "&top=" + topic.getTopicNumber();
- location = "confdisp?" + locator;
-
- // get the message
- TopicMessageContext msg = getMessageParameter(request,topic,true,location);
- location = "confdisp?" + locator + "&p1=" + msg.getPostNumber() + "&shac=1";
- setMyLocation(request,location);
-
- // figure out what command we want to perform
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("HY") || cmd.equals("HN"))
- { // we want to hide or show the message
- try
- { // attempt to hide or show the message
- msg.setHidden(cmd.equals("HY"));
-
- // go back and display stuff
- throw new RedirectResult(location);
-
- } // end if
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting hidden status: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- } // end if ("hide" or "show")
-
- if (cmd.equals("SCR"))
- { // we want to scribble the message
- try
- { // attempt to scribble the message
- msg.scribble();
-
- // go back and display stuff
- throw new RedirectResult(location);
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error scribbling message: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- } // end if ("scribble")
-
- if (cmd.equals("BY") || cmd.equals("BN"))
- { // we want to add or remove the bozo filter from the user here
- try
- { // attempt to set the bozo filter status
- topic.setBozo(msg.getCreatorUID(),cmd.equals("BY"));
-
- // go back and display stuff
- throw new RedirectResult(location);
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting filter status: " + de.getMessage(),
- location);
-
- } // end catch
-
- } // end if
-
- if (cmd.equals("NUKE"))
- { // nuking requires confirmation
- try
- { // we need confirmation on this operation
- if (ConfirmBox.isConfirmed(request,NUKE_CONFIRM_ATTR,NUKE_CONFIRM_PARAM))
- { // OK, go ahead, nuke the message!
- msg.nuke();
-
- // after which, redirect to topic view
- throw new RedirectResult("confdisp?" + locator);
-
- } // end if (confirmed)
- else
- { // not a proper confirmation - better display one
- List aliases = conf.getAliases();
- String message = "You are about to nuke message <" + (String)(aliases.get(0)) + "."
- + topic.getTopicNumber() + "." + msg.getPostNumber() + ">, originally composed by <"
- + msg.getCreatorName() + ">! Are you sure you want to do this?";
- String confirm_url = "postops?" + locator + "&msg=" + msg.getPostNumber() + "&cmd=NUKE";
- return new ConfirmBox(request,NUKE_CONFIRM_ATTR,NUKE_CONFIRM_PARAM,"Nuke Message",
- message,confirm_url,location);
-
- } // end else (not yet confirmed)
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error nuking message: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- } // end if ("nuke")
-
- if (cmd.equals("PU"))
- { // we want to publish the message to the front page
- try
- { // attempt to publish the message
- msg.publish();
-
- // go back and display stuff
- throw new RedirectResult(location);
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error publishing message: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- } // end if
-
- // unrecognized command!
- logger.error("invalid command to PostOperations.doGet: " + cmd);
- return new ErrorBox("Internal Error","Invalid command to PostOperations.doGet",location);
-
- } // end doVeniceGet
-
-} // end class PostOperations
diff --git a/src/com/silverwrist/venice/servlets/Settings.java b/src/com/silverwrist/venice/servlets/Settings.java
deleted file mode 100644
index b7829c7..0000000
--- a/src/com/silverwrist/venice/servlets/Settings.java
+++ /dev/null
@@ -1,425 +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;
-
-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.except.*;
-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 cid;
- try
- { // this is the community id of the hotlist entry
- cid = 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.
- *
- * 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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.servlets.format.RenderConfig;
-import com.silverwrist.venice.servlets.format.RenderData;
-
-public class StyleSheet extends HttpServlet
-{
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "StyleSheet applet - Generates a Cascading Stylesheet for Venice's use\n"
- + "Part of the Venice Web Communities System\n";
- return rc;
-
- } // end getServletInfo
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException
- {
- ServletContext ctxt = getServletContext();
- RenderData rdat = RenderConfig.createRenderData(ctxt,request,response);
- String stylesheet = Variables.getStyleSheetData(ctxt,rdat);
- if (stylesheet!=null)
- { // send back the stylesheet
- response.setContentType("text/css");
- response.setContentLength(stylesheet.length());
- PrintWriter out = response.getWriter();
- out.write(stylesheet);
- out.flush();
- response.flushBuffer();
-
- } // end if
- else // no stylesheet data
- response.sendError(HttpServletResponse.SC_NOT_FOUND,"stylesheets not enabled");
-
- } // end doGet
-
-} // end class StyleSheet
diff --git a/src/com/silverwrist/venice/servlets/SystemAdmin.java b/src/com/silverwrist/venice/servlets/SystemAdmin.java
deleted file mode 100644
index 00f6c40..0000000
--- a/src/com/silverwrist/venice/servlets/SystemAdmin.java
+++ /dev/null
@@ -1,474 +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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class SystemAdmin extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(SystemAdmin.class);
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private SystemAdminTop makeSystemAdminTop() throws ServletException
- {
- final String desired_name = "SystemAdminTop";
- MenuPanelCache cache = MenuPanelCache.getMenuPanelCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- SystemAdminTop template = new SystemAdminTop();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (SystemAdminTop)(cache.getNewMenuPanel(desired_name));
-
- } // end makeSystemAdminTop
-
- private AdminModifyUserDialog makeAdminModifyUserDialog() throws ServletException
- {
- final String desired_name = "AdminModifyUserDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- AdminModifyUserDialog template = new AdminModifyUserDialog();
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (AdminModifyUserDialog)(cache.getNewDialog(desired_name));
-
- } // end makeAdminModifyUserDialog
-
- private EditGlobalPropertiesDialog makeGlobalPropertiesDialog(SecurityInfo sinf) throws ServletException
- {
- final String desired_name = "EditGlobalPropertiesDialog";
- DialogCache cache = DialogCache.getDialogCache(getServletContext());
-
- if (!(cache.isCached(desired_name)))
- { // create a template and save it off
- EditGlobalPropertiesDialog template = new EditGlobalPropertiesDialog(sinf);
- cache.saveTemplate(template);
-
- } // end if
-
- // return a new copy
- return (EditGlobalPropertiesDialog)(cache.getNewDialog(desired_name));
-
- } // end makeGlobalPropertiesDialog
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "SystemAdmin servlet - Administrative functions for the entire system\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
- {
- // decide what to do based on the "cmd" parameter
- String cmd = getStandardCommandParam(request);
- if (logger.isDebugEnabled())
- logger.debug("SystemAdmin/doGet command value = " + cmd);
-
- if (cmd.equals("A"))
- { // "A" = View System Audit Records
- try
- { // get the list of audit records
- AdminOperations adm = user.getAdminInterface();
- int offset = 0;
- try
- { // convert the offset parameter
- String s_ofs = request.getParameter("ofs");
- if (!StringUtil.isStringEmpty(s_ofs))
- offset = Integer.parseInt(s_ofs);
-
- } // end try
- catch (NumberFormatException nfe)
- { // if it's untranslatable, set it at 0
- offset = 0;
-
- } // end catch
-
- // generate the lists
- List audit_list = adm.getAuditRecords(offset,engine.getNumAuditRecordsPerPage());
- int audit_count = adm.getAuditRecordCount();
-
- // return the audit viewer
- setMyLocation(request,"sysadmin?cmd=A&ofs=" + offset);
- return new AuditDataViewer(engine,audit_list,offset,audit_count,"System Audit Records",
- "sysadmin?cmd=A&ofs=%");
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to retrieve audit records: " + de.getMessage(),
- "sysadmin");
-
- } // end catch
-
- } // end if ("A" command)
-
- if (cmd.equals("UF"))
- { // "UF" = "User Find" - the initial screen of User Account Management
- if (!(user.hasAdminAccess()))
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- // prepare and load the display
- AdminFindUser afu = new AdminFindUser(engine);
- afu.loadGet();
- setMyLocation(request,"sysadmin?cmd=UF");
- return afu;
-
- } // end if ("UF" command)
-
- if (cmd.equals("UM"))
- { // "UM" = "User Modify" - the second screen of user account management
- try
- { // get the user to be modified
- AdminOperations adm = user.getAdminInterface();
- String s_uid = request.getParameter("uid");
- if (s_uid==null)
- throw new ErrorBox(null,"User ID parameter not found.","sysadmin?cmd=UF");
- AdminUserContext admuser = adm.getUserContext(Integer.parseInt(s_uid));
-
- AdminModifyUserDialog dlg = makeAdminModifyUserDialog();
- dlg.setupDialog(adm,admuser);
- setMyLocation(request,"sysadmin?cmd=UM");
- return dlg;
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to retrieve user information: " + de.getMessage(),
- "sysadmin?cmd=UF");
-
- } // end catch
- catch (NumberFormatException nfe)
- { // this is if we get a bogus UID
- return new ErrorBox(null,"Invalid user ID parameter.","sysadmin?cmd=UF");
-
- } // end catch
-
- } // end if ("UM" command)
-
- if (cmd.equals("G"))
- { // "G" = Edit Global Properties
- try
- { // get the global properties
- AdminOperations adm = user.getAdminInterface();
- EditGlobalPropertiesDialog dlg = makeGlobalPropertiesDialog(adm.getSecurityInfo());
- dlg.setupDialog(adm);
- setMyLocation(request,"sysadmin?cmd=G");
- return dlg;
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
-
- } // end if ("G" command)
-
- if (cmd.equals("IMP"))
- { // "IMP" = "Import Users"
- try
- { // get the import dialog
- AdminImportUser rc = new AdminImportUser(user.getAdminInterface(),false);
- setMyLocation(request,"sysadmin?cmd=IMP");
- return rc;
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
-
- } // end if ("IMP" command)
-
- // TODO: other command handling
-
- if (!(user.hasAdminAccess()))
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- setMyLocation(request,"sysadmin");
- return makeSystemAdminTop();
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // decide what to do based on the "cmd" parameter
- String cmd = getStandardCommandParam(request);
- if (logger.isDebugEnabled())
- logger.debug("SystemAdmin/doPost command value = " + cmd);
-
- if (cmd.equals("UF"))
- { // "UF" = "User Find" - the initial screen of User Account Management
- if (!(user.hasAdminAccess()))
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- try
- { // prepare and load the display
- AdminFindUser afu = new AdminFindUser(engine);
- afu.loadPost(request);
- setMyLocation(request,"sysadmin?cmd=UF");
- return afu;
-
- } // end try
- catch (DataException de)
- { // catch a database error and return it
- return new ErrorBox("Database Error","Database error on find: " + de.getMessage(),"sysadmin?cmd=UF");
-
- } // end catch
- catch (ValidationException ve)
- { // there was a validation error
- return new ErrorBox("Find Error",ve.getMessage(),"sysadmin?cmd=UF");
-
- } // end catch
-
- } // end if ("UF" command)
-
- if (cmd.equals("UM"))
- { // "UM" = "User Modify" - the second screen of user account management
- try
- { // get the dialog box
- AdminModifyUserDialog dlg = makeAdminModifyUserDialog();
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult("sysadmin?cmd=UF"); // we decided not to bother - go back
-
- if (dlg.isButtonClicked(request,"update"))
- { // get the user to be modified
- AdminOperations adm = user.getAdminInterface();
- String s_uid = request.getParameter("uid");
- if (s_uid==null)
- throw new ErrorBox(null,"User ID parameter not found.","sysadmin?cmd=UF");
- AdminUserContext admuser = adm.getUserContext(Integer.parseInt(s_uid));
-
- dlg.loadValues(request); // load field values
-
- try
- { // execute the dialog!
- dlg.doDialog(admuser);
- throw new RedirectResult("sysadmin?cmd=UF");
-
- } // end try
- catch (ValidationException ve)
- { // this is a simple error
- dlg.resetOnError(adm,admuser,ve.getMessage() + " Please try again.");
- setMyLocation(request,"sysadmin?cmd=UM");
- return dlg;
-
- } // end catch
-
- } // end if
- else
- { // the button must be wrong!
- logger.error("no known button click on SystemAdmin.doPost, cmd=UF");
- return new ErrorBox("Internal Error","Unknown command button pressed","sysadmin?cmd=UF");
-
- } // end else
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to retrieve user information: " + de.getMessage(),
- "sysadmin?cmd=UF");
-
- } // end catch
- catch (NumberFormatException nfe)
- { // this is if we get a bogus UID
- return new ErrorBox(null,"Invalid user ID parameter.","sysadmin?cmd=UF");
-
- } // end catch
-
- } // end if ("UM" command)
-
- if (cmd.equals("G"))
- { // "G" - Edit Global Properties
- try
- { // get the dialog box
- EditGlobalPropertiesDialog dlg = makeGlobalPropertiesDialog(engine.getSecurityInfo());
-
- if (dlg.isButtonClicked(request,"cancel"))
- throw new RedirectResult("sysadmin"); // we decided not to bother - go back
-
- if (dlg.isButtonClicked(request,"update"))
- { // update the system properties
- AdminOperations adm = user.getAdminInterface();
- dlg.loadValues(request);
-
- try
- { // execute the dialog!
- dlg.doDialog(adm);
- throw new RedirectResult("sysadmin");
-
- } // end try
- catch (ValidationException ve)
- { // validation error - retry the dialog
- dlg.setErrorMessage(ve.getMessage() + " Please try again.");
- setMyLocation(request,"sysadmin?cmd=G");
- return dlg;
-
- } // end catch
-
- } // end if
- else
- { // the button must be wrong!
- logger.error("no known button click on SystemAdmin.doPost, cmd=G");
- return new ErrorBox("Internal Error","Unknown command button pressed","sysadmin?cmd=UF");
-
- } // end else
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (DataException de)
- { // error pulling the audit records
- return new ErrorBox("Database Error","Unable to update global properties: " + de.getMessage(),
- "sysadmin");
-
- } // end catch
-
- } // end if ("G" command)
-
- // TODO: other command handling
-
- if (!(user.hasAdminAccess()))
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- setMyLocation(request,"sysadmin");
- return makeSystemAdminTop();
-
- } // end doVenicePost
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // decide what to do based on the "cmd" parameter
- String cmd = getStandardCommandParam(mphandler);
- if (logger.isDebugEnabled())
- logger.debug("SystemAdmin/doPost command value = " + cmd);
-
- if (cmd.equals("IMP"))
- { // "IMP" = "Import User Accounts"
- try
- { // get the administrative interface and then check the buttons
- AdminOperations adm = user.getAdminInterface();
- if (isImageButtonClicked(mphandler,"cancel"))
- throw new RedirectResult("sysadmin"); // we decided not to bother - go back
- if (!isImageButtonClicked(mphandler,"upload"))
- { // the button must be wrong!
- logger.error("no known button click on SystemAdmin.doPost, cmd=IMP");
- return new ErrorBox("Internal Error","Unknown command button pressed","sysadmin");
-
- } // end if
-
- if (!(mphandler.isFileParam("idata")))
- return new ErrorBox("Internal Error","Invalid input file parameter.","sysadmin");
-
- // create the view object and use it to execute the operation
- AdminImportUser rc = new AdminImportUser(user.getAdminInterface(),true);
- rc.execute(mphandler.getFileContentStream("idata"));
- setMyLocation(request,"sysadmin?cmd=IMP");
- return rc;
-
- } // end try
- catch (AccessError ae)
- { // an access error generally means we're not an administrator
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- } // end catch
- catch (ServletMultipartException smpe)
- { // error loading the data stream
- return new ErrorBox("Internal Error","Error loading post data: " + smpe.getMessage(),"sysadmin");
-
- } // end catch
-
- } // end if
-
- // TODO: other command handling
-
- if (!(user.hasAdminAccess()))
- return new ErrorBox("Access Error","You do not have permission to administer the system.",null);
-
- setMyLocation(request,"sysadmin");
- return makeSystemAdminTop();
-
- } // end doVenicePost
-
-} // end class SystemAdmin
diff --git a/src/com/silverwrist/venice/servlets/Top.java b/src/com/silverwrist/venice/servlets/Top.java
deleted file mode 100644
index 4baeef7..0000000
--- a/src/com/silverwrist/venice/servlets/Top.java
+++ /dev/null
@@ -1,102 +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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import org.apache.log4j.xml.DOMConfigurator;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class Top extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config); // required before we do anything else
- ServletContext ctxt = config.getServletContext();
- String root_file_path = ctxt.getRealPath("/");
- if (!(root_file_path.endsWith("/")))
- root_file_path += "/";
-
- // Initialize LOG4J logging.
- String lconf = ctxt.getInitParameter("logging.config");
- if (!(lconf.startsWith("/")))
- lconf = root_file_path + lconf;
- DOMConfigurator.configure(lconf);
-
- // Initialize the Venice engine.
- VeniceEngine engine = Variables.getVeniceEngine(ctxt);
-
- // Initialize the Venice rendering system.
- RenderConfig.getRenderConfig(ctxt);
-
- } // end init
-
- public void destroy()
- {
- super.destroy();
-
- } // end destroy
-
- public String getServletInfo()
- {
- String rc = "Top applet - Displays the Venice front page\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
- {
- changeMenuTop(request);
- setMyLocation(request,"top");
-
- try
- { // attempt to get the user content
- return new TopDisplay(getServletContext(),engine,user);
-
- } // end try
- catch (DataException de)
- { // there was a database error, whoops!
- return new ErrorBox("Database Error","Error loading front page: " + de.getMessage(),null);
-
- } // end catch
- catch (AccessError ae)
- { // there was an access error, whoops!
- return new ErrorBox("Access Error",ae.getMessage(),null);
-
- } // end catch
-
- } // end doVeniceGet
-
-} // end class Top
diff --git a/src/com/silverwrist/venice/servlets/TopicOperations.java b/src/com/silverwrist/venice/servlets/TopicOperations.java
deleted file mode 100644
index 7716f27..0000000
--- a/src/com/silverwrist/venice/servlets/TopicOperations.java
+++ /dev/null
@@ -1,252 +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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class TopicOperations extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String DELETE_CONFIRM_ATTR = "servlets.TopicOperations.delete.confirm";
- private static final String DELETE_CONFIRM_PARAM = "confirm";
-
- private static Category logger = Category.getInstance(TopicOperations.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "TopicOperations servlet - General topic operations (freeze, archive, etc.)\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
- {
- // get the community
- CommunityContext comm = getCommunityParameter(request,user,true,"top");
- changeMenuCommunity(request,comm);
- String locator = "sig=" + comm.getCommunityID();
- String location = "sigprofile?" + locator;
-
- // get the conference
- ConferenceContext conf = getConferenceParameter(request,comm,true,location);
- locator += "&conf=" + conf.getConfID();
- location = "confdisp?" + locator;
-
- // get the topic
- TopicContext topic = getTopicParameter(request,conf,true,location);
- locator += "&top=" + topic.getTopicNumber();
- location = "confdisp?" + locator;
-
- // figure out what command we want to perform...
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("HY") || cmd.equals("HN"))
- { // we want to set the hide status of the topic
- try
- { // call down to set the topic!
- topic.setHidden(cmd.equals("HY"));
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting hide status: " + de.getMessage(),
- location);
-
- } // end catch
-
- // go back to the topic view
- throw new RedirectResult(location);
-
- } // end if ("hide" or "show")
-
- if (cmd.equals("FY") || cmd.equals("FN"))
- { // we want to set the frozen status of the topic
- try
- { // call down to set the topic!
- topic.setFrozen(cmd.equals("FY"));
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting freeze status: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- // go back to the topic view
- throw new RedirectResult(location);
-
- } // end if ("freeze" or "unfreeze")
-
- if (cmd.equals("AY") || cmd.equals("AN"))
- { // we want to change the archived status of the topic
- try
- { // call down to set the topic!
- topic.setArchived(cmd.equals("AY"));
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting archive status: " + de.getMessage(),
- location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- // go back to the topic view
- throw new RedirectResult(location);
-
- } // end if ("archive" or "unarchive")
-
- if (cmd.equals("DEL"))
- { // Delete Topic requires a confirmation!
- if (ConfirmBox.isConfirmed(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM))
- { // OK, go ahead, delete the topic!
- location = "confdisp?sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- try
- { // delete the bloody topic!
- topic.delete();
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error deleting topic: " + de.getMessage(),location);
-
- } // end catch
- catch (AccessError ae)
- { // naughty naughty = you can't do this!
- return new ErrorBox("Access Error",ae.getMessage(),location);
-
- } // end catch
-
- // go back to the conference view
- throw new RedirectResult(location);
-
- } // end if (confirmed)
- else
- { // not a proper confirmation - better display one
- String message = "You are about to delete topic " + String.valueOf(topic.getTopicNumber())
- + " from the \"" + conf.getName() + "\" conference! Are you sure you want to do this?";
- return new ConfirmBox(request,DELETE_CONFIRM_ATTR,DELETE_CONFIRM_PARAM,"Delete Topic",message,
- "topicops?" + locator + "&cmd=DEL",location);
-
- } // end else
-
- } // end if (delete)
-
- if (cmd.equals("RB"))
- { // "RB" = "Remove Bozo" (UID specified as parameter "u")
- int uid = -1;
- try
- { // get the user ID to un-bozo
- String foo = request.getParameter("u");
- if (foo!=null)
- uid = Integer.parseInt(foo);
-
- } // end try
- catch (NumberFormatException nfe)
- { // just don't do anything on error
- uid = -1;
-
- } // end catch
-
- try
- { // remove "bozo" status from this user
- if (uid>0)
- topic.setBozo(uid,false);
- setMyLocation(request,"topicops?" + locator);
- return new ManageTopic(user,comm,conf,topic);
-
- } // end try
- catch (DataException de)
- { // whoops! this is a problem!
- return new ErrorBox("Database Error","Database error removing filtered user: " + de.getMessage(),
- "topicops?" + locator);
-
- } // end catch
-
- } // end if (remove bozo)
-
- if (cmd.equals("SY") || cmd.equals("SN"))
- { // "SY", "SN" - Set subscription status
- try
- { // call down to set the topic!
- topic.setSubscribed(cmd.equals("SY"));
- setMyLocation(request,"topicops?" + locator);
- return new ManageTopic(user,comm,conf,topic);
-
- } // end try
- catch (DataException de)
- { // there was a database error
- return new ErrorBox("Database Error","Database error setting subscription status: " + de.getMessage(),
- location);
-
- } // end catch
-
- } // end if (subscription control)
-
- // unrecognized command - load the "Manage Topic menu"
- try
- { // return that "Manage Topic" page
- setMyLocation(request,"topicops?" + locator);
- return new ManageTopic(user,comm,conf,topic);
-
- } // end try
- catch (DataException de)
- { // whoops! this is a problem!
- return new ErrorBox("Database Error","Database error loading manage page: " + de.getMessage(),location);
-
- } // end catch
-
- } // end doVeniceGet
-
-} // end class TopicOperations
diff --git a/src/com/silverwrist/venice/servlets/UserDisplay.java b/src/com/silverwrist/venice/servlets/UserDisplay.java
deleted file mode 100644
index a8f9522..0000000
--- a/src/com/silverwrist/venice/servlets/UserDisplay.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;
-
-import java.io.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class UserDisplay extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(UserDisplay.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "UserDisplay servlet - Displays Venice user profiles\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 uname = request.getPathInfo().substring(1); // the username we're looking at
-
- try
- { // load the profile corresponding to that username and display it
- UserProfile prof = user.getProfile(uname);
- changeMenuTop(request);
- setMyLocation(request,"user" + request.getPathInfo());
- return new UserProfileData(engine,prof);
-
- } // end try
- catch (DataException de)
- { // unable to get the user name
- return new ErrorBox("Database Error","Database error finding user: " + de.getMessage(),"top");
-
- } // end catch
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- String uname = request.getPathInfo().substring(1); // the username we're looking at
- UserProfile prof;
- String on_error;
-
- if (logger.isDebugEnabled())
- logger.debug("Posting to profile: " + uname);
-
- try
- { // load the profile corresponding to that username and display it
- prof = user.getProfile(uname);
- on_error = "user/" + prof.getUserName();
-
- } // end try
- catch (DataException de)
- { // unable to get the user name
- logger.error("error retrieving user profile: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error finding user: " + de.getMessage(),"top");
-
- } // end catch
-
- String cmd = getStandardCommandParam(request);
-
- if (cmd.equals("E"))
- { // send a quick email message - let's do it!
- if (logger.isDebugEnabled())
- logger.debug("sending quick email message");
-
- try
- { // send a quick email message...
- prof.sendQuickEmail(request.getParameter("subj"),request.getParameter("pb"));
-
- } // end try
- catch (AccessError ae)
- { // throw an access error box
- logger.error("access error sending email: " + ae.getMessage(),ae);
- return new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // database error
- logger.error("database error sending email: " + de.getMessage(),de);
- return new ErrorBox("Database Error","Database error sending message: " + de.getMessage(),on_error);
-
- } // end catch
- catch (EmailException ee)
- { // error sending the actual email
- logger.error("email exception: " + ee.getMessage(),ee);
- return new ErrorBox("E-Mail Error","Error sending e-mail: " + ee.getMessage(),on_error);
-
- } // end catch
-
- } // end if
-
- if (logger.isDebugEnabled())
- logger.debug("redisplaying profile window");
- changeMenuTop(request);
- setMyLocation(request,"user" + request.getPathInfo());
- return new UserProfileData(engine,prof);
-
- } // end doVenicePost
-
-} // end class UserDisplay
diff --git a/src/com/silverwrist/venice/servlets/UserPhoto.java b/src/com/silverwrist/venice/servlets/UserPhoto.java
deleted file mode 100644
index 804195b..0000000
--- a/src/com/silverwrist/venice/servlets/UserPhoto.java
+++ /dev/null
@@ -1,174 +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;
-
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.util.image.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public class UserPhoto extends VeniceServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(UserPhoto.class);
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public String getServletInfo()
- {
- String rc = "UserPhoto servlet - changes the user photo for a user\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 tgt = request.getParameter("tgt"); // target location
- if (tgt==null)
- tgt = "top"; // go back to the Top screen if nothing else
-
- try
- { // create the display
- return new UserPhotoData(engine,user,rdat,tgt);
-
- } // end try
- catch (DataException de)
- { // error getting at the data stream from the attachment
- return new ErrorBox("Database Error","Database error generating display: " + de.getMessage(),null);
-
- } // end catch
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- // Get target URL for the operation
- if (mphandler.isFileParam("tgt"))
- { // bogus target URL
- logger.error("Internal Error: 'tgt' should be a normal param");
- return new ErrorBox(null,"Internal Error: 'tgt' should be a normal param","top");
-
- } // end if
-
- String tgt = mphandler.getValue("tgt");
- if (tgt==null)
- tgt = "top"; // go back to the Top screen if nothing else
-
- if (isImageButtonClicked(mphandler,"cancel"))
- throw new RedirectResult("account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- if (isImageButtonClicked(mphandler,"upload"))
- { // uploading the image here!
- // also check on file parameter status
- if (!(mphandler.isFileParam("thepic")))
- { // bogus file parameter
- logger.error("Internal Error: 'thepic' should be a file param");
- return new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
- "account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end if
-
- if (!(mphandler.getContentType("thepic").startsWith("image/")))
- { // must be an image type we uploaded!
- logger.error("Error: 'thepic' not an image type");
- return new ErrorBox(null,"You did not upload an image file. Try again.",
- "userphoto?tgt=" + URLEncoder.encode(tgt));
-
- } // end if
-
- try
- { // get the real picture (normalized to 100x100 size)
- ImageLengthPair real_pic = ImageNormalizer.normalizeImage(mphandler.getFileContentStream("thepic"),
- engine.getUserPhotoSize(),"jpeg");
-
- // set the user photo data!
- ContactInfo ci = user.getContactInfo();
- ci.setPhotoData(request.getContextPath() + "/imagedata/","image/jpeg",real_pic.getLength(),
- real_pic.getData());
- user.putContactInfo(ci);
-
- // Jump back to the profile form.
- throw new RedirectResult("account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end try
- catch (ServletMultipartException smpe)
- { // the servlet multipart parser screwed up
- logger.error("Servlet multipart error:",smpe);
- return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),
- "account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end catch
- catch (ImageNormalizerException ine)
- { // the image was not valid
- logger.error("Image normalizer error:",ine);
- return new ErrorBox(null,ine.getMessage(),"userphoto?tgt=" + URLEncoder.encode(tgt));
-
- } // end catch
- catch (DataException de)
- { // error in the database!
- logger.error("DataException:",de);
- return new ErrorBox("Database Error","Database error storing user photo: " + de.getMessage(),
- "account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end catch
- catch (EmailException ee)
- { // email exception (WTF?)
- logger.error("Email exception (shouldn't happen):",ee);
- return new ErrorBox(null,"Internal Error: " + ee.getMessage(),
- "account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end catch
-
- } // end if
- else
- { // the button must be wrong!
- logger.error("no known button click on UserPhoto.doPost");
- return new ErrorBox("Internal Error","Unknown command button pressed",
- "account?cmd=P&tgt=" + URLEncoder.encode(tgt));
-
- } // end else
-
- } // end doVenicePost
-
-} // end class UserPhoto
diff --git a/src/com/silverwrist/venice/servlets/Variables.java b/src/com/silverwrist/venice/servlets/Variables.java
deleted file mode 100644
index c362e60..0000000
--- a/src/com/silverwrist/venice/servlets/Variables.java
+++ /dev/null
@@ -1,312 +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;
-
-import java.io.*;
-import java.lang.ref.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-import com.silverwrist.venice.servlets.format.menus.*;
-
-public class Variables
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- // ServletContext ("application") attributes
- protected static final String ENGINE_ATTRIBUTE = "com.silverwrist.venice.core.Engine";
- protected static final String STYLESHEET_ATTRIBUTE = "com.silverwrist.venice.rendering.StyleSheet";
-
- // HttpSession ("session") attributes
- protected static final String USERCTXT_ATTRIBUTE = "user.context";
- protected static final String MENU_ATTRIBUTE = "current.menu";
-
- // ServletRequest ("request" attributes)
- protected static final String COOKIEJAR_ATTRIBUTE = "com.silverwrist.venice.servlets.CookieJar";
-
- // Servlet initialization parameters
- protected static final String ENGINE_INIT_PARAM = "venice.config";
-
- // Cookie name
- public static final String LOGIN_COOKIE = "VeniceAuth";
-
- private static Category logger = Category.getInstance(Variables.class);
- private static Integer engine_gate = new Integer(0);
-
- /*--------------------------------------------------------------------------------
- * External static operations
- *--------------------------------------------------------------------------------
- */
-
- public static VeniceEngine getVeniceEngine(ServletContext ctxt) throws ServletException
- {
- synchronized (engine_gate)
- { // we must synchronize efforts to access the engine
- Object foo = ctxt.getAttribute(ENGINE_ATTRIBUTE);
- if (foo!=null)
- return (VeniceEngine)foo;
-
- String root_file_path = ctxt.getRealPath("/");
- if (!(root_file_path.endsWith("/")))
- root_file_path += "/";
-
- String cfgfile = ctxt.getInitParameter(ENGINE_INIT_PARAM); // get the config file name
- if (!(cfgfile.startsWith("/")))
- cfgfile = root_file_path + cfgfile;
- logger.info("Initializing Venice engine using config file: " + cfgfile);
-
- try
- { // extract the configuration file name and create the engine
- VeniceEngine engine = Startup.createEngine(cfgfile,root_file_path);
- ctxt.setAttribute(ENGINE_ATTRIBUTE,engine);
- return engine;
-
- } // end try
- catch (ConfigException e)
- { // configuration failed! post an error message
- logger.fatal("Engine configuration failed: " + e.getMessage(),e);
- throw new ServletException("Venice engine configuration failed: " + e.getMessage(),e);
-
- } // end catch
- catch (DataException e2)
- { // configuration failed! post an error message
- logger.fatal("Engine data load failed: " + e2.getMessage(),e2);
- throw new ServletException("Venice engine data load failed: " + e2.getMessage(),e2);
-
- } // end catch
-
- } // end synchronized block
-
- } // end getVeniceEngine
-
- public static UserContext getUserContext(ServletContext ctxt, HttpServletRequest request,
- HttpSession session)
- throws ServletException
- {
- Object uctmp = session.getAttribute(USERCTXT_ATTRIBUTE);
- if (uctmp!=null)
- return (UserContext)uctmp;
-
- try
- { // use the Venice engine to create a new user context and save it off
- VeniceEngine engine = getVeniceEngine(ctxt);
- UserContext user = engine.createUserContext(request.getRemoteAddr());
-
- // Did the user send a Venice authentication cookie? If so, try to use it.
- Cookie[] cookies = request.getCookies();
- Cookie venice_cookie = null;
- for (int i=0; (venice_cookie==null) && (i.
- *
- * 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;
-
-import java.io.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.util.ServletMultipartHandler;
-import com.silverwrist.util.ServletMultipartException;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.format.*;
-
-public abstract class VeniceServlet extends HttpServlet
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- private static final String LOCATION_ATTR = "com.silverwrist.venice.servlets.internal.Location";
-
- private static Category logger = Category.getInstance(VeniceServlet.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static final void notSupported(HttpServletRequest request, String message) throws ErrorResult
- {
- String protocol = request.getProtocol();
- if (protocol.endsWith("1.1"))
- throw new ErrorResult(HttpServletResponse.SC_METHOD_NOT_ALLOWED,message);
- else
- throw new ErrorResult(HttpServletResponse.SC_BAD_REQUEST,message);
-
- } // end notSupported
-
- private static final CommunityContext getCommunityParameter(String str, UserContext user, boolean required,
- String on_error) throws ErrorBox
- {
- if (StringUtil.isStringEmpty(str))
- { // there's no community parameter
- if (required)
- { // no communty parameter - bail out now!
- logger.error("community parameter not specified!");
- throw new ErrorBox(null,"No community specified.",on_error);
-
- } // end if
- else
- { // a null CommunityContext is permitted
- logger.debug("no community specified");
- return null;
-
- } // end else
-
- } // end if
-
- CommunityContext rc = null;
- try
- { // turn the string into a community ID, and thence to a CommunityContext
- int tmp_id = Integer.parseInt(str);
- rc = user.getCommunityContext(tmp_id);
- if (rc==null)
- { // trap any null results (may not be possible with communities, but you never know)
- logger.error("Community #" + tmp_id + " was not found!");
- throw new ErrorBox(null,"The specified community (#" + tmp_id + ") was not found in the database.",
- on_error);
-
- } // end if
-
- if (logger.isDebugEnabled())
- logger.debug("found community #" + rc.getCommunityID());
-
- } // end try
- catch (NumberFormatException nfe)
- { // error in Integer.parseInt
- logger.error("Cannot convert community parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid community parameter.",on_error);
-
- } // end catch
- catch (DataException de)
- { // error looking up the community
- throw new ErrorBox("Database Error","Database error finding community: " + de.getMessage(),on_error);
-
- } // end catch
-
- return rc;
-
- } // end getCommunityParameter
-
- private static TopicContext getTopicParameter(String str, UserContext user, ConferenceContext conf,
- boolean required, String on_error, String target)
- throws ErrorBox, LogInOrCreate
- {
- if (StringUtil.isStringEmpty(str))
- { // there's no topic parameter
- if (required)
- { // no topic parameter - bail out now!
- logger.error("Topic parameter not specified!");
- throw new ErrorBox(null,"No topic specified.",on_error);
-
- } // end if
- else
- { // a null TopicContext is permitted
- logger.debug("no topic specified");
- return null;
-
- } // end else
-
- } // end if
-
- TopicContext rc = null;
- try
- { // turn the string into a topic number, and thence to a TopicContext
- short tmp_id = Short.parseShort(str);
- rc = conf.getTopic(tmp_id);
- if (rc==null)
- { // the topic was not found!
- logger.error("ConfID #" + conf.getConfID() + " did not have topic #" + tmp_id);
- throw new ErrorBox(null,"Topic #" + tmp_id + " was not found in the '" + conf.getName()
- + "' conference.",on_error);
-
- } // end if
-
- if (logger.isDebugEnabled())
- logger.debug("found topic #" + rc.getTopicID());
-
- } // end try
- catch (NumberFormatException nfe)
- { // error in Integer.parseInt
- logger.error("Cannot convert topic parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid topic parameter.",on_error);
-
- } // end catch
- catch (AccessError ae)
- { // these all get handled in pretty much the same way
- logger.error("getTopicParameter(): Access error retrieving topic parameter");
- if ((user!=null) && (target!=null) && !(user.isLoggedIn()))
- throw new LogInOrCreate(target);
- throw new ErrorBox("Access Error",ae.getMessage(),on_error);
-
- } // end catch
- catch (DataException de)
- { // error looking up the topic
- throw new ErrorBox("Database Error","Database error finding topic: " + de.getMessage(),"top");
-
- } // end catch
-
- return rc;
-
- } // end getTopicParameter
-
- private static TopicMessageContext getMessageParameter(String str, ConferenceContext conf, boolean required,
- String on_error) throws ErrorBox
- {
- if (StringUtil.isStringEmpty(str))
- { // there's no message parameter
- if (required)
- { // no message parameter - bail out now!
- logger.error("Message parameter not specified!");
- throw new ErrorBox(null,"No message specified.",on_error);
-
- } // end if
- else
- { // a null TopicMessageContext is permitted
- logger.debug("no message specified");
- return null;
-
- } // end else
-
- } // end if
-
- TopicMessageContext rc = null;
- try
- { // turn the string into a postid, and thence to a TopicMessageContext
- long tmp_id = Long.parseLong(str);
- rc = conf.getMessageByPostID(tmp_id);
- if (rc==null)
- { // the message was not found
- logger.error("ConfID #" + conf.getConfID() + " does not contain postid " + tmp_id);
- throw new ErrorBox(null,"The post with ID number " + tmp_id + " was not found in the '"
- + conf.getName() + "' conference.",on_error);
-
- } // end if
-
- if (logger.isDebugEnabled())
- logger.debug("found post #" + rc.getPostID());
-
- } // end try
- catch (NumberFormatException nfe)
- { // error in Integer.parseInt
- logger.error("Cannot convert message parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid message 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 message: " + de.getMessage(),on_error);
-
- } // end catch
-
- return rc;
-
- } // end getMessageParameter
-
- private static TopicMessageContext getMessageParameter(String str, TopicContext topic, boolean required,
- String on_error) throws ErrorBox
- {
- if (StringUtil.isStringEmpty(str))
- { // there's no message parameter
- if (required)
- { // no message parameter - bail out now!
- logger.error("Message parameter not specified!");
- throw new ErrorBox(null,"No message specified.",on_error);
-
- } // end if
- else
- { // a null TopicMessageContext is permitted
- logger.debug("no message specified");
- return null;
-
- } // end else
-
- } // end if
-
- TopicMessageContext rc = null;
- try
- { // turn the string into a post number, and thence to a TopicMessageContext
- int tmp_id = Integer.parseInt(str);
- rc = topic.getMessage(tmp_id);
- if (rc==null)
- { // could not find the message
- logger.error("TopicID " + topic.getTopicID() + " does not contain message #" + tmp_id);
- throw new ErrorBox(null,"There is no message #" + tmp_id + " in the '" + topic.getName() + "' topic.",
- on_error);
-
- } // end if
-
- if (logger.isDebugEnabled())
- logger.debug("found post #" + rc.getPostID());
-
- } // end try
- catch (NumberFormatException nfe)
- { // error in Integer.parseInt
- logger.error("Cannot convert message parameter '" + str + "'!");
- throw new ErrorBox(null,"Invalid message 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 message: " + de.getMessage(),on_error);
-
- } // end catch
-
- return rc;
-
- } // end getMessageParameter
-
- /*--------------------------------------------------------------------------------
- * Internal operations intended for use by derived classes
- *--------------------------------------------------------------------------------
- */
-
- protected static final boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- protected static final boolean isImageButtonClicked(ServletMultipartHandler mphandler, String name)
- {
- String val = mphandler.getValue(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- protected final void putUserContext(HttpServletRequest request, UserContext ctxt)
- {
- Variables.putUserContext(request.getSession(true),ctxt);
-
- } // end putUserContext
-
- protected final void clearUserContext(HttpServletRequest request)
- {
- Variables.clearUserContext(request.getSession(true));
-
- } // end clearUserContext
-
- protected final void changeMenuTop(HttpServletRequest request)
- {
- Variables.setMenuTop(getServletContext(),request.getSession(true));
-
- } // end changeMenuTop
-
- protected final void changeMenuCommunity(HttpServletRequest request, CommunityContext comm)
- {
- Variables.setMenuCommunity(getServletContext(),request.getSession(true),comm);
-
- } // end changeMenuCommunity
-
- protected final void clearMenu(HttpServletRequest request)
- {
- Variables.clearMenu(request.getSession(true));
-
- } // end clearMenu
-
- protected final String getStandardCommandParam(ServletRequest request)
- {
- String foo = request.getParameter("cmd");
- if (foo==null)
- return "???";
- else
- return foo;
-
- } // end getStandardCommandParam
-
- protected final String getStandardCommandParam(ServletMultipartHandler mphandler) throws ErrorBox
- {
- if (mphandler.isFileParam("cmd"))
- throw new ErrorBox(null,"Internal Error: command should be a normal param",null);
- String foo = mphandler.getValue("cmd");
- if (foo==null)
- return "???";
- else
- return foo;
-
- } // end getStandardCommandParam
-
- protected final void setMyLocation(ServletRequest request, String loc)
- {
- request.setAttribute(LOCATION_ATTR,loc);
-
- } // end setMyLocation
-
- protected final static CommunityContext getCommunityParameter(ServletRequest request, UserContext user,
- boolean required, String on_error)
- throws ErrorBox
- {
- return getCommunityParameter(request.getParameter("sig"),user,required,on_error);
-
- } // end getCommunityParameter
-
- protected final static CommunityContext getCommunityParameter(ServletMultipartHandler mphandler,
- UserContext user, boolean required,
- String on_error) throws ErrorBox
- {
- if (mphandler.isFileParam("sig"))
- throw new ErrorBox(null,"Internal Error: community should be a normal param",on_error);
- return getCommunityParameter(mphandler.getValue("sig"),user,required,on_error);
-
- } // end getCommunityParameter
-
- protected static ConferenceContext getConferenceParameter(String str, CommunityContext comm,
- 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
- 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
- int tmp_id = Integer.parseInt(str);
- rc = comm.getConferenceContext(tmp_id);
- if (rc==null)
- { // couldn't find the conference
- logger.error("community #" + comm.getCommunityID() + " does not contain conference #" + tmp_id);
- throw new ErrorBox(null,"The conference #" + tmp_id + " could not be found in the '" + comm.getName()
- + "' community.",on_error);
-
- } // end if
-
- 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,
- CommunityContext comm, boolean required,
- String on_error) throws ErrorBox
- {
- return getConferenceParameter(request.getParameter("conf"),comm,required,on_error);
-
- } // end getConferenceParameter
-
- protected final static ConferenceContext getConferenceParameter(ServletMultipartHandler mphandler,
- CommunityContext comm, boolean required,
- String on_error) throws ErrorBox
- {
- if (mphandler.isFileParam("conf"))
- throw new ErrorBox(null,"Internal Error: conference should be a normal param",on_error);
- return getConferenceParameter(mphandler.getValue("conf"),comm,required,on_error);
-
- } // end getConferenceParameter
-
- protected final static TopicContext getTopicParameter(ServletRequest request, ConferenceContext conf,
- boolean required, String on_error)
- throws ErrorBox, LogInOrCreate
- {
- return getTopicParameter(request.getParameter("top"),null,conf,required,on_error,null);
-
- } // end getTopicParameter
-
- protected final static TopicContext getTopicParameter(ServletRequest request, UserContext user,
- ConferenceContext conf, boolean required,
- String on_error, String target)
- throws ErrorBox, LogInOrCreate
- {
- return getTopicParameter(request.getParameter("top"),user,conf,required,on_error,target);
-
- } // end getTopicParameter
-
- protected final static TopicContext getTopicParameter(ServletMultipartHandler mphandler,
- ConferenceContext conf, boolean required,
- String on_error) throws ErrorBox, LogInOrCreate
- {
- if (mphandler.isFileParam("top"))
- throw new ErrorBox(null,"Internal Error: topic should be a normal param",on_error);
- return getTopicParameter(mphandler.getValue("top"),null,conf,required,on_error,null);
-
- } // end getTopicParameter
-
- protected final static TopicMessageContext getMessageParameter(ServletRequest request,
- ConferenceContext conf, boolean required,
- String on_error) throws ErrorBox
- {
- return getMessageParameter(request.getParameter("msg"),conf,required,on_error);
-
- } // end getMessageParameter
-
- protected final static TopicMessageContext getMessageParameter(ServletMultipartHandler mphandler,
- ConferenceContext conf, boolean required,
- String on_error) throws ErrorBox
- {
- if (mphandler.isFileParam("msg"))
- throw new ErrorBox(null,"Internal Error: message should be a normal param",on_error);
- return getMessageParameter(mphandler.getValue("msg"),conf,required,on_error);
-
- } // end getMessageParameter
-
- protected final static TopicMessageContext getMessageParameter(ServletRequest request, TopicContext topic,
- boolean required, String on_error)
- throws ErrorBox
- {
- return getMessageParameter(request.getParameter("msg"),topic,required,on_error);
-
- } // end getMessageParameter
-
- protected final static TopicMessageContext getMessageParameter(ServletMultipartHandler mphandler,
- TopicContext topic, boolean required,
- String on_error) throws ErrorBox
- {
- if (mphandler.isFileParam("msg"))
- throw new ErrorBox(null,"Internal Error: message should be a normal param",on_error);
- return getMessageParameter(mphandler.getValue("msg"),topic,required,on_error);
-
- } // end getMessageParameter
-
- /*--------------------------------------------------------------------------------
- * Overrideable operations
- *--------------------------------------------------------------------------------
- */
-
- protected String getMyLocation(HttpServletRequest request)
- {
- return (String)(request.getAttribute(LOCATION_ATTR));
-
- } // end getMyLocation
-
- protected String getMyLocation(HttpServletRequest request, VeniceEngine engine, UserContext user,
- RenderData rdat)
- {
- return getMyLocation(request);
-
- } // end getMyLocation
-
- protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- notSupported(request,"GET method not supported");
- return null;
-
- } // end doVeniceGet
-
- protected VeniceContent doVenicePost(HttpServletRequest request, VeniceEngine engine,
- UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- notSupported(request,"POST method not supported for normal form posts");
- return null;
-
- } // end doVenicePost
-
- protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
- VeniceEngine engine, UserContext user, RenderData rdat)
- throws ServletException, IOException, VeniceServletResult
- {
- notSupported(request,"POST method not supported for multipart/form-data posts");
- return null;
-
- } // end doVenicePost
-
- /*--------------------------------------------------------------------------------
- * Overrides from class HttpServlet
- *--------------------------------------------------------------------------------
- */
-
- public final void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException
- {
- ServletContext ctxt = getServletContext();
- VeniceEngine engine = Variables.getVeniceEngine(ctxt);
- VeniceContent content = null;
-
- // Make all log messages for the request carry the remote address.
- NDC.push(request.getRemoteAddr());
- try
- { // get the user context
- UserContext user = Variables.getUserContext(ctxt,request,request.getSession(true));
- boolean record_uname = user.isLoggedIn();
- if (record_uname)
- NDC.push(user.getUserName());
-
- try
- { // and now we proceed!
- RenderData rdat = RenderConfig.createRenderData(ctxt,user,request,response);
-
- try
- { // run the actual "get" in the servlet
- content = doVeniceGet(request,engine,user,rdat);
-
- } // end try
- catch (VeniceServletResult res)
- { // special VeniceServletResult catch here - figure out what result it is
- if (res instanceof VeniceContent)
- content = (VeniceContent)res; // this is content
- else if (res instanceof ContentResult)
- { // this contains content
- ContentResult cres = (ContentResult)res;
- content = cres.getContent();
-
- } // end else if
- else if (res instanceof ExecuteResult)
- { // direct-execution result
- ExecuteResult xres = (ExecuteResult)res;
- Variables.flushCookies(request,response);
- xres.execute(rdat);
- return;
-
- } // end else if
- else // unrecognized VeniceServletResult
- content = null;
-
- } // end catch
- catch (RuntimeException re)
- { // record that we caught a runtime exception in here!
- logger.error("VeniceServlet.doGet caught " + re.getClass().getName() + " in doVeniceGet",re);
- throw re;
-
- } // end catch
-
- Variables.flushCookies(request,response);
- if (content!=null)
- { // display the content!
- BaseJSPData base = new BaseJSPData(engine,user,getMyLocation(request,engine,user,rdat),content);
- base.transfer(ctxt,rdat);
-
- } // end if
- else // there is no content - display the null response
- rdat.nullResponse();
-
- } // end try
- finally
- { // pop the username from the NDC if we used it
- if (record_uname)
- NDC.pop();
-
- } // end finally
-
- } // end try
- finally
- { // pop the nested diagnostic context
- NDC.pop();
-
- } // end finally
-
- } // end doGet
-
- public final void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException
- {
- ServletContext ctxt = getServletContext();
- VeniceEngine engine = Variables.getVeniceEngine(ctxt);
- ServletMultipartHandler mphandler = null;
- VeniceContent content = null;
-
- // Make all log messages for the request carry the remote address.
- NDC.push(request.getRemoteAddr());
- try
- { // get the user context
- UserContext user = Variables.getUserContext(ctxt,request,request.getSession(true));
- boolean record_uname = user.isLoggedIn();
- if (record_uname)
- NDC.push(user.getUserName());
-
- try
- { // and now we proceed!
- RenderData rdat = RenderConfig.createRenderData(ctxt,user,request,response);
-
- if (ServletMultipartHandler.canHandle(request))
- { // if this is a multipart/form-data request, invoke our special handler code
- try
- { // create the multipart handler
- mphandler = new ServletMultipartHandler(request);
-
- } // end try
- catch (ServletMultipartException e)
- { // this is an error message we need to generate and just bail out on
- logger.error("ServletMultipartException caught in doVenicePost!",e);
- BaseJSPData base = new BaseJSPData(engine,user,getMyLocation(request,engine,user,rdat),
- new ErrorBox(null,"Internal Error: " + e.getMessage(),null));
- base.transfer(ctxt,rdat);
- return;
-
- } // end if
-
- } // end if
-
- try
- { // call the appropriate doVenicePost method
- if (mphandler!=null)
- content = doVenicePost(request,mphandler,engine,user,rdat);
- else
- content = doVenicePost(request,engine,user,rdat);
-
- } // end try
- catch (VeniceServletResult res)
- { // special VeniceServletResult catch here - figure out what result it is
- if (res instanceof VeniceContent)
- content = (VeniceContent)res; // this is content
- else if (res instanceof ContentResult)
- { // this contains content
- ContentResult cres = (ContentResult)res;
- content = cres.getContent();
-
- } // end else if
- else if (res instanceof ExecuteResult)
- { // direct-execution result
- ExecuteResult xres = (ExecuteResult)res;
- Variables.flushCookies(request,response);
- xres.execute(rdat);
- return;
-
- } // end else if
- else // unrecognized VeniceServletResult
- content = null;
-
- } // end catch
- catch (RuntimeException re)
- { // record that we caught a runtime exception in here!
- logger.error("VeniceServlet.doPost caught " + re.getClass().getName() + " in doVenicePost",re);
- throw re;
-
- } // end catch
-
- Variables.flushCookies(request,response);
- if (content!=null)
- { // display the content!
- BaseJSPData base = new BaseJSPData(engine,user,getMyLocation(request,engine,user,rdat),content);
- base.transfer(ctxt,rdat);
-
- } // end if
- else // there is no content - display the null response
- rdat.nullResponse();
-
- } // end try
- finally
- { // pop the username from the NDC if we used it
- if (record_uname)
- NDC.pop();
-
- } // end finally
-
- } // end try
- finally
- { // pop the nested diagnostic context
- NDC.pop();
-
- } // end finally
-
- } // end doPost
-
-} // end class VeniceServlet
diff --git a/src/com/silverwrist/venice/servlets/format/AdminFindUser.java b/src/com/silverwrist/venice/servlets/format/AdminFindUser.java
deleted file mode 100644
index 0f1026d..0000000
--- a/src/com/silverwrist/venice/servlets/format/AdminFindUser.java
+++ /dev/null
@@ -1,246 +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.util.*;
-import javax.servlet.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class AdminFindUser implements JSPRender, SearchMode
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.AdminFindUser";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
- private int field = -1;
- private int mode = -1;
- private String term = null;
- private int offset = 0;
- private List results = null;
- private int find_count = -1;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public AdminFindUser(VeniceEngine engine)
- {
- this.engine = engine;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, return default
- return default_val;
-
- } // end catch
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static AdminFindUser retrieve(ServletRequest request)
- {
- return (AdminFindUser)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "User Account Management";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return "sysadmin?cmd=UF";
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "admin_find.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getSearchField()
- {
- return field;
-
- } // end getSearchField
-
- public boolean searchFieldIs(int value)
- {
- return (value==field);
-
- } // end searchFieldIs
-
- public int getSearchMode()
- {
- return mode;
-
- } // end getSearchMode
-
- public boolean searchModeIs(int value)
- {
- return (value==mode);
-
- } // end searchModeIs
-
- public String getSearchTerm()
- {
- return term;
-
- } // end getSearchTerm
-
- public List getResultsList()
- {
- return results;
-
- } // end getResultsList
-
- public int getNumResultsDisplayed()
- {
- return engine.getStdNumSearchResults();
-
- } // end getNumResultsDisplayed
-
- public int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public void loadGet()
- {
- field = FIELD_USER_NAME;
- mode = SEARCH_PREFIX;
- term = "";
-
- } // end loadGet
-
- public void loadPost(ServletRequest request) throws ValidationException, DataException
- {
- int catid = -1;
-
- // Retrieve all the posted parameters from the form and validate them.
- field = getParamInt(request,"field",FIELD_USER_NAME);
- if ( (field!=FIELD_USER_NAME) && (field!=FIELD_USER_DESCRIPTION) && (field!=FIELD_USER_GIVEN_NAME)
- && (field!=FIELD_USER_FAMILY_NAME))
- throw new ValidationException("The field search parameter is not valid.");
- mode = getParamInt(request,"mode",SEARCH_PREFIX);
- if ((mode!=SEARCH_PREFIX) && (mode!=SEARCH_SUBSTRING) && (mode!=SEARCH_REGEXP))
- throw new ValidationException("The search mode parameter is not valid.");
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Run the actual search.
- results = engine.searchForUsers(field,mode,term,offset,count);
- if (find_count<0)
- find_count = engine.getSearchUserCount(field,mode,term);
-
- } // end loadPost
-
-} // end class AdminFindUser
diff --git a/src/com/silverwrist/venice/servlets/format/AdminModifyUserDialog.java b/src/com/silverwrist/venice/servlets/format/AdminModifyUserDialog.java
deleted file mode 100644
index 0f8067e..0000000
--- a/src/com/silverwrist/venice/servlets/format/AdminModifyUserDialog.java
+++ /dev/null
@@ -1,378 +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.util.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.security.Role;
-
-public class AdminModifyUserDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * The photo URL control class.
- *--------------------------------------------------------------------------------
- */
-
- static class CDUserPhotoControl extends CDBaseFormField
- {
- private String linkURL;
-
- public CDUserPhotoControl(String name, String caption, String linkURL)
- {
- super(name,caption,"(click to change)",false);
- this.linkURL = linkURL;
-
- } // end constructor
-
- protected CDUserPhotoControl(CDUserPhotoControl other)
- {
- super(other);
- this.linkURL = other.linkURL;
-
- } // end constructor
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- if (isEnabled())
- out.write("");
- String photo = getValue();
- if (StringUtil.isStringEmpty(photo))
- photo = rdat.getPhotoNotAvailURL();
- out.write("");
- if (isEnabled())
- out.write("");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- { // this is a do-nothing value
- } // end validateContents
-
- public CDFormField duplicate()
- {
- return new CDUserPhotoControl(this);
-
- } // end clone
-
- public void setLinkURL(String s)
- {
- linkURL = s;
-
- } // end setLinkURL
-
- } // end class CDUserPhotoControl
-
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String YES = "Y";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CDUserPhotoControl photo_control;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public AdminModifyUserDialog()
- {
- super("Modify User Account",null,"moduserform","sysadmin");
- setHiddenField("cmd","UM");
- setHiddenField("uid","");
-
- addFormField(new CDFormCategoryHeader("Security Information","To change the user's password, enter a new "
- + "password into the fields below."));
- addFormField(new CDPasswordFormField("pass1","Password",null,false,32,128));
- addFormField(new CDPasswordFormField("pass2","Password","(retype)",false,32,128));
- addFormField(new CDTextFormField("remind","Password reminder phrase",null,false,32,255));
- addFormField(new CDRoleListFormField("base_lvl","Base security level",null,true,
- Collections.EMPTY_LIST));
- addFormField(new CDCheckBoxFormField("verify_email","E-mail address verified",null,YES));
- addFormField(new CDCheckBoxFormField("lockout","Account locked out",null,YES));
- addFormField(new CDCheckBoxFormField("nophoto","Disallow photo uploads for this user",null,YES));
- addFormField(new CDFormCategoryHeader("Name"));
- addFormField(new CDTextFormField("prefix","Prefix","(Mr., Ms., etc.)",false,8,8));
- addFormField(new CDTextFormField("first","First name",null,true,32,64));
- addFormField(new CDTextFormField("mid","Middle initial",null,false,1,1));
- addFormField(new CDTextFormField("last","Last name",null,true,32,64));
- addFormField(new CDTextFormField("suffix","Suffix","(Jr., III, etc.)",false,16,16));
- addFormField(new CDFormCategoryHeader("Location"));
- addFormField(new CDTextFormField("company","Company",null,false,32,255));
- addFormField(new CDTextFormField("addr1","Address",null,false,32,255));
- addFormField(new CDTextFormField("addr2","Address","(line 2)",false,32,255));
- addFormField(new CDCheckBoxFormField("pvt_addr","Hide address in profile",null,YES));
- addFormField(new CDTextFormField("loc","City",null,true,32,64));
- addFormField(new CDTextFormField("reg","State/Province",null,true,32,64));
- addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
- addFormField(new CDCountryListFormField("country","Country",null,true));
- addFormField(new CDFormCategoryHeader("Phone Numbers"));
- addFormField(new CDTextFormField("phone","Telephone",null,false,32,32));
- addFormField(new CDTextFormField("mobile","Mobile/cellphone",null,false,32,32));
- addFormField(new CDCheckBoxFormField("pvt_phone","Hide phone/mobile numbers in profile",null,YES));
- addFormField(new CDTextFormField("fax","Fax",null,false,32,32));
- addFormField(new CDCheckBoxFormField("pvt_fax","Hide fax number in profile",null,YES));
- addFormField(new CDFormCategoryHeader("Internet"));
- addFormField(new CDEmailAddressFormField("email","E-mail address",null,true,32,255));
- addFormField(new CDCheckBoxFormField("pvt_email","Hide e-mail address in profile",null,YES));
- addFormField(new CDTextFormField("url","Home page","(URL)",false,32,255));
- addFormField(new CDFormCategoryHeader("Personal"));
- addFormField(new CDTextFormField("descr","Personal description",null,false,32,255));
- photo_control = new CDUserPhotoControl("photo","User Photo","userphoto");
- addFormField(photo_control);
- addFormField(new CDFormCategoryHeader("User Preferences"));
- addFormField(new CDCheckBoxFormField("pic_in_post","Display user photos next to conference posts",
- "(where applicable)",YES));
- addFormField(new CDCheckBoxFormField("no_mass_mail",
- "Don't send user mass E-mail from community/conference hosts",
- null,YES));
- addFormField(new CDLocaleListFormField("locale","Default locale","(for formatting dates/times)",true));
- addFormField(new CDTimeZoneListFormField("tz","Default time zone",null,true));
- addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected AdminModifyUserDialog(AdminModifyUserDialog other)
- {
- super(other);
- photo_control = (CDUserPhotoControl)modifyField("photo");
-
- } // end AdminModifyUserDialog
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private void coreSetup(AdminOperations ops, AdminUserContext admuser)
- {
- setSubtitle("User: " + admuser.getUserName());
- setHiddenField("uid",String.valueOf(admuser.getUID()));
-
- CDPickListFormField level_field = (CDPickListFormField)modifyField("base_lvl");
- List role_list = ops.getAllowedRoleList();
- level_field.setChoicesList(role_list);
-
- // See if this level was found on the list.
- Role my_role = admuser.getBaseRole();
- boolean found = false;
- Iterator it = role_list.iterator();
- while (it.hasNext())
- { // seek each role in turn
- Role r = (Role)(it.next());
- if (r.equals(my_role))
- { // found it!
- found = true;
- break;
-
- } // end if
-
- } // end while
-
- if (!found)
- { // not in the list - set the defined "role list" to be a singleton of our current level
- role_list = Collections.singletonList(my_role);
- level_field.setChoicesList(role_list);
-
- } // end if
-
- } // end coreSetup
-
- /*--------------------------------------------------------------------------------
- * Overrides from class Object
- *--------------------------------------------------------------------------------
- */
-
- public Object clone()
- {
- return new AdminModifyUserDialog(this);
-
- } // end clone
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- String pass1 = getFieldValue("pass1");
- String pass2 = getFieldValue("pass2");
-
- if (StringUtil.isStringEmpty(pass1))
- { // empty must match empty
- if (!StringUtil.isStringEmpty(pass2))
- throw new ValidationException("The typed passwords do not match.");
-
- } // end if
- else
- { // the two passwords must match
- if (!(pass1.equals(pass2)))
- throw new ValidationException("The typed passwords do not match.");
-
- } // end if
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(AdminOperations ops, AdminUserContext admuser) throws DataException
- {
- coreSetup(ops,admuser);
-
- setFieldValue("base_lvl",String.valueOf(admuser.getBaseLevel()));
- if (admuser.isEmailVerified())
- setFieldValue("verify_email",YES);
- if (admuser.isLockedOut())
- setFieldValue("lockout",YES);
-
- ContactInfo ci = admuser.getContactInfo(); // get the main contact info
- AdminUserProperties props = admuser.getProperties();
-
- if (props.getDisallowPhoto())
- setFieldValue("nophoto",YES);
- setFieldValue("prefix",ci.getNamePrefix());
- setFieldValue("first",ci.getGivenName());
- char init = ci.getMiddleInitial();
- if (init!=' ')
- setFieldValue("mid",String.valueOf(init));
- setFieldValue("last",ci.getFamilyName());
- setFieldValue("suffix",ci.getNameSuffix());
- setFieldValue("company",ci.getCompany());
- setFieldValue("addr1",ci.getAddressLine1());
- setFieldValue("addr2",ci.getAddressLine2());
- if (ci.getPrivateAddress())
- setFieldValue("pvt_addr",YES);
- setFieldValue("loc",ci.getLocality());
- setFieldValue("reg",ci.getRegion());
- setFieldValue("pcode",ci.getPostalCode());
- setFieldValue("country",ci.getCountry());
- setFieldValue("phone",ci.getPhone());
- setFieldValue("mobile",ci.getMobile());
- if (ci.getPrivatePhone())
- setFieldValue("pvt_phone",YES);
- setFieldValue("fax",ci.getFax());
- if (ci.getPrivateFax())
- setFieldValue("pvt_fax",YES);
- setFieldValue("email",ci.getEmail());
- if (ci.getPrivateEmail())
- setFieldValue("pvt_email",YES);
- setFieldValue("url",ci.getURL());
- setFieldValue("descr",admuser.getDescription());
- setFieldValue("photo",ci.getPhotoURL());
- photo_control.setLinkURL("adminuserphoto?uid=" + admuser.getUID());
- if (props.getDisplayPostPictures())
- setFieldValue("pic_in_post",YES);
- if (props.getMassMailOptOut())
- setFieldValue("no_mass_mail",YES);
- setFieldValue("locale",admuser.getLocale().toString());
- setFieldValue("tz",admuser.getTimeZone().getID());
-
- } // end setupDialog
-
- public void doDialog(AdminUserContext admuser) throws ValidationException, DataException
- {
- validate(); // validate the dialog
-
- try
- { // reset the base level
- admuser.setBaseLevel(Integer.parseInt(getFieldValue("base_lvl")));
-
- } // end try
- catch (NumberFormatException nfe)
- { // this shouldn't happen
- throw new InternalStateError("new_level should be an integer - form screwup");
-
- } // end catch
-
- // Change the password if applicable.
- String foo = getFieldValue("pass1");
- if (!StringUtil.isStringEmpty(foo))
- admuser.setPassword(foo,getFieldValue("remind"));
-
- admuser.setEmailVerified(YES.equals(getFieldValue("verify_email")));
- admuser.setLockedOut(YES.equals(getFieldValue("lockout")));
-
- ContactInfo ci = admuser.getContactInfo(); // get the main contact info
- AdminUserProperties props = admuser.getProperties();
-
- // Reset all the contact info fields.
- props.setDisallowPhoto(YES.equals(getFieldValue("nophoto")));
- ci.setNamePrefix(getFieldValue("prefix"));
- ci.setGivenName(getFieldValue("first"));
- foo = getFieldValue("mid");
- if ((foo==null) || (foo.length()<1))
- ci.setMiddleInitial(' ');
- else
- ci.setMiddleInitial(foo.charAt(0));
- ci.setFamilyName(getFieldValue("last"));
- ci.setNameSuffix(getFieldValue("suffix"));
- ci.setCompany(getFieldValue("company"));
- ci.setAddressLine1(getFieldValue("addr1"));
- ci.setAddressLine2(getFieldValue("addr2"));
- ci.setPrivateAddress(YES.equals(getFieldValue("pvt_addr")));
- ci.setLocality(getFieldValue("loc"));
- ci.setRegion(getFieldValue("reg"));
- ci.setPostalCode(getFieldValue("pcode"));
- ci.setCountry(getFieldValue("country"));
- ci.setPhone(getFieldValue("phone"));
- ci.setMobile(getFieldValue("mobile"));
- ci.setPrivatePhone(YES.equals(getFieldValue("pvt_phone")));
- ci.setFax(getFieldValue("fax"));
- ci.setPrivateFax(YES.equals(getFieldValue("pvt_fax")));
- ci.setEmail(getFieldValue("email"));
- ci.setPrivateEmail(YES.equals(getFieldValue("pvt_email")));
- ci.setURL(getFieldValue("url"));
- props.setDisplayPostPictures(YES.equals(getFieldValue("pic_in_post")));
- props.setMassMailOptOut(YES.equals(getFieldValue("no_mass_mail")));
-
- // Store the completed contact info.
- admuser.putContactInfo(ci);
- admuser.setProperties(props);
-
- // Save off the user's description and preferences.
- admuser.setDescription(getFieldValue("descr"));
- admuser.setLocale(International.get().createLocale(getFieldValue("locale")));
- admuser.setTimeZone(TimeZone.getTimeZone(getFieldValue("tz")));
-
- } // end doDialog
-
- public void resetOnError(AdminOperations ops, AdminUserContext admuser, String message)
- {
- coreSetup(ops,admuser);
- setErrorMessage(message);
- setFieldValue("pass1",null);
- setFieldValue("pass2",null);
-
- } // end resetOnError
-
-} // end class AdminModifyUserDialog
diff --git a/src/com/silverwrist/venice/servlets/format/AdminUserPhotoData.java b/src/com/silverwrist/venice/servlets/format/AdminUserPhotoData.java
deleted file mode 100644
index a1e7eb5..0000000
--- a/src/com/silverwrist/venice/servlets/format/AdminUserPhotoData.java
+++ /dev/null
@@ -1,135 +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.awt.Dimension;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class AdminUserPhotoData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.AdminUserPhotoData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private Dimension photo_dims;
- private String photo_url;
- private int uid;
- private String user_name;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public AdminUserPhotoData(VeniceEngine engine, AdminUserContext admuser, RenderData rdat)
- throws DataException
- {
- photo_dims = engine.getUserPhotoSize();
- photo_url = admuser.getContactInfo().getPhotoURL();
- if (StringUtil.isStringEmpty(photo_url))
- photo_url = rdat.getPhotoNotAvailURL();
- this.uid = admuser.getUID();
- this.user_name = admuser.getUserName();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static AdminUserPhotoData retrieve(ServletRequest request)
- {
- return (AdminUserPhotoData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Set User Photo";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "admin_user_photo.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getUID()
- {
- return uid;
-
- } // end getUID
-
- public String getUserName()
- {
- return user_name;
-
- } // end getUserName
-
- public String getPhotoTag(RenderData rdat)
- {
- StringBuffer buf = new StringBuffer("");
- return buf.toString();
-
- } // end getPhotoTag
-
-} // end class AdminUserPhotoData
diff --git a/src/com/silverwrist/venice/servlets/format/AttachmentForm.java b/src/com/silverwrist/venice/servlets/format/AttachmentForm.java
deleted file mode 100644
index 88ad534..0000000
--- a/src/com/silverwrist/venice/servlets/format/AttachmentForm.java
+++ /dev/null
@@ -1,135 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.htmlcheck.*;
-import com.silverwrist.venice.core.*;
-
-public class AttachmentForm implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.AttachmentForm";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private int cid;
- private int confid;
- private long postid;
- private String target;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public AttachmentForm(CommunityContext comm, ConferenceContext conf, TopicMessageContext msg, String target)
- {
- this.cid = comm.getCommunityID();
- this.confid = conf.getConfID();
- this.postid = msg.getPostID();
- this.target = target;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static AttachmentForm retrieve(ServletRequest request)
- {
- return (AttachmentForm)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Upload Attachment";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "attach_form.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getCommunityID()
- {
- return cid;
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return confid;
-
- } // end getConfID
-
- public long getPostID()
- {
- return postid;
-
- } // end getPostID
-
- public String getTarget()
- {
- return target;
-
- } // end getTarget
-
-} // end class AttachmentForm
diff --git a/src/com/silverwrist/venice/servlets/format/BaseJSPData.java b/src/com/silverwrist/venice/servlets/format/BaseJSPData.java
deleted file mode 100644
index 977ea86..0000000
--- a/src/com/silverwrist/venice/servlets/format/BaseJSPData.java
+++ /dev/null
@@ -1,227 +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 javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.servlets.Variables;
-import com.silverwrist.venice.servlets.format.menus.LeftMenu;
-
-public class BaseJSPData
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
- protected static final String ATTR_NAME = "com.silverwrist.venice.BaseJSPData";
-
- private static Category logger = Category.getInstance(BaseJSPData.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine; // the Venice engine
- private UserContext user; // user context
- private String location; // location string to use for this page
- private VeniceContent content; // the actual content
- private boolean login_links = true; // show login links up top?
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public BaseJSPData(VeniceEngine engine, UserContext user, String location, VeniceContent content)
- {
- this.engine = engine;
- this.user = user;
- this.location = location;
- this.content = content;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static operations
- *--------------------------------------------------------------------------------
- */
-
- public static BaseJSPData retrieve(ServletRequest request)
- {
- return (BaseJSPData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTitle(RenderData rdat)
- {
- if (content==null)
- return "";
- else
- return content.getPageTitle(rdat);
-
- } // end getTitle
-
- public String getPageQID()
- {
- if (content==null)
- return null;
- else
- return content.getPageQID();
-
- } // end getPageQID
-
- public boolean locationSpecified()
- {
- return (location!=null);
-
- } // end if
-
- public String getLocation()
- {
- return location;
-
- } // end getLocation
-
- public boolean displayLoginLinks()
- {
- return login_links && (location!=null);
-
- } // end displayLoginLinks
-
- public void displayLoginLinks(boolean value)
- {
- login_links = value;
-
- } // end displayLoginLinks
-
- public void transfer(ServletContext ctxt, RenderData rdat) throws IOException, ServletException
- {
- rdat.storeBaseJSPData(this);
- RequestDispatcher dispatcher = ctxt.getRequestDispatcher(rdat.getFormatJSPPath("base.jsp"));
- rdat.forwardDispatch(dispatcher);
-
- } // end transfer
-
- public void renderBannerAd(Writer out, RenderData rdat) throws IOException
- {
- Advertisement advert;
- if (user.isLoggedIn())
- advert = user.selectAd();
- else
- advert = engine.selectAd();
- if (advert==null)
- { // no advert found - bail out now!
- out.write(" ");
- return;
-
- } // end if
-
- String full_image_path;
- if (advert.getImagePathStyle()==Advertisement.CONTEXT_RELATIVE)
- { // return the full image path
- full_image_path = rdat.getContextRelativePath(advert.getImagePath());
-
- } // end if
- else
- { // can't render the ad - just punt
- out.write(" ");
- return;
-
- } // end else
-
- // Write the banner ad.
- String url = advert.getLinkURL();
- String capt = advert.getCaption();
- if (url!=null)
- out.write("");
- out.write("");
- if (url!=null)
- out.write("");
-
- } // end renderBannerAd
-
- public void renderMenu(HttpSession session, Writer out, RenderData rdat) throws IOException
- {
- ComponentRender menu = Variables.getMenu(session);
- if (menu==null)
- menu = (ComponentRender)(rdat.getLeftMenu("top"));
- menu.renderHere(out,rdat);
-
- } // end renderMenu
-
- public void renderFixedMenu(Writer out, RenderData rdat) throws IOException
- {
- ComponentRender menu = (ComponentRender)(rdat.getLeftMenu("fixed"));
- menu.renderHere(out,rdat);
-
- } // end renderFixedMenu
-
- public void renderContent(ServletContext ctxt, Writer out, RenderData rdat)
- throws IOException, ServletException
- {
- if (content==null)
- { // there is no content!
- new ErrorBox(null,"Internal Error: There is no content available",null).renderHere(out,rdat);
- return;
-
- } // end if
-
- if (content instanceof ContentRender)
- { // we have an old-style ContentRender
- ContentRender cr = (ContentRender)content;
- cr.renderHere(out,rdat);
- return;
-
- } // end if
- else if (content instanceof JSPRender)
- { // we have a JSP-rendered page - include it
- JSPRender jr = (JSPRender)content;
- rdat.storeJSPRender(jr);
- RequestDispatcher dispatcher = ctxt.getRequestDispatcher(rdat.getFormatJSPPath(jr.getTargetJSPName()));
- out.flush();
- rdat.flushOutput(); // make sure the stuff to be output first is output
- rdat.includeDispatch(dispatcher);
- rdat.flushOutput(); // now make sure the included page is properly flushed
- return;
-
- } // end else if
- else // this is the fallback if we don't recognize the content
- new ErrorBox(null,"Internal Error: Content of invalid type",null).renderHere(out,rdat);
-
- } // end renderContent
-
-} // end class BaseJSPData
diff --git a/src/com/silverwrist/venice/servlets/format/CDBaseFormFieldReverse.java b/src/com/silverwrist/venice/servlets/format/CDBaseFormFieldReverse.java
deleted file mode 100644
index 6771843..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDBaseFormFieldReverse.java
+++ /dev/null
@@ -1,181 +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 com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.except.ValidationException;
-
-public abstract class CDBaseFormFieldReverse implements CDFormField, ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String name;
- private String caption;
- private String caption2;
- private boolean required;
- private String value = null;
- private boolean enabled;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- protected CDBaseFormFieldReverse(String name, String caption, String caption2, boolean required)
- {
- this.name = name;
- this.caption = caption;
- this.caption2 = caption2;
- this.required = required;
- this.enabled = true;
-
- } // end constructor
-
- protected CDBaseFormFieldReverse(CDBaseFormFieldReverse other)
- {
- this.name = other.name;
- this.caption = other.caption;
- this.caption2 = other.caption2;
- this.required = other.required;
- this.enabled = true;
- // N.B.: do NOT copy value!
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal operations
- *--------------------------------------------------------------------------------
- */
-
- protected final String getCaption()
- {
- return caption;
-
- } // end getCaption
-
- /*--------------------------------------------------------------------------------
- * Abstract functions which MUST be overriden
- *--------------------------------------------------------------------------------
- */
-
- protected abstract void renderActualField(Writer out, RenderData rdat)
- throws IOException;
-
- /*--------------------------------------------------------------------------------
- * Overridable operations
- *--------------------------------------------------------------------------------
- */
-
- protected void validateContents(String value) throws ValidationException
- { // this is a do-nothing value
- } // end validateContents
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface ComponentRender
- *--------------------------------------------------------------------------------
- */
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- out.write("
\n");
-
- } // end renderHere
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface CDFormField
- *--------------------------------------------------------------------------------
- */
-
- public String getName()
- {
- return name;
-
- } // end getName
-
- public String getValue()
- {
- return value;
-
- } // end getValue
-
- public void setValue(String value)
- {
- this.value = value;
-
- } // end setValue
-
- public Object getObjValue()
- {
- return value;
-
- } // end getObjValue
-
- public void setObjValue(Object obj)
- {
- this.value = obj.toString();
-
- } // end setObjValue
-
- public boolean isRequired()
- {
- return required;
-
- } // end isRequired
-
- public CDCommandButton findButton(String name)
- {
- return null;
-
- } // end findButton
-
- public void validate() throws ValidationException
- {
- if (required && enabled && StringUtil.isStringEmpty(value))
- throw new ValidationException("The '" + caption + "' field is required.");
- validateContents(value);
-
- } // end validate
-
- public boolean isEnabled()
- {
- return enabled;
-
- } // end isEnabled
-
- public void setEnabled(boolean flag)
- {
- enabled = flag;
-
- } // end setEnabled
-
-} // end CDBaseFormFieldReverse
diff --git a/src/com/silverwrist/venice/servlets/format/CDCommandButton.java b/src/com/silverwrist/venice/servlets/format/CDCommandButton.java
deleted file mode 100644
index aae5f26..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDCommandButton.java
+++ /dev/null
@@ -1,28 +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 javax.servlet.ServletRequest;
-
-public interface CDCommandButton extends ComponentRender
-{
- public abstract String getName();
-
- public abstract boolean isClicked(ServletRequest request);
-
-} // end interface CDCommandButton
diff --git a/src/com/silverwrist/venice/servlets/format/CDImageButton.java b/src/com/silverwrist/venice/servlets/format/CDImageButton.java
deleted file mode 100644
index 15639dc..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDImageButton.java
+++ /dev/null
@@ -1,64 +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 javax.servlet.ServletRequest;
-
-public class CDImageButton implements CDCommandButton
-{
- private String name; // name of the button field
- private String image; // image file to output
- private String alt_text; // alt text to output
- private int width; // width of button image
- private int height; // height of button image
-
- public CDImageButton(String name, String image, String alt_text, int width, int height)
- {
- this.name = name;
- this.image = image;
- this.alt_text = alt_text;
- this.width = width;
- this.height = height;
-
- } // end constructor
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- out.write("");
-
- } // end renderHere
-
- public String getName()
- {
- return name;
-
- } // end getName
-
- public boolean isClicked(ServletRequest request)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isClicked
-
-} // end class CDImageButton
diff --git a/src/com/silverwrist/venice/servlets/format/CDIntegerFormField.java b/src/com/silverwrist/venice/servlets/format/CDIntegerFormField.java
deleted file mode 100644
index cb2c703..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDIntegerFormField.java
+++ /dev/null
@@ -1,143 +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.*;
-import com.silverwrist.venice.except.ValidationException;
-
-public class CDIntegerFormField extends CDTextFormField
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final double LN10 = Math.log(10.0);
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private int min_value;
- private int max_value;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CDIntegerFormField(String name, String caption, String caption2, int min, int max)
- {
- super(name,caption,caption2,true,numDigits(min,max),numDigits(min,max));
- this.min_value = min;
- this.max_value = max;
-
- } // end constructor
-
- protected CDIntegerFormField(CDIntegerFormField other)
- {
- super(other);
- this.min_value = other.min_value;
- this.max_value = other.max_value;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal operations
- *--------------------------------------------------------------------------------
- */
-
- private static int numDigits(int v)
- {
- if (v==0)
- return 1;
- else if (v>0)
- return 1 + (int)(Math.floor(Math.log((double)v) / LN10));
- else
- return 2 + (int)(Math.floor(Math.log((double)(-v)) / LN10));
-
- } // end numDigits
-
- private static int numDigits(int min, int max)
- {
- return Math.max(Math.max(numDigits(min),numDigits(max)),2);
-
- } // end numDigits
-
- /*--------------------------------------------------------------------------------
- * Overrides from class CDTextFormField
- *--------------------------------------------------------------------------------
- */
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- super.renderActualField(out,rdat);
- out.write(" (" + min_value + " - " + max_value + ")");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- {
- super.validateContents(value);
- try
- { // convert to an integer and check against range
- int x = Integer.parseInt(value);
- if ((min_value>Integer.MIN_VALUE) && (xmax_value))
- throw new ValidationException("The value of the '" + getCaption()
- + "' field must be less than or equal to " + max_value + ".");
-
- } // end try
- catch (NumberFormatException nfe)
- { // integer conversion failed
- throw new ValidationException("Invalid non-numeric character in the '" + getCaption() + "' field.");
-
- } // end catch
-
- } // end validateContents
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface CDFormField
- *--------------------------------------------------------------------------------
- */
-
- public Object getObjValue()
- {
- try
- { // build an Integer and return it
- return new Integer(getValue());
-
- } // end try
- catch (NumberFormatException nfe)
- { // shouldn't happen
- return null;
-
- } // end catch
-
- } // end getObjValue
-
- public CDFormField duplicate()
- {
- return new CDIntegerFormField(this);
-
- } // end clone
-
-} // end class CDIntegerFormField
diff --git a/src/com/silverwrist/venice/servlets/format/CDPasswordFormField.java b/src/com/silverwrist/venice/servlets/format/CDPasswordFormField.java
deleted file mode 100644
index 8a3dc2d..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDPasswordFormField.java
+++ /dev/null
@@ -1,70 +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.except.ValidationException;
-
-public class CDPasswordFormField extends CDBaseFormField
-{
- private int size;
- private int maxlength;
-
- public CDPasswordFormField(String name, String caption, String caption2, boolean required,
- int size, int maxlength)
- {
- super(name,caption,caption2,required);
- this.size = size;
- this.maxlength = maxlength;
-
- } // end constructor
-
- protected CDPasswordFormField(CDPasswordFormField other)
- {
- super(other);
- this.size = other.size;
- this.maxlength = other.maxlength;
-
- } // end constructor
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- out.write("");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- { // this is a do-nothing value
- } // end validateContents
-
- public CDFormField duplicate()
- {
- return new CDPasswordFormField(this);
-
- } // end clone
-
-} // end class CDPasswordFormField
diff --git a/src/com/silverwrist/venice/servlets/format/CDPasswordFormFieldCommand.java b/src/com/silverwrist/venice/servlets/format/CDPasswordFormFieldCommand.java
deleted file mode 100644
index 7066b1b..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDPasswordFormFieldCommand.java
+++ /dev/null
@@ -1,70 +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 javax.servlet.ServletRequest;
-
-public class CDPasswordFormFieldCommand extends CDPasswordFormField
-{
- private CDCommandButton button;
-
- public CDPasswordFormFieldCommand(String name, String caption, String caption2, boolean required,
- int size, int maxlength, CDCommandButton button)
- {
- super(name,caption,caption2,required,size,maxlength);
- this.button = button;
-
- } // end constructor
-
- protected CDPasswordFormFieldCommand(CDPasswordFormFieldCommand other)
- {
- super(other);
- this.button = other.button;
-
- } // end constructor
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- super.renderActualField(out,rdat);
- if (button!=null)
- { // add the button
- out.write(" ");
- button.renderHere(out,rdat);
-
- } // end if
-
- } // end renderActualField
-
- public CDCommandButton findButton(String name)
- {
- if ((button!=null) && (button.getName().equals(name)))
- return button;
- else
- return super.findButton(name);
-
- } // end findButton
-
- public CDFormField duplicate()
- {
- return new CDPasswordFormFieldCommand(this);
-
- } // end clone
-
-} // end class CDPasswordFormFieldCommand
diff --git a/src/com/silverwrist/venice/servlets/format/CDSimplePickListFormField.java b/src/com/silverwrist/venice/servlets/format/CDSimplePickListFormField.java
deleted file mode 100644
index f4dca99..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDSimplePickListFormField.java
+++ /dev/null
@@ -1,62 +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.util.List;
-import java.io.Writer;
-import java.io.IOException;
-import com.silverwrist.util.StringUtil;
-
-public class CDSimplePickListFormField extends CDPickListFormField
-{
- private char separator;
-
- public CDSimplePickListFormField(String name, String caption, String caption2, boolean required,
- List string_list, char separator)
- {
- super(name,caption,caption2,required,string_list);
- this.separator = separator;
-
- } // end constructor
-
- protected CDSimplePickListFormField(CDSimplePickListFormField other)
- {
- super(other);
- this.separator = other.separator;
-
- } // end constructor
-
- protected void renderChoice(Writer out, RenderData rdat, Object obj, String my_value) throws IOException
- {
- String full = (String)obj;
- int breakpt = full.indexOf(separator);
- String val = full.substring(0,breakpt);
- out.write("\n");
-
- } // end renderChoice
-
- public CDFormField duplicate()
- {
- return new CDSimplePickListFormField(this);
-
- } // end duplicate
-
-} // end class CDSimplePickListFormField
diff --git a/src/com/silverwrist/venice/servlets/format/CDTextFormField.java b/src/com/silverwrist/venice/servlets/format/CDTextFormField.java
deleted file mode 100644
index 635ad84..0000000
--- a/src/com/silverwrist/venice/servlets/format/CDTextFormField.java
+++ /dev/null
@@ -1,97 +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.except.ValidationException;
-
-public class CDTextFormField extends CDBaseFormField
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private int size;
- private int maxlength;
- private int real_maxlength;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CDTextFormField(String name, String caption, String caption2, boolean required,
- int size, int maxlength)
- {
- super(name,caption,caption2,required);
- this.size = Math.max(size,2);
- this.maxlength = Math.max(maxlength,2);
- this.real_maxlength = maxlength;
-
- } // end constructor
-
- protected CDTextFormField(CDTextFormField other)
- {
- super(other);
- this.size = other.size;
- this.maxlength = other.maxlength;
- this.real_maxlength = other.real_maxlength;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class CDBaseFormField
- *--------------------------------------------------------------------------------
- */
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- out.write("");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- {
- if (value.length()>real_maxlength)
- throw new ValidationException("The value of the '" + getCaption() + "' field must be no longer than "
- + real_maxlength + " characters.");
-
- } // end validateContents
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface CDFormField
- *--------------------------------------------------------------------------------
- */
-
- public CDFormField duplicate()
- {
- return new CDTextFormField(this);
-
- } // end clone
-
-} // end class CDTextFormField
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityAdminTop.java b/src/com/silverwrist/venice/servlets/format/CommunityAdminTop.java
deleted file mode 100644
index dbdfdfa..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityAdminTop.java
+++ /dev/null
@@ -1,70 +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.util.*;
-import java.io.Writer;
-import java.io.IOException;
-import com.silverwrist.venice.core.CommunityContext;
-
-public class CommunityAdminTop extends ContentMenuPanel
-{
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CommunityAdminTop()
- {
- super("Community Administration:",null);
- addChoice("Community Profile","sigadmin?sig=$s&cmd=P");
- addChoice("Set Community Category","sigadmin?sig=$s&cmd=T");
- addChoice("Set Community Features","sigadmin?sig=$s&cmd=F");
- addChoice("Membership Control","sigadmin?sig=$s&cmd=M");
- addChoice("E-Mail To All Members","sigadmin?sig=$s&cmd=I");
- addChoice("Display Audit Records","sigadmin?sig=$s&cmd=A");
- // TODO: More options
- addChoice("Delete Community","sigadmin?sig=$s&cmd=DEL");
-
- } // end constructor
-
- protected CommunityAdminTop(CommunityAdminTop other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setCommunity(CommunityContext comm)
- {
- setSubtitle(comm.getName());
- setParameter("s",String.valueOf(comm.getCommunityID()));
-
- } // end setCommunity
-
- public Object clone()
- {
- return new CommunityAdminTop(this);
-
- } // end clone
-
-} // end class CommunityAdminTop
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityCategoryBrowseData.java b/src/com/silverwrist/venice/servlets/format/CommunityCategoryBrowseData.java
deleted file mode 100644
index 59e567d..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityCategoryBrowseData.java
+++ /dev/null
@@ -1,163 +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.util.*;
-import javax.servlet.ServletRequest;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CommunityCategoryBrowseData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityCategoryBrowseData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String name;
- private String base_applet;
- private CategoryDescriptor prev_cat;
- private CategoryDescriptor curr_cat;
- private List subcats;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public CommunityCategoryBrowseData(UserContext user, CommunityContext comm, int current_id)
- throws DataException
- {
- name = comm.getName();
- base_applet = "sigadmin?sig=" + String.valueOf(comm.getCommunityID());
- prev_cat = comm.getCategory();
- if (prev_cat.getCategoryID()==current_id)
- curr_cat = prev_cat;
- else
- curr_cat = user.getCategoryDescriptor(current_id);
- subcats = curr_cat.getSubCategories();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityCategoryBrowseData retrieve(ServletRequest request)
- {
- return (CommunityCategoryBrowseData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Set Community Category";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "commcatbrowser.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getCommunityName()
- {
- return name;
-
- } // end if
-
- public String getCancelURL(RenderData rdat)
- {
- return rdat.getEncodedServletPath(base_applet);
-
- } // end getCancelURL
-
- public String getPreviousCategory()
- {
- return prev_cat.toString();
-
- } // end getPreviousCategory
-
- public CategoryDescriptor getCurrentCategory()
- {
- return curr_cat;
-
- } // end getCurrentCategory
-
- public String getGoLink(RenderData rdat, int catid)
- {
- return rdat.getEncodedServletPath(base_applet + "&cmd=T&go=" + String.valueOf(catid));
-
- } // end getGoLink
-
- public String getSetLink(RenderData rdat, int catid)
- {
- return rdat.getEncodedServletPath(base_applet + "&cmd=T&set=" + String.valueOf(catid));
-
- } // end getGoLink
-
- public Iterator getSubcategoryIterator()
- {
- return subcats.iterator();
-
- } // end getSubcategoryIterator
-
- public boolean hasSubcategories()
- {
- return (subcats.size()>0);
-
- } // end hasSubcategories
-
-} // end class CommunityCategoryBrowseData
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityEMail.java b/src/com/silverwrist/venice/servlets/format/CommunityEMail.java
deleted file mode 100644
index a4d6786..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityEMail.java
+++ /dev/null
@@ -1,115 +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.util.*;
-import javax.servlet.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CommunityEMail implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityEMail";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CommunityEMail(CommunityContext comm)
- {
- this.comm = comm;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityEMail retrieve(ServletRequest request)
- {
- return (CommunityEMail)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Community E-Mail: " + comm.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "comm_email.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final String getCommunityName()
- {
- return comm.getName();
-
- } // end getCommunityName
-
-} // end class CommunityEMail
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityLogoData.java b/src/com/silverwrist/venice/servlets/format/CommunityLogoData.java
deleted file mode 100644
index 861d869..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityLogoData.java
+++ /dev/null
@@ -1,127 +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.awt.Dimension;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CommunityLogoData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityLogoData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private int cid;
- private Dimension logo_dims;
- private String logo_url;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public CommunityLogoData(VeniceEngine engine, CommunityContext comm, RenderData rdat)
- throws DataException
- {
- cid = comm.getCommunityID();
- logo_dims = engine.getCommunityLogoSize();
- logo_url = comm.getContactInfo().getPhotoURL();
- if (StringUtil.isStringEmpty(logo_url))
- logo_url = rdat.getFullImagePath("sig_other.jpg");
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityLogoData retrieve(ServletRequest request)
- {
- return (CommunityLogoData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Set Community Logo";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "comm_logo.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getCommunityID()
- {
- return cid;
-
- } // end getCommunityID
-
- public String getLogoTag(RenderData rdat)
- {
- StringBuffer buf = new StringBuffer("");
- return buf.toString();
-
- } // end getLogoTag
-
-} // end class CommunityLogoData
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityMembership.java b/src/com/silverwrist/venice/servlets/format/CommunityMembership.java
deleted file mode 100644
index 4c380da..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityMembership.java
+++ /dev/null
@@ -1,340 +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.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.security.Role;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CommunityMembership implements JSPRender, SearchMode
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityMembership";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine; // reference to the engine
- private CommunityContext comm; // the community we're in
- private List display_list = null; // list of members to display
- private boolean comm_members = false; // is this a list of community members?
- private int field = -1; // search field
- private int mode = -1; // search mode
- private String term = null; // search term
- private int offset = 0; // search result offset
- private int find_count = -1; // search results count
- private List role_choices; // the list of security roles
- private Role role_comm_host; // the "Community Host" security role
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CommunityMembership(VeniceEngine engine, CommunityContext comm)
- {
- this.engine = engine;
- this.comm = comm;
- SecurityInfo sinf = comm.getSecurityInfo();
- this.role_choices = sinf.getRoleList("Community.UserLevels");
- this.role_comm_host = sinf.getRole("Community.Host");
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, return default
- return default_val;
-
- } // end catch
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityMembership retrieve(ServletRequest request)
- {
- return (CommunityMembership)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Membership in Community " + comm.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "comm_member.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void doCommunityMemberList() throws DataException
- {
- this.display_list = comm.getMemberList();
- this.comm_members = true;
- this.term = "";
-
- } // end doCommunityMemberList
-
- public void doSearch(ServletRequest request) throws ValidationException, DataException, AccessError
- {
- // Validate the search field parameter.
- field = getParamInt(request,"field",FIELD_USER_NAME);
- if ( (field!=FIELD_USER_NAME) && (field!=FIELD_USER_DESCRIPTION) && (field!=FIELD_USER_GIVEN_NAME)
- && (field!=FIELD_USER_FAMILY_NAME))
- throw new ValidationException("The field search parameter is not valid.");
-
- // Validate the search mode parameter.
- mode = getParamInt(request,"mode",SEARCH_PREFIX);
- if ((mode!=SEARCH_PREFIX) && (mode!=SEARCH_SUBSTRING) && (mode!=SEARCH_REGEXP))
- throw new ValidationException("The search mode parameter is not valid.");
-
- // Retrieve the search term parameter.
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Perform the search!
- List intermediate = engine.searchForUsers(field,mode,term,offset,count);
- if (find_count<0)
- find_count = engine.getSearchUserCount(field,mode,term);
-
- // Create the real display list by getting the community security levels.
- Iterator it = intermediate.iterator();
- Vector rc = new Vector(count+1);
- while (it.hasNext())
- { // loop around and find the member level of every one
- UserFound uf = (UserFound)(it.next());
- int new_level = comm.getMemberLevel(uf.getUID());
- if (new_level==-1)
- new_level = 0;
- rc.add(uf.createNewLevel(new_level));
-
- } // end while
-
- display_list = rc; // save display list for display
-
- } // end doSearch
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public String getCommunityName()
- {
- return comm.getName();
-
- } // end getCommunityName
-
- public String getLocator()
- {
- return "sig=" + comm.getCommunityID();
-
- } // end getLocator
-
- public boolean displayList()
- {
- if ((display_list==null) || (display_list.size()==0))
- return false;
- if (comm_members && (display_list.size()>engine.getMaxNumCommunityMembersDisplay()))
- return false;
- return true;
-
- } // end displayList
-
- public boolean isCommunityMemberList()
- {
- return comm_members;
-
- } // end isCommunityMemberList
-
- public int getSearchField()
- {
- return field;
-
- } // end getSearchField
-
- public int getSearchMode()
- {
- return mode;
-
- } // end getSearchMode
-
- public boolean searchFieldIs(int value)
- {
- return (field==value);
-
- } // end searchFieldIs
-
- public boolean searchModeIs(int value)
- {
- return (mode==value);
-
- } // end searchModeIs
-
- public String getSearchTerm()
- {
- return term;
-
- } // end getSearchTerm
-
- public int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public int getSize()
- {
- return display_list.size();
-
- } // end getSize
-
- public int getNumResultsDisplayed()
- {
- return engine.getStdNumSearchResults();
-
- } // end getNumResultsDisplayed
-
- public UserFound getItem(int ndx)
- {
- return (UserFound)(display_list.get(ndx));
-
- } // end getItem
-
- public void outputDropDown(Writer out, int uid, int cur_level) throws IOException
- {
- out.write("\n");
- out.write("\n");
-
- } // end outputDropDown
-
-} // end class CommunityMembership
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityProfileData.java b/src/com/silverwrist/venice/servlets/format/CommunityProfileData.java
deleted file mode 100644
index 3ece3fc..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityProfileData.java
+++ /dev/null
@@ -1,178 +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 javax.servlet.ServletRequest;
-import com.silverwrist.util.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CommunityProfileData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityProfileData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine; // the Venice engine
- private UserContext user; // the current user managing this
- private CommunityContext comm; // the community being displayed
- private ContactInfo ci; // community's contact info
- private UserProfile host_prof; // community host's user profile
- private CategoryDescriptor cat; // community's full category descriptor
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public CommunityProfileData(VeniceEngine engine, UserContext user, CommunityContext ctxt)
- throws DataException
- {
- this.engine = engine;
- this.user = user;
- this.comm = ctxt;
- this.ci = ctxt.getContactInfo();
- this.host_prof = ctxt.getHostProfile();
- this.cat = ctxt.getCategory();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityProfileData retrieve(ServletRequest request)
- {
- return (CommunityProfileData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Community Profile: " + comm.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return "go/" + comm.getAlias() + "!";
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "commprofile.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public CommunityContext getCommunityContext()
- {
- return comm;
-
- } // end getCommunityContext
-
- public String getCommunityLogoURL(RenderData rdat)
- {
- String tmp = ci.getPhotoURL();
- if (StringUtil.isStringEmpty(tmp))
- tmp = rdat.getFullImagePath("sig_other.jpg");
- return tmp;
-
- } // end getCommunityLogoURL
-
- public boolean isUserLoggedIn()
- {
- return user.isLoggedIn();
-
- } // end isUserLoggedIn
-
- public String getHostUserName()
- {
- return host_prof.getUserName();
-
- } // end getHostUserName
-
- public ContactInfo getCommunityContactInfo()
- {
- return ci;
-
- } // end getCommunityContactInfo
-
- public String getAddressLastLine()
- {
- String tmp_c = ci.getLocality();
- String tmp_s = ci.getRegion();
- StringBuffer buf = new StringBuffer();
- if (!(StringUtil.isStringEmpty(tmp_c)) && !(StringUtil.isStringEmpty(tmp_s)))
- buf.append(tmp_c).append(", ").append(tmp_s);
- else if (!(StringUtil.isStringEmpty(tmp_c)))
- buf.append(tmp_c);
- else if (!(StringUtil.isStringEmpty(tmp_s)))
- buf.append(tmp_s);
- tmp_s = ci.getPostalCode();
- if (!(StringUtil.isStringEmpty(tmp_s)))
- buf.append(' ').append(tmp_s);
- return buf.toString();
-
- } // end getAddressLastLine
-
- public String getFullCountry()
- {
- Country c = International.get().getCountryForCode(ci.getCountry());
- return ((c==null) ? null : c.getName());
-
- } // end getFullCountry
-
- public CategoryDescriptor getCategory()
- {
- return cat;
-
- } // end getCategory
-
-} // end class CommunityProfileData
diff --git a/src/com/silverwrist/venice/servlets/format/CommunityWelcome.java b/src/com/silverwrist/venice/servlets/format/CommunityWelcome.java
deleted file mode 100644
index 9282f85..0000000
--- a/src/com/silverwrist/venice/servlets/format/CommunityWelcome.java
+++ /dev/null
@@ -1,115 +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 javax.servlet.ServletRequest;
-import com.silverwrist.venice.core.CommunityContext;
-
-public class CommunityWelcome implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.CommunityWelcome";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String name;
- private String entry_url;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public CommunityWelcome(CommunityContext comm)
- {
- name = comm.getName();
- entry_url = "sig/" + comm.getAlias();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static CommunityWelcome retrieve(ServletRequest request)
- {
- return (CommunityWelcome)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Welcome to " + name;
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "commwelcome.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getCommunityName()
- {
- return name;
-
- } // end getCommunityName
-
- public String getEntryURL(RenderData rdat)
- {
- return rdat.getEncodedServletPath(entry_url);
-
- } // end getEntryURL
-
-} // end class CommunityWelcome
diff --git a/src/com/silverwrist/venice/servlets/format/ConferenceActivity.java b/src/com/silverwrist/venice/servlets/format/ConferenceActivity.java
deleted file mode 100644
index e329238..0000000
--- a/src/com/silverwrist/venice/servlets/format/ConferenceActivity.java
+++ /dev/null
@@ -1,191 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceActivity implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceActivity";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private TopicContext topic; // the topic being listed
- private boolean posters; // is this a list of posters?
- private List records; // the actual data records
- private String locator = null; // our locator
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ConferenceActivity(CommunityContext comm, ConferenceContext conf, TopicContext topic, boolean posters)
- throws DataException, AccessError
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
- this.posters = posters;
- if (topic!=null)
- { // do the report on the topic
- if (posters)
- this.records = topic.getActivePosters();
- else
- this.records = topic.getActiveReaders();
-
- } // end if
- else
- { // do the report on the conference
- if (posters)
- this.records = conf.getActivePosters();
- else
- this.records = conf.getActiveReaders();
-
- } // end else
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ConferenceActivity retrieve(ServletRequest request)
- {
- return (ConferenceActivity)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- if (topic!=null)
- { // it's a topic report
- if (posters)
- return "Users Posting in Topic " + topic.getName();
- else
- return "Users Reading Topic " + topic.getName();
-
- } // end if
- else
- { // it's a conference report
- if (posters)
- return "Users Posting in Conference " + conf.getName();
- else
- return "Users Reading Conference " + conf.getName();
-
- } // end else
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "conf_activity.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public String getTopicName()
- {
- if (topic==null)
- return null;
- else
- return topic.getName();
-
- } // end getTopicName
-
- public String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- return locator;
-
- } // end getLocator
-
- public boolean isTopicReport()
- {
- return (topic!=null);
-
- } // end isTopicReport
-
- public boolean isPosterReport()
- {
- return posters;
-
- } // end isPosterReport
-
- public boolean anyElements()
- {
- return (records.size()>0);
-
- } // end anyElements
-
- public Iterator getRecordsIterator()
- {
- return records.iterator();
-
- } // end getRecordsIterator
-
-} // end class ConferenceActivity
diff --git a/src/com/silverwrist/venice/servlets/format/ConferenceCustomBlocks.java b/src/com/silverwrist/venice/servlets/format/ConferenceCustomBlocks.java
deleted file mode 100644
index 242e967..0000000
--- a/src/com/silverwrist/venice/servlets/format/ConferenceCustomBlocks.java
+++ /dev/null
@@ -1,150 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceCustomBlocks implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceCustomBlocks";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being diddled with
- private String top_custom; // the top custom block
- private String bottom_custom; // the bottom custom block
- private String locator = null; // locator string
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ConferenceCustomBlocks(CommunityContext comm, ConferenceContext conf) throws DataException
- {
- this.comm = comm;
- this.conf = conf;
- this.top_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
- this.bottom_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ConferenceCustomBlocks retrieve(ServletRequest request)
- {
- return (ConferenceCustomBlocks)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Customize Conference: " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "conf_custom.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConferenceID()
- {
- return conf.getConfID();
-
- } // end getConferenceID
-
- public final String getConferenceName()
- {
- return conf.getName();
-
- } // end getConferenceName
-
- public final String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- return locator;
-
- } // end getLocator
-
- public final String getTopCustomBlock()
- {
- return (top_custom==null) ? "" : StringUtil.encodeHTML(top_custom);
-
- } // end getTopCustomBlock
-
- public final String getBottomCustomBlock()
- {
- return (bottom_custom==null) ? "" : StringUtil.encodeHTML(bottom_custom);
-
- } // end getBottomCustomBlock
-
-} // end class ConferenceCustomBlocks
diff --git a/src/com/silverwrist/venice/servlets/format/ConferenceEMail.java b/src/com/silverwrist/venice/servlets/format/ConferenceEMail.java
deleted file mode 100644
index ce7a264..0000000
--- a/src/com/silverwrist/venice/servlets/format/ConferenceEMail.java
+++ /dev/null
@@ -1,152 +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.IOException;
-import java.io.Writer;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceEMail implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceEMail";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private List topics; // list of topics in that conference
- private String locator = null; // locator string
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ConferenceEMail(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
- {
- this.comm = comm;
- this.conf = conf;
- this.topics = conf.getTopicList(ConferenceContext.DISPLAY_ALL,ConferenceContext.SORT_NAME);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ConferenceEMail retrieve(ServletRequest request)
- {
- return (ConferenceEMail)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Conference E-Mail: " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "conf_email.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConferenceID()
- {
- return conf.getConfID();
-
- } // end getConferenceID
-
- public final String getConferenceName()
- {
- return conf.getName();
-
- } // end getConferenceName
-
- public final String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- return locator;
-
- } // end getLocator
-
- public final void writeTopicChoices(Writer out) throws IOException
- {
- out.write("\n");
- Iterator it = topics.iterator();
- while (it.hasNext())
- { // write out the entire topic list as a drop-down list
- TopicContext topic = (TopicContext)(it.next());
- out.write("\n");
-
- } // end while
-
- } // end writeTopicChoices
-
-} // end class ConferenceEMail
diff --git a/src/com/silverwrist/venice/servlets/format/ConferenceListing.java b/src/com/silverwrist/venice/servlets/format/ConferenceListing.java
deleted file mode 100644
index 454b162..0000000
--- a/src/com/silverwrist/venice/servlets/format/ConferenceListing.java
+++ /dev/null
@@ -1,181 +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.util.*;
-import javax.servlet.ServletRequest;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceListing implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceListing";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm;
- private List conferences;
- private List[] hosts;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ConferenceListing(CommunityContext comm) throws DataException, AccessError
- {
- this.comm = comm;
- this.conferences = comm.getConferences();
- this.hosts = new List[this.conferences.size()];
- for (int i=0; i.
- *
- * 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 javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.security.Role;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceMembership implements JSPRender, SearchMode
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceMembership";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine; // reference to the engine
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private List display_list = null; // list of members to display
- private boolean conf_members = false; // is this a list of conference members?
- private int field = -1; // search field
- private int mode = -1; // search mode
- private String term = null; // search term
- private int offset = 0; // search result offset
- private int find_count = -1; // search results count
- private List role_choices; // the list of security roles
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public ConferenceMembership(VeniceEngine engine, CommunityContext comm, ConferenceContext conf)
- {
- this.engine = engine;
- this.comm = comm;
- this.conf = conf;
- this.role_choices = conf.getSecurityInfo().getRoleList("Conference.UserLevels");
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, return default
- return default_val;
-
- } // end catch
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ConferenceMembership retrieve(ServletRequest request)
- {
- return (ConferenceMembership)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Membership in Conference " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "conf_member.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void doConferenceMemberList() throws DataException, AccessError
- {
- this.display_list = conf.getMemberList();
- this.conf_members = true;
- this.term = "";
-
- } // end doConferenceMemberList
-
- public void doSearch(ServletRequest request) throws ValidationException, DataException, AccessError
- {
- // Validate the search field parameter.
- field = getParamInt(request,"field",FIELD_USER_NAME);
- if ( (field!=FIELD_USER_NAME) && (field!=FIELD_USER_DESCRIPTION) && (field!=FIELD_USER_GIVEN_NAME)
- && (field!=FIELD_USER_FAMILY_NAME))
- throw new ValidationException("The field search parameter is not valid.");
-
- // Validate the search mode parameter.
- mode = getParamInt(request,"mode",SEARCH_PREFIX);
- if ((mode!=SEARCH_PREFIX) && (mode!=SEARCH_SUBSTRING) && (mode!=SEARCH_REGEXP))
- throw new ValidationException("The search mode parameter is not valid.");
-
- // Retrieve the search term parameter.
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Perform the search!
- List intermediate = comm.searchForMembers(field,mode,term,offset,count);
- if (find_count<0)
- find_count = comm.getSearchMemberCount(field,mode,term);
-
- // Create the real display list by getting the conference security levels.
- Iterator it = intermediate.iterator();
- Vector rc = new Vector(count+1);
- while (it.hasNext())
- { // loop around and find the member level of every one
- UserFound uf = (UserFound)(it.next());
- int new_level = conf.getMemberLevel(uf.getUID());
- if (new_level==-1)
- new_level = 0;
- rc.add(uf.createNewLevel(new_level));
-
- } // end while
-
- display_list = rc; // save display list for display
-
- } // end doSearch
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public String getCommunityName()
- {
- return comm.getName();
-
- } // end getCommunityName
-
- public String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public String getLocator()
- {
- return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- } // end getLocator
-
- public boolean displayList()
- {
- if ((display_list==null) || (display_list.size()==0))
- return false;
- if (conf_members && (display_list.size()>engine.getMaxNumConferenceMembersDisplay()))
- return false;
- return true;
-
- } // end displayList
-
- public boolean conferenceMemberList()
- {
- return conf_members;
-
- } // end conferenceMemberList
-
- public int getSearchField()
- {
- return field;
-
- } // end getSearchField
-
- public int getSearchMode()
- {
- return mode;
-
- } // end getSearchMode
-
- public boolean searchFieldIs(int value)
- {
- return (field==value);
-
- } // end searchFieldIs
-
- public boolean searchModeIs(int value)
- {
- return (mode==value);
-
- } // end searchModeIs
-
- public String getSearchTerm()
- {
- return term;
-
- } // end getSearchTerm
-
- public int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public int getSize()
- {
- return display_list.size();
-
- } // end getSize
-
- public int getNumResultsDisplayed()
- {
- return engine.getStdNumSearchResults();
-
- } // end getNumResultsDisplayed
-
- public UserFound getItem(int ndx)
- {
- return (UserFound)(display_list.get(ndx));
-
- } // end getItem
-
- public void outputDropDown(Writer out, int uid, int cur_level) throws IOException
- {
- out.write("\n");
- out.write("\n");
-
- } // end outputDropDown
-
-} // end class ConferenceMembership
diff --git a/src/com/silverwrist/venice/servlets/format/ConferenceSequence.java b/src/com/silverwrist/venice/servlets/format/ConferenceSequence.java
deleted file mode 100644
index 196446f..0000000
--- a/src/com/silverwrist/venice/servlets/format/ConferenceSequence.java
+++ /dev/null
@@ -1,177 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ConferenceSequence implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ConferenceSequence";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm;
- 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(CommunityContext comm) throws DataException, AccessError
- {
- this.comm = comm;
- this.conf_list = comm.getConferences();
-
- Integer last_id = null;
- for (int i=0; i.
- *
- * 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.util.*;
-import java.io.Writer;
-import java.io.IOException;
-import javax.servlet.ServletRequest;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.except.ValidationException;
-
-public class ContentDialog implements Cloneable, ContentRender, ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String title; // dialog title
- private String subtitle; // dialog subtitle
- private String formname; // name of the built-in form
- private String action; // action applet
- private String error_message = null; // error message
- private String instructions = null; // instructions
- private Hashtable hidden_fields; // list of all hidden fields & values
- private Hashtable command_buttons; // command buttons by name
- private Vector command_order; // command buttons in order (left to right)
- private Hashtable form_fields; // form fields by name
- private Vector form_order; // form fields in order (top to bottom)
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public ContentDialog(String title, String subtitle, String formname, String action)
- {
- this.title = title;
- this.subtitle = subtitle;
- this.formname = formname;
- this.action = action;
- hidden_fields = new Hashtable();
- command_buttons = new Hashtable();
- command_order = new Vector();
- form_fields = new Hashtable();
- form_order = new Vector();
-
- } // end constructor
-
- protected ContentDialog(ContentDialog other)
- {
- this.title = other.title;
- this.subtitle = other.subtitle;
- this.formname = other.formname;
- this.action = other.action;
- this.instructions = other.instructions;
- this.hidden_fields = (Hashtable)(other.hidden_fields.clone());
- command_buttons = new Hashtable();
- command_order = new Vector();
- form_fields = new Hashtable();
- form_order = new Vector();
-
- Enumeration enum = other.command_order.elements();
- while (enum.hasMoreElements())
- { // share the command buttons with the new dialog
- CDCommandButton button = (CDCommandButton)(enum.nextElement());
- addCommandButton(button);
-
- } // end while
-
- enum = other.form_order.elements();
- while (enum.hasMoreElements())
- { // clone the form fields and put them in the new dialog
- CDFormField field = (CDFormField)(enum.nextElement());
- addFormField(field.duplicate());
-
- } // end while
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private boolean anyRequired()
- {
- boolean rc = false;
- Enumeration enum = form_order.elements();
- while (!rc && enum.hasMoreElements())
- { // look for the first field that's marked "required"
- CDFormField fld = (CDFormField)(enum.nextElement());
- rc = fld.isRequired();
-
- } // end while
-
- return rc;
-
- } // end anyRequired
-
- /*--------------------------------------------------------------------------------
- * Overrideable operations
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- { // do nothing at this level
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return title;
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface ContentRender
- *--------------------------------------------------------------------------------
- */
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- Enumeration enum;
-
- // Output the content header
- rdat.writeContentHeader(out,title,subtitle);
-
- if (error_message!=null)
- { // print the error message
- out.write("
\n");
-
- } // end renderHere
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void addChoice(String title, String url)
- {
- items.add(new ContentMenuPanelItem(title,url));
-
- } // end addChoice
-
- public void setParameter(String name, String value)
- {
- params.put(name,value);
-
- } // end setParameter
-
- public void setTitle(String s)
- {
- title = s;
-
- } // end setTitle
-
- public void setSubtitle(String s)
- {
- subtitle = s;
-
- } // end setSubtitle
-
- public Object clone()
- {
- return new ContentMenuPanel(this);
-
- } // end clone
-
-} // end class ContentMenuPanel
diff --git a/src/com/silverwrist/venice/servlets/format/CreateCommunityDialog.java b/src/com/silverwrist/venice/servlets/format/CreateCommunityDialog.java
deleted file mode 100644
index df33495..0000000
--- a/src/com/silverwrist/venice/servlets/format/CreateCommunityDialog.java
+++ /dev/null
@@ -1,165 +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.util.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class CreateCommunityDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CreateCommunityDialog()
- {
- super("Create New Community",null,"createcommform","sigops");
- setHiddenField("cmd","C");
-
- Vector vec_pubpriv = new Vector(2);
- vec_pubpriv.add("0|Public");
- vec_pubpriv.add("1|Private");
- vec_pubpriv.trimToSize();
-
- Vector vec_hidemode = new Vector(3);
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
- + "|Hide in directory, but not in search");
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
- vec_hidemode.trimToSize();
-
- addFormField(new CDFormCategoryHeader("Basic Information"));
- addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
- addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
- addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
- addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
- addFormField(new CDLanguageListFormField("language","Primary language",null,true));
- addFormField(new CDFormCategoryHeader("Location"));
- addFormField(new CDTextFormField("loc","City",null,false,32,64));
- addFormField(new CDTextFormField("reg","State/Province",null,false,32,64));
- addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
- addFormField(new CDCountryListFormField("country","Country",null,true));
- addFormField(new CDFormCategoryHeader("Security"));
- addFormField(new CDSimplePickListFormField("comtype","Community type:",null,true,vec_pubpriv,'|'));
- addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
- addFormField(new CDSimplePickListFormField("hidemode","Community visibility:",null,true,vec_hidemode,'|'));
- addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected CreateCommunityDialog(CreateCommunityDialog other)
- {
- super(other);
-
- } // end CreateCommunityDialog
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- if (engine.aliasExists(getFieldValue("alias"),-1))
- throw new ValidationException("That alias is already used by another community on the system.");
-
- if (getFieldValue("comtype").equals("1"))
- { // make sure if they flagged it as Private that they specified a join key
- if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
- throw new ValidationException("Private communities must specify a join key value.");
-
- } // end if
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(VeniceEngine engine)
- {
- this.engine = engine;
-
- } // end setupDialog
-
- public CommunityContext doDialog(UserContext user) throws ValidationException, DataException, AccessError
- {
- validate(); // validate the dialog entries
-
- int hidemode;
-
- try
- { // attempt to get the hide mode first...
- hidemode = Integer.parseInt(getFieldValue("hidemode"));
-
- } // end try
- catch (NumberFormatException nfe)
- { // how rude!
- throw new InternalStateError("somehow we got a non-numeric result from a numeric dropdown list!");
-
- } // end catch
-
- // Determine what the "join key" should be.
- String jkey;
- if (getFieldValue("comtype").equals("1"))
- jkey = getFieldValue("joinkey");
- else
- jkey = null;
-
- // Create the new community context.
- CommunityContext rc = user.createCommunity(getFieldValue("name"),getFieldValue("alias"),
- getFieldValue("language"),getFieldValue("synopsis"),
- getFieldValue("rules"),jkey,hidemode);
-
- // Get the new community's contact record and fill in the pieces of info we know.
- ContactInfo ci = rc.getContactInfo();
- ci.setLocality(getFieldValue("loc"));
- ci.setRegion(getFieldValue("reg"));
- ci.setPostalCode(getFieldValue("pcode"));
- ci.setCountry(getFieldValue("country"));
- rc.putContactInfo(ci);
-
- return rc; // all done!
-
- } // end doDialog
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new CreateCommunityDialog(this);
-
- } // end clone
-
-} // end class CreateCommunityDialog
diff --git a/src/com/silverwrist/venice/servlets/format/CreateConferenceDialog.java b/src/com/silverwrist/venice/servlets/format/CreateConferenceDialog.java
deleted file mode 100644
index e51a0d5..0000000
--- a/src/com/silverwrist/venice/servlets/format/CreateConferenceDialog.java
+++ /dev/null
@@ -1,120 +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.util.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.AccessError;
-import com.silverwrist.venice.except.DataException;
-import com.silverwrist.venice.except.ValidationException;
-
-public class CreateConferenceDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public CreateConferenceDialog()
- {
- super("Create New Conference",null,"newconfform","confops");
- setHiddenField("cmd","C");
- setHiddenField("sig","");
-
- Vector vec_pubpriv = new Vector(2);
- vec_pubpriv.add("0|Public");
- vec_pubpriv.add("1|Private");
- vec_pubpriv.trimToSize();
-
- addFormField(new CDTextFormField("name","Conference Name",null,true,32,128));
- addFormField(new CDVeniceIDFormField("alias","Conference Alias",null,true,32,64));
- addFormField(new CDTextFormField("descr","Description",null,false,32,255));
- addFormField(new CDSimplePickListFormField("ctype","Conference type",null,true,vec_pubpriv,'|'));
- addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
- null,"Y"));
- addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected CreateConferenceDialog(CreateConferenceDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- if (engine.confAliasExists(getFieldValue("alias")))
- throw new ValidationException("That alias is already used by another conference on the system.");
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(VeniceEngine engine, CommunityContext comm)
- {
- this.engine = engine;
- setHiddenField("sig",String.valueOf(comm.getCommunityID()));
-
- } // end setupDialog
-
- public ConferenceContext doDialog(CommunityContext comm)
- throws ValidationException, DataException, AccessError
- {
- validate(); // validate the form
-
- // Convert a couple of fields to Booleans, which we need.
- final String yes = "Y";
- boolean pvt = getFieldValue("ctype").equals("1");
- boolean hide_list = yes.equals(getFieldValue("hide"));
-
- // create the conference!
- return comm.createConference(getFieldValue("name"),getFieldValue("alias"),getFieldValue("descr"),pvt,
- hide_list);
-
- } // end if
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new CreateConferenceDialog(this);
-
- } // end clone
-
-} // end class CreateConferenceDialog
diff --git a/src/com/silverwrist/venice/servlets/format/DialogCache.java b/src/com/silverwrist/venice/servlets/format/DialogCache.java
deleted file mode 100644
index 731b5b2..0000000
--- a/src/com/silverwrist/venice/servlets/format/DialogCache.java
+++ /dev/null
@@ -1,103 +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.util.Hashtable;
-import javax.servlet.ServletContext;
-import org.apache.log4j.*;
-
-public class DialogCache
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- protected static final String ATTR_NAME = "com.silverwrist.venice.servlets.DialogCache";
-
- private static Category logger = Category.getInstance(DialogCache.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- Hashtable cache;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- protected DialogCache()
- {
- cache = new Hashtable();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public boolean isCached(String name)
- {
- return (cache.get(name)!=null);
-
- } // end isCached
-
- public void saveTemplate(ContentDialog template)
- {
- String fullname = template.getClass().getName();
- int clip_pos = fullname.lastIndexOf('.');
- if (clip_pos>=0)
- fullname = fullname.substring(clip_pos+1);
- cache.put(fullname,template);
-
- } // end saveTemplate
-
- public ContentDialog getNewDialog(String name)
- {
- ContentDialog template = (ContentDialog)(cache.get(name));
- if (template!=null)
- return (ContentDialog)(template.clone());
- else
- return null;
-
- } // end getNewDialog
-
- /*--------------------------------------------------------------------------------
- * Static operations for use by servlets
- *--------------------------------------------------------------------------------
- */
-
- public static DialogCache getDialogCache(ServletContext ctxt)
- {
- // Look in the servlet attributes first.
- Object foo = ctxt.getAttribute(ATTR_NAME);
- if (foo!=null)
- return (DialogCache)foo;
-
- // create a new one and return it
- DialogCache cache = new DialogCache();
- ctxt.setAttribute(ATTR_NAME,cache);
- return cache;
-
- } // end getDialogCache
-
-} // end class DialogCache
diff --git a/src/com/silverwrist/venice/servlets/format/EditCommunityProfileDialog.java b/src/com/silverwrist/venice/servlets/format/EditCommunityProfileDialog.java
deleted file mode 100644
index d5c7043..0000000
--- a/src/com/silverwrist/venice/servlets/format/EditCommunityProfileDialog.java
+++ /dev/null
@@ -1,353 +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.*;
-import java.util.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.security.Role;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class EditCommunityProfileDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * The logo URL control class.
- *--------------------------------------------------------------------------------
- */
-
- static class CDCommunityLogoControl extends CDBaseFormField
- {
- private String linkURL;
-
- public CDCommunityLogoControl(String name, String caption, String linkURL)
- {
- super(name,caption,"(click to change)",false);
- this.linkURL = linkURL;
-
- } // end constructor
-
- protected CDCommunityLogoControl(CDCommunityLogoControl other)
- {
- super(other);
- this.linkURL = other.linkURL;
-
- } // end constructor
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- if (isEnabled())
- out.write("");
- String photo = getValue();
- if (StringUtil.isStringEmpty(photo))
- photo = rdat.getFullImagePath("sig_other.jpg");
- out.write("");
- if (isEnabled())
- out.write("");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- { // this is a do-nothing value
- } // end validateContents
-
- public CDFormField duplicate()
- {
- return new CDCommunityLogoControl(this);
-
- } // end clone
-
- public void setLinkURL(String s)
- {
- linkURL = s;
-
- } // end setLinkURL
-
- } // end class CDCommunityLogoControl
-
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String YES = "Y";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CDCommunityLogoControl logo_control;
- private VeniceEngine engine;
- private int cid;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public EditCommunityProfileDialog(SecurityInfo sinf)
- {
- super("Edit Community Profile:",null,"commprofform","sigadmin");
- setHiddenField("cmd","P");
- setHiddenField("sig","");
-
- Vector vec_pubpriv = new Vector(2);
- vec_pubpriv.add("0|Public");
- vec_pubpriv.add("1|Private");
- vec_pubpriv.trimToSize();
-
- Vector vec_hidemode = new Vector(3);
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_NONE) + "|Show in both directory and search");
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_DIRECTORY)
- + "|Hide in directory, but not in search");
- vec_hidemode.add(String.valueOf(CommunityContext.HIDE_BOTH) + "|Hide in both directory and search");
- vec_hidemode.trimToSize();
-
- addFormField(new CDFormCategoryHeader("Basic Information"));
- addFormField(new CDTextFormField("name","Community Name",null,true,32,128));
- addFormField(new CDVeniceIDFormField("alias","Community Alias",null,true,32,32));
- addFormField(new CDTextFormField("synopsis","Synopsis",null,false,32,255));
- addFormField(new CDTextFormField("rules","Rules",null,false,32,255));
- addFormField(new CDLanguageListFormField("language","Primary language",null,true));
- addFormField(new CDTextFormField("url","Home page",null,false,32,255));
- logo_control = new CDCommunityLogoControl("logo","Community logo","commlogo");
- addFormField(logo_control);
-
- addFormField(new CDFormCategoryHeader("Location"));
- addFormField(new CDTextFormField("company","Company",null,false,32,255));
- addFormField(new CDTextFormField("addr1","Address",null,false,32,255));
- addFormField(new CDTextFormField("addr2","Address","(line 2)",false,32,255));
- addFormField(new CDTextFormField("loc","City",null,false,32,64));
- addFormField(new CDTextFormField("reg","State/Province",null,false,32,64));
- addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
- addFormField(new CDCountryListFormField("country","Country",null,true));
-
- addFormField(new CDFormCategoryHeader("Security"));
- addFormField(new CDSimplePickListFormField("comtype","Communty type",null,true,vec_pubpriv,'|'));
- addFormField(new CDTextFormField("joinkey","Join key","(for private communities)",false,32,64));
- addFormField(new CDCheckBoxFormField("membersonly","Allow only members to access this community",
- null,YES));
- addFormField(new CDSimplePickListFormField("hidemode","Community visibility",null,true,vec_hidemode,'|'));
- addFormField(new CDRoleListFormField("read_lvl","Security level required to read contents",null,true,
- sinf.getRoleList("Community.Read")));
- addFormField(new CDRoleListFormField("write_lvl","Security level required to update profile",null,true,
- sinf.getRoleList("Community.Write")));
- addFormField(new CDRoleListFormField("create_lvl","Security level required to create new subobjects",
- null,true,sinf.getRoleList("Community.Create")));
- addFormField(new CDRoleListFormField("delete_lvl","Security level required to delete community",null,true,
- sinf.getRoleList("Community.Delete")));
- addFormField(new CDRoleListFormField("join_lvl","Security level required to join community",null,true,
- sinf.getRoleList("Community.Join")));
-
- addFormField(new CDFormCategoryHeader("Conferencing Options"));
- addFormField(new CDCheckBoxFormField("pic_in_post","Display user pictures next to posts in conferences",
- "(by default; user can override)",YES));
-
- addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end EditCommunityProfileDialog
-
- protected EditCommunityProfileDialog(EditCommunityProfileDialog other)
- {
- super(other);
- logo_control = (CDCommunityLogoControl)modifyField("logo");
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private void doDisable(CommunityContext comm)
- {
- if (comm.isAdminCommunity())
- { // make sure certain fields are disabled for admin community
- setFieldEnabled("comtype",false);
- setFieldEnabled("joinkey",false);
- setFieldEnabled("membersonly",false);
- setFieldEnabled("hidemode",false);
- setFieldEnabled("read_lvl",false);
- setFieldEnabled("write_lvl",false);
- setFieldEnabled("create_lvl",false);
- setFieldEnabled("delete_lvl",false);
- setFieldEnabled("join_lvl",false);
-
- } // end if
-
- } // end doDisable
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- if (engine.aliasExists(getFieldValue("alias"),cid))
- throw new ValidationException("That alias is already used by another community on the system.");
-
- if (getFieldValue("comtype").equals("1"))
- { // make sure if they flagged it as Private that they specified a join key
- if (StringUtil.isStringEmpty(getFieldValue("joinkey")))
- throw new ValidationException("Private communities must specify a join key value.");
-
- } // end if
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialogBasic(VeniceEngine engine, CommunityContext comm)
- {
- this.engine = engine;
- this.cid = comm.getCommunityID();
-
- } // end setupDialogBasic
-
- public void setupDialog(VeniceEngine engine, CommunityContext comm) throws DataException, AccessError
- {
- setupDialogBasic(engine,comm);
- ContactInfo ci = comm.getContactInfo();
- CommunityProperties props = comm.getProperties();
-
- setHiddenField("sig",String.valueOf(comm.getCommunityID()));
- setFieldValue("name",comm.getName());
- setFieldValue("alias",comm.getAlias());
- setFieldValue("synopsis",comm.getSynopsis());
- setFieldValue("rules",comm.getRules());
- setFieldValue("language",comm.getLanguageCode());
- setFieldValue("url",ci.getURL());
- setFieldValue("logo",ci.getPhotoURL());
- logo_control.setLinkURL("commlogo?sig=" + comm.getCommunityID());
- setFieldValue("company",ci.getCompany());
- setFieldValue("addr1",ci.getAddressLine1());
- setFieldValue("addr2",ci.getAddressLine2());
- setFieldValue("loc",ci.getLocality());
- setFieldValue("reg",ci.getRegion());
- setFieldValue("pcode",ci.getPostalCode());
- setFieldValue("country",ci.getCountry());
- if (comm.isPublicCommunity())
- { // public community - no join key
- setFieldValue("comtype","0");
- setFieldValue("joinkey","");
-
- } // end if
- else
- { // private community - display the join key
- setFieldValue("comtype","1");
- setFieldValue("joinkey",comm.getJoinKey());
-
- } // end else
-
- if (comm.getMembersOnly())
- setFieldValue("membersonly",YES);
- setFieldValue("hidemode",String.valueOf(comm.getHideMode()));
- setFieldValue("read_lvl",String.valueOf(comm.getReadLevel()));
- setFieldValue("write_lvl",String.valueOf(comm.getWriteLevel()));
- setFieldValue("create_lvl",String.valueOf(comm.getCreateLevel()));
- setFieldValue("delete_lvl",String.valueOf(comm.getDeleteLevel()));
- setFieldValue("join_lvl",String.valueOf(comm.getJoinLevel()));
- if (props.getDisplayPostPictures())
- setFieldValue("pic_in_post",YES);
-
- doDisable(comm);
-
- } // end setupDialog
-
- public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
- {
- validate(); // validate the dialog entries
-
- int hidemode, read_lvl, write_lvl, create_lvl, delete_lvl, join_lvl;
- try
- { // convert the values of some dropdowns to real numbers
- hidemode = Integer.parseInt(getFieldValue("hidemode"));
- read_lvl = Integer.parseInt(getFieldValue("read_lvl"));
- write_lvl = Integer.parseInt(getFieldValue("write_lvl"));
- create_lvl = Integer.parseInt(getFieldValue("create_lvl"));
- delete_lvl = Integer.parseInt(getFieldValue("delete_lvl"));
- join_lvl = Integer.parseInt(getFieldValue("join_lvl"));
-
- } // end try
- catch (NumberFormatException nfe)
- { // how rude!
- throw new InternalStateError("somehow we got a non-numeric result from a numeric dropdown list!");
-
- } // end catch
-
- // save off the ContactInfo-related fields first
- ContactInfo ci = comm.getContactInfo();
- ci.setURL(getFieldValue("url"));
- ci.setCompany(getFieldValue("company"));
- ci.setAddressLine1(getFieldValue("addr1"));
- ci.setAddressLine2(getFieldValue("addr2"));
- ci.setLocality(getFieldValue("loc"));
- ci.setRegion(getFieldValue("reg"));
- ci.setPostalCode(getFieldValue("pcode"));
- ci.setCountry(getFieldValue("country"));
- comm.putContactInfo(ci);
-
- // now save off the property-related fields
- CommunityProperties props = comm.getProperties();
- props.setDisplayPostPictures(YES.equals(getFieldValue("pic_in_post")));
- comm.setProperties(props);
-
- // now save the big text fields
- comm.setName(getFieldValue("name"));
- comm.setAlias(getFieldValue("alias"));
- comm.setSynopsis(getFieldValue("synopsis"));
- comm.setRules(getFieldValue("rules"));
- comm.setLanguage(getFieldValue("language"));
-
- if (!(comm.isAdminCommunity()))
- { // save off the security information
- String jkey;
- if (getFieldValue("comtype").equals("1"))
- jkey = getFieldValue("joinkey");
- else
- jkey = null;
- comm.setJoinKey(jkey);
- comm.setMembersOnly(YES.equals(getFieldValue("membersonly")));
- comm.setHideMode(hidemode);
- comm.setSecurityLevels(read_lvl,write_lvl,create_lvl,delete_lvl,join_lvl);
-
- } // end if
-
- } // end doDialog
-
- public void resetOnError(CommunityContext comm, String message)
- {
- setErrorMessage(message);
- doDisable(comm);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new EditCommunityProfileDialog(this);
-
- } // end clone
-
-} // end class EditCommunityProfileDialog
-
diff --git a/src/com/silverwrist/venice/servlets/format/EditConferenceDialog.java b/src/com/silverwrist/venice/servlets/format/EditConferenceDialog.java
deleted file mode 100644
index acf8657..0000000
--- a/src/com/silverwrist/venice/servlets/format/EditConferenceDialog.java
+++ /dev/null
@@ -1,188 +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.util.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.security.Role;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class EditConferenceDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String YES = "Y";
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public EditConferenceDialog(SecurityInfo sinf)
- {
- super("Edit Conference:",null,"editconfform","confops");
- setHiddenField("cmd","E");
- setHiddenField("sig","");
- setHiddenField("conf","");
-
- addFormField(new CDFormCategoryHeader("Basic Information"));
- addFormField(new CDTextFormField("name","Conference Name",null,true,32,128));
- addFormField(new CDTextFormField("descr","Description",null,false,32,255));
- addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
- null,YES));
- addFormField(new CDFormCategoryHeader("Security Information"));
- addFormField(new CDRoleListFormField("read_lvl","Security level required to read conference",null,true,
- sinf.getRoleList("Conference.Read")));
- addFormField(new CDRoleListFormField("post_lvl","Security level required to post to conference",null,true,
- sinf.getRoleList("Conference.Post")));
- addFormField(new CDRoleListFormField("create_lvl",
- "Security level required to create new topics in conference",null,
- true,sinf.getRoleList("Conference.Create")));
- addFormField(new CDRoleListFormField("hide_lvl",
- "Security level required to archive or freeze topics",
- "(or to hide posts of which you are not the owner)",true,
- sinf.getRoleList("Conference.Hide")));
- addFormField(new CDRoleListFormField("nuke_lvl",
- "Security level required to delete topics or nuke posts",
- "(or to scribble posts of which you are not the owner)",true,
- sinf.getRoleList("Conference.Nuke")));
- addFormField(new CDRoleListFormField("change_lvl",
- "Security level required to change conference attributes",null,true,
- sinf.getRoleList("Conference.Change")));
- addFormField(new CDRoleListFormField("delete_lvl",
- "Security level required to delete conference",null,true,
- sinf.getRoleList("Conference.Delete")));
- addFormField(new CDFormCategoryHeader("Conference Properties"));
- addFormField(new CDCheckBoxFormField("pic_in_post","Display users' pictures next to their posts",
- "(user can override)",YES));
- addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected EditConferenceDialog(EditConferenceDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal operations
- *--------------------------------------------------------------------------------
- */
-
- private final void doDisable(CommunityContext comm, ConferenceContext conf)
- {
- setFieldEnabled("hide",conf.canSetHideList());
-
- } // end doDisable
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
- {
- doDisable(comm,conf);
- setHiddenField("sig",String.valueOf(comm.getCommunityID()));
- setHiddenField("conf",String.valueOf(conf.getConfID()));
- setTitle("Edit Conference: " + conf.getName());
- setFieldValue("name",conf.getName());
- setFieldValue("descr",conf.getDescription());
- if (conf.canSetHideList())
- { // this is only valid at community level
- if (conf.getHideList())
- setFieldValue("hide",YES);
- else
- setFieldValue("hide","");
-
- } // end if
-
- setFieldValue("read_lvl",String.valueOf(conf.getReadLevel()));
- setFieldValue("post_lvl",String.valueOf(conf.getPostLevel()));
- setFieldValue("create_lvl",String.valueOf(conf.getCreateLevel()));
- setFieldValue("hide_lvl",String.valueOf(conf.getHideLevel()));
- setFieldValue("nuke_lvl",String.valueOf(conf.getNukeLevel()));
- setFieldValue("change_lvl",String.valueOf(conf.getChangeLevel()));
- setFieldValue("delete_lvl",String.valueOf(conf.getDeleteLevel()));
- ConferenceProperties props = conf.getProperties();
- if (props.getDisplayPostPictures())
- setFieldValue("pic_in_post",YES);
- else
- setFieldValue("pic_in_post","");
-
- } // end setupDialog
-
- public void doDialog(ConferenceContext conf) throws ValidationException, DataException, AccessError
- {
- validate(); // validate the dialog entries
-
- ConferenceProperties props = conf.getProperties();
- int read_lvl, post_lvl, create_lvl, hide_lvl, nuke_lvl, change_lvl, delete_lvl;
- try
- { // get all the security levels out of their form fields
- read_lvl = Integer.parseInt(getFieldValue("read_lvl"));
- post_lvl = Integer.parseInt(getFieldValue("post_lvl"));
- create_lvl = Integer.parseInt(getFieldValue("create_lvl"));
- hide_lvl = Integer.parseInt(getFieldValue("hide_lvl"));
- nuke_lvl = Integer.parseInt(getFieldValue("nuke_lvl"));
- change_lvl = Integer.parseInt(getFieldValue("change_lvl"));
- delete_lvl = Integer.parseInt(getFieldValue("delete_lvl"));
-
- } // end try
- catch (NumberFormatException nfe)
- { // how rude!
- throw new InternalStateError("somehow we got a non-numeric result from a numeric dropdown list!");
-
- } // end catch
-
- // sweep through the conference and set the appropriate changes
- conf.setName(getFieldValue("name"));
- conf.setDescription(getFieldValue("descr"));
- if (conf.canSetHideList())
- conf.setHideList(YES.equals(getFieldValue("hide")));
- conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl);
-
- // reset the properties
- props.setDisplayPostPictures(YES.equals(getFieldValue("pic_in_post")));
- conf.setProperties(props);
-
- } // end doDialog
-
- public void resetOnError(CommunityContext comm, ConferenceContext conf, String message)
- {
- doDisable(comm,conf);
- setHiddenField("sig",String.valueOf(comm.getCommunityID()));
- setHiddenField("conf",String.valueOf(conf.getConfID()));
- setTitle("Edit Conference: " + conf.getName());
- setErrorMessage(message);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new EditConferenceDialog(this);
-
- } // end clone
-
-} // end class EditConferenceDialog
diff --git a/src/com/silverwrist/venice/servlets/format/EditGlobalPropertiesDialog.java b/src/com/silverwrist/venice/servlets/format/EditGlobalPropertiesDialog.java
deleted file mode 100644
index 1a0c35e..0000000
--- a/src/com/silverwrist/venice/servlets/format/EditGlobalPropertiesDialog.java
+++ /dev/null
@@ -1,128 +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.*;
-import java.util.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.security.Role;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class EditGlobalPropertiesDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public EditGlobalPropertiesDialog(SecurityInfo sinf)
- {
- super("Edit Global Properties",null,"globpropform","sysadmin");
- setHiddenField("cmd","G");
-
- addFormField(new CDFormCategoryHeader("System Properties"));
- addFormField(new CDIntegerFormField("search_items","Number of search items to display per page",
- null,5,100));
- addFormField(new CDIntegerFormField("fp_posts","Number of published posts to display on front page",
- null,1,50));
- addFormField(new CDIntegerFormField("audit_recs","Number of audit records to display per page",
- null,10,500));
- addFormField(new CDRoleListFormField("create_lvl","Security level required to create a new community",
- null,true,sinf.getRoleList("Global.CreateCommunity")));
-
- addFormField(new CDFormCategoryHeader("Community Properties"));
- addFormField(new CDIntegerFormField("comm_mbrs","Number of community members to display per page",
- null,10,100));
-
- addFormField(new CDFormCategoryHeader("Conferencing Properties"));
- addFormField(new CDIntegerFormField("posts_page","Maximum number of posts to display per page",
- null,5,100));
- addFormField(new CDIntegerFormField("old_posts","Number of \"old\" posts to display at top of page",
- null,1,5));
- addFormField(new CDIntegerFormField("conf_mbrs","Number of conference members to display per page",
- null,10,100));
- addFormField(new CDCheckBoxFormField("pic_in_post","Display user pictures next to posts in conferences",
- "(by default; user can override)"));
-
- addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected EditGlobalPropertiesDialog(EditGlobalPropertiesDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(AdminOperations adm)
- {
- GlobalProperties props = adm.getProperties();
- setFieldObjValue("search_items",new Integer(props.getSearchItemsPerPage()));
- setFieldObjValue("fp_posts",new Integer(props.getPostsOnFrontPage()));
- setFieldObjValue("audit_recs",new Integer(props.getAuditRecordsPerPage()));
- setFieldObjValue("create_lvl",new Integer(props.getCommunityCreateLevel()));
- setFieldObjValue("comm_mbrs",new Integer(props.getCommunityMembersPerPage()));
- setFieldObjValue("posts_page",new Integer(props.getPostsPerPage()));
- setFieldObjValue("old_posts",new Integer(props.getOldPostsAtTop()));
- setFieldObjValue("conf_mbrs",new Integer(props.getConferenceMembersPerPage()));
- setFieldObjValue("pic_in_post",new Boolean(props.getDisplayPostPictures()));
-
- } // end setupDialog
-
- public void doDialog(AdminOperations adm) throws ValidationException, DataException
- {
- validate(); // validate the dialog
-
- // Reset the global properties.
- GlobalProperties props = adm.getProperties();
- Integer iv = (Integer)(getFieldObjValue("search_items"));
- props.setSearchItemsPerPage(iv.intValue());
- iv = (Integer)(getFieldObjValue("fp_posts"));
- props.setPostsOnFrontPage(iv.intValue());
- iv = (Integer)(getFieldObjValue("audit_recs"));
- props.setAuditRecordsPerPage(iv.intValue());
- iv = (Integer)(getFieldObjValue("create_lvl"));
- props.setCommunityCreateLevel(iv.intValue());
- iv = (Integer)(getFieldObjValue("comm_mbrs"));
- props.setCommunityMembersPerPage(iv.intValue());
- iv = (Integer)(getFieldObjValue("posts_page"));
- props.setPostsPerPage(iv.intValue());
- iv = (Integer)(getFieldObjValue("old_posts"));
- props.setOldPostsAtTop(iv.intValue());
- iv = (Integer)(getFieldObjValue("conf_mbrs"));
- props.setConferenceMembersPerPage(iv.intValue());
- Boolean bv = (Boolean)(getFieldObjValue("pic_in_post"));
- props.setDisplayPostPictures(bv.booleanValue());
- adm.setProperties(props);
-
- } // end doDialog
-
- public Object clone()
- {
- return new EditGlobalPropertiesDialog(this);
-
- } // end clone
-
-} // end class EditGlobalPropertiesDialog
diff --git a/src/com/silverwrist/venice/servlets/format/EditProfileDialog.java b/src/com/silverwrist/venice/servlets/format/EditProfileDialog.java
deleted file mode 100644
index e5e6b1c..0000000
--- a/src/com/silverwrist/venice/servlets/format/EditProfileDialog.java
+++ /dev/null
@@ -1,319 +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.*;
-import java.net.URLEncoder;
-import java.util.*;
-import com.silverwrist.util.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class EditProfileDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * The photo URL control class.
- *--------------------------------------------------------------------------------
- */
-
- static class CDUserPhotoControl extends CDBaseFormField
- {
- private String linkURL;
-
- public CDUserPhotoControl(String name, String caption, String linkURL)
- {
- super(name,caption,"(click to change)",false);
- this.linkURL = linkURL;
-
- } // end constructor
-
- protected CDUserPhotoControl(CDUserPhotoControl other)
- {
- super(other);
- this.linkURL = other.linkURL;
-
- } // end constructor
-
- protected void renderActualField(Writer out, RenderData rdat) throws IOException
- {
- if (isEnabled())
- out.write("");
- String photo = getValue();
- if (StringUtil.isStringEmpty(photo))
- photo = rdat.getPhotoNotAvailURL();
- out.write("");
- if (isEnabled())
- out.write("");
-
- } // end renderActualField
-
- protected void validateContents(String value) throws ValidationException
- { // this is a do-nothing value
- } // end validateContents
-
- public CDFormField duplicate()
- {
- return new CDUserPhotoControl(this);
-
- } // end clone
-
- public void setLinkURL(String s)
- {
- linkURL = s;
-
- } // end setLinkURL
-
- } // end class CDUserPhotoControl
-
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static final String YES = "Y";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CDUserPhotoControl photo_control;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public EditProfileDialog()
- {
- super("Edit Your Profile",null,"profform","account");
- setHiddenField("cmd","P");
- setHiddenField("tgt","");
- addFormField(new CDFormCategoryHeader("Password","To change your password, enter a new password "
- + "into the fields below."));
- addFormField(new CDPasswordFormField("pass1","Password",null,false,32,128));
- addFormField(new CDPasswordFormField("pass2","Password","(retype)",false,32,128));
- addFormField(new CDTextFormField("remind","Password reminder phrase",null,false,32,255));
- addFormField(new CDFormCategoryHeader("Name"));
- addFormField(new CDTextFormField("prefix","Prefix","(Mr., Ms., etc.)",false,8,8));
- addFormField(new CDTextFormField("first","First name",null,true,32,64));
- addFormField(new CDTextFormField("mid","Middle initial",null,false,1,1));
- addFormField(new CDTextFormField("last","Last name",null,true,32,64));
- addFormField(new CDTextFormField("suffix","Suffix","(Jr., III, etc.)",false,16,16));
- addFormField(new CDFormCategoryHeader("Location"));
- addFormField(new CDTextFormField("company","Company",null,false,32,255));
- addFormField(new CDTextFormField("addr1","Address",null,false,32,255));
- addFormField(new CDTextFormField("addr2","Address","(line 2)",false,32,255));
- addFormField(new CDCheckBoxFormField("pvt_addr","Hide address in profile",null,YES));
- addFormField(new CDTextFormField("loc","City",null,true,32,64));
- addFormField(new CDTextFormField("reg","State/Province",null,true,32,64));
- addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
- addFormField(new CDCountryListFormField("country","Country",null,true));
- addFormField(new CDFormCategoryHeader("Phone Numbers"));
- addFormField(new CDTextFormField("phone","Telephone",null,false,32,32));
- addFormField(new CDTextFormField("mobile","Mobile/cellphone",null,false,32,32));
- addFormField(new CDCheckBoxFormField("pvt_phone","Hide phone/mobile numbers in profile",null,YES));
- addFormField(new CDTextFormField("fax","Fax",null,false,32,32));
- addFormField(new CDCheckBoxFormField("pvt_fax","Hide fax number in profile",null,YES));
- addFormField(new CDFormCategoryHeader("Internet"));
- addFormField(new CDEmailAddressFormField("email","E-mail address",null,true,32,255));
- addFormField(new CDCheckBoxFormField("pvt_email","Hide e-mail address in profile",null,YES));
- addFormField(new CDTextFormField("url","Home page","(URL)",false,32,255));
- addFormField(new CDFormCategoryHeader("Personal"));
- addFormField(new CDTextFormField("descr","Personal description",null,false,32,255));
- photo_control = new CDUserPhotoControl("photo","User Photo","userphoto");
- addFormField(photo_control);
- addFormField(new CDFormCategoryHeader("User Preferences"));
- addFormField(new CDCheckBoxFormField("pic_in_post","Display user photos next to conference posts",
- "(where applicable)",YES));
- addFormField(new CDCheckBoxFormField("no_mass_mail",
- "Don't send me mass E-mail from community/conference hosts",
- null,YES));
- addFormField(new CDLocaleListFormField("locale","Default locale","(for formatting dates/times)",true));
- addFormField(new CDTimeZoneListFormField("tz","Default time zone",null,true));
- addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected EditProfileDialog(EditProfileDialog other)
- {
- super(other);
- photo_control = (CDUserPhotoControl)modifyField("photo");
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class Object
- *--------------------------------------------------------------------------------
- */
-
- public Object clone()
- {
- return new EditProfileDialog(this);
-
- } // end clone
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- String pass1 = getFieldValue("pass1");
- String pass2 = getFieldValue("pass2");
-
- if (StringUtil.isStringEmpty(pass1))
- { // empty must match empty
- if (!StringUtil.isStringEmpty(pass2))
- throw new ValidationException("The typed passwords do not match.");
-
- } // end if
- else
- { // the two passwords must match
- if (!(pass1.equals(pass2)))
- throw new ValidationException("The typed passwords do not match.");
-
- } // end if
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setTarget(String target)
- {
- setHiddenField("tgt",target);
-
- } // end setTarget
-
- public void setupDialog(UserContext uc, String target) throws DataException
- {
- setTarget(target);
- ContactInfo ci = uc.getContactInfo(); // get the main contact info
- UserProperties props = uc.getProperties(); // get the properties
-
- setFieldEnabled("photo",ci.canSetPhoto());
- setFieldValue("prefix",ci.getNamePrefix());
- setFieldValue("first",ci.getGivenName());
- char init = ci.getMiddleInitial();
- if (init!=' ')
- setFieldValue("mid",String.valueOf(init));
- setFieldValue("last",ci.getFamilyName());
- setFieldValue("suffix",ci.getNameSuffix());
- setFieldValue("company",ci.getCompany());
- setFieldValue("addr1",ci.getAddressLine1());
- setFieldValue("addr2",ci.getAddressLine2());
- if (ci.getPrivateAddress())
- setFieldValue("pvt_addr",YES);
- setFieldValue("loc",ci.getLocality());
- setFieldValue("reg",ci.getRegion());
- setFieldValue("pcode",ci.getPostalCode());
- setFieldValue("country",ci.getCountry());
- setFieldValue("phone",ci.getPhone());
- setFieldValue("mobile",ci.getMobile());
- if (ci.getPrivatePhone())
- setFieldValue("pvt_phone",YES);
- setFieldValue("fax",ci.getFax());
- if (ci.getPrivateFax())
- setFieldValue("pvt_fax",YES);
- setFieldValue("email",ci.getEmail());
- if (ci.getPrivateEmail())
- setFieldValue("pvt_email",YES);
- setFieldValue("url",ci.getURL());
- setFieldValue("descr",uc.getDescription());
- setFieldValue("photo",ci.getPhotoURL());
- photo_control.setLinkURL("userphoto?tgt=" + URLEncoder.encode(target));
- if (props.getDisplayPostPictures())
- setFieldValue("pic_in_post",YES);
- if (props.getMassMailOptOut())
- setFieldValue("no_mass_mail",YES);
- setFieldValue("locale",uc.getLocale().toString());
- setFieldValue("tz",uc.getTimeZone().getID());
-
- } // end setupDialog
-
- public boolean doDialog(UserContext uc) throws ValidationException, DataException, EmailException
- {
- validate(); // validate the dialog
-
- ContactInfo ci = uc.getContactInfo(); // get the main contact info
- UserProperties props = uc.getProperties();
-
- // Reset all the contact info fields.
- ci.setNamePrefix(getFieldValue("prefix"));
- ci.setGivenName(getFieldValue("first"));
- String foo = getFieldValue("mid");
- if ((foo==null) || (foo.length()<1))
- ci.setMiddleInitial(' ');
- else
- ci.setMiddleInitial(foo.charAt(0));
- ci.setFamilyName(getFieldValue("last"));
- ci.setNameSuffix(getFieldValue("suffix"));
- ci.setCompany(getFieldValue("company"));
- ci.setAddressLine1(getFieldValue("addr1"));
- ci.setAddressLine2(getFieldValue("addr2"));
- ci.setPrivateAddress(YES.equals(getFieldValue("pvt_addr")));
- ci.setLocality(getFieldValue("loc"));
- ci.setRegion(getFieldValue("reg"));
- ci.setPostalCode(getFieldValue("pcode"));
- ci.setCountry(getFieldValue("country"));
- ci.setPhone(getFieldValue("phone"));
- ci.setMobile(getFieldValue("mobile"));
- ci.setPrivatePhone(YES.equals(getFieldValue("pvt_phone")));
- ci.setFax(getFieldValue("fax"));
- ci.setPrivateFax(YES.equals(getFieldValue("pvt_fax")));
- ci.setEmail(getFieldValue("email"));
- ci.setPrivateEmail(YES.equals(getFieldValue("pvt_email")));
- ci.setURL(getFieldValue("url"));
-
- // Store the completed contact info.
- boolean retval = uc.putContactInfo(ci);
-
- // Save off the properties.
- props.setDisplayPostPictures(YES.equals(getFieldValue("pic_in_post")));
- props.setMassMailOptOut(YES.equals(getFieldValue("no_mass_mail")));
- uc.setProperties(props);
-
- // Save off the user's description and preferences.
- uc.setDescription(getFieldValue("descr"));
- uc.setLocale(International.get().createLocale(getFieldValue("locale")));
- uc.setTimeZone(TimeZone.getTimeZone(getFieldValue("tz")));
-
- // Finally, change the password if applicable.
- foo = getFieldValue("pass1");
- if (!StringUtil.isStringEmpty(foo))
- uc.setPassword(foo,getFieldValue("remind"));
-
- return retval; // pass back up so we can decide where to jump
-
- } // end doDialog
-
- public void resetOnError(boolean photo_flag, String message)
- {
- setErrorMessage(message);
- setFieldValue("pass1",null);
- setFieldValue("pass2",null);
- setFieldEnabled("photo",photo_flag);
-
- } // end resetOnError
-
-} // end class EditProfileDialog
diff --git a/src/com/silverwrist/venice/servlets/format/ErrorBox.java b/src/com/silverwrist/venice/servlets/format/ErrorBox.java
deleted file mode 100644
index 4e57abd..0000000
--- a/src/com/silverwrist/venice/servlets/format/ErrorBox.java
+++ /dev/null
@@ -1,91 +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 com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.servlets.VeniceServletResult;
-
-public class ErrorBox extends VeniceServletResult implements ContentRender, ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String title;
- private String message;
- private String back;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ErrorBox(String title, String message, String back)
- {
- super();
- this.title = title;
- this.message = message;
- this.back = back;
-
- if (this.title==null)
- this.title = "Error!";
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return title;
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface ContentRender
- *--------------------------------------------------------------------------------
- */
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- out.write("
\n");
- if (back==null)
- out.write("Use your browser's Back button to go back.\n");
- else
- out.write("Go back.\n");
- out.write("
\n");
-
- } // end renderHere
-
-} // end class ErrorBox
diff --git a/src/com/silverwrist/venice/servlets/format/FindData.java b/src/com/silverwrist/venice/servlets/format/FindData.java
deleted file mode 100644
index 4cbcd8b..0000000
--- a/src/com/silverwrist/venice/servlets/format/FindData.java
+++ /dev/null
@@ -1,443 +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 javax.servlet.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class FindData implements JSPRender, SearchMode
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.FindData";
-
- // The various display categories
- public static final int FD_COMMUNITIES = 0;
- public static final int FD_USERS = 1;
- public static final int FD_CATEGORIES = 2;
- public static final int FD_POSTS = 3;
-
- // The titles and URLs of the header data
- private static Vector header_titles = null;
- private static Vector header_urls = null;
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
- private UserContext user;
- private int disp;
- private int field = -1;
- private int mode = -1;
- private String term = null;
- private int offset = 0;
- private CategoryDescriptor cat = null;
- private List subcats = null;
- private List results = null;
- private int find_count = -1;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public FindData(VeniceEngine engine, UserContext user, int disp)
- {
- this.engine = engine;
- this.user = user;
- this.disp = disp;
-
- if (header_titles==null)
- { // construct the title and URL vectors
- header_titles = new Vector();
- header_titles.add("Communities");
- header_titles.add("Users");
- header_titles.add("Categories");
- header_titles.add("Posts");
- header_titles.trimToSize();
-
- header_urls = new Vector();
- header_urls.add("find?disp=" + String.valueOf(FD_COMMUNITIES));
- header_urls.add("find?disp=" + String.valueOf(FD_USERS));
- header_urls.add("find?disp=" + String.valueOf(FD_CATEGORIES));
- header_urls.add("find?disp=" + String.valueOf(FD_POSTS));
- header_urls.trimToSize();
-
- } // end if
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, return default
- return default_val;
-
- } // end catch
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static int getNumChoices()
- {
- return FD_POSTS + 1;
-
- } // end getNumChoices
-
- public static FindData retrieve(ServletRequest request)
- {
- return (FindData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Find";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "find.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void writeHeader(RenderData rdat, Writer out) throws IOException
- {
- rdat.writeContentSelectorHeader(out,"Find:",header_titles,header_urls,disp);
-
- } // end writeHeader
-
- public int getDisplayOption()
- {
- return disp;
-
- } // end getDisplayOption
-
- public int getSearchField()
- {
- return field;
-
- } // end getSearchField
-
- public boolean searchFieldIs(int value)
- {
- return (value==field);
-
- } // end searchFieldIs
-
- public int getSearchMode()
- {
- return mode;
-
- } // end getSearchMode
-
- public boolean searchModeIs(int value)
- {
- return (value==mode);
-
- } // end searchModeIs
-
- public String getSearchTerm()
- {
- return term;
-
- } // end getSearchTerm
-
- public CategoryDescriptor getCategory()
- {
- return cat;
-
- } // end getCategory
-
- public List getSubCategoryList()
- {
- return subcats;
-
- } // end getSubCategoryList
-
- public List getResultsList()
- {
- return results;
-
- } // end getResultsList
-
- public int getNumResultsDisplayed()
- {
- return engine.getStdNumSearchResults();
-
- } // end getNumResultsDisplayed
-
- public int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public void loadGet(int catid) throws DataException
- {
- if (disp==FD_COMMUNITIES)
- { // fill in the list of subcategories and of communities in this category
- cat = user.getCategoryDescriptor(catid);
- subcats = cat.getSubCategories();
- if (cat.getCategoryID()>=0)
- { // fill in the communities that are in this category
- results = user.getCommunitiesInCategory(cat,offset,getNumResultsDisplayed());
- find_count = user.getNumCommunitiesInCategory(cat);
-
- } // end if
- field = FIELD_COMMUNITY_NAME;
-
- } // end if
- else if (disp==FD_USERS)
- field = FIELD_USER_NAME;
-
- mode = SEARCH_PREFIX;
- term = "";
-
- } // end loadGet
-
- public void loadPost(ServletRequest request) throws ValidationException, DataException
- {
- int catid = -1;
-
- // Retrieve all the posted parameters from the form and validate them. First validate the
- // category ID (if specified) and the field identifier.
- switch (disp)
- {
- case FD_COMMUNITIES:
- catid = getParamInt(request,"cat",-1);
- if (!engine.isValidCategoryID(catid))
- throw new ValidationException("The category ID parameter is not valid.");
- field = getParamInt(request,"field",FIELD_COMMUNITY_NAME);
- if ((field!=FIELD_COMMUNITY_NAME) && (field!=FIELD_COMMUNITY_SYNOPSIS))
- throw new ValidationException("The field search parameter is not valid.");
- break;
-
- case FD_USERS:
- field = getParamInt(request,"field",FIELD_USER_NAME);
- if ( (field!=FIELD_USER_NAME) && (field!=FIELD_USER_DESCRIPTION) && (field!=FIELD_USER_GIVEN_NAME)
- && (field!=FIELD_USER_FAMILY_NAME))
- throw new ValidationException("The field search parameter is not valid.");
- break;
-
- case FD_CATEGORIES:
- case FD_POSTS:
- // no parameters to set here - there's no "field" for category/post search
- break;
-
- default:
- throw new InternalStateError("loadPost failure - invalid display parameter");
-
- } // end switch
-
- if (disp!=FD_POSTS)
- { // Validate the search mode parameter.
- mode = getParamInt(request,"mode",SEARCH_PREFIX);
- if ((mode!=SEARCH_PREFIX) && (mode!=SEARCH_SUBSTRING) && (mode!=SEARCH_REGEXP))
- throw new ValidationException("The search mode parameter is not valid.");
-
- } // end if
-
- // Retrieve the search term parameter.
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Run the actual search.
- switch (disp)
- {
- case FD_COMMUNITIES:
- if (catid>=0)
- { // retrieve the category descriptor and the subcategory list
- cat = user.getCategoryDescriptor(catid);
- subcats = cat.getSubCategories();
- if (cat.getCategoryID()>=0)
- { // fill in the communities that are in this category
- results = user.getCommunitiesInCategory(cat,offset,count);
- if (find_count<0)
- find_count = user.getNumCommunitiesInCategory(cat);
-
- } // end if
-
- } // end if
- else
- { // retrieve the community search data
- results = user.searchForCommunities(field,mode,term,offset,count);
- if (find_count<0)
- find_count = user.getSearchCommunityCount(field,mode,term);
-
- } // end else
- break;
-
- case FD_USERS:
- results = engine.searchForUsers(field,mode,term,offset,count);
- if (find_count<0)
- find_count = engine.getSearchUserCount(field,mode,term);
- break;
-
- case FD_CATEGORIES:
- results = user.searchForCategories(mode,term,offset,count);
- if (find_count<0)
- find_count = user.getSearchCategoryCount(mode,term);
- break;
-
- case FD_POSTS:
- results = user.searchPosts(term,offset,count);
- if (find_count<0)
- find_count = user.getSearchPostCount(term);
- break;
-
- } // end switch
-
- } // end loadPost
-
- public static String getCatJumpLink(RenderData rdat, int catid)
- {
- return rdat.getEncodedServletPath("find?disp=" + String.valueOf(FD_COMMUNITIES) + "&cat="
- + String.valueOf(catid));
-
- } // end getCatJumpLink
-
- public static String getCommunityHostName(CommunityContext comm)
- {
- try
- { // get the host name for the specified community
- UserProfile prof = comm.getHostProfile();
- return prof.getUserName();
-
- } // end try
- catch (DataException e)
- { // just return NULL if an exception strikes
- return null;
-
- } // end catch
-
- } // end getCommunityHostName
-
- public static int getCommunityMemberCount(CommunityContext comm)
- {
- try
- { // get the member count for the specified community
- return comm.getMemberCount();
-
- } // end try
- catch (DataException e)
- { // just return -1 if an exception strikes
- return -1;
-
- } // end catch
-
- } // end getCommunityMemberCount
-
- public static String getActivityString(CommunityContext comm, RenderData rdat)
- {
- return rdat.getActivityString(comm.getLastAccessDate());
-
- } // end getActivityString
-
-} // end class FindData
diff --git a/src/com/silverwrist/venice/servlets/format/FindPostData.java b/src/com/silverwrist/venice/servlets/format/FindPostData.java
deleted file mode 100644
index ba8e696..0000000
--- a/src/com/silverwrist/venice/servlets/format/FindPostData.java
+++ /dev/null
@@ -1,275 +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 javax.servlet.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class FindPostData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.FindPostData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm;
- private ConferenceContext conf;
- private TopicContext topic;
- private String term = "";
- private int offset = 0;
- private int find_count = 0;
- private List results = null;
- private int max_results = 0;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public FindPostData(CommunityContext comm, ConferenceContext conf, TopicContext topic)
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal static functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, fall through
- } // end catch
-
- return default_val;
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static FindPostData retrieve(ServletRequest request)
- {
- return (FindPostData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Find Posts";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "findpost.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final void doSearch(ServletRequest request, VeniceEngine engine) throws AccessError, DataException
- {
- max_results = engine.getStdNumSearchResults();
-
- // Retrieve the search term parameter.
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= max_results;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += max_results; // go forwards instead
- else
- throw new InternalStateError("Unable to determine what action triggered the form.");
-
- if (topic!=null)
- { // search the topic
- results = topic.searchPosts(term,offset,max_results);
- if (find_count<0)
- find_count = topic.getSearchPostCount(term);
-
- } // end if
- else if (conf!=null)
- { // search the conference
- results = conf.searchPosts(term,offset,max_results);
- if (find_count<0)
- find_count = conf.getSearchPostCount(term);
-
- } // end else if
- else
- { // search the community
- results = comm.searchPosts(term,offset,max_results);
- if (find_count<0)
- find_count = comm.getSearchPostCount(term);
-
- } // end else
-
- } // end doSearch
-
- public final String getExtraParameters()
- {
- StringBuffer buf = new StringBuffer("");
- if (conf!=null)
- { // append the conference number parameter
- buf.append("\n");
- if (topic!=null)
- { // append the topic number parameter
- buf.append("\n");
-
- } // end if
-
- } // end if
-
- return buf.toString();
-
- } // end getExtraParameters
-
- public final String getReturnLink(RenderData rdat)
- {
- if (topic!=null)
- return "Return to Topic";
- else if (conf!=null)
- return "Return to Topic List";
- else
- return "Return to Topic List";
-
- } // end getReturnLink
-
- public final String getSubtitle()
- {
- if (topic!=null)
- return "Topic: " + topic.getName();
- else if (conf!=null)
- return "Conference: " + conf.getName();
- else
- return "Community: " + comm.getName();
-
- } // end getSubtitle
-
- public final String getTerm()
- {
- return term;
-
- } // end getTerm
-
- public final int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public final int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public final List getResults()
- {
- return results;
-
- } // end getResults
-
- public final int getMaxResults()
- {
- return max_results;
-
- } // end getMaxResults
-
-} // end class FindPostData
diff --git a/src/com/silverwrist/venice/servlets/format/Hotlist.java b/src/com/silverwrist/venice/servlets/format/Hotlist.java
deleted file mode 100644
index 6b36d3d..0000000
--- a/src/com/silverwrist/venice/servlets/format/Hotlist.java
+++ /dev/null
@@ -1,119 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-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
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * 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
diff --git a/src/com/silverwrist/venice/servlets/format/Invitation.java b/src/com/silverwrist/venice/servlets/format/Invitation.java
deleted file mode 100644
index ee1f172..0000000
--- a/src/com/silverwrist/venice/servlets/format/Invitation.java
+++ /dev/null
@@ -1,149 +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.IOException;
-import java.io.Writer;
-import javax.servlet.ServletRequest;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-
-public class Invitation implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.Invitation";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community context
- private ConferenceContext conf; // the conference context
- private TopicContext topic; // the topic context
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public Invitation(CommunityContext comm, ConferenceContext conf, TopicContext topic)
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static Invitation retrieve(ServletRequest request)
- {
- return (Invitation)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Send Invitation";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- String rc = "sigops?cmd=I&sig=" + comm.getCommunityID();
- if (conf!=null)
- { // add conference and topic parameters, as needed
- rc += ("&conf=" + conf.getConfID());
- if (topic!=null)
- rc += ("&top=" + topic.getTopicNumber());
-
- } // end if
-
- return rc;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "invitation.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final void writeHeader(Writer out, RenderData rdat) throws IOException
- {
- if (topic!=null)
- rdat.writeContentHeader(out,"Send Topic Invitation:",
- topic.getName() + " (in " + conf.getName() + ", in " + comm.getName() + ")");
- else if (conf!=null)
- rdat.writeContentHeader(out,"Send Conference Invitation:",
- conf.getName() + " (in " + comm.getName() + ")");
- else
- rdat.writeContentHeader(out,"Send Community Invitation:",comm.getName());
-
- } // end writeHeader
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final String getParameters()
- {
- String rc = "";
- if (conf==null)
- return rc;
- rc += ("\n");
- if (topic==null)
- return rc;
- rc += ("\n");
- return rc;
-
- } // end getAdditionalParameters
-
-} // end class Invitation
diff --git a/src/com/silverwrist/venice/servlets/format/JoinKeyDialog.java b/src/com/silverwrist/venice/servlets/format/JoinKeyDialog.java
deleted file mode 100644
index d71c2f4..0000000
--- a/src/com/silverwrist/venice/servlets/format/JoinKeyDialog.java
+++ /dev/null
@@ -1,95 +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 com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class JoinKeyDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public JoinKeyDialog()
- {
- super("Join Key Required",null,"joinkeyform","sigops");
- setHiddenField("cmd","J");
- setHiddenField("sig","");
- setInstructions("You must specify a join key before you can join this community. You might have received "
- + "the join key from the community's host, or via an invitation e-mail message. Please "
- + "enter it in the box below.");
- addFormField(new CDTextFormField("key","Join key",null,false,32,64));
- addCommandButton(new CDImageButton("join","bn_join_now.gif","Join Now",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected JoinKeyDialog(JoinKeyDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- if (StringUtil.isStringEmpty(getFieldValue("key")))
- throw new ValidationException("No join key specified.");
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupDialog(CommunityContext comm)
- {
- setHiddenField("sig",String.valueOf(comm.getCommunityID()));
-
- } // end setupDialog
-
- public void doDialog(CommunityContext comm) throws ValidationException, DataException, AccessError
- {
- validate();
- comm.join(getFieldValue("key"));
-
- } // end doDialog
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
- setFieldValue("key",null);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new JoinKeyDialog(this);
-
- } // end clone
-
-} // end class JoinKeyDialog
-
diff --git a/src/com/silverwrist/venice/servlets/format/LoginDialog.java b/src/com/silverwrist/venice/servlets/format/LoginDialog.java
deleted file mode 100644
index a4b6627..0000000
--- a/src/com/silverwrist/venice/servlets/format/LoginDialog.java
+++ /dev/null
@@ -1,84 +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 com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.except.ValidationException;
-import com.silverwrist.venice.servlets.Variables;
-
-public class LoginDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public LoginDialog()
- {
- super("Log In",null,"loginform","account");
- setHiddenField("cmd","L");
- setHiddenField("tgt","");
- setInstructions("Forgot your password? Enter your user name and click the Reminder button to receive "
- + "a password reminder via E-mail.");
- addFormField(new CDVeniceIDFormField("user","User name",null,false,32,64));
- addFormField(new CDPasswordFormField("pass","Password",null,false,32,128));
- addFormField(new CDCheckBoxFormField("saveme","Remember me for next time so I can log in automatically",
- null,"Y"));
- addCommandButton(new CDImageButton("login","bn_log_in.gif","Log In",80,24));
- addCommandButton(new CDImageButton("remind","bn_reminder.gif","Password Reminder",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected LoginDialog(LoginDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setTarget(String target)
- {
- setHiddenField("tgt",target);
-
- } // end setTarget
-
- public void setupNew(String target)
- {
- setHiddenField("tgt",target);
-
- } // end setupNew
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
- setFieldValue("pass",null);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new LoginDialog(this);
-
- } // end clone
-
-} // end class LoginDialog
diff --git a/src/com/silverwrist/venice/servlets/format/ManageConference.java b/src/com/silverwrist/venice/servlets/format/ManageConference.java
deleted file mode 100644
index 9200342..0000000
--- a/src/com/silverwrist/venice/servlets/format/ManageConference.java
+++ /dev/null
@@ -1,150 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-
-public class ManageConference implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ManageConference";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private String locator = null; // the locator we use
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ManageConference(CommunityContext comm, ConferenceContext conf)
- {
- this.comm = comm;
- this.conf = conf;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ManageConference retrieve(ServletRequest request)
- {
- return (ManageConference)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Manage Conference: " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "manage_conf.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public final String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public final String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- return locator;
-
- } // end getLocator
-
- public final String getDefaultPseud()
- {
- return conf.getDefaultPseud();
-
- } // end getDefaultPseud
-
- public final boolean displayInviteSection()
- {
- return conf.canSendInvitation();
-
- } // end displayInviteSection
-
- public final boolean displayAdminSection()
- {
- return conf.canChangeConference() || conf.canDeleteConference();
-
- } // end displayAdminSection
-
-} // end class ManageConference
diff --git a/src/com/silverwrist/venice/servlets/format/ManageConferenceAliases.java b/src/com/silverwrist/venice/servlets/format/ManageConferenceAliases.java
deleted file mode 100644
index fd3d8a2..0000000
--- a/src/com/silverwrist/venice/servlets/format/ManageConferenceAliases.java
+++ /dev/null
@@ -1,162 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ManageConferenceAliases implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ManageConferenceAliases";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private List aliases; // list of aliases generated
- private String error_message; // error message to display
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf) throws DataException
- {
- this.comm = comm;
- this.conf = conf;
- this.aliases = conf.getAliases();
- this.error_message = null;
-
- } // end constructor
-
- public ManageConferenceAliases(CommunityContext comm, ConferenceContext conf, String message)
- throws DataException
- {
- this.comm = comm;
- this.conf = conf;
- this.aliases = conf.getAliases();
- this.error_message = message;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ManageConferenceAliases retrieve(ServletRequest request)
- {
- return (ManageConferenceAliases)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Manage Conference Aliases: " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "manage_aliases.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public String getLocator()
- {
- return "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
-
- } // end getLocator
-
- public boolean canRemoveAliases()
- {
- return (aliases.size()>1);
-
- } // end canRemoveAliases
-
- public Iterator getAliasIterator()
- {
- return aliases.iterator();
-
- } // end getAliasIterator
-
- public String getErrorMessage()
- {
- return error_message;
-
- } // end getErrorMessage
-
-} // end class ManageConferenceAliases
diff --git a/src/com/silverwrist/venice/servlets/format/ManageTopic.java b/src/com/silverwrist/venice/servlets/format/ManageTopic.java
deleted file mode 100644
index da215e7..0000000
--- a/src/com/silverwrist/venice/servlets/format/ManageTopic.java
+++ /dev/null
@@ -1,188 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ManageTopic implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ManageTopic";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private TopicContext topic; // the topic being managed
- private String locator = null; // the locator we use
- private List bozos_list; // the list of "bozo" users
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ManageTopic(UserContext user, CommunityContext comm, ConferenceContext conf, TopicContext topic)
- throws DataException
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
-
- // Load up the list of bozos, sorting them in user name order.
- List bozo_uids = topic.getBozos();
- if (bozo_uids.size()>0)
- { // use a TreeMap to do the sorting
- TreeMap load_map = new TreeMap();
- Iterator it = bozo_uids.iterator();
- while (it.hasNext())
- { // fill in the list of user profiles
- Integer uid = (Integer)(it.next());
- UserProfile prof = user.getProfile(uid.intValue());
- load_map.put(prof.getUserName(),prof);
-
- } // end while
-
- bozos_list = new ArrayList(load_map.values());
-
- } // end if
- else // no bozos - just set empty list
- bozos_list = Collections.EMPTY_LIST;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ManageTopic retrieve(ServletRequest request)
- {
- return (ManageTopic)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Manage Topic: " + topic.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "manage_topic.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public final int getTopicNumber()
- {
- return topic.getTopicNumber();
-
- } // end getTopicID
-
- public final String getTopicName()
- {
- return topic.getName();
-
- } // end getConfName
-
- public final String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID() + "&top="
- + topic.getTopicNumber();
- return locator;
-
- } // end getLocator
-
- public final int getNumBozos()
- {
- return bozos_list.size();
-
- } // end getNumBozos()
-
- public final Iterator getBozosIterator()
- {
- return bozos_list.iterator();
-
- } // end getBozosIterator
-
- public final boolean isSubscribed()
- {
- return topic.isSubscribed();
-
- } // end isSubscribed
-
- public final boolean displayInviteSection()
- {
- return topic.canSendInvitation();
-
- } // end displayInviteSection
-
-} // end class ManageTopic
diff --git a/src/com/silverwrist/venice/servlets/format/MenuPanelCache.java b/src/com/silverwrist/venice/servlets/format/MenuPanelCache.java
deleted file mode 100644
index 504b978..0000000
--- a/src/com/silverwrist/venice/servlets/format/MenuPanelCache.java
+++ /dev/null
@@ -1,103 +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.util.Hashtable;
-import javax.servlet.ServletContext;
-import org.apache.log4j.*;
-
-public class MenuPanelCache
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- protected static final String ATTR_NAME = "com.silverwrist.venice.servlets.MenuPanelCache";
-
- private static Category logger = Category.getInstance(MenuPanelCache.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- Hashtable cache;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- protected MenuPanelCache()
- {
- cache = new Hashtable();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public boolean isCached(String name)
- {
- return (cache.get(name)!=null);
-
- } // end isCached
-
- public void saveTemplate(ContentMenuPanel template)
- {
- String fullname = template.getClass().getName();
- int clip_pos = fullname.lastIndexOf('.');
- if (clip_pos>=0)
- fullname = fullname.substring(clip_pos+1);
- cache.put(fullname,template);
-
- } // end saveTemplate
-
- public ContentMenuPanel getNewMenuPanel(String name)
- {
- ContentMenuPanel template = (ContentMenuPanel)(cache.get(name));
- if (template!=null)
- return (ContentMenuPanel)(template.clone());
- else
- return null;
-
- } // end getNewMenuPanel
-
- /*--------------------------------------------------------------------------------
- * Static operations for use by servlets
- *--------------------------------------------------------------------------------
- */
-
- public static MenuPanelCache getMenuPanelCache(ServletContext ctxt)
- {
- // Look in the servlet attributes first.
- Object foo = ctxt.getAttribute(ATTR_NAME);
- if (foo!=null)
- return (MenuPanelCache)foo;
-
- // create a new one and return it
- MenuPanelCache cache = new MenuPanelCache();
- ctxt.setAttribute(ATTR_NAME,cache);
- return cache;
-
- } // end getMenuPanelCache
-
-} // end class MenuPanelCache
diff --git a/src/com/silverwrist/venice/servlets/format/NewAccountDialog.java b/src/com/silverwrist/venice/servlets/format/NewAccountDialog.java
deleted file mode 100644
index a11646d..0000000
--- a/src/com/silverwrist/venice/servlets/format/NewAccountDialog.java
+++ /dev/null
@@ -1,155 +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.util.List;
-import javax.servlet.ServletRequest;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class NewAccountDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine = null;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public NewAccountDialog()
- {
- super("Create Account",null,"createform","account");
- setInstructions("To create a new account, please enter your information below.");
- setHiddenField("cmd","C");
- setHiddenField("tgt","");
- addFormField(new CDFormCategoryHeader("Name"));
- addFormField(new CDTextFormField("prefix","Prefix","(Mr., Ms., etc.)",false,8,8));
- addFormField(new CDTextFormField("first","First name",null,true,32,64));
- addFormField(new CDTextFormField("mid","Middle initial",null,false,1,1));
- addFormField(new CDTextFormField("last","Last name",null,true,32,64));
- addFormField(new CDTextFormField("suffix","Suffix","(Jr., III, etc.)",false,16,16));
- addFormField(new CDFormCategoryHeader("Location"));
- addFormField(new CDTextFormField("loc","City",null,true,32,64));
- addFormField(new CDTextFormField("reg","State/Province",null,true,32,64));
- addFormField(new CDTextFormField("pcode","Zip/Postal Code",null,true,32,64));
- addFormField(new CDCountryListFormField("country","Country",null,true));
- addFormField(new CDFormCategoryHeader("E-mail"));
- addFormField(new CDEmailAddressFormField("email","E-mail address",null,true,32,255));
- addFormField(new CDFormCategoryHeader("Account Information"));
- addFormField(new CDVeniceIDFormField("user","User name",null,true,32,64));
- addFormField(new CDPasswordFormField("pass1","Password",null,true,32,128));
- addFormField(new CDPasswordFormField("pass2","Password","(retype)",true,32,128));
- addFormField(new CDTextFormField("remind","Password reminder phrase",null,false,32,255));
- addCommandButton(new CDImageButton("create","bn_create.gif","Create",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected NewAccountDialog(NewAccountDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- if (!(getFieldValue("pass1").equals(getFieldValue("pass2"))))
- throw new ValidationException("The typed passwords do not match.");
-
- if (engine.isEmailAddressBanned(getFieldValue("email")))
- throw new ValidationException("This email address may not register a new account.");
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setEngine(VeniceEngine engine)
- {
- this.engine = engine;
-
- } // end setEngine
-
- public void setTarget(String target)
- {
- setHiddenField("tgt",target);
-
- } // end setTarget
-
- public UserContext doDialog(ServletRequest request)
- throws ValidationException, DataException, AccessError, EmailException
- {
- validate(); // validate the dialog
-
- // Create the new user account and set up its initial context.
- UserContext uc = engine.createNewAccount(request.getRemoteAddr(),getFieldValue("user"),
- getFieldValue("pass1"),getFieldValue("remind"));
-
- // Set up the account's contact info.
- ContactInfo ci = uc.getContactInfo();
- ci.setNamePrefix(getFieldValue("prefix"));
- ci.setGivenName(getFieldValue("first"));
- String blort = getFieldValue("mid");
- if ((blort==null) || (blort.length()<1))
- ci.setMiddleInitial(' ');
- else
- ci.setMiddleInitial(blort.charAt(0));
- ci.setFamilyName(getFieldValue("last"));
- ci.setNameSuffix(getFieldValue("suffix"));
- ci.setLocality(getFieldValue("loc"));
- ci.setRegion(getFieldValue("reg"));
- ci.setPostalCode(getFieldValue("pcode"));
- ci.setCountry(getFieldValue("country"));
- ci.setEmail(getFieldValue("email"));
-
- // save the contact info for the user (this also sends email confirmation messages as needed)
- uc.putContactInfo(ci);
-
- return uc;
-
- } // end doDialog
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
- setFieldValue("pass1",null);
- setFieldValue("pass2",null);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new NewAccountDialog(this);
-
- } // end clone
-
-} // end class NewAccountDialog
-
-
diff --git a/src/com/silverwrist/venice/servlets/format/NewCommunityWelcome.java b/src/com/silverwrist/venice/servlets/format/NewCommunityWelcome.java
deleted file mode 100644
index 5b9ffd3..0000000
--- a/src/com/silverwrist/venice/servlets/format/NewCommunityWelcome.java
+++ /dev/null
@@ -1,129 +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 javax.servlet.ServletRequest;
-import com.silverwrist.venice.core.CommunityContext;
-
-public class NewCommunityWelcome implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.NewCommunityWelcome";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String name;
- private String entry_url;
- private String invite_url;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public NewCommunityWelcome(CommunityContext comm)
- {
- name = comm.getName();
- entry_url = "sig/" + comm.getAlias();
- invite_url = "sigops?cmd=I&sig=" + comm.getCommunityID();
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static NewCommunityWelcome retrieve(ServletRequest request)
- {
- return (NewCommunityWelcome)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "New Community Created";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "newcommwelcome.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getCommunityName()
- {
- return name;
-
- } // end getCommunityName
-
- public String getEntryURL(RenderData rdat)
- {
- return rdat.getEncodedServletPath(entry_url);
-
- } // end getEntryURL
-
- public String getDisplayURL(RenderData rdat)
- {
- return rdat.getCompleteServletPath(entry_url);
-
- } // end getEntryURL
-
- public String getInviteURL(RenderData rdat)
- {
- return rdat.getEncodedServletPath(invite_url);
-
- } // end getInviteURL
-
-} // end class NewCommunityWelcome
diff --git a/src/com/silverwrist/venice/servlets/format/NewTopicForm.java b/src/com/silverwrist/venice/servlets/format/NewTopicForm.java
deleted file mode 100644
index fe259a0..0000000
--- a/src/com/silverwrist/venice/servlets/format/NewTopicForm.java
+++ /dev/null
@@ -1,242 +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.util.*;
-import javax.servlet.*;
-import com.silverwrist.venice.htmlcheck.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class NewTopicForm implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.NewTopicForm";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being created in
- private String topic_name; // the initial topic name
- private String pseud; // the pseud to display
- private boolean attach; // is there an attachment?
- private String post_box; // stuff from the post box
- private String preview = null; // the preview & spellchuck data
- private int num_errors = 0; // the number of spelling errors we get
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public NewTopicForm(CommunityContext comm, ConferenceContext conf)
- {
- this.comm = comm;
- this.conf = conf;
-
- } // end constrcutor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static NewTopicForm retrieve(ServletRequest request)
- {
- return (NewTopicForm)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Create New Topic";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "newtopic.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setupNewRequest()
- {
- topic_name = "";
- pseud = conf.getDefaultPseud();
- attach = false;
- post_box = "";
-
- } // end setupNewRequest
-
- public void generatePreview(VeniceEngine engine, ConferenceContext conf, ServletRequest request)
- throws ValidationException
- {
- HTMLChecker check;
-
- try
- { // run the data through the HTML Checker
- check = engine.getEscapingChecker();
-
- // sanitize the "title" parameter
- String foo = request.getParameter("title");
- if (foo==null)
- throw new ValidationException("Title parameter was not specified.");
- check.append(foo);
- check.finish();
- topic_name = check.getValue();
- check.reset();
-
- // sanitize the "pseud" parameter
- foo = request.getParameter("pseud");
- if (foo==null)
- throw new ValidationException("Pseud parameter was not specified.");
- check.append(foo);
- check.finish();
- pseud = check.getValue();
- check.reset();
-
- // sanitize the body text itself
- foo = request.getParameter("pb");
- if (foo==null)
- throw new ValidationException("Body text was not specified.");
- check.append(foo);
- check.finish();
- post_box = check.getValue();
-
- // generate the body text preview
- check = conf.getNewTopicPreviewChecker();
- check.append(foo);
- check.finish();
- preview = check.getValue();
- num_errors = check.getCounter("spelling");
-
- } // end try
- catch (HTMLCheckerException e)
- { // make sure we catch the HTML Checker exceptions
- throw new InternalStateError("spurious HTMLCheckerException in generatePreview",e);
-
- } // end catch
-
- // set the "attach" flag to save the checkbox state
- final String yes = "Y";
- attach = yes.equals(request.getParameter("attach"));
-
- } // end generatePreview
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public String getTopicName()
- {
- return topic_name;
-
- } // end getTopicName
-
- public String getPseud()
- {
- return pseud;
-
- } // end getPseud
-
- public boolean getAttachCheck()
- {
- return attach;
-
- } // end getAttachCheck
-
- public String getPostBoxData()
- {
- return post_box;
-
- } // end getPostBoxData
-
- public boolean isPreview()
- {
- return (preview!=null);
-
- } // end isPreview
-
- public String getPreviewData()
- {
- return preview;
-
- } // end getPreviewData
-
- public int getNumSpellingErrors()
- {
- return num_errors;
-
- } // end getNumSpellingErrors
-
- public boolean isNullRequest()
- {
- return ((topic_name.length()==0) || (post_box.length()==0));
-
- } // end isNullRequest
-
-} // end class NewTopicForm
diff --git a/src/com/silverwrist/venice/servlets/format/PostPreview.java b/src/com/silverwrist/venice/servlets/format/PostPreview.java
deleted file mode 100644
index 61798e1..0000000
--- a/src/com/silverwrist/venice/servlets/format/PostPreview.java
+++ /dev/null
@@ -1,216 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.htmlcheck.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class PostPreview implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.PostPreview";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm;
- private ConferenceContext conf;
- private TopicContext topic;
- private String next;
- private String pseud;
- private String data;
- private String preview;
- private int num_errors;
- private int msgs;
- private boolean attach;
- private boolean slippage;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public PostPreview(VeniceEngine engine, CommunityContext comm, ConferenceContext conf, TopicContext topic,
- String pseud, String data, String next, int msgs, boolean attach, boolean slippage)
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
- this.next = next;
- this.msgs = msgs;
- this.attach = attach;
- this.slippage = slippage;
-
- try
- { // sanitize the pseud data
- HTMLChecker check = engine.getEscapingChecker();
- check.append(pseud);
- check.finish();
- this.pseud = check.getValue();
-
- // sanitize the post box data
- check.reset();
- check.append(data);
- check.finish();
- this.data = check.getValue();
-
- // now generate the preview
- check = topic.getPreviewChecker();
- check.append(data);
- check.finish();
- this.preview = check.getValue();
- this.num_errors = check.getCounter("spelling");
-
- } // end try
- catch (HTMLCheckerException e)
- { // this is a bad issue...
- throw new InternalStateError("spurious HTMLCheckerException thrown");
-
- } // end catch
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static PostPreview retrieve(ServletRequest request)
- {
- return (PostPreview)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Previewing Message";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "preview.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getNumSpellingErrors()
- {
- return num_errors;
-
- } // end getNumSpellingErrors
-
- public String getPreviewData()
- {
- return preview;
-
- } // end getPreviewData
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public int getTopicNumber()
- {
- return topic.getTopicNumber();
-
- } // end getTopicNumber
-
- public int getTotalMessages()
- {
- return msgs;
-
- } // end getTotalMessages
-
- public String getNextVal()
- {
- return next;
-
- } // end getNextVal
-
- public String getPseud()
- {
- return pseud;
-
- } // end getPseud
-
- public boolean attachChecked()
- {
- return attach;
-
- } // end attachChecked
-
- public String getBodyText()
- {
- return data;
-
- } // end getBodyText
-
- public boolean slippageDetected()
- {
- return slippage;
-
- } // end slippageDetected
-
-} // end class PostPreview
diff --git a/src/com/silverwrist/venice/servlets/format/PostSlippage.java b/src/com/silverwrist/venice/servlets/format/PostSlippage.java
deleted file mode 100644
index e2d02a8..0000000
--- a/src/com/silverwrist/venice/servlets/format/PostSlippage.java
+++ /dev/null
@@ -1,243 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.htmlcheck.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class PostSlippage implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.PostSlippage";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm;
- private ConferenceContext conf;
- private TopicContext topic;
- private List messages;
- private String next;
- private String pseud;
- private String text;
- private boolean attach;
- private String topic_stem;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public PostSlippage(VeniceEngine engine, CommunityContext comm, ConferenceContext conf, TopicContext topic,
- int lastval, String next, String pseud, String text, boolean attach)
- throws DataException, AccessError
- {
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
- this.messages = topic.getMessages(lastval,topic.getTotalMessages()-1);
- this.next = next;
- this.attach = attach;
- List aliases = conf.getAliases();
- topic_stem = (String)(aliases.get(0)) + "." + String.valueOf(topic.getTopicNumber()) + ".";
-
- try
- { // run the text and pseud through an HTML checker to escape them
- HTMLChecker ch = engine.getEscapingChecker();
- ch.append(pseud);
- ch.finish();
- this.pseud = ch.getValue();
- ch.reset();
- ch.append(text);
- ch.finish();
- this.text = text;
-
- } // end try
- catch (HTMLCheckerException e)
- { // this shouldn't happen
- throw new InternalStateError("spurious HTMLCheckerException thrown");
-
- } // end catch
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static PostSlippage retrieve(ServletRequest request)
- {
- return (PostSlippage)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Slippage or Double-Click Detected";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "slippage.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public static String getPosterName(TopicMessageContext msg)
- {
- try
- { // have to guard agains a DataException here
- return msg.getCreatorName();
-
- } // end try
- catch (DataException de)
- { // just return "unknown" on failure
- return "(unknown)";
-
- } // end catch
-
- } // end getPosterName
-
- public static String getMessageBodyText(TopicMessageContext msg)
- {
- try
- { // have to guard against a DataException here
- return msg.getBodyText();
-
- } // end try
- catch (DataException de)
- { // just return an error message
- return "(Unable to retrieve message data: " + StringUtil.encodeHTML(de.getMessage()) + ")";
-
- } // end catch
-
- } // end getMessageBodyText
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public int getTopicNumber()
- {
- return topic.getTopicNumber();
-
- } // end getTopicNumber
-
- public String getTopicName()
- {
- return topic.getName();
-
- } // end getTopicName
-
- public String getIdentifyingData()
- {
- return "Slippage posting to topic " + String.valueOf(topic.getTopicID());
-
- } // end getIdentifyingData
-
- public int getTotalMessages()
- {
- return topic.getTotalMessages();
-
- } // end getTotalMessages
-
- public Iterator getMessageIterator()
- {
- return messages.iterator();
-
- } // end getMessageIterator
-
- public String getNextVal()
- {
- return next;
-
- } // end getNextVal
-
- public String getPseud()
- {
- return pseud;
-
- } // end getPseud
-
- public boolean attachChecked()
- {
- return attach;
-
- } // end attachChecked
-
- public String getBodyText()
- {
- return text;
-
- } // end getBodyText
-
- public String getMessageReference(TopicMessageContext msg)
- {
- return topic_stem + String.valueOf(msg.getPostNumber());
-
- } // end getMessageReference
-
-} // end class PostSlippage
diff --git a/src/com/silverwrist/venice/servlets/format/RenderConfig.java b/src/com/silverwrist/venice/servlets/format/RenderConfig.java
deleted file mode 100644
index e6771a4..0000000
--- a/src/com/silverwrist/venice/servlets/format/RenderConfig.java
+++ /dev/null
@@ -1,675 +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.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import org.w3c.dom.*;
-import com.silverwrist.util.*;
-import com.silverwrist.venice.core.CommunityContext;
-import com.silverwrist.venice.core.UserContext;
-import com.silverwrist.venice.core.VeniceEngine;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.servlets.Variables;
-import com.silverwrist.venice.servlets.format.menus.*;
-import com.silverwrist.venice.servlets.format.sideboxes.SideBoxFactory;
-import com.silverwrist.venice.util.XMLLoader;
-
-public class RenderConfig implements ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- protected static final String ATTR_NAME = "com.silverwrist.venice.servlets.RenderConfig";
- protected static final String CONFIG_FILE_PARAM = "render.config";
-
- private static Category logger = Category.getInstance(RenderConfig.class);
-
- private static Map colornames_map;
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String site_title;
- private boolean want_comments;
- private boolean allow_gzip;
- private boolean no_smart_tags;
- private String font_face;
- private File stylesheet;
- private long stylesheet_time = 0;
- private String image_url;
- private String static_url;
- private String site_logo;
- private int site_logo_width = 140;
- private int site_logo_height = 80;
- private String site_logo_linkURL = null;
- private StockMessages stock_messages;
- private Map menus;
- private String[] colors_array;
- private int footer_logo_scale;
- private Map sidebox_factories;
- private String photo_not_avail;
- private boolean photo_not_avail_fixup;
- private CommunityLeftMenuFactory comm_menu_fact;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- protected RenderConfig(String config_file, String root_file_path) throws ConfigException
- {
- XMLLoader loader = XMLLoader.get();
- Document doc = loader.loadConfigDocument(config_file);
-
- // Make sure the document is valid.
- Element root = loader.configGetRootElement(doc,"render-config");
- DOMElementHelper root_h = new DOMElementHelper(root);
-
- // Get the site title.
- site_title = loader.configGetSubElementText(root_h,"site-name");
- if (logger.isDebugEnabled())
- logger.debug("Site title: " + site_title);
-
- // Get the section.
- Element sect = loader.configGetSubSection(root_h,"rendering");
-
- // Load the quick Boolean values indicated by the presence or absence of a tag.
- DOMElementHelper sect_h = new DOMElementHelper(sect);
- want_comments = sect_h.hasChildElement("html-comments");
- allow_gzip = sect_h.hasChildElement("gzip-output");
- no_smart_tags = !(sect_h.hasChildElement("ms-copyright-violations"));
- if (logger.isDebugEnabled())
- { // log the read values
- logger.debug("Use HTML comments: " + want_comments);
- logger.debug("Use GZIP encoding: " + allow_gzip);
- logger.debug("Disable IE Smart Tags: " + no_smart_tags);
-
- } // end if
-
- // Load the default font face.
- font_face = loader.configGetSubElementText(sect_h,"font");
- if (logger.isDebugEnabled())
- logger.debug("Font face: " + font_face);
-
- // Load the default stylesheet file reference.
- String tmp = sect_h.getSubElementText("stylesheet");
- if (tmp!=null)
- { // we're using Cascading Stylesheets - load it and test for existence
- if (!(tmp.startsWith("/"))) // prepend app root
- tmp = root_file_path + tmp;
- if (logger.isDebugEnabled())
- logger.debug("Stylesheet location: " + tmp);
-
- // Test to make sure the stylesheet is actually present.
- stylesheet = new File(tmp);
- if (!(stylesheet.exists() && stylesheet.canRead()))
- { // it's not there - bail out!
- logger.fatal("unable to read stylesheet file: " + tmp);
- throw new ConfigException("stylesheet " + tmp + " cannot be read",sect);
-
- } // end if
-
- } // end if
- else // no stylesheet
- stylesheet = null;
-
- // Get the section and load the colors out of it..
- Element sect1 = loader.configGetSubSection(sect_h,"colors");
- colors_array = new String[colornames_map.size()];
- int i;
- NodeList nl = sect1.getChildNodes();
- for (i=0; i section.
- sect = loader.configGetSubSection(root_h,"paths");
- sect_h = new DOMElementHelper(sect);
-
- // Load the image path.
- image_url = loader.configGetSubElementText(sect_h,"image");
- if (logger.isDebugEnabled())
- logger.debug("Image path: " + image_url);
-
- // Load the static path.
- static_url = loader.configGetSubElementText(sect_h,"static");
- if (logger.isDebugEnabled())
- logger.debug("Static files path: " + static_url);
-
- // Get the site logo element.
- sect1 = loader.configGetSubSection(sect_h,"site-logo");
- DOMElementHelper sect1_h = new DOMElementHelper(sect1);
- site_logo = loader.configGetText(sect1_h);
-
- // Get the width and height of the logo.
- itmp = sect1_h.getAttributeInt("width");
- if (itmp!=null)
- site_logo_width = itmp.intValue();
- itmp = sect1_h.getAttributeInt("height");
- if (itmp!=null)
- site_logo_height = itmp.intValue();
-
- // Get the link URL of the logo.
- tmp = sect1.getAttribute("href");
- if (!(StringUtil.isStringEmpty(tmp)))
- site_logo_linkURL = tmp;
-
- if (logger.isDebugEnabled())
- logger.debug("Site logo: " + site_logo);
-
- // Get the name of the sidebox configuration file.
- String sidebox_config = loader.configGetSubElementText(sect_h,"sidebox-config");
- if (!(sidebox_config.startsWith("/")))
- sidebox_config = root_file_path + sidebox_config;
-
- // Get the name of the "photo not available" image.
- sect1 = sect_h.getSubElement("photo-not-avail");
- if (sect1!=null)
- { // load the element text and fixup information
- sect1_h = new DOMElementHelper(sect1);
- photo_not_avail = sect1_h.getElementText();
- photo_not_avail_fixup = sect1_h.hasAttribute("fixup");
-
- } // end if
- else
- { // just load the defaults
- photo_not_avail = "photo_not_avail.gif";
- photo_not_avail_fixup = true;
-
- } // end else
-
- // Get the name of the services configuration file.
- String services_config = loader.configGetSubElementText(sect_h,"services-config");
- if (!(services_config.startsWith("/")))
- services_config = root_file_path + services_config;
-
- // Load the section.
- sect = loader.configGetSubSection(root_h,"messages");
-
- // Initialize the stock messages list.
- stock_messages = new StockMessages(sect);
-
- // Load the section.
- sect = loader.configGetSubSection(root_h,"menu-definitions");
-
- // Initialize the menus list.
- HashMap tmp_menus = new HashMap();
- nl = sect.getChildNodes();
- for (i=0; i subnodes and use them to initialize menus
- Node n = nl.item(i);
- if (n.getNodeType()==Node.ELEMENT_NODE)
- { // verify that it's a menu definition, then get its ID and build a menu
- loader.configVerifyNodeName(n,"menudef",sect);
- String menuid = loader.configGetAttribute((Element)n,"id");
-
- // create the menu and add it to the mapping
- LeftMenu menu = new LeftMenu((Element)n,menuid);
- tmp_menus.put(menuid,menu);
- if (logger.isDebugEnabled())
- logger.debug("menu \"" + menuid + "\" defined");
-
- } // end if
- // else just ignore it
-
- } // end for
-
- // save off the menus as an unmodifiable map
- if (tmp_menus.isEmpty())
- menus = Collections.EMPTY_MAP;
- else
- menus = Collections.unmodifiableMap(tmp_menus);
- if (logger.isDebugEnabled())
- logger.debug(menus.size() + " menu definitions loaded from config");
-
- // done with the render-config.xml file
- // Load up the sidebox-config.xml file.
- doc = loader.loadConfigDocument(sidebox_config);
- root = loader.configGetRootElement(doc,"sidebox-config");
-
- // Examine the child nodes for sidebox configuration data.
- nl = root.getChildNodes();
- HashMap tmp_factories = new HashMap();
- for (i=0; i ID not numeric!");
- throw new ConfigException("non-numeric ID specified in ",(Element)n);
-
- } // end catch
-
- SideBoxFactory factory = createSideBoxFactory((Element)n);
- tmp_factories.put(itmp,factory);
-
- } // end if
- // else ignore this node
-
- } // end for
-
- if (tmp_factories.isEmpty())
- sidebox_factories = Collections.EMPTY_MAP;
- else
- sidebox_factories = Collections.unmodifiableMap(tmp_factories);
-
- // done with the sidebox-config.xml file
- // Load up the services-config.xml file.
- doc = loader.loadConfigDocument(services_config);
- root = loader.configGetRootElement(doc,"services-config");
- root_h = new DOMElementHelper(root);
-
- // Get the community section and pass it to the CommunityLeftMenuFactory.
- comm_menu_fact = new CommunityLeftMenuFactory(root_h.getSubElement("community"));
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static SideBoxFactory createSideBoxFactory(Element cfg) throws ConfigException
- {
- XMLLoader loader = XMLLoader.get();
- String cname = loader.configGetSubElementText(cfg,"factory-class");
-
- try
- { // load the factory class and create an instance of the factory
- SideBoxFactory factory = (SideBoxFactory)(Class.forName(cname).newInstance());
- factory.setConfiguration(cfg);
- return factory;
-
- } // end try
- catch (ClassNotFoundException cnfe)
- { // sidebox could not be configured
- logger.fatal(" config not valid!",cnfe);
- throw new ConfigException(" in is not a valid class!",cfg);
-
- } // end catch
- catch (IllegalAccessException iae)
- { // could not access class and/or constructor
- logger.fatal(" is not accessible!",iae);
- throw new ConfigException(" in is not accessible!",cfg);
-
- } // end catch
- catch (InstantiationException ie)
- { // unable to create the class
- logger.fatal(" could not be instantiated!",ie);
- throw new ConfigException(" in could not be created!",cfg);
-
- } // end catch
- catch (ClassCastException cce)
- { // the class is not a SideBoxFactory implementor - cannot create
- logger.fatal(" is not a SideBoxFactory!",cce);
- throw new ConfigException(" in is not the correct type!",cfg);
-
- } // end catch
-
- } // end createSideBoxFactory
-
- /*--------------------------------------------------------------------------------
- * External operations usable only by RenderData
- *--------------------------------------------------------------------------------
- */
-
- boolean useHTMLComments()
- {
- return want_comments;
-
- } // end useHTMLComments
-
- boolean isGZIPAllowed()
- {
- return allow_gzip;
-
- } // end isGZIPAllowed
-
- boolean noSmartTags()
- {
- return no_smart_tags;
-
- } // end noSmartTags
-
- String getFullImagePath(String name)
- {
- StringBuffer buf = new StringBuffer();
- buf.append(image_url).append(name);
- return buf.toString();
-
- } // end getFullImagePath
-
- String getStaticFilePath(String name)
- {
- StringBuffer buf = new StringBuffer();
- buf.append(static_url).append(name);
- return buf.toString();
-
- } // end getStaticFilePath
-
- String getTitleTag(String specific)
- {
- StringBuffer buf = new StringBuffer();
- buf.append("").append(specific).append(" - ").append(site_title).append("");
- return buf.toString();
-
- } // end getTitleTag
-
- String getSiteImageTag(int hspace, int vspace)
- {
- StringBuffer buf = new StringBuffer();
- if (site_logo_linkURL!=null)
- buf.append("");
- buf.append("0)
- buf.append(" HSPACE=").append(hspace);
- if (vspace>0)
- buf.append(" VSPACE=").append(vspace);
- buf.append('>');
- if (site_logo_linkURL!=null)
- buf.append("");
- return buf.toString();
-
- } // end getSiteImageTag
-
- String getStdFontTag(String color, int size)
- {
- StringBuffer buf = new StringBuffer("');
- return buf.toString();
-
- } // end getStdFontTag
-
- String getStdFontTag(int selector, int size)
- {
- if ((selector<0) || (selector>=colors_array.length))
- throw new IndexOutOfBoundsException("getStdColor(): invalid color selector value");
- return getStdFontTag(colors_array[selector],size);
-
- } // end getStdFontTag
-
- String getStdBaseFontTag(int size)
- {
- StringBuffer buf = new StringBuffer("*");
- return buf.toString();
-
- } // end getRequiredBullet
-
- void writeContentHeader(Writer out, String primary, String secondary) throws IOException
- {
- out.write("" + getStdFontTag(colors_array[CONTENT_HEADER],5) + ""
- + StringUtil.encodeHTML(primary) + "");
- if (secondary!=null)
- out.write(" " + getStdFontTag(colors_array[CONTENT_HEADER],3) + ""
- + StringUtil.encodeHTML(secondary) + "");
- out.write("\n");
-
- } // end writeContentHeader
-
- String getStockMessage(String identifier)
- {
- return (String)(stock_messages.get(identifier));
-
- } // end getStockMessage
-
- void writeStockMessage(Writer out, String identifier) throws IOException
- {
- String text = (String)(stock_messages.get(identifier));
- out.write(StringUtil.encodeHTML(text));
-
- } // end writeStockMessage
-
- String getStdColor(int selector)
- {
- if ((selector<0) || (selector>=colors_array.length))
- throw new IndexOutOfBoundsException("getStdColor(): invalid color selector value");
- return colors_array[selector];
-
- } // end getStdColor
-
- int scaleFooterLogo(int param)
- {
- return (param * footer_logo_scale) / 100;
-
- } // end scaleFooterLogo
-
- public LeftMenu getLeftMenu(String identifier)
- {
- return (LeftMenu)(menus.get(identifier));
-
- } // end getLeftMenu
-
- synchronized String loadStyleSheetData() throws IOException
- {
- if (stylesheet==null)
- return null;
-
- // Load the stylesheet data.
- StringBuffer raw_data = IOUtil.loadText(stylesheet);
- stylesheet_time = stylesheet.lastModified();
-
- // Set up the replacements map to replace the various parameters.
- HashMap vars = new HashMap();
- vars.put("font",font_face);
- vars.put("color.frame",colors_array[FRAME_BACKGROUND]);
- vars.put("color.top.background",colors_array[TITLE_BACKGROUND]);
- vars.put("color.top.foreground",colors_array[TITLE_FOREGROUND]);
- vars.put("color.top.link",colors_array[TITLE_LINK]);
- vars.put("color.left.background",colors_array[LEFT_BACKGROUND]);
- vars.put("color.left.foreground",colors_array[LEFT_FOREGROUND]);
- vars.put("color.left.link",colors_array[LEFT_LINK]);
- vars.put("color.content.background",colors_array[CONTENT_BACKGROUND]);
- vars.put("color.content.foreground",colors_array[CONTENT_FOREGROUND]);
- vars.put("color.content.header",colors_array[CONTENT_HEADER]);
- vars.put("color.disabled",colors_array[CONTENT_DISABLED]);
- vars.put("color.error",colors_array[CONTENT_ERROR]);
- vars.put("color.sidebox.top.background",colors_array[SIDEBOX_TITLE_BACKGROUND]);
- vars.put("color.sidebox.top.foreground",colors_array[SIDEBOX_TITLE_FOREGROUND]);
- vars.put("color.sidebox.background",colors_array[SIDEBOX_CONTENT_BACKGROUND]);
- vars.put("color.sidebox.foreground",colors_array[SIDEBOX_CONTENT_FOREGROUND]);
- vars.put("color.sidebox.link",colors_array[SIDEBOX_CONTENT_LINK]);
- vars.put("color.dlg.confirm.title.background",colors_array[CONFIRM_TITLE_BACKGROUND]);
- vars.put("color.dlg.confirm.title.foreground",colors_array[CONFIRM_TITLE_FOREGROUND]);
- vars.put("color.dlg.error.title.background",colors_array[ERROR_TITLE_BACKGROUND]);
- vars.put("color.dlg.error.title.foreground",colors_array[ERROR_TITLE_FOREGROUND]);
- return StringUtil.replaceAllVariables(raw_data.toString(),vars);
-
- } // end loadStyleSheet
-
- boolean hasStyleSheetChanged()
- {
- if (stylesheet==null)
- return false;
- return (stylesheet_time!=stylesheet.lastModified());
-
- } // end hasStyleSheetChanged
-
- boolean useStyleSheet()
- {
- return (stylesheet!=null);
-
- } // end useStyleSheet
-
- VeniceContent createSideBox(int id, VeniceEngine engine, UserContext uc) throws AccessError, DataException
- {
- SideBoxFactory fact = (SideBoxFactory)(sidebox_factories.get(new Integer(id)));
- if (fact==null)
- throw new DataException("invalid sidebox ID!");
- return fact.create(engine,uc);
-
- } // end createSideBox
-
- String getPhotoNotAvail()
- {
- return photo_not_avail;
-
- } // end getPhotoNotAvail
-
- boolean getPhotoNotAvailFixup()
- {
- return photo_not_avail_fixup;
-
- } // end getPhotoNotAvailFixup
-
- public CommunityLeftMenu createCommunityMenu(CommunityContext comm)
- {
- return comm_menu_fact.createMenu(comm);
-
- } // end createCommunityMenu
-
- String getDefaultServletAddress(RenderData rdat, CommunityContext comm)
- {
- return comm_menu_fact.getDefaultServletAddress(rdat,comm);
-
- } // end getDefaultServletAddress
-
- /*--------------------------------------------------------------------------------
- * Static operations for use by VeniceServlet
- *--------------------------------------------------------------------------------
- */
-
- public static RenderConfig getRenderConfig(ServletContext ctxt) throws ServletException
- {
- // Look in the servlet attributes first.
- Object obj = ctxt.getAttribute(ATTR_NAME);
- if (obj!=null)
- return (RenderConfig)obj;
-
- // Get the root file path.
- String root_file_path = ctxt.getRealPath("/");
- if (!(root_file_path.endsWith("/")))
- root_file_path += "/";
-
- // Get the parameter for the renderer's config file.
- String cfgfile = ctxt.getInitParameter(CONFIG_FILE_PARAM);
- if (!(cfgfile.startsWith("/")))
- cfgfile = root_file_path + cfgfile;
- logger.info("Initializing Venice rendering using config file: " + cfgfile);
-
- try
- { // create the RenderConfig object and save it to attributes.
- RenderConfig rconf = new RenderConfig(cfgfile,root_file_path);
- ctxt.setAttribute(ATTR_NAME,rconf);
- return rconf;
-
- } // end try
- catch (ConfigException e)
- { // configuration failed! post an error message
- logger.fatal("Rendering configuration failed: " + e.getMessage(),e);
- throw new ServletException("Venice rendering configuration failed: " + e.getMessage(),e);
-
- } // end catch
-
- } // end getRenderConfig
-
- public static RenderData createRenderData(ServletContext ctxt, HttpServletRequest request,
- HttpServletResponse response) throws ServletException
- {
- UserContext uc = Variables.getUserContext(ctxt,request,request.getSession(true));
- return new RenderData(getRenderConfig(ctxt),uc,ctxt,request,response);
-
- } // end createRenderData
-
- public static RenderData createRenderData(ServletContext ctxt, UserContext uc, HttpServletRequest request,
- HttpServletResponse response) throws ServletException
- {
- return new RenderData(getRenderConfig(ctxt),uc,ctxt,request,response);
-
- } // end createRenderData
-
- /*--------------------------------------------------------------------------------
- * Static initializer
- *--------------------------------------------------------------------------------
- */
-
- static
- { // Initialize the mapping of color names from render-config.xml to color selector IDs.
- HashMap m = new HashMap();
- m.put("frame-bg",new Integer(FRAME_BACKGROUND));
- m.put("title-bg",new Integer(TITLE_BACKGROUND));
- m.put("title-fg",new Integer(TITLE_FOREGROUND));
- m.put("title-link",new Integer(TITLE_LINK));
- m.put("left-bg",new Integer(LEFT_BACKGROUND));
- m.put("left-fg",new Integer(LEFT_FOREGROUND));
- m.put("left-link",new Integer(LEFT_LINK));
- m.put("content-bg",new Integer(CONTENT_BACKGROUND));
- m.put("content-fg",new Integer(CONTENT_FOREGROUND));
- m.put("content-hdr",new Integer(CONTENT_HEADER));
- m.put("content-disabled",new Integer(CONTENT_DISABLED));
- m.put("content-error",new Integer(CONTENT_ERROR));
- m.put("sidebox-title-bg",new Integer(SIDEBOX_TITLE_BACKGROUND));
- m.put("sidebox-title-fg",new Integer(SIDEBOX_TITLE_FOREGROUND));
- m.put("sidebox-content-bg",new Integer(SIDEBOX_CONTENT_BACKGROUND));
- m.put("sidebox-content-fg",new Integer(SIDEBOX_CONTENT_FOREGROUND));
- m.put("sidebox-content-link",new Integer(SIDEBOX_CONTENT_LINK));
- m.put("confirm-title-bg",new Integer(CONFIRM_TITLE_BACKGROUND));
- m.put("confirm-title-fg",new Integer(CONFIRM_TITLE_FOREGROUND));
- m.put("error-title-bg",new Integer(ERROR_TITLE_BACKGROUND));
- m.put("error-title-fg",new Integer(ERROR_TITLE_FOREGROUND));
- colornames_map = Collections.unmodifiableMap(m);
-
- } // end static initializer
-
-} // end class RenderConfig
diff --git a/src/com/silverwrist/venice/servlets/format/RenderData.java b/src/com/silverwrist/venice/servlets/format/RenderData.java
deleted file mode 100644
index d4d565c..0000000
--- a/src/com/silverwrist/venice/servlets/format/RenderData.java
+++ /dev/null
@@ -1,597 +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.util.*;
-import java.io.*;
-import java.text.DateFormat;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.IOUtil;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.CommunityContext;
-import com.silverwrist.venice.core.UserContext;
-import com.silverwrist.venice.core.VeniceEngine;
-import com.silverwrist.venice.db.PostLinkRewriter;
-import com.silverwrist.venice.db.UserNameRewriter;
-import com.silverwrist.venice.except.DataException;
-import com.silverwrist.venice.servlets.format.menus.LeftMenu;
-import com.silverwrist.venice.util.IDUtils;
-
-public class RenderData implements ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- private static final String ATTR_NAME = "com.silverwrist.venice.RenderData";
-
- private static Category logger = Category.getInstance(RenderData.class.getName());
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private RenderConfig rconf;
- private ServletContext ctxt;
- private HttpServletRequest request;
- private HttpServletResponse response;
- private boolean can_gzip = false;
- private Locale my_locale;
- private TimeZone my_timezone;
- private DateFormat activity_time = null;
- private DateFormat display_date = null;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- RenderData(RenderConfig rconf, UserContext uc, ServletContext ctxt, HttpServletRequest request,
- HttpServletResponse response)
- {
- this.rconf = rconf;
- this.ctxt = ctxt;
- this.request = request;
- this.response = response;
-
- // determine whether this browser can accept GZIP-encoded content
- String encodings = request.getHeader("Accept-Encoding");
- if ((encodings!=null) && (encodings.indexOf("gzip")>=0))
- can_gzip = true;
-
- // read the user's preferred locale
- try
- { // get the user default locale
- my_locale = uc.getLocale();
-
- } // end try
- catch (DataException de)
- { // locale problems...
- my_locale = Locale.getDefault();
-
- } // end catch
-
- // read the user's preferred time zone
- try
- { // get the user default timezone
- my_timezone = uc.getTimeZone();
-
- } // end try
- catch (DataException de)
- { // time zone problems...
- my_timezone = TimeZone.getDefault();
-
- } // end catch
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static operations
- *--------------------------------------------------------------------------------
- */
-
- public static RenderData retrieve(ServletRequest request)
- {
- return (RenderData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public boolean useHTMLComments()
- {
- return rconf.useHTMLComments();
-
- } // end useHTMLComments
-
- public boolean canGZIPEncode()
- {
- return rconf.isGZIPAllowed() && can_gzip;
-
- } // end canGZIPEncode
-
- public boolean noSmartTags()
- {
- return rconf.noSmartTags();
-
- } // end noSmartTags
-
- public String getSiteImageTag(int hspace, int vspace)
- {
- return rconf.getSiteImageTag(hspace,vspace);
-
- } // end getSiteImageTag
-
- public String getFullServletPath(String name)
- {
- StringBuffer buf = new StringBuffer(request.getContextPath());
- buf.append('/').append(name);
- return buf.toString();
-
- } // end getFullServletPath
-
- public String getCompleteServletPath(String name)
- {
- StringBuffer buf = new StringBuffer("http://");
- buf.append(request.getServerName());
- if (request.getServerPort()!=80)
- buf.append(':').append(request.getServerPort());
- buf.append(request.getContextPath()).append('/').append(name);
- return buf.toString();
-
- } // end getCompleteServletPath
-
- public String getEncodedServletPath(String name)
- {
- return response.encodeURL(this.getFullServletPath(name));
-
- } // end getEncodedServletPath
-
- public String getFullImagePath(String name)
- {
- return rconf.getFullImagePath(name);
-
- } // end getFullImagePath
-
- public String getStaticFilePath(String name)
- {
- return rconf.getStaticFilePath(name);
-
- } // end getStaticFilePath
-
- public String getFormatJSPPath(String name)
- {
- return "/format/" + name;
-
- } // end getFormatJSPPath
-
- public String getStaticIncludePath(String name)
- {
- return "/static/" + name;
-
- } // end getStaticIncludePath
-
- public String getContextRelativePath(String name)
- {
- StringBuffer buf = new StringBuffer(request.getContextPath());
- if (name.charAt(0)!='/')
- buf.append('/');
- return buf.append(name).toString();
-
- } // end getContextRelativePath
-
- public String getStdFontTag(String color, int size)
- {
- return rconf.getStdFontTag(color,size);
-
- } // end getStdFontTag
-
- public String getStdFontTag(int selector, int size)
- {
- return rconf.getStdFontTag(selector,size);
-
- } // end getStdFontTag
-
- public String getStdBaseFontTag(int size)
- {
- return rconf.getStdBaseFontTag(size);
-
- } // end getStdBaseFontTag
-
- public String getTitleTag(String specific)
- {
- return rconf.getTitleTag(specific);
-
- } // end getTitleTag
-
- public String getRequiredBullet()
- {
- return rconf.getRequiredBullet();
-
- } // end getRequiredBullet
-
- public void writeContentHeader(Writer out, String primary, String secondary) throws IOException
- {
- rconf.writeContentHeader(out,primary,secondary);
-
- } // end writeContentHeader
-
- public void writeContentSelectorHeader(Writer out, String caption, List choices,
- List urls, int selected) throws IOException
- {
- int nchoice = choices.size();
- if (urls.size()" + rconf.getStdFontTag(CONTENT_HEADER,5) + ""
- + StringUtil.encodeHTML(caption) + ""
- + rconf.getStdFontTag(CONTENT_HEADER,3));
- for (int i=0; i");
- else
- out.write("");
- out.write(StringUtil.encodeHTML((String)(choices.get(i))));
- if (i==selected)
- out.write("");
- else
- out.write("");
- out.write(" ");
-
- } // end for
-
- out.write("]\n");
-
- } // end writeContentSelectorHeader
-
- public String getStockMessage(String identifier)
- {
- return rconf.getStockMessage(identifier);
-
- } // end getStockMessage
-
- public void writeStockMessage(Writer out, String identifier) throws IOException
- {
- rconf.writeStockMessage(out,identifier);
-
- } // end writeStockMessage
-
- public String getStdColor(int selector)
- {
- return rconf.getStdColor(selector);
-
- } // end getStdColor
-
- public int scaleFooterLogo(int param)
- {
- return rconf.scaleFooterLogo(param);
-
- } // end scaleFooterLogo
-
- public LeftMenu getLeftMenu(String identifier)
- {
- return rconf.getLeftMenu(identifier);
-
- } // end getLeftMenu
-
- public String loadStyleSheetData() throws IOException
- {
- return rconf.loadStyleSheetData();
-
- } // end loadStyleSheetData
-
- public boolean hasStyleSheetChanged()
- {
- return rconf.hasStyleSheetChanged();
-
- } // end hasStyleSheetChanged
-
- public boolean useStyleSheet()
- {
- return rconf.useStyleSheet();
-
- } // end useStyleSheet
-
- public String getPhotoNotAvailURL()
- {
- if (rconf.getPhotoNotAvailFixup())
- return rconf.getFullImagePath(rconf.getPhotoNotAvail());
- else
- return rconf.getPhotoNotAvail();
-
- } // end getPhotoNotAvailURL
-
- public String getDefaultServletAddress(CommunityContext comm)
- {
- return rconf.getDefaultServletAddress(this,comm);
-
- } // end getDefaultServletAddress
-
- public String formatDateForDisplay(Date date)
- {
- if (display_date==null)
- { // create the display date formatter
- display_date = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM,my_locale);
- display_date.setTimeZone(my_timezone);
-
- } // end if
-
- return display_date.format(date);
-
- } // end formatDateForDisplay
-
- public Calendar createCalendar()
- {
- return new GregorianCalendar(my_timezone,my_locale);
-
- } // end createCalendar
-
- public Calendar createCalendar(Date date)
- {
- Calendar rc = new GregorianCalendar(my_timezone,my_locale);
- rc.setTime(date);
- return rc;
-
- } // end createCalendar
-
- public void flushOutput() throws IOException
- {
- response.flushBuffer();
-
- } // end flushOutput
-
- public String encodeURL(String url)
- {
- return response.encodeURL(url);
-
- } // end encodeURL
-
- public void storeBaseJSPData(BaseJSPData data)
- {
- data.store(request);
-
- } // end storeBaseJSPData
-
- public void storeJSPRender(JSPRender jr)
- {
- jr.store(request);
-
- } // end storeJSPRender
-
- public void setRequestAttribute(String name, Object value)
- {
- request.setAttribute(name,value);
-
- } // end setRequestAttribute
-
- public void forwardDispatch(RequestDispatcher dispatcher) throws IOException, ServletException
- {
- dispatcher.forward(request,response);
-
- } // end forwardDispatch
-
- public void includeDispatch(RequestDispatcher dispatcher) throws IOException, ServletException
- {
- dispatcher.include(request,response);
-
- } // end forwardDispatch
-
- public void redirectTo(String servlet) throws IOException
- {
- String url = response.encodeRedirectURL(this.getFullServletPath(servlet));
- response.sendRedirect(url);
-
- } // end redirectTo
-
- public void redirectAbsolute(String url) throws IOException
- {
- response.sendRedirect(url);
-
- } // end redirectAbsolute
-
- public String getActivityString(Date date)
- {
- if (date==null)
- return "Never"; // safeguard
-
- Calendar c_last = createCalendar(date);
- Calendar c_now = createCalendar(new Date());
- int delta_days = 0;
- while ( (c_last.get(Calendar.YEAR)!=c_now.get(Calendar.YEAR))
- || (c_last.get(Calendar.DAY_OF_YEAR)!=c_now.get(Calendar.DAY_OF_YEAR)))
- { // advance until we're pointing at the same year and the same day of the year
- delta_days++;
- c_last.add(Calendar.DAY_OF_YEAR,1);
-
- } // end while
-
- switch (delta_days)
- { // now return a string based on the difference in days
- case 0:
- if (activity_time==null)
- { // get the "activity" time formatter
- activity_time = DateFormat.getTimeInstance(DateFormat.MEDIUM,my_locale);
- activity_time.setTimeZone(my_timezone);
-
- } // end if
- return "Today, " + activity_time.format(date);
-
- case 1:
- if (activity_time==null)
- { // get the "activity" time formatter
- activity_time = DateFormat.getTimeInstance(DateFormat.MEDIUM,my_locale);
- activity_time.setTimeZone(my_timezone);
-
- } // end if
- return "Yesterday, " + activity_time.format(date);
-
- default:
- return String.valueOf(delta_days) + " days ago";
-
- } // end switch
-
- } // end getActivityString
-
- public void nullResponse()
- {
- response.setStatus(response.SC_NO_CONTENT);
-
- } // end nullResponse
-
- public void errorResponse(int code) throws IOException
- {
- response.sendError(code);
-
- } // end errorResponse
-
- public void errorResponse(int code, String msg) throws IOException
- {
- response.sendError(code,msg);
-
- } // end errorResponse
-
- public void sendBinaryData(String type, String filename, int length, InputStream data) throws IOException
- {
- response.setContentType(type);
- response.setContentLength(length);
- if (filename!=null) // make sure we pass the filename along, too
- response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\";");
-
- // Copy the contents of the "data" stream to the output.
- IOUtil.copy(data,response.getOutputStream());
-
- } // end sendBinaryData
-
- public String rewritePostData(String data)
- {
- if ((data.indexOf(PostLinkRewriter.URI_PREFIX)<0) && (data.indexOf(UserNameRewriter.URI_PREFIX)<0))
- return data;
-
- StringBuffer buf = new StringBuffer();
- String interm;
-
- if (data.indexOf(PostLinkRewriter.URI_PREFIX)>=0)
- { // begin replacing everything with post links
- String t = data;
- int p = t.indexOf(PostLinkRewriter.URI_PREFIX);
- while (p>=0)
- { // break off the start of the string
- if (p>0)
- buf.append(t.substring(0,p));
- t = t.substring(p + PostLinkRewriter.URI_PREFIX.length());
-
- // find the end of the post link...
- p = 0;
- while (IDUtils.isValidPostLinkChar(t.charAt(p)))
- p++;
-
- if (p>0)
- { // append the post link to the "go" servlet path, and encode the lot
- buf.append(getEncodedServletPath("go/" + t.substring(0,p)));
- t = t.substring(p);
-
- } // end if
- else // false alarm
- buf.append(PostLinkRewriter.URI_PREFIX);
-
- // and now look again...
- p = t.indexOf(PostLinkRewriter.URI_PREFIX);
-
- } // end while
-
- buf.append(t);
- interm = buf.toString();
- buf.setLength(0);
-
- } // end if
- else // no post link strings, this is the intermediate form
- interm = data;
-
- if (interm.indexOf(UserNameRewriter.URI_PREFIX)>=0)
- { // begin replacing everything with user links
- String t = interm;
- int p = t.indexOf(UserNameRewriter.URI_PREFIX);
- while (p>=0)
- { // break off the start of the string
- if (p>0)
- buf.append(t.substring(0,p));
- t = t.substring(p + UserNameRewriter.URI_PREFIX.length());
-
- // find the end of the user link...
- p = 0;
- while (IDUtils.isValidVeniceIDChar(t.charAt(p)))
- p++;
-
- if (p>0)
- { // append the post link to the "user" servlet path, and encode the lot
- buf.append(getEncodedServletPath("user/" + t.substring(0,p)));
- t = t.substring(p);
-
- } // end if
- else // false alarm
- buf.append(UserNameRewriter.URI_PREFIX);
-
- // and now look again...
- p = t.indexOf(UserNameRewriter.URI_PREFIX);
-
- } // end while
-
- buf.append(t);
- return buf.toString();
-
- } // end if
- else // no more to find - just return this
- return interm;
-
- } // end rewritePostData
-
- public String mapToPath(String path)
- {
- return ctxt.getRealPath(path);
-
- } // end mapToPath
-
- public Cookie createCookie(String name, String value, int age)
- {
- Cookie rc = new Cookie(name,value);
- rc.setMaxAge(age);
- rc.setPath(request.getContextPath());
- return rc;
-
- } // end createCookie
-
-} // end class RenderData
diff --git a/src/com/silverwrist/venice/servlets/format/ReportConferenceMenu.java b/src/com/silverwrist/venice/servlets/format/ReportConferenceMenu.java
deleted file mode 100644
index 2ebd690..0000000
--- a/src/com/silverwrist/venice/servlets/format/ReportConferenceMenu.java
+++ /dev/null
@@ -1,135 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class ReportConferenceMenu implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ReportConferenceMenu";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private List topics; // the topics in this conference
- private String locator = null; // the locator
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ReportConferenceMenu(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
- {
- this.comm = comm;
- this.conf = conf;
- this.topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ReportConferenceMenu retrieve(ServletRequest request)
- {
- return (ReportConferenceMenu)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Conference Reports: " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return "confops?cmd=QR&" + getLocator();
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "report_conf.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public String getLocator()
- {
- if (locator==null)
- locator = "sig=" + comm.getCommunityID() + "&conf=" + conf.getConfID();
- return locator;
-
- } // end getLocator
-
- public Iterator getTopics()
- {
- return topics.iterator();
-
- } // end getTopics
-
-} // end class ReportConferenceMenu
diff --git a/src/com/silverwrist/venice/servlets/format/SideBoxList.java b/src/com/silverwrist/venice/servlets/format/SideBoxList.java
deleted file mode 100644
index e070750..0000000
--- a/src/com/silverwrist/venice/servlets/format/SideBoxList.java
+++ /dev/null
@@ -1,157 +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.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class SideBoxList implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.SideBoxList";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private UserContext uc; // user context
- private List in_list; // sideboxes that are "in"
- private List out_list; // sideboxes that are "out"
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public SideBoxList(VeniceEngine engine, UserContext uc) throws DataException
- {
- this.uc = uc;
- this.in_list = uc.getSideBoxList();
- HashSet ids = new HashSet(in_list.size());
- Iterator it = in_list.iterator();
- while (it.hasNext())
- { // add the IDs of all the sideboxes to the set
- SideBoxDescriptor d = (SideBoxDescriptor)(it.next());
- ids.add(new Integer(d.getID()));
-
- } // end while
-
- List all_list = engine.getMasterSideBoxList();
- if (all_list.size()>in_list.size())
- { // allocate an ArrayList to hold the sideboxes
- out_list = new ArrayList(all_list.size()-in_list.size());
- it = all_list.iterator();
- while (it.hasNext())
- { // get all sideboxes not in the "in" list and put them in the "out" list
- SideBoxDescriptor d = (SideBoxDescriptor)(it.next());
- if (!(ids.contains(new Integer(d.getID()))))
- out_list.add(d);
-
- } // end while
-
- } // end if
- else // all sideboxes are "in"...
- out_list = Collections.EMPTY_LIST;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static SideBoxList retrieve(ServletRequest request)
- {
- return (SideBoxList)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Your Front Page Configuration";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "sideboxlist.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public int getInListSize()
- {
- return in_list.size();
-
- } // end getInListSize
-
- public SideBoxDescriptor getInListItem(int index)
- {
- return (SideBoxDescriptor)(in_list.get(index));
-
- } // end getInListItem
-
- public int getOutListSize()
- {
- return out_list.size();
-
- } // end getOutListSize
-
- public SideBoxDescriptor getOutListItem(int index)
- {
- return (SideBoxDescriptor)(out_list.get(index));
-
- } // end getInListItem
-
-} // end class SideBoxList
-
diff --git a/src/com/silverwrist/venice/servlets/format/StaticRender.java b/src/com/silverwrist/venice/servlets/format/StaticRender.java
deleted file mode 100644
index 519ca08..0000000
--- a/src/com/silverwrist/venice/servlets/format/StaticRender.java
+++ /dev/null
@@ -1,180 +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.*;
-import com.silverwrist.util.IOUtil;
-import com.silverwrist.util.cache.CacheMap;
-
-public class StaticRender implements ContentRender
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- private static CacheMap cache = new CacheMap(15,25);
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String name;
- private boolean processed = false;
- private String title = null;
- private String content = null;
-
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- protected StaticRender(String name)
- {
- this.name = name;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static String searchBetweenTags(StringBuffer data, String search, String tagname)
- {
- tagname = tagname.toUpperCase();
- String start = "<" + tagname;
- String end = "" + tagname + ">";
-
- int startpos = search.indexOf(start);
- if (startpos<0)
- return null;
- startpos += start.length();
-
- int bkt_pos = search.indexOf('>',startpos);
- if (bkt_pos<0)
- return null;
-
- int end_pos = search.indexOf(end,++bkt_pos);
- if (end_pos<0)
- return data.substring(bkt_pos);
- else
- return data.substring(bkt_pos,end_pos);
-
- } // end searchBetweenTags
-
- private synchronized void process(RenderData rdat)
- {
- if (processed)
- return; // check and set flag
-
- // Map the content path to a real filename.
- String real_path = rdat.mapToPath(rdat.getStaticIncludePath(name));
- if (real_path==null)
- { // not found!
- title = name;
- content = "File not mappable: " + name;
- return;
-
- } // end if
-
- // Read in the whole thing.
- StringBuffer raw_file;
- try
- { // read in from the file
- raw_file = IOUtil.loadText(new File(real_path));
-
- } // end try
- catch (IOException ioe)
- { // I/O exception - just discard
- title = name;
- content = "I/O error reading " + name + ": " + ioe.getMessage();
- return;
-
- } // end catch
-
- // make the upper-case search page and use that to locate the page title and body
- String search_page = raw_file.toString().toUpperCase();
- title = searchBetweenTags(raw_file,search_page,"TITLE");
- content = searchBetweenTags(raw_file,search_page,"BODY");
- if (content==null)
- { // no content?
- content = "No content seen on " + name;
- processed = false;
-
- } // end if
-
- processed = true; // set the flag to indicate we've got everything
-
- } // end process
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- process(rdat);
- if (title==null)
- return name;
- else
- return title;
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return "static/" + name;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface ContentRender
- *--------------------------------------------------------------------------------
- */
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- process(rdat);
- if (content!=null)
- out.write(content);
-
- } // end renderHere
-
- /*--------------------------------------------------------------------------------
- * External static operations
- *--------------------------------------------------------------------------------
- */
-
- public static StaticRender getStaticRender(String name)
- {
- StaticRender rc = (StaticRender)(cache.get(name));
- if (rc==null)
- { // create a new object and cache it
- rc = new StaticRender(name);
- cache.put(name,rc);
-
- } // end if
-
- return rc;
-
- } // end getStaticRender
-
-} // end class StaticRender
diff --git a/src/com/silverwrist/venice/servlets/format/TextMessageDialog.java b/src/com/silverwrist/venice/servlets/format/TextMessageDialog.java
deleted file mode 100644
index 39dba3f..0000000
--- a/src/com/silverwrist/venice/servlets/format/TextMessageDialog.java
+++ /dev/null
@@ -1,178 +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.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.htmlcheck.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class TextMessageDialog implements ContentRender, ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Dialog types
- public static final int TYPE_ACCEPT_DECLINE = 0;
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private int type;
- private String title;
- private String subtitle;
- private String text;
- private String[] choices;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public TextMessageDialog(int type, String title, String text, String[] choices)
- {
- this.type = type;
- this.title = title;
- this.subtitle = null;
- this.text = text;
- this.choices = choices;
-
- int nbutton = getNumButtons(type);
- if (choices.length
\n
\n");
-
- int nbutton = getNumButtons(type);
- for (int i=0; i0)
- out.write(" \n");
- out.write("\n");
-
- } // end for
-
- out.write("
\n");
-
- } // end renderHere
-
-} // end class TextMessageDialog
diff --git a/src/com/silverwrist/venice/servlets/format/TopDisplay.java b/src/com/silverwrist/venice/servlets/format/TopDisplay.java
deleted file mode 100644
index 99ceb65..0000000
--- a/src/com/silverwrist/venice/servlets/format/TopDisplay.java
+++ /dev/null
@@ -1,283 +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 javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class TopDisplay implements ContentRender, ColorSelectors
-{
- /*--------------------------------------------------------------------------------
- * Static data values
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(TopDisplay.class);
-
- private static final String ATTR_NAME = "com.silverwrist.venice.TopDisplay";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private ServletContext ctxt;
- private VeniceEngine engine;
- private UserContext uc;
- private List top_posts;
- private List descrs;
- private VeniceContent[] sideboxes;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public TopDisplay(ServletContext ctxt, VeniceEngine engine, UserContext uc)
- throws ServletException, DataException, AccessError
- {
- // Stash some basic information.
- this.ctxt = ctxt;
- this.engine = engine;
- this.uc = uc;
- this.top_posts = engine.getPublishedMessages(false);
- this.descrs = uc.getSideBoxList();
-
- // Create the sideboxes.
- sideboxes = new VeniceContent[descrs.size()];
- RenderConfig rconf = RenderConfig.getRenderConfig(ctxt);
- 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
- logger.error("top_content.jsp failure",se);
- 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");
-
- // 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 write an error message
- logger.error("sidebox #" + i + " failure",se);
- out.write(rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,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
- logger.error("sidebox #" + i + " class " + sideboxes[i].getClass().getName() + " cannot be rendered");
- out.write(rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,2) + "cannot display sidebox of class: "
- + sideboxes[i].getClass().getName() + "\n");
-
- } // end else
-
- // close up the framework of this sidebox
- out.write("
\n");
-
- } // end for
-
- if (uc.isLoggedIn())
- { // write the Configure button below the sideboxes
- out.write("\n");
-
- } // end if
-
- // Finish up.
- out.write("
\n
");
-
- } // end renderHere
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public static String getPosterName(TopicMessageContext msg)
- {
- try
- { // have to guard agains a DataException here
- return msg.getCreatorName();
-
- } // end try
- catch (DataException de)
- { // just return "unknown" on failure
- return "(unknown)";
-
- } // end catch
-
- } // end getPosterName
-
- public static String getTopicPostLink(RenderData rdat, TopicMessageContext msg)
- {
- try
- { // retrieve the topic post link and name, and combine them
- TopicContext topic = msg.getEnclosingTopic();
- String plink = topic.getPostLink();
- return "" + topic.getName() + "";
-
- } // end try
- catch (DataException de)
- { // just return null on failure
- return null;
-
- } // end catch
- catch (Exception e)
- { // temporary guard point here
- logger.error("Caught in getTopicPostLink:",e);
- return null;
-
- } // end catch
-
- } // end getTopicPostLink
-
- public static String getMessageBodyText(TopicMessageContext msg)
- {
- try
- { // have to guard against a DataException here
- return msg.getBodyText();
-
- } // end try
- catch (DataException de)
- { // just return an error message
- return "(Unable to retrieve message data: " + StringUtil.encodeHTML(de.getMessage()) + ")";
-
- } // end catch
-
- } // end getMessageBodyText
-
- public int getNumTopPosts()
- {
- return top_posts.size();
-
- } // end getNumTopPosts
-
- public TopicMessageContext getTopPost(int index)
- {
- return (TopicMessageContext)(top_posts.get(index));
-
- } // end getTopPost
-
- public boolean displayWelcome()
- {
- return !(uc.isLoggedIn());
-
- } // end displayWelcome
-
-} // end class TopDisplay
diff --git a/src/com/silverwrist/venice/servlets/format/TopicListing.java b/src/com/silverwrist/venice/servlets/format/TopicListing.java
deleted file mode 100644
index babcba6..0000000
--- a/src/com/silverwrist/venice/servlets/format/TopicListing.java
+++ /dev/null
@@ -1,221 +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.IOException;
-import java.io.Writer;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class TopicListing implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.TopicListing";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private CommunityContext comm; // the community we're in
- private ConferenceContext conf; // the conference being listed
- private int view_opt; // the view option used
- private int sort_opt; // the sort option used
- private List topic_list; // the topic list
- private TopicVisitOrder visit_order; // indicates order in which topics are visited
- private String qid; // "quick ID" for this page
- private String top_custom; // top custom HTML block
- private String bottom_custom; // bottom custom HTML block
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public TopicListing(HttpServletRequest request, CommunityContext comm, ConferenceContext conf, int view_opt,
- int sort_opt) throws DataException, AccessError
- {
- this.comm = comm;
- this.conf = conf;
- this.view_opt = view_opt;
- this.sort_opt = sort_opt;
- this.topic_list = conf.getTopicList(view_opt,sort_opt);
- this.visit_order = TopicVisitOrder.initialize(request.getSession(true),conf.getConfID(),this.topic_list);
- List aliases = conf.getAliases();
- this.qid = "go/" + comm.getAlias() + "!" + (String)(aliases.get(0));
- this.top_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
- this.bottom_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static TopicListing retrieve(ServletRequest request)
- {
- return (TopicListing)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Topics in " + conf.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return qid;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "topics.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public final String getLocator()
- {
- StringBuffer buf = new StringBuffer("sig=");
- buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
- return buf.toString();
-
- } // end getLocator
-
- public final String getConfName()
- {
- return conf.getName();
-
- } // end getConfName
-
- public final boolean canDoReadNew()
- {
- return visit_order.isNext();
-
- } // end canDoReadNew
-
- public final String getNextLocator()
- {
- StringBuffer buf = new StringBuffer("sig=");
- buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID()).append("&top=");
- buf.append(visit_order.getNext());
- return buf.toString();
-
- } // end getNextLocator
-
- public final boolean canCreateTopic()
- {
- return conf.canCreateTopic();
-
- } // end canCreateTopic
-
- public final boolean canAddToHotlist()
- {
- return conf.canAddToHotlist();
-
- } // end canAddToHotlist
-
- public final boolean anyTopics()
- {
- return (topic_list.size()>0);
-
- } // end anyTopics
-
- public final int getViewOption()
- {
- return view_opt;
-
- } // end getViewOption
-
- public final boolean isView(int value)
- {
- return (view_opt==value);
-
- } // end isSort
-
- public final boolean isSort(int value)
- {
- return (sort_opt==value);
-
- } // end isSort
-
- public final Iterator getTopicIterator()
- {
- return topic_list.iterator();
-
- } // end getTopicIterator
-
- public final void writeTopCustom(Writer out) throws IOException
- {
- if (top_custom!=null)
- out.write(top_custom);
-
- } // end writeTopCustom
-
- public final void writeBottomCustom(Writer out) throws IOException
- {
- if (bottom_custom!=null)
- out.write(bottom_custom);
-
- } // end writeBottomCustom
-
-} // end class TopicListing
diff --git a/src/com/silverwrist/venice/servlets/format/TopicPosts.java b/src/com/silverwrist/venice/servlets/format/TopicPosts.java
deleted file mode 100644
index e49bfef..0000000
--- a/src/com/silverwrist/venice/servlets/format/TopicPosts.java
+++ /dev/null
@@ -1,544 +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.awt.Dimension;
-import java.io.Writer;
-import java.io.IOException;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import org.apache.log4j.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class TopicPosts implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(TopicPosts.class);
-
- private static int SCALING_NUM = 1;
- private static int SCALING_DENOM = 2;
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.TopicPosts";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
- private CommunityContext comm;
- private ConferenceContext conf;
- private TopicContext topic;
- private int first;
- private int last;
- private boolean show_advanced;
- private boolean no_bozos;
- private int unread;
- private List messages;
- private TopicVisitOrder visit_order;
- private String topic_stem;
- private String topic_qid;
- private String top_custom;
- private String bottom_custom;
- private String cache_locator = null;
- private HashSet bozo_uids = new HashSet();
- private Dimension photo_size = null;
- private HashMap uid_photos = null;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public TopicPosts(HttpServletRequest request, VeniceEngine engine, UserContext user, CommunityContext comm,
- ConferenceContext conf, TopicContext topic, int first, int last, boolean read_new,
- boolean show_advanced, boolean no_bozos) throws DataException, AccessError
- {
- if (logger.isDebugEnabled())
- logger.debug("TopicPosts: comm=" + comm.getCommunityID() + ", conf=" + conf.getConfID() + ", topic="
- + topic.getTopicNumber() + ", range=[" + first + ", " + last + "], rnm=" + read_new
- + ", shac=" + show_advanced + ", nbz=" + no_bozos);
- this.engine = engine;
- this.comm = comm;
- this.conf = conf;
- this.topic = topic;
- this.first = first;
- this.last = last;
- this.show_advanced = show_advanced;
- this.no_bozos = no_bozos;
- this.unread = topic.getUnreadMessages();
- if (read_new)
- topic.setUnreadMessages(0);
- if (logger.isDebugEnabled())
- logger.debug(this.unread + " unread messages");
- this.messages = topic.getMessages(first,last);
- this.visit_order = TopicVisitOrder.retrieve(request.getSession(true),conf.getConfID());
- if (visit_order!=null)
- visit_order.visit(topic.getTopicNumber());
- List aliases = conf.getAliases();
- topic_stem = (String)(aliases.get(0)) + "." + topic.getTopicNumber() + ".";
- topic_qid = "go/" + comm.getAlias() + "!" + (String)(aliases.get(0)) + "." + topic.getTopicNumber();
- top_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
- bottom_custom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
-
- // build up the list of users IN THIS VIEW that are bozo-filtered
- HashSet saw_users = new HashSet();
- if (conf.displayPostPictures() && user.displayPostPictures())
- { // build up the mapping of UIDs to photo URLs
- Dimension psz = engine.getUserPhotoSize();
- photo_size = new Dimension((psz.width * SCALING_NUM) / SCALING_DENOM,
- (psz.height * SCALING_NUM) / SCALING_DENOM);
- uid_photos = new HashMap();
-
- } // end if
-
- Iterator it = messages.iterator();
- while (it.hasNext())
- { // get the user IDs of all messages on this page
- TopicMessageContext msg = (TopicMessageContext)(it.next());
- Integer the_uid = new Integer(msg.getCreatorUID());
- boolean get_photo;
- if (!(saw_users.contains(the_uid)))
- { // only check user IDs once per display operation
- saw_users.add(the_uid);
- get_photo = true;
- if (topic.isBozo(the_uid.intValue()))
- { // shall we get the user photo?
- bozo_uids.add(the_uid);
- get_photo = no_bozos;
-
- } // end if
-
- if (conf.displayPostPictures() && user.displayPostPictures() && get_photo)
- { // look up the user photo URL
- UserProfile prof = user.getProfile(the_uid.intValue());
- String url = prof.getPhotoURL();
- if (url!=null)
- uid_photos.put(the_uid,url);
-
- } // end else if
-
- } // end if
-
- } // end while
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static TopicPosts retrieve(ServletRequest request)
- {
- return (TopicPosts)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return topic.getName() + ": " + topic.getTotalMessages() + " Total; " + unread + " New; Last: "
- + rdat.formatDateForDisplay(topic.getLastUpdateDate());
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return topic_qid;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "posts.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public static final String getPosterName(TopicMessageContext msg)
- {
- try
- { // have to guard agains a DataException here
- return msg.getCreatorName();
-
- } // end try
- catch (DataException de)
- { // just return "unknown" on failure
- return "(unknown)";
-
- } // end catch
-
- } // end getPosterName
-
- public static final String getMessageBodyText(TopicMessageContext msg)
- {
- try
- { // have to guard against a DataException here
- return msg.getBodyText();
-
- } // end try
- catch (DataException de)
- { // just return an error message
- return "(Unable to retrieve message data: " + StringUtil.encodeHTML(de.getMessage()) + ")";
-
- } // end catch
-
- } // end getMessageBodyText
-
- public final int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public final int getConfID()
- {
- return conf.getConfID();
-
- } // end getConfID
-
- public final int getTopicNumber()
- {
- return topic.getTopicNumber();
-
- } // end getTopicNumber
-
- public final int getNextTopicNumber()
- {
- if (visit_order!=null)
- return visit_order.getNext();
- else
- return -1;
-
- } // end getNextTopicNumber
-
- public final String getConfLocator()
- {
- StringBuffer buf = new StringBuffer("sig=");
- buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
- return buf.toString();
-
- } // end getConfLocator
-
- public final String getLocator()
- {
- if (cache_locator==null)
- { // build up the standard locator
- StringBuffer buf = new StringBuffer("sig=");
- buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID()).append("&top=");
- buf.append(topic.getTopicNumber());
- cache_locator = buf.toString();
-
- } // end if
-
- return cache_locator;
-
- } // end getLocator
-
- public final String getNextLocator()
- {
- StringBuffer buf = new StringBuffer("sig=");
- buf.append(comm.getCommunityID()).append("&conf=").append(conf.getConfID());
- if (visit_order!=null)
- buf.append("&top=").append(visit_order.getNext());
- return buf.toString();
-
- } // end getNextLocator
-
- public final String getRestoreLocator()
- {
- StringBuffer buf = new StringBuffer("rtop=");
- buf.append(topic.getTopicNumber()).append("&rct=").append(unread);
- return buf.toString();
-
- } // end getRestoreLocator
-
- public final String getIdentifyingData()
- {
- StringBuffer buf = new StringBuffer("Posts ");
- buf.append(first).append(" through ").append(last).append(" in topic #").append(topic.getTopicID());
- return buf.toString();
-
- } // end getIdentifyingData
-
- public final String getTopicName()
- {
- return topic.getName();
-
- } // end getTopicName
-
- public final int getTotalMessages()
- {
- return topic.getTotalMessages();
-
- } // end getTotalMessages
-
- public final int getNewMessages()
- {
- return unread;
-
- } // end getNewMessages
-
- public final Date getLastUpdate()
- {
- return topic.getLastUpdateDate();
-
- } // end getLastUpdate
-
- public final boolean isTopicHidden()
- {
- return topic.isHidden();
-
- } // end isTopicHidden
-
- public final boolean canDoNextTopic()
- {
- if (visit_order!=null)
- return visit_order.isNext();
- else
- return false;
-
- } // end canDoNextTopic
-
- public final boolean canFreezeTopic()
- {
- return topic.canFreeze();
-
- } // end canFreezeTopic
-
- public final boolean isTopicFrozen()
- {
- return topic.isFrozen();
-
- } // end isTopicFrozen
-
- public final boolean canArchiveTopic()
- {
- return topic.canArchive();
-
- } // end canArchiveTopic
-
- public final boolean isTopicArchived()
- {
- return topic.isArchived();
-
- } // end isTopicArchived
-
- public final boolean canDeleteTopic()
- {
- return topic.canDelete();
-
- } // end canDeleteTopic
-
- public final boolean canScrollUp()
- {
- return (first>0);
-
- } // end canScrollUp
-
- public final String getScrollUpLocator()
- {
- int new_first = first - engine.getNumPostsPerPage();
- int new_last = first - 1;
- if (new_first<0)
- { // normalize so we start at 0
- new_last += (-new_first);
- new_first = 0;
-
- } // end if
-
- StringBuffer buf = new StringBuffer("p1=");
- buf.append(new_first).append("&p2=").append(new_last);
- return buf.toString();
-
- } // end getScrollUpLocator
-
- public final boolean canScrollDown()
- {
- return ((topic.getTotalMessages() - (1 + last))>0);
-
- } // end canScrollDown
-
- public final String getScrollDownLocator()
- {
- int new_last = last + engine.getNumPostsPerPage();
- int my_last = topic.getTotalMessages() - 1;
- if (new_last>my_last)
- new_last = my_last; // normalize so we end at the last post
- StringBuffer buf = new StringBuffer("p1=");
- buf.append(last+1).append("&p2=").append(new_last);
- return buf.toString();
-
- } // end getScrollDownLocator
-
- public final boolean canScrollToEnd()
- {
- return ((topic.getTotalMessages() - (1 + last))>0);
-
- } // end canScrollToEnd
-
- public final String getScrollToEndLocator()
- {
- int my_last = topic.getTotalMessages();
- StringBuffer buf = new StringBuffer("p1=");
- buf.append(my_last-engine.getNumPostsPerPage()).append("&p2=").append(my_last-1);
- return buf.toString();
-
- } // end getScrollToEndLocator
-
- public final Iterator getMessageIterator()
- {
- return messages.iterator();
-
- } // end getMessageIterator()
-
- public final boolean emitBreakLinePoint(int msg)
- {
- return (msg==(topic.getTotalMessages()-unread));
-
- } // end emitBreakLinePoint
-
- public final boolean showAdvanced()
- {
- return show_advanced && (last==first);
-
- } // end showAdvanced
-
- public final boolean displayPostBox()
- {
- boolean flag1 = conf.canPostToConference();
- boolean flag2 = (topic.isFrozen() ? topic.canFreeze() : true);
- boolean flag3 = (topic.isArchived() ? topic.canArchive() : true);
- return flag1 && flag2 && flag3;
-
- } // end displayPostBox
-
- public final String getDefaultPseud()
- {
- return conf.getDefaultPseud();
-
- } // end getDefaultPseud
-
- public final String getMessageReference(TopicMessageContext msg)
- {
- return topic_stem + msg.getPostNumber();
-
- } // end getMessageReference
-
- public final int getNumPostsPerPage()
- {
- return engine.getNumPostsPerPage();
-
- } // end getNumPostsPerPage
-
- public final boolean displayAttachmentInNewWindow(TopicMessageContext msg)
- {
- if (!(msg.hasAttachment()))
- return false;
- String type = msg.getAttachmentType();
- return (type.startsWith("text/") || type.startsWith("image/"));
-
- } // end displayAttachmentInNewWindow
-
- public final boolean bozoFilterUser(int uid)
- {
- if (no_bozos)
- return false;
- else
- return bozo_uids.contains(new Integer(uid));
-
- } // end bozoFilterUser
-
- public final boolean showBozoFilteredIndicator(int uid)
- {
- if (no_bozos)
- return bozo_uids.contains(new Integer(uid));
- else
- return false;
-
- } // end showBozoFilteredIndicator
-
- public final boolean showFilterButton(int uid)
- {
- return !(bozo_uids.contains(new Integer(uid))) && topic.canSetBozo(uid);
-
- } // end showFilterButton
-
- public final String getUserPhotoTag(int uid, RenderData rdat)
- {
- if (photo_size==null)
- return ""; // user photos not enabled
- StringBuffer buf = new StringBuffer("");
- return buf.toString();
-
- } // end getUserPhotoTag
-
- public final boolean displayPostPictures()
- {
- return (photo_size!=null);
-
- } // end displayPostPictures
-
- public final void writeTopCustom(Writer out) throws IOException
- {
- if (top_custom!=null)
- out.write(top_custom);
-
- } // end writeTopCustom
-
- public final void writeBottomCustom(Writer out) throws IOException
- {
- if (bottom_custom!=null)
- out.write(bottom_custom);
-
- } // end writeBottomCustom
-
-} // end class TopicPosts
diff --git a/src/com/silverwrist/venice/servlets/format/UserPhotoData.java b/src/com/silverwrist/venice/servlets/format/UserPhotoData.java
deleted file mode 100644
index 9d1810d..0000000
--- a/src/com/silverwrist/venice/servlets/format/UserPhotoData.java
+++ /dev/null
@@ -1,127 +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.awt.Dimension;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-
-public class UserPhotoData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.UserPhotoData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private Dimension photo_dims;
- private String photo_url;
- private String target;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public UserPhotoData(VeniceEngine engine, UserContext user, RenderData rdat, String target)
- throws DataException
- {
- photo_dims = engine.getUserPhotoSize();
- photo_url = user.getContactInfo().getPhotoURL();
- if (StringUtil.isStringEmpty(photo_url))
- photo_url = rdat.getPhotoNotAvailURL();
- this.target = target;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static UserPhotoData retrieve(ServletRequest request)
- {
- return (UserPhotoData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Set User Photo";
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "user_photo.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getTarget()
- {
- return target;
-
- } // end getTarget
-
- public String getPhotoTag(RenderData rdat)
- {
- StringBuffer buf = new StringBuffer("");
- return buf.toString();
-
- } // end getPhotoTag
-
-} // end class UserPhotoData
diff --git a/src/com/silverwrist/venice/servlets/format/UserProfileData.java b/src/com/silverwrist/venice/servlets/format/UserProfileData.java
deleted file mode 100644
index eeb072b..0000000
--- a/src/com/silverwrist/venice/servlets/format/UserProfileData.java
+++ /dev/null
@@ -1,163 +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.awt.Dimension;
-import javax.servlet.ServletRequest;
-import com.silverwrist.util.StringUtil;
-import com.silverwrist.venice.core.VeniceEngine;
-import com.silverwrist.venice.core.UserProfile;
-
-public class UserProfileData implements JSPRender
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.UserProfileData";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine;
- private UserProfile prof;
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public UserProfileData(VeniceEngine engine, UserProfile prof)
- {
- this.engine = engine;
- this.prof = prof;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static UserProfileData retrieve(ServletRequest request)
- {
- return (UserProfileData)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "User Profile - " + prof.getUserName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return "user/" + prof.getUserName();
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "userprofile.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public UserProfile getUserProfile()
- {
- return prof;
-
- } // end getUserProfile
-
- public String getAddressLastLine()
- {
- String tmp_c = prof.getLocality();
- String tmp_s = prof.getRegion();
- StringBuffer buf = new StringBuffer();
- if (!(StringUtil.isStringEmpty(tmp_c)) && !(StringUtil.isStringEmpty(tmp_s)))
- buf.append(tmp_c).append(", ").append(tmp_s);
- else if (!(StringUtil.isStringEmpty(tmp_c)))
- buf.append(tmp_c);
- else if (!(StringUtil.isStringEmpty(tmp_s)))
- buf.append(tmp_s);
- tmp_s = prof.getPostalCode();
- if (!(StringUtil.isStringEmpty(tmp_s)))
- buf.append(' ').append(tmp_s);
- return buf.toString();
-
- } // end getAddressLastLine
-
- public String getFullName()
- {
- StringBuffer buf = new StringBuffer(prof.getGivenName());
- String tmp = prof.getNamePrefix();
- if (!(StringUtil.isStringEmpty(tmp)))
- { // insert prefix at beginning
- buf.insert(0,' ');
- buf.insert(0,tmp);
-
- } // end if
- if (prof.getMiddleInitial()!=' ')
- buf.append(' ').append(prof.getMiddleInitial()).append('.');
- buf.append(' ').append(prof.getFamilyName());
- tmp = prof.getNameSuffix();
- if (!(StringUtil.isStringEmpty(tmp)))
- buf.append(' ').append(tmp);
- return buf.toString();
-
- } // end getFullName
-
- public String getPhotoTag(RenderData rdat)
- {
- Dimension dim = engine.getUserPhotoSize();
- StringBuffer buf = new StringBuffer("");
- return buf.toString();
-
- } // end getPhotoTag
-
-} // end class UserProfileData
diff --git a/src/com/silverwrist/venice/servlets/format/VerifyEmailDialog.java b/src/com/silverwrist/venice/servlets/format/VerifyEmailDialog.java
deleted file mode 100644
index 82b1ede..0000000
--- a/src/com/silverwrist/venice/servlets/format/VerifyEmailDialog.java
+++ /dev/null
@@ -1,118 +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 com.silverwrist.venice.except.*;
-import com.silverwrist.venice.util.IDUtils;
-
-public class VerifyEmailDialog extends ContentDialog
-{
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- int confirm_num = 0;
-
- /*--------------------------------------------------------------------------------
- * Constructors
- *--------------------------------------------------------------------------------
- */
-
- public VerifyEmailDialog()
- {
- super("Verify E-mail Address",null,"verifyform","account");
- setInstructions("Check your e-mail, then enter the confirmation number that was e-mailed to you "
- + "in the field below. Once you do so, your account will be fully validated. "
- + "If you have not received your confirmation, click on the 'Send Again' button "
- + "below.");
- setHiddenField("cmd","V");
- setHiddenField("tgt","");
- addFormField(new CDTextFormField("num","Confirmation number",null,false,7,7));
- addCommandButton(new CDImageButton("ok","bn_ok.gif","OK",80,24));
- addCommandButton(new CDImageButton("again","bn_send_again.gif","Send Again",80,24));
- addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
-
- } // end constructor
-
- protected VerifyEmailDialog(VerifyEmailDialog other)
- {
- super(other);
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Overrides from class ContentDialog
- *--------------------------------------------------------------------------------
- */
-
- protected void validateWholeForm() throws ValidationException
- {
- try
- { // convert to a number and check its range
- int num = Integer.parseInt(getFieldValue("num"));
-
- if (!IDUtils.isValidConfirmationNumber(num))
- throw new ValidationException("The value you have entered is not a valid confirmation number.");
-
- confirm_num = num; // save off for later
-
- } // end try
- catch (NumberFormatException e)
- { // conversion error!
- throw new ValidationException("The value you have entered is not a valid number.");
-
- } // end catch
-
- } // end validateWholeForm
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void setTarget(String target)
- {
- setHiddenField("tgt",target);
-
- } // end setTarget
-
- public int getConfirmationNumber()
- {
- return confirm_num;
-
- } // end getConfirmationNumber
-
- public void resetOnError(String message)
- {
- setErrorMessage(message);
- setFieldValue("num",null);
-
- } // end resetOnError
-
- public Object clone()
- {
- return new VerifyEmailDialog(this);
-
- } // end clone
-
-} // end class VerifyEmailDialog
-
-
-
-
diff --git a/src/com/silverwrist/venice/servlets/format/ViewCommunityMembers.java b/src/com/silverwrist/venice/servlets/format/ViewCommunityMembers.java
deleted file mode 100644
index dbcb679..0000000
--- a/src/com/silverwrist/venice/servlets/format/ViewCommunityMembers.java
+++ /dev/null
@@ -1,341 +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.*;
-import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import com.silverwrist.venice.core.*;
-import com.silverwrist.venice.except.*;
-import com.silverwrist.venice.security.Role;
-
-public class ViewCommunityMembers implements JSPRender, SearchMode
-{
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- // Attribute name for request attribute
- protected static final String ATTR_NAME = "com.silverwrist.venice.content.ViewCommunityMembers";
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private VeniceEngine engine; // engine context
- private CommunityContext comm; // community context
- private List display_list = null; // list of members to display
- private boolean simple_list = false; // simple list?
- private int field = -1; // search field
- private int mode = -1; // search mode
- private String term = null; // search term
- private int offset = 0; // search result offset
- private int find_count = -1; // search results count
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public ViewCommunityMembers(VeniceEngine engine, CommunityContext comm)
- {
- this.engine = engine;
- this.comm = comm;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Internal functions
- *--------------------------------------------------------------------------------
- */
-
- private static int getParamInt(ServletRequest request, String name, int default_val)
- {
- String str = request.getParameter(name);
- if (str==null)
- return -1;
-
- try
- { // parse the integer value
- return Integer.parseInt(str);
-
- } // end try
- catch (NumberFormatException nfe)
- { // in case of conversion error, return default
- return default_val;
-
- } // end catch
-
- } // end getParamInt
-
- private static boolean isImageButtonClicked(ServletRequest request, String name)
- {
- String val = request.getParameter(name + ".x");
- return (val!=null);
-
- } // end isImageButtonClicked
-
- /*--------------------------------------------------------------------------------
- * External static functions
- *--------------------------------------------------------------------------------
- */
-
- public static ViewCommunityMembers retrieve(ServletRequest request)
- {
- return (ViewCommunityMembers)(request.getAttribute(ATTR_NAME));
-
- } // end retrieve
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface VeniceContent
- *--------------------------------------------------------------------------------
- */
-
- public String getPageTitle(RenderData rdat)
- {
- return "Members of Community " + comm.getName();
-
- } // end getPageTitle
-
- public String getPageQID()
- {
- return null;
-
- } // end getPageQID
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface JSPRender
- *--------------------------------------------------------------------------------
- */
-
- public void store(ServletRequest request)
- {
- request.setAttribute(ATTR_NAME,this);
-
- } // end store
-
- public String getTargetJSPName()
- {
- return "view_member.jsp";
-
- } // end getTargetJSPName
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public void doInitialList() throws DataException
- {
- display_list = comm.getMemberList();
- simple_list = true;
- term = "";
- offset = 0;
- find_count = display_list.size();
-
- } // end doInitialList
-
- public void doSearch(ServletRequest request) throws ValidationException, DataException
- {
- // Get the "simple list" parameter.
- int slp = getParamInt(request,"sl",1);
- simple_list = (slp==1);
-
- if (simple_list)
- { // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- throw new ValidationException("Invalid button click."); // this can't happen
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Get the member list and offset it if necessary.
- List tmp = comm.getMemberList();
- if (find_count<0)
- find_count = tmp.size();
- if (offset>0)
- display_list = tmp.subList(offset,tmp.size());
- else
- display_list = tmp;
-
- term = ""; // null out the search term
-
- } // end if
- else
- { // Validate the search field parameter.
- field = getParamInt(request,"field",FIELD_USER_NAME);
- if ( (field!=FIELD_USER_NAME) && (field!=FIELD_USER_DESCRIPTION) && (field!=FIELD_USER_GIVEN_NAME)
- && (field!=FIELD_USER_FAMILY_NAME))
- throw new ValidationException("The field search parameter is not valid.");
-
- // Validate the search mode parameter.
- mode = getParamInt(request,"mode",SEARCH_PREFIX);
- if ((mode!=SEARCH_PREFIX) && (mode!=SEARCH_SUBSTRING) && (mode!=SEARCH_REGEXP))
- throw new ValidationException("The search mode parameter is not valid.");
-
- // Retrieve the search term parameter.
- term = request.getParameter("term");
- if (term==null)
- term = "";
-
- // Retrieve the offset and find count parameters.
- offset = getParamInt(request,"ofs",0);
- find_count = getParamInt(request,"fcount",-1);
-
- // Adjust the search return offset based on the command button click.
- int count = getNumResultsDisplayed();
- if (isImageButtonClicked(request,"search"))
- offset = 0;
- else if (isImageButtonClicked(request,"previous"))
- { // adjust the offset in the reverse direction
- offset -= count;
- if (offset<0)
- offset = 0;
-
- } // end else if
- else if (isImageButtonClicked(request,"next"))
- offset += count; // go forwards instead
- else
- throw new ValidationException("Unable to determine what action triggered the form.");
-
- // Perform the search!
- display_list = comm.searchForMembers(field,mode,term,offset,count);
- if (find_count<0)
- find_count = comm.getSearchMemberCount(field,mode,term);
-
- } // end else
-
- } // end doSearch
-
- public int getNumResultsDisplayed()
- {
- return engine.getStdNumSearchResults();
-
- } // end getNumResultsDisplayed
-
- public String getCommunityName()
- {
- return comm.getName();
-
- } // end getCommunityName
-
- public int getCommunityID()
- {
- return comm.getCommunityID();
-
- } // end getCommunityID
-
- public boolean getSimpleList()
- {
- return simple_list;
-
- } // end getSimpleList
-
- public int getSimpleListParam()
- {
- return (simple_list ? 1 : 0);
-
- } // end getSimpleListParam
-
- public int getSearchField()
- {
- return field;
-
- } // end getSearchField
-
- public int getSearchMode()
- {
- return mode;
-
- } // end getSearchMode
-
- public boolean searchFieldIs(int value)
- {
- return (field==value);
-
- } // end searchFieldIs
-
- public boolean searchModeIs(int value)
- {
- return (mode==value);
-
- } // end searchModeIs
-
- public String getSearchTerm()
- {
- return term;
-
- } // end getSearchTerm
-
- public int getFindCount()
- {
- return find_count;
-
- } // end getFindCount
-
- public int getOffset()
- {
- return offset;
-
- } // end getOffset
-
- public int getSize()
- {
- return display_list.size();
-
- } // end getSize
-
- public boolean displayList()
- {
- if ((display_list==null) || (display_list.size()==0))
- return false;
- return true;
-
- } // end displayList
-
- public UserFound getItem(int ndx)
- {
- return (UserFound)(display_list.get(ndx));
-
- } // end getItem
-
- public boolean isCommunityAdmin(UserFound uf)
- {
- SecurityInfo sinf = comm.getSecurityInfo();
- Role r = sinf.getRole("Community.Host");
- return r.isSatisfiedBy(uf.getLevel());
-
- } // end isCommunityAdmin
-
-} // end class ViewCommunityMembers
diff --git a/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java b/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java
deleted file mode 100644
index dacb2b5..0000000
--- a/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java
+++ /dev/null
@@ -1,183 +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.menus;
-
-import java.io.Writer;
-import java.io.IOException;
-import java.util.*;
-import org.apache.log4j.*;
-import org.w3c.dom.*;
-import com.silverwrist.util.*;
-import com.silverwrist.venice.except.ConfigException;
-import com.silverwrist.venice.servlets.format.ComponentRender;
-import com.silverwrist.venice.servlets.format.RenderData;
-
-public class LeftMenu implements ComponentRender
-{
- /*--------------------------------------------------------------------------------
- * Internal class representing a header component
- *--------------------------------------------------------------------------------
- */
-
- static class Header implements ComponentRender
- {
- private TextItem item;
-
- Header(Element elt)
- {
- DOMElementHelper h = new DOMElementHelper(elt);
- item = new TextItem(h.getElementText());
-
- } // end constructor
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- out.write("");
- item.renderHere(out,rdat);
- out.write(" \n");
-
- } // end renderHere
-
- } // end class Header
-
- /*--------------------------------------------------------------------------------
- * Internal class representing a separator component
- *--------------------------------------------------------------------------------
- */
-
- static class Separator implements ComponentRender
- {
- private ComponentRender cr;
-
- Separator()
- {
- this.cr = null;
-
- } // end constructor
-
- Separator(ComponentRender cr)
- {
- this.cr = cr;
-
- } // end constructor
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- if (cr!=null)
- cr.renderHere(out,rdat);
- out.write(" \n");
-
- } // end renderHere
-
- } // end class Separator
-
- /*--------------------------------------------------------------------------------
- * Static data members
- *--------------------------------------------------------------------------------
- */
-
- private static Category logger = Category.getInstance(LeftMenu.class);
- private static final Separator separator_singleton = new Separator(null);
-
- /*--------------------------------------------------------------------------------
- * Attributes
- *--------------------------------------------------------------------------------
- */
-
- private String identifier;
- private ArrayList menu_items = new ArrayList();
-
- /*--------------------------------------------------------------------------------
- * Constructor
- *--------------------------------------------------------------------------------
- */
-
- public LeftMenu(Element elt, String identifier) throws ConfigException
- {
- if (!(elt.getNodeName().equals("menudef")))
- { // just some shorts-checking here to make sure the element is OK
- logger.fatal("huh?!? this should have been a if it got here!");
- throw new ConfigException("not a element");
-
- } // end if
-
- NodeList items = elt.getChildNodes();
- for (int i=0; i inside ");
- throw new ConfigException("unknown element <" + n.getNodeName() + "/> inside ",n);
-
- } // end else
-
- } // end if (an element node)
-
- } // end for (each child node)
-
- this.identifier = identifier;
-
- } // end constructor
-
- /*--------------------------------------------------------------------------------
- * Implementations from interface ComponentRender
- *--------------------------------------------------------------------------------
- */
-
- public void renderHere(Writer out, RenderData rdat) throws IOException
- {
- Iterator it = menu_items.iterator();
- while (it.hasNext())
- { // render each menu item in turn
- ComponentRender cr = (ComponentRender)(it.next());
- cr.renderHere(out,rdat);
-
- } // end while
-
- } // end renderHere
-
- /*--------------------------------------------------------------------------------
- * External operations
- *--------------------------------------------------------------------------------
- */
-
- public String getIdentifier()
- {
- return identifier;
-
- } // end getIdentifier
-
-} // end class LeftMenu
-
diff --git a/src/com/silverwrist/venice/ui/AutoCleanup.java b/src/com/silverwrist/venice/ui/AutoCleanup.java
new file mode 100644
index 0000000..ad350bc
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/AutoCleanup.java
@@ -0,0 +1,24 @@
+/*
+ * 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.ui;
+
+public interface AutoCleanup
+{
+ public abstract void cleanup();
+
+} // end interface AutoCleanup
diff --git a/src/com/silverwrist/venice/servlets/format/ColorSelectors.java b/src/com/silverwrist/venice/ui/ColorSelectors.java
similarity index 97%
rename from src/com/silverwrist/venice/servlets/format/ColorSelectors.java
rename to src/com/silverwrist/venice/ui/ColorSelectors.java
index 9798b77..1d24262 100644
--- a/src/com/silverwrist/venice/servlets/format/ColorSelectors.java
+++ b/src/com/silverwrist/venice/ui/ColorSelectors.java
@@ -15,7 +15,7 @@
*
* Contributor(s):
*/
-package com.silverwrist.venice.servlets.format;
+package com.silverwrist.venice.ui;
public interface ColorSelectors
{
diff --git a/src/com/silverwrist/venice/ui/Content.java b/src/com/silverwrist/venice/ui/Content.java
new file mode 100644
index 0000000..0f4dabb
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/Content.java
@@ -0,0 +1,34 @@
+/*
+ * 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.ui;
+
+public interface Content
+{
+ public static final int MENU_SELECTOR_NOCHANGE = -1;
+ public static final int MENU_SELECTOR_TOP = 0;
+ public static final int MENU_SELECTOR_COMMUNITY = 1;
+
+ public abstract boolean needFrame();
+
+ public abstract int getMenuSelector();
+
+ public abstract String getPageTitle(RequestOutput ro);
+
+ public abstract String getPageQID();
+
+} // end interface Content
diff --git a/src/com/silverwrist/venice/servlets/format/ComponentRender.java b/src/com/silverwrist/venice/ui/ContentDirect.java
similarity index 79%
rename from src/com/silverwrist/venice/servlets/format/ComponentRender.java
rename to src/com/silverwrist/venice/ui/ContentDirect.java
index de61378..2701a49 100644
--- a/src/com/silverwrist/venice/servlets/format/ComponentRender.java
+++ b/src/com/silverwrist/venice/ui/ContentDirect.java
@@ -15,13 +15,12 @@
*
* Contributor(s):
*/
-package com.silverwrist.venice.servlets.format;
+package com.silverwrist.venice.ui;
-import java.io.Writer;
import java.io.IOException;
-public interface ComponentRender
+public interface ContentDirect extends Content
{
- public abstract void renderHere(Writer out, RenderData rdat) throws IOException;
+ public abstract void render(RequestOutput out) throws IOException;
-} // end interface ComponentRender
+} // end interface ContentDirect
diff --git a/src/com/silverwrist/venice/servlets/format/VeniceContent.java b/src/com/silverwrist/venice/ui/ContentExecute.java
similarity index 80%
rename from src/com/silverwrist/venice/servlets/format/VeniceContent.java
rename to src/com/silverwrist/venice/ui/ContentExecute.java
index 4b03729..1f9ac08 100644
--- a/src/com/silverwrist/venice/servlets/format/VeniceContent.java
+++ b/src/com/silverwrist/venice/ui/ContentExecute.java
@@ -15,12 +15,12 @@
*
* Contributor(s):
*/
-package com.silverwrist.venice.servlets.format;
+package com.silverwrist.venice.ui;
-public interface VeniceContent
+import java.io.IOException;
+
+public interface ContentExecute
{
- public abstract String getPageTitle(RenderData rdat);
+ public abstract void execute(RequestExec req) throws IOException;
- public abstract String getPageQID();
-
-} // end interface VeniceContent
+} // end interface ContentExecute
diff --git a/src/com/silverwrist/venice/servlets/format/JSPRender.java b/src/com/silverwrist/venice/ui/ContentJSP.java
similarity index 76%
rename from src/com/silverwrist/venice/servlets/format/JSPRender.java
rename to src/com/silverwrist/venice/ui/ContentJSP.java
index 2415a17..89bc6e2 100644
--- a/src/com/silverwrist/venice/servlets/format/JSPRender.java
+++ b/src/com/silverwrist/venice/ui/ContentJSP.java
@@ -15,14 +15,14 @@
*
* Contributor(s):
*/
-package com.silverwrist.venice.servlets.format;
+package com.silverwrist.venice.ui;
-import javax.servlet.ServletRequest;
-
-public interface JSPRender extends VeniceContent
+public interface ContentJSP extends Content
{
- public abstract void store(ServletRequest request);
+ public abstract String getJSPName();
- public abstract String getTargetJSPName();
+ public abstract void initialize(RequestInput req);
-} // end interface JSPRender
+ public abstract void terminate(RequestInput req);
+
+} // end interface ContentJSP
diff --git a/src/com/silverwrist/venice/ui/LinkTypes.java b/src/com/silverwrist/venice/ui/LinkTypes.java
new file mode 100644
index 0000000..3348cae
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/LinkTypes.java
@@ -0,0 +1,28 @@
+/*
+ * 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.ui;
+
+public interface LinkTypes
+{
+ public static final int ABSOLUTE = 0;
+
+ public static final int SERVLET = 1;
+
+ public static final int FRAME = 2;
+
+} // end interface LinkTypes
diff --git a/src/com/silverwrist/venice/servlets/format/ContentRender.java b/src/com/silverwrist/venice/ui/RenderDirect.java
similarity index 78%
rename from src/com/silverwrist/venice/servlets/format/ContentRender.java
rename to src/com/silverwrist/venice/ui/RenderDirect.java
index 267c03c..0983efc 100644
--- a/src/com/silverwrist/venice/servlets/format/ContentRender.java
+++ b/src/com/silverwrist/venice/ui/RenderDirect.java
@@ -15,13 +15,12 @@
*
* Contributor(s):
*/
-package com.silverwrist.venice.servlets.format;
+package com.silverwrist.venice.ui;
-import java.io.Writer;
import java.io.IOException;
-public interface ContentRender extends VeniceContent
+public interface RenderDirect
{
- public abstract void renderHere(Writer out, RenderData rdat) throws IOException;
+ public abstract void render(RequestOutput out) throws IOException;
-} // end interface ContentRender
+} // end interface RenderDirect
diff --git a/src/com/silverwrist/venice/ui/RequestExec.java b/src/com/silverwrist/venice/ui/RequestExec.java
new file mode 100644
index 0000000..9a92344
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/RequestExec.java
@@ -0,0 +1,52 @@
+/*
+ * 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.ui;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.sql.Blob;
+import java.sql.SQLException;
+
+public interface RequestExec extends LinkTypes
+{
+ public abstract void error(int code) throws IOException;
+
+ public abstract void error(int code, String message) throws IOException;
+
+ public abstract void redirect(String where, int type) throws IOException;
+
+ public abstract void noContent();
+
+ public abstract void sendBinary(String type, String filename, int length, InputStream data)
+ throws IOException;
+
+ public abstract void sendBinary(String type, int length, InputStream data) throws IOException;
+
+ public abstract void sendBinary(String type, String filename, Blob data) throws IOException, SQLException;
+
+ public abstract void sendBinary(String type, Blob data) throws IOException, SQLException;
+
+ public abstract void sendBinary(String type, String filename, byte[] data) throws IOException;
+
+ public abstract void sendBinary(String type, byte[] data) throws IOException;
+
+ public abstract void sendText(String type, String data) throws IOException;
+
+ public abstract void sendText(String type, char[] data) throws IOException;
+
+} // end interface RequestExec
diff --git a/src/com/silverwrist/venice/ui/RequestInput.java b/src/com/silverwrist/venice/ui/RequestInput.java
new file mode 100644
index 0000000..3c8ec2f
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/RequestInput.java
@@ -0,0 +1,180 @@
+/*
+ * 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.ui;
+
+import java.awt.Dimension;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Map;
+import com.silverwrist.util.ServletMultipartException;
+import com.silverwrist.venice.core.CommunityContext;
+import com.silverwrist.venice.core.UserContext;
+import com.silverwrist.venice.core.VeniceEngine;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.dlg.Dialog;
+import com.silverwrist.venice.ui.helpers.ErrorBox;
+import com.silverwrist.venice.ui.menus.MenuComponent;
+import com.silverwrist.venice.ui.script.ScriptManager;
+
+public interface RequestInput extends LinkTypes
+{
+ public static final String LOGIN_COOKIE = "VeniceAuth";
+ public static final int LOGIN_COOKIE_AGE = 60*60*24*365; // one year
+ public static final String LEFT_MENU_SESSION_ATTR = "LeftMenu";
+
+ public abstract String mapPath(String s);
+
+ public abstract String getContextPath();
+
+ public abstract String getServletPath();
+
+ public abstract String getPathInfo();
+
+ public abstract String getQueryString();
+
+ public abstract String getVerb();
+
+ public abstract String getSourceAddress();
+
+ public abstract boolean hasParameter(String name);
+
+ public abstract String getParameter(String name);
+
+ public abstract int getParameterInt(String name, int default_value);
+
+ public abstract short getParameterShort(String name, short default_value);
+
+ public abstract long getParameterLong(String name, long default_value);
+
+ public abstract Enumeration getParameterNames();
+
+ public abstract String[] getParameterValues(String name);
+
+ public abstract boolean isFileParam(String name);
+
+ public abstract String getParameterType(String name);
+
+ public abstract int getParameterSize(String name);
+
+ public abstract InputStream getParameterDataStream(String name) throws ServletMultipartException;
+
+ public abstract boolean isImageButtonClicked(String name);
+
+ public abstract Object getAppAttribute(String name);
+
+ public abstract void setAppAttribute(String name, Object o);
+
+ public abstract Object getSessionAttribute(String name);
+
+ public abstract void setSessionAttribute(String name, Object o);
+
+ public abstract Object getRequestAttribute(String name);
+
+ public abstract void setRequestAttribute(String name, Object o);
+
+ public abstract void savePersistentCookie(String name, String value, int max_age);
+
+ public abstract void saveTemporaryCookie(String name, String value);
+
+ public abstract void deleteCookie(String name);
+
+ public abstract VeniceEngine getEngine();
+
+ public abstract UserContext getUser();
+
+ public abstract void replaceUser(UserContext new_user);
+
+ public abstract ScriptManager getScriptManager();
+
+ public abstract String getStyleSheetData() throws IOException;
+
+ public abstract String getColor(int selector);
+
+ public abstract String getColor(String name);
+
+ public abstract boolean useHTMLComments();
+
+ public abstract String formatURL(String url, int type);
+
+ public abstract String formatDate(Date date);
+
+ public abstract String getFontTag(int colorsel, int size);
+
+ public abstract String getFontTag(String color, int size);
+
+ public abstract String getFontTag(int colorsel, String size);
+
+ public abstract String getFontTag(String color, String size);
+
+ public abstract int convertLinkType(String str);
+
+ public abstract String getLocation();
+
+ public abstract void setLocation(String str);
+
+ public abstract boolean getDisplayLogin();
+
+ public abstract void setDisplayLogin(boolean val);
+
+ public abstract String getStockMessage(String key);
+
+ public abstract String getStockMessage(String key, Map vars);
+
+ public abstract String getStaticPath(String s);
+
+ public abstract String getExternalStaticPath(String s);
+
+ public abstract String getImagePath(String s);
+
+ public abstract MenuComponent getMenu(String name);
+
+ public abstract MenuComponent getMenu(String name, Map vars);
+
+ public abstract String getScriptName(String raw_name);
+
+ public abstract String getScriptName(boolean strip_ext);
+
+ public abstract String getScriptLoggerName(String raw_name);
+
+ public abstract String getScriptLoggerName();
+
+ public abstract Dialog getDialog(String name);
+
+ public abstract Content[] getSideBoxes() throws AccessError, DataException;
+
+ public abstract String getUserPhotoTag(String url);
+
+ public abstract String getUserPhotoTag(String url, Dimension size);
+
+ public abstract CommunityContext getCommunity();
+
+ public abstract CommunityContext getCommunity(boolean required, String on_error) throws ErrorBox;
+
+ public abstract String getActivityString(Date date);
+
+ public abstract String getDefaultServletAddress(CommunityContext comm);
+
+ public abstract String getCommunityLogoTag(String url);
+
+ public abstract String expandServletPath(String spath);
+
+ public abstract void registerCleanup(AutoCleanup ac);
+
+} // end interface RequestInput
diff --git a/src/com/silverwrist/venice/ui/RequestOutput.java b/src/com/silverwrist/venice/ui/RequestOutput.java
new file mode 100644
index 0000000..ee2a1ad
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/RequestOutput.java
@@ -0,0 +1,95 @@
+/*
+ * 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.ui;
+
+import java.awt.Dimension;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Date;
+import java.util.Map;
+import javax.servlet.ServletException;
+
+public interface RequestOutput extends LinkTypes
+{
+ public abstract Writer getWriter() throws IOException;
+
+ public abstract void write(String s) throws IOException;
+
+ public abstract void writeStackTrace(Throwable t) throws IOException;
+
+ public abstract void flush() throws IOException;
+
+ public abstract void output(Content c) throws IOException, ServletException;
+
+ public abstract void output(Writer out, Content c) throws IOException, ServletException;
+
+ public abstract void writeFrameHead(Writer out, Content c) throws IOException;
+
+ public abstract void writeFrameHead(Content c) throws IOException;
+
+ public abstract void writeSiteImageTag(Writer out) throws IOException;
+
+ public abstract void writeSiteImageTag() throws IOException;
+
+ public abstract void writeVeniceLogo(Writer out) throws IOException;
+
+ public abstract void writeVeniceLogo() throws IOException;
+
+ public abstract void writeContentHeader(Writer out, String primary, String secondary) throws IOException;
+
+ public abstract void writeContentHeader(String primary, String secondary) throws IOException;
+
+ public abstract String formatURL(String url, int type);
+
+ public abstract String formatDate(Date date);
+
+ public abstract String getColor(int selector);
+
+ public abstract String getColor(String name);
+
+ public abstract String getFontTag(int colorsel, int size);
+
+ public abstract String getFontTag(String color, int size);
+
+ public abstract String getFontTag(int colorsel, String size);
+
+ public abstract String getFontTag(String color, String size);
+
+ public abstract String getStockMessage(String key);
+
+ public abstract String getStockMessage(String key, Map vars);
+
+ public abstract String getStaticPath(String s);
+
+ public abstract String getExternalStaticPath(String s);
+
+ public abstract String getImagePath(String s);
+
+ public abstract String getButtonVisual(String id);
+
+ public abstract String getButtonInput(String id);
+
+ public abstract String getUserPhotoTag(String url);
+
+ public abstract String getUserPhotoTag(String url, Dimension size);
+
+ public abstract String getActivityString(Date date);
+
+ public abstract String getCommunityLogoTag(String url);
+
+} // end interface RequestOutput
diff --git a/src/com/silverwrist/venice/ui/conf/AttachmentContent.java b/src/com/silverwrist/venice/ui/conf/AttachmentContent.java
new file mode 100644
index 0000000..db7054f
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/AttachmentContent.java
@@ -0,0 +1,68 @@
+/*
+ * 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.ui.helpers;
+
+import java.io.InputStream;
+import java.io.IOException;
+import com.silverwrist.venice.core.TopicMessageContext;
+import com.silverwrist.venice.except.AccessError;
+import com.silverwrist.venice.except.DataException;
+import com.silverwrist.venice.ui.ContentExecute;
+import com.silverwrist.venice.ui.LinkTypes;
+import com.silverwrist.venice.ui.RequestExec;
+import com.silverwrist.venice.ui.helpers.ThrowableContent;
+
+public class AttachmentContent extends ThrowableContent implements ContentExecute
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String type;
+ private String filename;
+ private int length;
+ private InputStream stm;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public AttachmentContent(TopicMessageContext msg) throws AccessError, DataException
+ {
+ super();
+ this.type = msg.getAttachmentType();
+ this.filename = msg.getAttachmentFilename();
+ this.length = msg.getAttachmentLength();
+ this.stm = msg.getAttachmentData();
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface ContentExecute
+ *--------------------------------------------------------------------------------
+ */
+
+ public void execute(RequestExec req) throws IOException
+ {
+ req.sendBinary(type,filename,length,stm);
+
+ } // end execute
+
+} // end class BinaryDataContent
diff --git a/src/com/silverwrist/venice/ui/conf/CurrentConference.java b/src/com/silverwrist/venice/ui/conf/CurrentConference.java
new file mode 100644
index 0000000..18ea589
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/CurrentConference.java
@@ -0,0 +1,631 @@
+/*
+ * 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.ui.conf;
+
+import java.util.*;
+import javax.servlet.*;
+import org.apache.log4j.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.helpers.*;
+import com.silverwrist.venice.ui.servlet.RequestImpl;
+
+public class CurrentConference implements AutoCleanup
+{
+ /*--------------------------------------------------------------------------------
+ * Static data members
+ *--------------------------------------------------------------------------------
+ */
+
+ private static Category logger = Category.getInstance(CurrentConference.class);
+
+ private static final String ATTR_NAME = "HELPER.CurrentConference";
+ private static final String TOPIC_SORT_HOLDER_ATTR = "conference.topic.TopicSortHolder";
+ private static final String TOPIC_VISIT_ORDER_ATTR = "conference.topic.TopicVisitOrder";
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private RequestInput rinput;
+ private ConferenceContext conf = null;
+ private TopicContext topic = null;
+ private TopicSortHolder topic_sort = null;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public CurrentConference(RequestInput rinput)
+ {
+ this.rinput = rinput;
+ rinput.setRequestAttribute(ATTR_NAME,this);
+ rinput.registerCleanup(this);
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Internal operations
+ *--------------------------------------------------------------------------------
+ */
+
+ private final synchronized void getTopicSortHolder()
+ {
+ if (topic_sort==null)
+ { // look in the session variables first
+ topic_sort = (TopicSortHolder)(rinput.getSessionAttribute(TOPIC_SORT_HOLDER_ATTR));
+ if (topic_sort==null)
+ { // create a new one and save it off
+ topic_sort = new TopicSortHolder();
+ rinput.setSessionAttribute(TOPIC_SORT_HOLDER_ATTR,topic_sort);
+
+ } // end if
+
+ } // end if
+
+ } // end getTopicSortHolder
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface AutoCleanup
+ *--------------------------------------------------------------------------------
+ */
+
+ public void cleanup()
+ {
+ rinput.setRequestAttribute(ATTR_NAME,null);
+ rinput = null;
+ conf = null;
+ topic_sort = null;
+
+ } // end cleanup
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public final ConferenceContext getConferenceParam(String param_name, boolean required, String on_error)
+ throws ErrorBox, LogInOrCreate
+ {
+ CommunityContext comm = rinput.getCommunity(required,on_error);
+ ConferenceContext rc = null;
+
+ if (rinput.hasParameter(param_name))
+ { // get the conference ID
+ int conf_id = rinput.getParameterInt(param_name,-1);
+ if (conf_id<0)
+ { // the ID parameter is not valid!
+ logger.error("Cannot convert conference parameter '" + rinput.getParameter(param_name) + "'!");
+ throw new ErrorBox(null,"Invalid conference parameter.",on_error);
+
+ } // end if
+
+ if (comm==null)
+ throw new ErrorBox(null,"Community context for conference not specified.",on_error);
+
+ try
+ { // get the conference context
+ rc = comm.getConferenceContext(conf_id);
+ if (rc==null)
+ { // couldn't find the conference
+ logger.error("community #" + comm.getCommunityID() + " does not contain conference #" + conf_id);
+ throw new ErrorBox(null,"The conference #" + conf_id + " could not be found in the '"
+ + comm.getName() + "' community.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("found conf #" + rc.getConfID());
+
+ } // end try
+ catch (AccessError ae)
+ { // these all get handled in pretty much the same way
+ if (rinput.getUser().isLoggedIn())
+ throw new ErrorBox("Access Error",ae.getMessage(),on_error);
+ else
+ throw new LogInOrCreate();
+
+ } // 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
+
+ } // end if
+ else
+ { // 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
+
+ if (logger.isDebugEnabled())
+ logger.debug("no conference specified");
+
+ } // end else
+
+ return rc;
+
+ } // end getConferenceParam
+
+ public final ConferenceContext getConference()
+ {
+ return conf;
+
+ } // end getConference
+
+ public final ConferenceContext getConference(boolean required, String on_error)
+ throws ErrorBox, LogInOrCreate
+ {
+ if (conf!=null)
+ return conf;
+
+ // call down to our sub-function
+ conf = getConferenceParam("conf",required,on_error);
+ return conf;
+
+ } // end getConference
+
+ public final TopicContext getTopicParam(String param_name, boolean required, String on_error)
+ throws ErrorBox, LogInOrCreate
+ {
+ ConferenceContext conf = getConference(required,on_error);
+ TopicContext rc = null;
+
+ if (logger.isDebugEnabled())
+ logger.debug("getTopicParam(\"" + param_name + "\"," + required + ",...) entry - param is "
+ + rinput.getParameter(param_name));
+
+ if (rinput.hasParameter(param_name))
+ { // get the topic ID
+ short topic_id = rinput.getParameterShort(param_name,(short)(-1));
+ if (topic_id<0)
+ { // the ID parameter is not valid!
+ logger.error("Cannot convert topic parameter '" + rinput.getParameter(param_name) + "'!");
+ throw new ErrorBox(null,"Invalid topic parameter.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("translated topic parameter: #" + topic_id);
+
+ if (conf==null)
+ throw new ErrorBox(null,"Conference context for topic not specified.",on_error);
+
+ try
+ { // get the topic context
+ rc = conf.getTopic(topic_id);
+ if (rc==null)
+ { // couldn't find the topic
+ logger.error("conference #" + conf.getConfID() + " does not contain topic #" + topic_id);
+ throw new ErrorBox(null,"The topic #" + topic_id + " could not be found in the '"
+ + conf.getName() + "' conference.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("found topic #" + rc.getTopicNumber() + " (" + rc.getTopicID() + ")");
+
+ } // end try
+ catch (AccessError ae)
+ { // these all get handled in pretty much the same way
+ logger.error("caught AccessError: " + ae.getMessage());
+ if (rinput.getUser().isLoggedIn())
+ throw new ErrorBox("Access Error",ae.getMessage(),on_error);
+ else
+ throw new LogInOrCreate();
+
+ } // end catch
+ catch (DataException de)
+ { // error looking up the conference
+ logger.error("caught DataException: " + de.getMessage());
+ throw new ErrorBox("Database Error","Database error finding topic: " + de.getMessage(),on_error);
+
+ } // end catch
+
+ } // end if
+ else
+ { // there's no topic parameter
+ if (required)
+ { // no topic parameter - bail out now!
+ logger.error("Topic parameter not specified!");
+ throw new ErrorBox(null,"No topic specified.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("no topic specified");
+
+ } // end else
+
+ return rc;
+
+ } // end getTopicParam
+
+ public final TopicContext getOptionalTopic(String param_name)
+ {
+ if (conf==null)
+ { // no conference context
+ logger.warn("getOptionalTopic(): no conference context");
+ return null;
+
+ } // end if
+
+ short topic_id = rinput.getParameterShort(param_name,(short)0);
+ if (topic_id<=0)
+ { // the topic parameter is not real valid
+ logger.warn("getOptionalTopic(): invalid topic number");
+ return null;
+
+ } // end if
+
+ TopicContext rc = null;
+ try
+ { // get a topic
+ rc = conf.getTopic(topic_id);
+ if (rc==null)
+ logger.warn("getOptionalTopic(): topic # " + topic_id + " not found");
+
+ } // end try
+ catch (DataException de)
+ { // ignore DataException
+ logger.warn("getOptionalTopic(): DataException getting topic",de);
+ return null;
+
+ } // end catch
+ catch (AccessError ae)
+ { // ignore AccessError
+ logger.warn("getOptionalTopic(): AccessError getting topic",ae);
+ return null;
+
+ } // end catch
+
+ return rc;
+
+ } // end getOptionalTopic
+
+ public final TopicContext getTopic()
+ {
+ return topic;
+
+ } // end getTopic
+
+ public final TopicContext getTopic(boolean required, String on_error) throws ErrorBox, LogInOrCreate
+ {
+ if (topic!=null)
+ return topic;
+
+ // call down to our sub-function
+ topic = getTopicParam("top",required,on_error);
+ return topic;
+
+ } // end getTopic
+
+ public final TopicMessageContext getMessageParam(String param_name, boolean required, String on_error)
+ throws ErrorBox, LogInOrCreate
+ {
+ ConferenceContext conf = getConference(required,on_error);
+ TopicMessageContext rc = null;
+
+ if (rinput.hasParameter(param_name))
+ { // get the message ID
+ long message_id = rinput.getParameterLong(param_name,(long)(-1));
+ if (message_id<0)
+ { // the ID parameter is not valid!
+ logger.error("Cannot convert message parameter '" + rinput.getParameter(param_name) + "'!");
+ throw new ErrorBox(null,"Invalid message parameter.",on_error);
+
+ } // end if
+
+ if (conf==null)
+ throw new ErrorBox(null,"Conference context for message not specified.",on_error);
+
+ try
+ { // get the message by its post ID
+ rc = conf.getMessageByPostID(message_id);
+ if (rc==null)
+ { // couldn't find the topic
+ logger.error("conference #" + conf.getConfID() + " does not contain message #" + message_id);
+ throw new ErrorBox(null,"The message #" + message_id + " could not be found in the '"
+ + conf.getName() + "' conference.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("found message #" + rc.getPostNumber() + " (" + rc.getPostID() + ")");
+
+ } // end try
+ catch (AccessError ae)
+ { // these all get handled in pretty much the same way
+ if (rinput.getUser().isLoggedIn())
+ throw new ErrorBox("Access Error",ae.getMessage(),on_error);
+ else
+ throw new LogInOrCreate();
+
+ } // end catch
+ catch (DataException de)
+ { // error looking up the conference
+ throw new ErrorBox("Database Error","Database error finding message: " + de.getMessage(),on_error);
+
+ } // end catch
+
+ } // end if
+ else
+ { // there's no message parameter
+ if (required)
+ { // no message parameter - bail out now!
+ logger.error("Message parameter not specified!");
+ throw new ErrorBox(null,"No message specified.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("no message specified");
+
+ } // end else
+
+ return rc;
+
+ } // end getMessageParam
+
+ public final TopicMessageContext getTopicMessageParam(String param_name, boolean required, String on_error)
+ throws ErrorBox, LogInOrCreate
+ {
+ TopicContext topic = getTopic(required,on_error);
+ TopicMessageContext rc = null;
+
+ if (rinput.hasParameter(param_name))
+ { // get the post number
+ int post_num = rinput.getParameterInt(param_name,-1);
+ if (post_num<0)
+ { // the post number parameter is not valid!
+ logger.error("Cannot convert message parameter '" + rinput.getParameter(param_name) + "'!");
+ throw new ErrorBox(null,"Invalid message parameter.",on_error);
+
+ } // end if
+
+ if (topic==null)
+ throw new ErrorBox(null,"Topic context for message not specified.",on_error);
+
+ try
+ { // get the appropriate message
+ rc = topic.getMessage(post_num);
+ if (rc==null)
+ { // couldn't find the topic
+ logger.error("topic #" + topic.getTopicID() + " does not contain message #" + post_num);
+ throw new ErrorBox(null,"The message #" + post_num + " could not be found in the '"
+ + topic.getName() + "' topic.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("found message #" + rc.getPostNumber() + " (" + rc.getPostID() + ")");
+
+ } // end try
+ catch (AccessError ae)
+ { // these all get handled in pretty much the same way
+ if (rinput.getUser().isLoggedIn())
+ throw new ErrorBox("Access Error",ae.getMessage(),on_error);
+ else
+ throw new LogInOrCreate();
+
+ } // end catch
+ catch (DataException de)
+ { // error looking up the conference
+ throw new ErrorBox("Database Error","Database error finding message: " + de.getMessage(),on_error);
+
+ } // end catch
+
+ } // end if
+ else
+ { // there's no message parameter
+ if (required)
+ { // no message parameter - bail out now!
+ logger.error("Message parameter not specified!");
+ throw new ErrorBox(null,"No message specified.",on_error);
+
+ } // end if
+
+ if (logger.isDebugEnabled())
+ logger.debug("no message specified");
+
+ } // end else
+
+ return rc;
+
+ } // end getTopicMessageParam
+
+ public final int getViewOption()
+ {
+ if (conf==null)
+ return -1;
+ getTopicSortHolder();
+ return topic_sort.getViewOption(conf.getConfID());
+
+ } // end getViewOption
+
+ public final void setViewOption(int opt)
+ {
+ if (conf==null)
+ return;
+ getTopicSortHolder();
+ topic_sort.setViewOption(conf.getConfID(),opt);
+
+ } // end setViewOption
+
+ public final int getSortOption()
+ {
+ if (conf==null)
+ return -1;
+ getTopicSortHolder();
+ return topic_sort.getSortOption(conf.getConfID());
+
+ } // end getSortOption
+
+ public final void setSortOption(int opt)
+ {
+ if (conf==null)
+ return;
+ getTopicSortHolder();
+ topic_sort.setSortOption(conf.getConfID(),opt);
+
+ } // end setSortOption
+
+ public final TopicVisitOrder getTopicVisitOrder()
+ {
+ if (conf==null)
+ return null;
+ Map map = (Map)(rinput.getSessionAttribute(TOPIC_VISIT_ORDER_ATTR));
+ if (map==null)
+ return null;
+ return (TopicVisitOrder)(map.get(new Integer(conf.getConfID())));
+
+ } // end getTopicVisitOrder
+
+ public final TopicVisitOrder newTopicVisitOrder(List topiclist)
+ {
+ if (conf==null)
+ return null;
+ TopicVisitOrder tvo = new TopicVisitOrder(topiclist);
+ Map map = null;
+ synchronized (this)
+ { // get the map in the session attribute
+ map = (Map)(rinput.getSessionAttribute(TOPIC_VISIT_ORDER_ATTR));
+ if (map==null)
+ { // create new map and save it off
+ map = Collections.synchronizedMap(new HashMap());
+ rinput.setSessionAttribute(TOPIC_VISIT_ORDER_ATTR,map);
+
+ } // end if
+
+ } // end synchronized block
+
+ map.put(new Integer(conf.getConfID()),tvo);
+ return tvo;
+
+ } // end newTopicVisitOrder
+
+ public final PostInterval getPostInterval(String on_error) throws ErrorBox
+ {
+ if (topic==null)
+ return null;
+
+ int first, last;
+
+ if (rinput.hasParameter("pxg"))
+ { // we have a Go box parameter - decode it
+ String foo = rinput.getParameter("pxg");
+ int p = foo.indexOf('-'); // range specifier
+ try
+ { // attempt to parse out two post numbers from here
+ if (p<0)
+ { // only one number specified - make them both equal
+ first = Integer.parseInt(foo.trim());
+ last = first;
+
+ } // end if
+ else if (p==0)
+ { // "-number" is the same as "0-number"
+ last = Integer.parseInt(foo.substring(1).trim());
+ first = 0;
+
+ } // end else if
+ else if (p==(foo.length()-1))
+ { // "number-" is the same as "number-"
+ first = Integer.parseInt(foo.substring(0,p).trim());
+ last = topic.getTotalMessages() - 1;
+
+ } // end else if
+ else
+ { // decode both numbers
+ first = Integer.parseInt(foo.substring(0,p).trim());
+ last = Integer.parseInt(foo.substring(p+1).trim());
+
+ } // end else
+
+ return new PostInterval(first,last); // this will sort them out
+
+ } // end try
+ catch (NumberFormatException nfe)
+ { // if numeric conversion fails, just fall out and try to redisplay the other way
+ } // end catch
+
+ } // end if
+
+ if (rinput.hasParameter("p1"))
+ { // convert the first message parameter and range-test it
+ first = rinput.getParameterInt("p1",-1);
+ if (first<0)
+ first = 0;
+ else if (first>=topic.getTotalMessages())
+ first = topic.getTotalMessages() - 1;
+
+ // get and range-check the second parameter (if it's there)
+ last = rinput.getParameterInt("p2",first);
+ if ((last<0) || (last>=topic.getTotalMessages()))
+ last = topic.getTotalMessages() - 1;
+
+ } // end if
+ else
+ { // no range specified - cook up a default
+ last = topic.getTotalMessages();
+ int unread = topic.getUnreadMessages();
+ if ((unread==0) || (unread>=rinput.getEngine().getNumPostsPerPage()))
+ first = last - rinput.getEngine().getNumPostsPerPage();
+ else
+ first = last - (unread + rinput.getEngine().getNumOldPostsBeforeNew());
+ last--;
+
+ } // end else
+
+ return new PostInterval(first,last); // all done!
+
+ } // end getPostInterval
+
+ /*--------------------------------------------------------------------------------
+ * External static operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public static final CurrentConference get(RequestInput ri)
+ {
+ CurrentConference cc = (CurrentConference)(ri.getRequestAttribute(ATTR_NAME));
+ if (cc==null)
+ cc = new CurrentConference(ri);
+ return cc;
+
+ } // end get
+
+ public static final CurrentConference get(ServletRequest sreq) throws ServletException
+ {
+ Object obj = sreq.getAttribute(RequestImpl.REQUEST_ATTRIBUTE_STEM + ATTR_NAME);
+ if (obj==null)
+ throw new ServletException("CurrentConference.get: unable to get request content");
+ if (obj instanceof CurrentConference)
+ return (CurrentConference)obj;
+ throw new ServletException("CurrentConference.get: request content is not a CurrentConference object");
+
+ } // end get
+
+} // end class CurrentConference
diff --git a/src/com/silverwrist/venice/ui/conf/PostInterval.java b/src/com/silverwrist/venice/ui/conf/PostInterval.java
new file mode 100644
index 0000000..8184e6a
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/PostInterval.java
@@ -0,0 +1,59 @@
+/*
+ * 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.ui.conf;
+
+public class PostInterval
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private int first;
+ private int last;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ PostInterval(int a, int b)
+ {
+ first = (a=0)
return unread[ndx_next];
@@ -144,14 +79,15 @@ public class TopicVisitOrder
} // end isNext
- public void visit(short topnum)
+ public final void visit(short topnum)
{
if (ndx_next<0)
return;
+ int i;
if (topics[ndx_next]!=topnum)
{ // go searching for the matching topic number
- for (int i=0; i.
+ *
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+
+public class ConferenceCanAddToHotlistTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ return (conf.canAddToHotlist() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanAddToHotlistTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanCreateTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanCreateTag.java
new file mode 100644
index 0000000..69f3bd5
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanCreateTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceCanCreateTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ CommunityContext comm = getRequestInput().getCommunity();
+ if (comm==null)
+ throw new JspTagException(" tag - community not defined!");
+
+ return (comm.canCreateConference() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanCreateTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanManageTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanManageTag.java
new file mode 100644
index 0000000..4a1cb5e
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanManageTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceCanManageTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ CommunityContext comm = getRequestInput().getCommunity();
+ if (comm==null)
+ throw new JspTagException(" tag - community not defined!");
+
+ return (comm.canManageConferences() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanManageTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanPostTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanPostTag.java
new file mode 100644
index 0000000..7d01327
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanPostTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceCanPostTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ return (conf.canPostToConference() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanPostTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanReadNewTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanReadNewTag.java
new file mode 100644
index 0000000..8a638ea
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanReadNewTag.java
@@ -0,0 +1,46 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+
+public class ConferenceCanReadNewTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ CurrentConference currc = getCC();
+ if (currc==null)
+ throw new JspTagException(" tag - conference not defined!");
+ TopicVisitOrder tvo = currc.getTopicVisitOrder();
+ if (tvo==null)
+ return SKIP_BODY;
+
+ return (tvo.isNext() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanReadNewTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanSendInviteTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanSendInviteTag.java
new file mode 100644
index 0000000..62e2f11
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceCanSendInviteTag.java
@@ -0,0 +1,43 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+
+public class ConferenceCanSendInviteTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ return (conf.canSendInvitation() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class ConferenceCanSendInviteTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceDefaultPseudTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceDefaultPseudTag.java
new file mode 100644
index 0000000..5d2d1fd
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceDefaultPseudTag.java
@@ -0,0 +1,56 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceDefaultPseudTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(conf.getDefaultPseud());
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing conference default pseud - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class ConferenceDefaultPseudTag
+
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceIDTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceIDTag.java
new file mode 100644
index 0000000..4e055df
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceIDTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceIDTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(String.valueOf(conf.getConfID()));
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing conference ID - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class ConferenceIDTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/ConferenceNameTag.java b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceNameTag.java
new file mode 100644
index 0000000..592c081
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/ConferenceNameTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class ConferenceNameTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(conf.getName());
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing conference name - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class ConferenceNameTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostAttachTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostAttachTag.java
new file mode 100644
index 0000000..1ba682a
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostAttachTag.java
@@ -0,0 +1,77 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostAttachTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String name = null;
+ private String value = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (name==null)
+ throw new JspTagException(" name= attribute not specified!");
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.setAttach(name,(value!=null));
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+ public void release()
+ {
+ super.release();
+ name = null;
+ value = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setName(String v)
+ {
+ name = v;
+
+ } // end setName
+
+ public void setValue(String v)
+ {
+ value = v;
+
+ } // end setValue
+
+} // end class PostAttachTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostBoxTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostBoxTag.java
new file mode 100644
index 0000000..cdf53c4
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostBoxTag.java
@@ -0,0 +1,248 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import java.util.*;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostBoxTag extends VeniceConfBodyTagSupport implements ColorSelectors
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String action = null;
+ private String type = "servlet";
+ private int real_type = -1;
+ private HashMap params = new HashMap();
+ private String newtopic_name = null;
+ private String newtopic_value = null;
+ private String pseud_name = null;
+ private String pseud_value = null;
+ private String attach_name = null;
+ private boolean attach_value = false;
+ private String text_name = null;
+ private String text_value = null;
+ private ArrayList buttons = new ArrayList();
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (action==null)
+ throw new JspTagException(" action= attribute not specified!");
+ real_type = getRequestInput().convertLinkType(type);
+ if (real_type<0)
+ throw new JspTagException(" type= attribute not a valid link type");
+ return EVAL_BODY_TAG;
+
+ } // end doStartTag
+
+ public int doAfterBody()
+ {
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+ public int doEndTag() throws JspException
+ {
+ if (pseud_name==null)
+ throw new JspTagException(" tag has no tag inside it!");
+ if (attach_name==null)
+ throw new JspTagException(" tag has no tag inside it!");
+ if (text_name==null)
+ throw new JspTagException(" tag has no tag inside it!");
+ if (buttons.isEmpty())
+ throw new JspTagException(" tag has no tags inside it!");
+ RequestOutput ro = getRequestOutput();
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write("\n");
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing post box - " + e.getMessage());
+
+ } // end catch
+
+ return EVAL_PAGE;
+
+ } // end doEndTag
+
+ public void release()
+ {
+ super.release();
+ action = null;
+ type = "servlet";
+ real_type = -1;
+ params.clear();
+ pseud_name = null;
+ pseud_value = null;
+ attach_name = null;
+ attach_value = false;
+ text_name = null;
+ text_value = null;
+ buttons.clear();
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setAction(String v)
+ {
+ action = v;
+
+ } // end setAction
+
+ public void setType(String v)
+ {
+ type = v;
+
+ } // end setType
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ final void addParam(String name, String value)
+ {
+ params.put(name,value);
+
+ } // end addParam
+
+ final void setNewTopic(String param_name, String value) throws JspException
+ {
+ if (newtopic_name!=null)
+ throw new JspTagException(" may only appear once inside a !");
+ if (param_name==null)
+ throw new JspTagException(" parameter name not specified!");
+ newtopic_name = param_name;
+ newtopic_value = value;
+
+ } // end setNewTopic
+
+ final void setPseud(String param_name, String value) throws JspException
+ {
+ if (pseud_name!=null)
+ throw new JspTagException(" may only appear once inside a !");
+ if (param_name==null)
+ throw new JspTagException(" parameter name not specified!");
+ pseud_name = param_name;
+ pseud_value = value;
+
+ } // end setPseud
+
+ final void setAttach(String param_name, boolean value) throws JspException
+ {
+ if (attach_name!=null)
+ throw new JspTagException(" may only appear once inside a !");
+ if (param_name==null)
+ throw new JspTagException(" parameter name not specified!");
+ attach_name = param_name;
+ attach_value = value;
+
+ } // end setAttach
+
+ final void setText(String param_name, String value) throws JspException
+ {
+ if (text_name!=null)
+ throw new JspTagException(" may only appear once inside a !");
+ if (param_name==null)
+ throw new JspTagException(" parameter name not specified!");
+ text_name = param_name;
+ text_value = value;
+
+ } // end setText
+
+ final void addButton(String id)
+ {
+ buttons.add(id);
+
+ } // end addButton
+
+} // end class PostBoxTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostButtonTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostButtonTag.java
new file mode 100644
index 0000000..0c6b454
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostButtonTag.java
@@ -0,0 +1,69 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostButtonTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String id = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (id==null)
+ throw new JspTagException(" id= attribute not specified!");
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.addButton(id);
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+ public void release()
+ {
+ super.release();
+ id = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setId(String v)
+ {
+ id = v;
+
+ } // end setName
+
+} // end class PostPseudTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostNewTopicTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostNewTopicTag.java
new file mode 100644
index 0000000..cc45a25
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostNewTopicTag.java
@@ -0,0 +1,75 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostNewTopicTag extends VeniceConfBodyTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String name = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (name==null)
+ throw new JspTagException(" name= attribute not specified!");
+ return EVAL_BODY_TAG;
+
+ } // end doStartTag
+
+ public int doAfterBody() throws JspException
+ {
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.setNewTopic(name,getBodyContent().getString());
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+ public void release()
+ {
+ super.release();
+ name = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setName(String v)
+ {
+ name = v;
+
+ } // end setName
+
+} // end class PostNewTopicTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostParamTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostParamTag.java
new file mode 100644
index 0000000..3453dcb
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostParamTag.java
@@ -0,0 +1,75 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostParamTag extends VeniceConfBodyTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String name = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (name==null)
+ throw new JspTagException(" name= attribute not specified!");
+ return EVAL_BODY_TAG;
+
+ } // end doStartTag
+
+ public int doAfterBody() throws JspException
+ {
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.addParam(name,getBodyContent().getString());
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+ public void release()
+ {
+ super.release();
+ name = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setName(String v)
+ {
+ name = v;
+
+ } // end setName
+
+} // end class PostParamTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostPseudTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostPseudTag.java
new file mode 100644
index 0000000..7f0552e
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostPseudTag.java
@@ -0,0 +1,75 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostPseudTag extends VeniceConfBodyTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String name = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (name==null)
+ throw new JspTagException(" name= attribute not specified!");
+ return EVAL_BODY_TAG;
+
+ } // end doStartTag
+
+ public int doAfterBody() throws JspException
+ {
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.setPseud(name,getBodyContent().getString());
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+ public void release()
+ {
+ super.release();
+ name = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setName(String v)
+ {
+ name = v;
+
+ } // end setName
+
+} // end class PostPseudTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostRewriteTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostRewriteTag.java
new file mode 100644
index 0000000..fdac45a
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostRewriteTag.java
@@ -0,0 +1,153 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.db.PostLinkRewriter;
+import com.silverwrist.venice.db.UserNameRewriter;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.util.IDUtils;
+
+public class PostRewriteTag extends VeniceConfBodyTagSupport implements LinkTypes
+{
+ /*--------------------------------------------------------------------------------
+ * Internal operations
+ *--------------------------------------------------------------------------------
+ */
+
+ private static void output(BodyContent body, String data) throws JspException
+ {
+ try
+ { // write the escaped information
+ JspWriter out = body.getEnclosingWriter();
+ out.write(data);
+
+ } // end try
+ catch (IOException e)
+ { // translate output exception
+ throw new JspTagException("IO error writing rewritten post data: " + e.getMessage());
+
+ } // end catch
+
+ } // end output
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doAfterBody() throws JspException
+ {
+ BodyContent body = getBodyContent();
+ String data = body.getString();
+
+ if ((data.indexOf(PostLinkRewriter.URI_PREFIX)<0) && (data.indexOf(UserNameRewriter.URI_PREFIX)<0))
+ { // no post links or user links in here - output what we've got and call it
+ output(body,data);
+ return SKIP_BODY;
+
+ } // end if
+
+ StringBuffer buf = new StringBuffer();
+ RequestInput ri = getRequestInput();
+ String t;
+ int p;
+
+ if (data.indexOf(PostLinkRewriter.URI_PREFIX)>=0)
+ { // begin replacing the post links with real post links
+ t = data;
+ p = t.indexOf(PostLinkRewriter.URI_PREFIX);
+ while (p>=0)
+ { // break off the start of the string and append it
+ if (p>0)
+ buf.append(t.substring(0,p));
+ t = t.substring(p + PostLinkRewriter.URI_PREFIX.length());
+
+ // find the end of the post link...
+ p = 0;
+ while (IDUtils.isValidPostLinkChar(t.charAt(p)))
+ p++;
+
+ if (p>0)
+ { // append the post link to the "go" servlet path, and encode the lot
+ buf.append(ri.formatURL("go/" + t.substring(0,p),SERVLET));
+ t = t.substring(p);
+
+ } // end if
+ else // false alarm
+ buf.append(PostLinkRewriter.URI_PREFIX);
+
+ // and now look again...
+ p = t.indexOf(PostLinkRewriter.URI_PREFIX);
+
+ } // end while
+
+ // append the rest of the string and clean up
+ buf.append(t);
+ data = buf.toString();
+ buf.setLength(0);
+
+ } // end if
+ // else there were no post links, just leave "data" the way it is
+
+ if (data.indexOf(PostLinkRewriter.URI_PREFIX)<0)
+ { // no user links in here - output what we've got and call it
+ output(body,data);
+ return SKIP_BODY;
+
+ } // end if
+
+ // begin replacing the user links with real user links
+ t = data;
+ p = t.indexOf(PostLinkRewriter.URI_PREFIX);
+ while (p>=0)
+ { // break off the start of the string and append it
+ if (p>0)
+ buf.append(t.substring(0,p));
+ t = t.substring(p + UserNameRewriter.URI_PREFIX.length());
+
+ // find the end of the user link...
+ p = 0;
+ while (IDUtils.isValidVeniceIDChar(t.charAt(p)))
+ p++;
+
+ if (p>0)
+ { // append the post link to the "user" servlet path, and encode the lot
+ buf.append(ri.formatURL("user/" + t.substring(0,p),SERVLET));
+ t = t.substring(p);
+
+ } // end if
+ else // false alarm
+ buf.append(UserNameRewriter.URI_PREFIX);
+
+ // and now look again...
+ p = t.indexOf(UserNameRewriter.URI_PREFIX);
+
+ } // end while
+
+ // Clean up and return the resulting output.
+ buf.append(t);
+ output(body,buf.toString());
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+} // end class PostRewriteTag
+
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/PostTextTag.java b/src/com/silverwrist/venice/ui/conf/jsp/PostTextTag.java
new file mode 100644
index 0000000..7dc9293
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/PostTextTag.java
@@ -0,0 +1,75 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.ui.*;
+
+public class PostTextTag extends VeniceConfBodyTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String name = null;
+
+ /*--------------------------------------------------------------------------------
+ * Overrides from class BodyTagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ if (name==null)
+ throw new JspTagException(" name= attribute not specified!");
+ return EVAL_BODY_TAG;
+
+ } // end doStartTag
+
+ public int doAfterBody() throws JspException
+ {
+ PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
+ if (postbox==null)
+ throw new JspTagException(" tag must be within a tag!");
+ postbox.setText(name,getBodyContent().getString());
+ return SKIP_BODY;
+
+ } // end doAfterBody
+
+ public void release()
+ {
+ super.release();
+ name = null;
+
+ } // end release
+
+ /*--------------------------------------------------------------------------------
+ * Attribute set functions
+ *--------------------------------------------------------------------------------
+ */
+
+ public void setName(String v)
+ {
+ name = v;
+
+ } // end setName
+
+} // end class PostTextTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanArchiveTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanArchiveTag.java
new file mode 100644
index 0000000..f609011
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanArchiveTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanArchiveTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.canArchive() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanArchiveTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanCreateTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanCreateTag.java
new file mode 100644
index 0000000..986516f
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanCreateTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanCreateTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ ConferenceContext conf = getConference();
+ if (conf==null)
+ throw new JspTagException(" tag - conference not defined!");
+
+ return (conf.canCreateTopic() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanCreateTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanDeleteTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanDeleteTag.java
new file mode 100644
index 0000000..149d8f6
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanDeleteTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanDeleteTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.canDelete() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanDeleteTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanFreezeTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanFreezeTag.java
new file mode 100644
index 0000000..a714983
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanFreezeTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanFreezeTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.canFreeze() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanFreezeTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanPostTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanPostTag.java
new file mode 100644
index 0000000..3bae6ac
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanPostTag.java
@@ -0,0 +1,47 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanPostTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+ ConferenceContext conf = getConference(); // if topic is non-null, conference is, too
+
+ boolean flag1 = conf.canPostToConference();
+ boolean flag2 = (topic.isFrozen() ? topic.canFreeze() : true);
+ boolean flag3 = (topic.isArchived() ? topic.canArchive() : true);
+
+ return ((flag1 && flag2 && flag3) ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanPostTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicCanSendInvitationTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanSendInvitationTag.java
new file mode 100644
index 0000000..b89bef4
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicCanSendInvitationTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicCanSendInvitationTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.canSendInvitation() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicCanSendInvitationTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIDTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIDTag.java
new file mode 100644
index 0000000..6255213
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIDTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIDTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(String.valueOf(topic.getTopicID()));
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing topic ID - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class TopicIDTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsArchivedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsArchivedTag.java
new file mode 100644
index 0000000..eec08d7
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsArchivedTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsArchivedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isArchived() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicIsArchivedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsFrozenTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsFrozenTag.java
new file mode 100644
index 0000000..a79224b
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsFrozenTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsFrozenTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isFrozen() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicIsFrozenTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsHiddenTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsHiddenTag.java
new file mode 100644
index 0000000..83ccedd
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsHiddenTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsHiddenTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isHidden() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicIsHiddenTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotArchivedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotArchivedTag.java
new file mode 100644
index 0000000..fe31192
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotArchivedTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsNotArchivedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isArchived() ? SKIP_BODY : EVAL_BODY_INCLUDE);
+
+ } // end doStartTag
+
+} // end class TopicIsNotArchivedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotFrozenTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotFrozenTag.java
new file mode 100644
index 0000000..83ab9af
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotFrozenTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsNotFrozenTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isFrozen() ? SKIP_BODY : EVAL_BODY_INCLUDE);
+
+ } // end doStartTag
+
+} // end class TopicIsNotFrozenTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotHiddenTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotHiddenTag.java
new file mode 100644
index 0000000..7527143
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicIsNotHiddenTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicIsNotHiddenTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isHidden() ? SKIP_BODY : EVAL_BODY_INCLUDE);
+
+ } // end doStartTag
+
+} // end class TopicIsNotHiddenTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicLastMessageTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicLastMessageTag.java
new file mode 100644
index 0000000..547f712
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicLastMessageTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicLastMessageTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(String.valueOf(topic.getTotalMessages() - 1));
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing topic message index - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class TopicLastMessageTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicNameTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicNameTag.java
new file mode 100644
index 0000000..9404fec
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicNameTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicNameTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(topic.getName());
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing topic name - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class TopicNameTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSpecifiedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSpecifiedTag.java
new file mode 100644
index 0000000..7dad274
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSpecifiedTag.java
@@ -0,0 +1,39 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicNotSpecifiedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ return ((topic==null) ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicNotSpecifiedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSubscribedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSubscribedTag.java
new file mode 100644
index 0000000..cd2c81f
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicNotSubscribedTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicNotSubscribedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isSubscribed() ? SKIP_BODY : EVAL_BODY_INCLUDE);
+
+ } // end doStartTag
+
+} // end class TopicNotSubscribedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicNumberTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicNumberTag.java
new file mode 100644
index 0000000..5177d97
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicNumberTag.java
@@ -0,0 +1,55 @@
+/*
+ * 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.ui.conf.jsp;
+
+import java.io.IOException;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicNumberTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ try
+ { // write out what we came here to accomplish
+ JspWriter out = pageContext.getOut();
+ out.write(String.valueOf(topic.getTopicNumber()));
+
+ } // end try
+ catch (IOException e)
+ { // convert the I/O error into something the servlet engine can deal with
+ throw new JspTagException("error writing topic number - " + e.getMessage());
+
+ } // end catch
+
+ return SKIP_BODY;
+
+ } // end doStartTag
+
+} // end class TopicNumberTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicSpecifiedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicSpecifiedTag.java
new file mode 100644
index 0000000..945d1e4
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicSpecifiedTag.java
@@ -0,0 +1,39 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicSpecifiedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ return ((topic!=null) ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicSpecifiedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/TopicSubscribedTag.java b/src/com/silverwrist/venice/ui/conf/jsp/TopicSubscribedTag.java
new file mode 100644
index 0000000..c248efc
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/TopicSubscribedTag.java
@@ -0,0 +1,42 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+
+public class TopicSubscribedTag extends VeniceConfTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Overrides from class TagSupport
+ *--------------------------------------------------------------------------------
+ */
+
+ public int doStartTag() throws JspException
+ {
+ TopicContext topic = getTopic();
+ if (topic==null)
+ throw new JspTagException(" tag - topic not defined!");
+
+ return (topic.isSubscribed() ? EVAL_BODY_INCLUDE : SKIP_BODY);
+
+ } // end doStartTag
+
+} // end class TopicSubscribedTag
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfBodyTagSupport.java b/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfBodyTagSupport.java
new file mode 100644
index 0000000..8444a8f
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfBodyTagSupport.java
@@ -0,0 +1,62 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.*;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+import com.silverwrist.venice.ui.jsp.VeniceBodyTagSupport;
+
+public class VeniceConfBodyTagSupport extends VeniceBodyTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Internal operations
+ *--------------------------------------------------------------------------------
+ */
+
+ protected final CurrentConference getCC() throws JspException
+ {
+ try
+ { // call through and get it
+ return CurrentConference.get(pageContext.getRequest());
+
+ } // end try
+ catch (ServletException e)
+ { // convert the exception type
+ throw new JspTagException(e.getMessage());
+
+ } // end catch
+
+ } // end getCC
+
+ protected final ConferenceContext getConference() throws JspException
+ {
+ return getCC().getConference();
+
+ } // end getConference
+
+ protected final TopicContext getTopic() throws JspException
+ {
+ return getCC().getTopic();
+
+ } // end getTopic
+
+} // end class VeniceConfBodyTagSupport
diff --git a/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfTagSupport.java b/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfTagSupport.java
new file mode 100644
index 0000000..d927e26
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/jsp/VeniceConfTagSupport.java
@@ -0,0 +1,62 @@
+/*
+ * 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.ui.conf.jsp;
+
+import javax.servlet.*;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+import com.silverwrist.venice.ui.jsp.VeniceTagSupport;
+
+public class VeniceConfTagSupport extends VeniceTagSupport
+{
+ /*--------------------------------------------------------------------------------
+ * Internal operations
+ *--------------------------------------------------------------------------------
+ */
+
+ protected final CurrentConference getCC() throws JspException
+ {
+ try
+ { // call through and get it
+ return CurrentConference.get(pageContext.getRequest());
+
+ } // end try
+ catch (ServletException e)
+ { // convert the exception type
+ throw new JspTagException(e.getMessage());
+
+ } // end catch
+
+ } // end getCC
+
+ protected final ConferenceContext getConference() throws JspException
+ {
+ return getCC().getConference();
+
+ } // end getConference
+
+ protected final TopicContext getTopic() throws JspException
+ {
+ return getCC().getTopic();
+
+ } // end getTopic
+
+} // end class VeniceConfTagSupport
diff --git a/src/com/silverwrist/venice/ui/conf/view/ConfMemberView.java b/src/com/silverwrist/venice/ui/conf/view/ConfMemberView.java
new file mode 100644
index 0000000..7b3dd21
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/view/ConfMemberView.java
@@ -0,0 +1,248 @@
+/*
+ * 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.ui.conf.view;
+
+import java.util.*;
+import javax.servlet.*;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.security.Role;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.servlet.RequestImpl;
+
+public class ConfMemberView implements ContentJSP
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private int max_results; // the maximum number of results displayed
+ private List role_list; // the list of possible roles
+ private String conference_name; // the current conference name
+ private boolean simple = true; // is this a simple listing or not?
+ private RequestInput rinput = null; // the RequestInput (during execution)
+ private int field = -1; // search field indicator
+ private int mode = -1; // search mode indicator
+ private String term = ""; // current search term
+ private List results = null; // the search results
+ private int offset = 0; // offset in list of results
+ private int find_count = -1; // total count of things found
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public ConfMemberView(int max_results, ConferenceContext conf)
+ {
+ this.max_results = max_results;
+ this.conference_name = conf.getName();
+ SecurityInfo sinf = conf.getSecurityInfo();
+ this.role_list = sinf.getRoleList("Conference.UserLevels");
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface Content
+ *--------------------------------------------------------------------------------
+ */
+
+ public boolean needFrame()
+ {
+ return true;
+
+ } // end needFrame
+
+ public int getMenuSelector()
+ {
+ return MENU_SELECTOR_COMMUNITY;
+
+ } // end getMenuSelector
+
+ public String getPageTitle(RequestOutput ro)
+ {
+ return "Membership in Conference " + conference_name;
+
+ } // end getPageTitle
+
+ public String getPageQID()
+ {
+ return null;
+
+ } // end getPageQID
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface ContentJSP
+ *--------------------------------------------------------------------------------
+ */
+
+ public String getJSPName()
+ {
+ return "conf/membership.jsp";
+
+ } // end getJSPName
+
+ public void initialize(RequestInput req)
+ {
+ rinput = req;
+
+ } // end initialize
+
+ public void terminate(RequestInput req)
+ {
+ rinput = null;
+
+ } // end terminate
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public final int getMaxResults()
+ {
+ return max_results;
+
+ } // end getMaxResults
+
+ public final List getRoleList()
+ {
+ return role_list;
+
+ } // end getRoleList
+
+ public final String getConferenceName()
+ {
+ return conference_name;
+
+ } // end getConferenceName
+
+ public final boolean getSimple()
+ {
+ return simple;
+
+ } // end getSimple
+
+ public final void setSimple(boolean b)
+ {
+ simple = b;
+
+ } // end setSimple
+
+ public final int getField()
+ {
+ return field;
+
+ } // end getField
+
+ public final void setField(int v)
+ {
+ field = v;
+
+ } // end setField
+
+ public final boolean testField(int v)
+ {
+ return (field==v);
+
+ } // end testField
+
+ public final int getMode()
+ {
+ return mode;
+
+ } // end getMode
+
+ public final void setMode(int v)
+ {
+ mode = v;
+
+ } // end setMode
+
+ public final boolean testMode(int v)
+ {
+ return (mode==v);
+
+ } // end testMode
+
+ public final String getTerm()
+ {
+ return term;
+
+ } // end getTerm
+
+ public final void setTerm(String v)
+ {
+ term = v;
+
+ } // end setTerm
+
+ public final List getResults()
+ {
+ return results;
+
+ } // end getResults
+
+ public final void setResults(List v)
+ {
+ results = v;
+
+ } // end setResults
+
+ public final int getOffset()
+ {
+ return offset;
+
+ } // end getOffset
+
+ public final void setOffset(int v)
+ {
+ offset = v;
+
+ } // end setOffset
+
+ public final int getFindCount()
+ {
+ return find_count;
+
+ } // end getFindCount
+
+ public final void setFindCount(int v)
+ {
+ find_count = v;
+
+ } // end setFindCount
+
+ /*--------------------------------------------------------------------------------
+ * External static operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public static final ConfMemberView get(ServletRequest sreq) throws ServletException
+ {
+ Object obj = sreq.getAttribute(RequestImpl.REQUEST_CONTENT);
+ if (obj==null)
+ throw new ServletException("ConfMemberView.get: unable to get request content");
+ if (obj instanceof ConfMemberView)
+ return (ConfMemberView)obj;
+ throw new ServletException("ConfMemberView.get: request content is not a ConfMemberView object");
+
+ } // end get
+
+} // end class ConfMemberView
diff --git a/src/com/silverwrist/venice/ui/conf/view/FindPostView.java b/src/com/silverwrist/venice/ui/conf/view/FindPostView.java
new file mode 100644
index 0000000..07e29e7
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/view/FindPostView.java
@@ -0,0 +1,199 @@
+/*
+ * 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.ui.conf.view;
+
+import java.util.*;
+import javax.servlet.*;
+import org.apache.log4j.*;
+import com.silverwrist.util.StringUtil;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+import com.silverwrist.venice.ui.servlet.RequestImpl;
+
+public class FindPostView implements ContentJSP
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private RequestInput rinput = null;
+ private CommunityContext comm;
+ private ConferenceContext conf;
+ private TopicContext topic;
+ private String term = "";
+ private int offset = 0;
+ private int find_count = 0;
+ private List results = null;
+ private int max_results = 0;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public FindPostView(CommunityContext comm, ConferenceContext conf, TopicContext topic)
+ {
+ this.comm = comm;
+ this.conf = conf;
+ this.topic = topic;
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface Content
+ *--------------------------------------------------------------------------------
+ */
+
+ public boolean needFrame()
+ {
+ return true;
+
+ } // end needFrame
+
+ public int getMenuSelector()
+ {
+ return MENU_SELECTOR_COMMUNITY;
+
+ } // end getMenuSelector
+
+ public String getPageTitle(RequestOutput ro)
+ {
+ return "Find Posts";
+
+ } // end getPageTitle
+
+ public String getPageQID()
+ {
+ return null;
+
+ } // end getPageQID
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface ContentJSP
+ *--------------------------------------------------------------------------------
+ */
+
+ public String getJSPName()
+ {
+ return "conf/find.jsp";
+
+ } // end getJSPName
+
+ public void initialize(RequestInput req)
+ {
+ rinput = req;
+
+ } // end initialize
+
+ public void terminate(RequestInput req)
+ {
+ rinput = null;
+
+ } // end terminate
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public final String getTerm()
+ {
+ return term;
+
+ } // end getTerm
+
+ public final void setTerm(String s)
+ {
+ term = s;
+
+ } // end setTerm
+
+ public final int getOffset()
+ {
+ return offset;
+
+ } // end getOffset
+
+ public final void setOffset(int v)
+ {
+ offset = v;
+
+ } // end setOffset
+
+ public final int getFindCount()
+ {
+ return find_count;
+
+ } // end getFindCount
+
+ public final void setFindCount(int v)
+ {
+ find_count = v;
+
+ } // end setFindCount
+
+ public final List getResults()
+ {
+ return results;
+
+ } // end getResults
+
+ public final void setResults(List l)
+ {
+ results = l;
+
+ } // end setResults
+
+ public final int getMaxResults()
+ {
+ return max_results;
+
+ } // end getMaxResults
+
+ public final void setMaxResults(int v)
+ {
+ max_results = v;
+
+ } // end setMaxResults
+
+ public final String formatDate(Date date)
+ {
+ return ((rinput==null) ? null : rinput.formatDate(date));
+
+ } // end formatDate
+
+ /*--------------------------------------------------------------------------------
+ * External static operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public static final FindPostView get(ServletRequest sreq) throws ServletException
+ {
+ Object obj = sreq.getAttribute(RequestImpl.REQUEST_CONTENT);
+ if (obj==null)
+ throw new ServletException("FindPostView.get: unable to get request content");
+ if (obj instanceof FindPostView)
+ return (FindPostView)obj;
+ throw new ServletException("FindPostView.get: request content is not a FindPostView object");
+
+ } // end get
+
+} // end class FindPostView
diff --git a/src/com/silverwrist/venice/ui/conf/view/PostsView.java b/src/com/silverwrist/venice/ui/conf/view/PostsView.java
new file mode 100644
index 0000000..655b919
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/conf/view/PostsView.java
@@ -0,0 +1,503 @@
+/*
+ * 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.ui.conf.view;
+
+import java.awt.Dimension;
+import java.util.*;
+import javax.servlet.*;
+import org.apache.log4j.*;
+import com.silverwrist.util.StringUtil;
+import com.silverwrist.venice.core.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.conf.*;
+import com.silverwrist.venice.ui.servlet.RequestImpl;
+
+public class PostsView implements ContentJSP
+{
+ /*--------------------------------------------------------------------------------
+ * Static data members
+ *--------------------------------------------------------------------------------
+ */
+
+ private static Category logger = Category.getInstance(PostsView.class);
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private CommunityContext comm;
+ private ConferenceContext conf;
+ private TopicContext topic;
+ private String qid = null;
+ private int first = 0;
+ private int last;
+ private int unread;
+ private boolean show_advanced = false;
+ private boolean no_bozos = false;
+ private RequestInput rinput = null;
+ private List messages = Collections.EMPTY_LIST;
+ private TopicVisitOrder tvo = null;
+ private String topic_stem = "";
+ private String top_custom = "";
+ private String bottom_custom = "";
+ private Dimension photo_dims = null;
+ private Map photo_map = null;
+ private Set bozo_uids = new HashSet();
+ private String title = "";
+ private String subtitle = "";
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public PostsView(CommunityContext comm, CurrentConference currc)
+ {
+ this.comm = comm;
+ this.conf = currc.getConference();
+ this.topic = currc.getTopic();
+ this.last = this.topic.getTotalMessages() - 1;
+ this.unread = this.topic.getUnreadMessages();
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface Content
+ *--------------------------------------------------------------------------------
+ */
+
+ public boolean needFrame()
+ {
+ return true;
+
+ } // end needFrame
+
+ public int getMenuSelector()
+ {
+ return MENU_SELECTOR_COMMUNITY;
+
+ } // end getMenuSelector
+
+ public String getPageTitle(RequestOutput ro)
+ {
+ return title + ": " + subtitle;
+
+ } // end getPageTitle
+
+ public String getPageQID()
+ {
+ return qid;
+
+ } // end getPageQID
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface ContentJSP
+ *--------------------------------------------------------------------------------
+ */
+
+ public String getJSPName()
+ {
+ return "conf/posts.jsp";
+
+ } // end getJSPName
+
+ public void initialize(RequestInput req)
+ {
+ rinput = req;
+
+ } // end initialize
+
+ public void terminate(RequestInput req)
+ {
+ rinput = null;
+
+ } // end terminate
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public final CommunityContext getCommunity()
+ {
+ return comm;
+
+ } // end getCommunity
+
+ public final ConferenceContext getConference()
+ {
+ return conf;
+
+ } // end getConference
+
+ public final TopicContext getTopic()
+ {
+ return topic;
+
+ } // end getTopic
+
+ public final void setPageQID(String v)
+ {
+ if (rinput==null)
+ qid = v;
+
+ } // end setPageQID
+
+ public final int getFirst()
+ {
+ return first;
+
+ } // end getFirst
+
+ public final void setFirst(int v)
+ {
+ if (rinput==null)
+ first = v;
+
+ } // end setFirst
+
+ public final int getLast()
+ {
+ return last;
+
+ } // end getLast
+
+ public final void setLast(int v)
+ {
+ if (rinput==null)
+ last = v;
+
+ } // end setLast
+
+ public final int getUnread()
+ {
+ return unread;
+
+ } // end getUnread
+
+ public final void setUnread(int v)
+ {
+ if (rinput==null)
+ unread = v;
+
+ } // end setUnread
+
+ public final boolean getShowAdvanced()
+ {
+ return show_advanced;
+
+ } // end getShowAdvanced
+
+ public final void setShowAdvanced(boolean v)
+ {
+ if (rinput==null)
+ show_advanced = v;
+
+ } // end setShowAdvanced
+
+ public final boolean getNoBozos()
+ {
+ return no_bozos;
+
+ } // end getNoBozos
+
+ public final void setNoBozos(boolean v)
+ {
+ if (rinput==null)
+ no_bozos = v;
+
+ } // end setNoBozos
+
+ public final List getMessages()
+ {
+ return messages;
+
+ } // end getMessages
+
+ public final void setMessages(List v)
+ {
+ if (rinput==null)
+ messages = v;
+
+ } // end setMessages
+
+ public final TopicVisitOrder getTopicVisitOrder()
+ {
+ return tvo;
+
+ } // end getTopicVisitOrder
+
+ public final void setTopicVisitOrder(TopicVisitOrder v)
+ {
+ if (rinput==null)
+ tvo = v;
+
+ } // end setTopicVisitOrder
+
+ public final String getTopicStem()
+ {
+ return topic_stem;
+
+ } // end getTopicStem
+
+ public final void setTopicStem(String v)
+ {
+ if (rinput==null)
+ topic_stem = v;
+
+ } // end setTopicStem
+
+ public final String getTopCustom()
+ {
+ return top_custom;
+
+ } // end getTopCustom
+
+ public final void setTopCustom(String v)
+ {
+ if (rinput==null)
+ top_custom = ((v==null) ? "" : v);
+
+ } // end setTopCustom
+
+ public final String getBottomCustom()
+ {
+ return bottom_custom;
+
+ } // end getBottomCustom
+
+ public final void setBottomCustom(String v)
+ {
+ if (rinput==null)
+ bottom_custom = ((v==null) ? "" : v);
+
+ } // end setBottomCustom
+
+ public final Dimension getPhotoDims()
+ {
+ return photo_dims;
+
+ } // end getPhotoDims
+
+ public final void setPhotoDims(Dimension v)
+ {
+ if (rinput==null)
+ photo_dims = v;
+
+ } // end setPhotoDims
+
+ public final Map getPhotoMap()
+ {
+ return photo_map;
+
+ } // end getPhotoMap
+
+ public final Set getBozoUIDs()
+ {
+ return bozo_uids;
+
+ } // end getBozoUIDs
+
+ public final String getTitle()
+ {
+ return title;
+
+ } // end getTitle
+
+ public final void setTitle(String v)
+ {
+ if (rinput==null)
+ title = ((v==null) ? "" : v);
+
+ } // end setTitle
+
+ public final String getSubtitle()
+ {
+ return subtitle;
+
+ } // end getSubtitle
+
+ public final void setSubtitle(String v)
+ {
+ if (rinput==null)
+ subtitle = ((v==null) ? "" : v);
+
+ } // end setSubtitle
+
+ public final void buildInternals(UserContext user) throws DataException
+ {
+ if (rinput!=null)
+ return;
+
+ if (photo_dims!=null)
+ photo_map = new HashMap();
+
+ HashSet saw_users = new HashSet();
+ Iterator it = messages.iterator();
+ boolean get_photo = true;
+ while (it.hasNext())
+ { // get the user names of all users on the page
+ TopicMessageContext msg = (TopicMessageContext)(it.next());
+ Integer the_uid = new Integer(msg.getCreatorUID());
+ if (!(saw_users.contains(the_uid)))
+ { // only check a UID once
+ saw_users.add(the_uid);
+ get_photo = true;
+ if (topic.isBozo(the_uid.intValue()))
+ { // this user is filtered
+ bozo_uids.add(the_uid);
+ get_photo = no_bozos; // get photo if bozo filter overridden
+
+ } // end if
+
+ if (get_photo && (photo_dims!=null))
+ { // store the user photo URL
+ String url = user.getProfile(the_uid.intValue()).getPhotoURL();
+ if (url!=null)
+ photo_map.put(the_uid,url);
+
+ } // end if
+
+ } // end if
+ // else ignore the uID
+
+ } // end while
+
+ } // end buildInternals
+
+ public final boolean canDoNextTopic()
+ {
+ if (tvo!=null)
+ return tvo.isNext();
+ else
+ return false;
+
+ } // end canDoNextTopic
+
+ public final short getNextTopic()
+ {
+ if (tvo!=null)
+ return tvo.getNext();
+ else
+ return -1;
+
+ } // else getNextTopic
+
+ public final int getPageSize()
+ {
+ return ((rinput==null) ? 0 : rinput.getEngine().getNumPostsPerPage());
+
+ } // end getPageSize
+
+ public final boolean bozoFilterUser(int uid)
+ {
+ if (no_bozos)
+ return false;
+ else
+ return bozo_uids.contains(new Integer(uid));
+
+ } // end bozoFilterUser
+
+ public final boolean showBozoFilteredIndicator(int uid)
+ {
+ if (no_bozos)
+ return bozo_uids.contains(new Integer(uid));
+ else
+ return false;
+
+ } // end showBozoFilteredIndicator
+
+ public final String getUserPhotoTag(RequestOutput ro, int uid)
+ {
+ if ((photo_dims==null) || (photo_map==null))
+ return ""; // user photos not enabled
+ return ro.getUserPhotoTag((String)(photo_map.get(new Integer(uid))),photo_dims);
+
+ } // end getUserPhotoTag
+
+ public final String formatDate(Date date)
+ {
+ return ((rinput==null) ? null : rinput.formatDate(date));
+
+ } // end formatDate
+
+ public final boolean showFilterButton(int uid)
+ {
+ return !(bozo_uids.contains(new Integer(uid))) && topic.canSetBozo(uid);
+
+ } // end showFilterButton
+
+ /*--------------------------------------------------------------------------------
+ * External static operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public static final PostsView get(ServletRequest sreq) throws ServletException
+ {
+ Object obj = sreq.getAttribute(RequestImpl.REQUEST_CONTENT);
+ if (obj==null)
+ throw new ServletException("PostsView.get: unable to get request content");
+ if (obj instanceof PostsView)
+ return (PostsView)obj;
+ throw new ServletException("PostsView.get: request content is not a PostsView object");
+
+ } // end get
+
+ public static final String getPosterName(TopicMessageContext msg)
+ {
+ try
+ { // have to guard agains a DataException here
+ return msg.getCreatorName();
+
+ } // end try
+ catch (DataException de)
+ { // just return "unknown" on failure
+ return "(unknown)";
+
+ } // end catch
+
+ } // end getPosterName
+
+ public static final String getMessageBodyText(TopicMessageContext msg)
+ {
+ try
+ { // have to guard against a DataException here
+ return msg.getBodyText();
+
+ } // end try
+ catch (DataException de)
+ { // just return an error message
+ return "(Unable to retrieve message data: " + StringUtil.encodeHTML(de.getMessage()) + ")";
+
+ } // end catch
+
+ } // end getMessageBodyText
+
+ public static final boolean displayAttachmentInNewWindow(TopicMessageContext msg)
+ {
+ if (!(msg.hasAttachment()))
+ return false;
+ String type = msg.getAttachmentType();
+ return (type.startsWith("text/") || type.startsWith("image/"));
+
+ } // end displayAttachmentInNewWindow
+
+} // end class PostView
+
diff --git a/src/com/silverwrist/venice/ui/config/ButtonHolder.java b/src/com/silverwrist/venice/ui/config/ButtonHolder.java
new file mode 100644
index 0000000..95e4e6e
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/config/ButtonHolder.java
@@ -0,0 +1,127 @@
+/*
+ * 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.ui.config;
+
+import java.util.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.DOMElementHelper;
+import com.silverwrist.util.StringUtil;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.util.XMLLoader;
+
+class ButtonHolder
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private int width;
+ private int height;
+ private Map id_to_caption;
+ private Map id_to_image;
+ private String tail_tag;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ ButtonHolder(Element cfg, String image_path) throws ConfigException
+ {
+ // get the initial header information
+ XMLLoader loader = XMLLoader.get();
+ loader.configVerifyNodeName(cfg,"buttons");
+ width = loader.configGetAttributeInt(cfg,"width");
+ height = loader.configGetAttributeInt(cfg,"height");
+ tail_tag = "\" WIDTH=" + width + " HEIGHT=" + height + " BORDER=0>";
+
+ // load the individual button descriptors
+ HashMap tmp_caption = new HashMap();
+ HashMap tmp_image = new HashMap();
+ NodeList nl = cfg.getChildNodes();
+ for (int i=0; i
+ buf.append("[ ").append(caption).append(" ]");
+ buf.append(tail_tag);
+ return buf.toString();
+
+ } // end getButtonVisual
+
+ final String getButtonInput(String id)
+ {
+ // Look up the caption and image.
+ String img = (String)(id_to_image.get(id));
+ if (img==null)
+ return "";
+ String caption = (String)(id_to_caption.get(id));
+
+ // Build the returned tag.
+ StringBuffer buf = new StringBuffer(".
+ *
+ * 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.ui.config;
+
+import java.util.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+
+public class ColorPalette implements ColorSelectors
+{
+ /*--------------------------------------------------------------------------------
+ * Static data members
+ *--------------------------------------------------------------------------------
+ */
+
+ private static final Map config_map; // mapping from configuration names to color indexes
+ private static final Map streetname_map; // mapping from "street names" to color indexes
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String[] colors_array; // the actual colors
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ ColorPalette(Element colors) throws ConfigException
+ {
+ colors_array = new String[config_map.size()];
+ int i;
+ NodeList nl = colors.getChildNodes();
+ for (i=0; i=colors_array.length))
+ throw new IndexOutOfBoundsException("invalid color selector");
+ return colors_array[selector];
+
+ } // end getColor
+
+ public final String getColor(String name)
+ {
+ Integer sel = (Integer)(streetname_map.get(name));
+ if (sel==null)
+ return name;
+ else
+ return colors_array[sel.intValue()];
+
+ } // end getColor
+
+ public final void fillParameterMap(String prefix, Map the_map)
+ {
+ Iterator it = streetname_map.entrySet().iterator();
+ while (it.hasNext())
+ { // read each entry, translate it, and add it to the new map
+ Map.Entry ntry = (Map.Entry)(it.next());
+ String new_name = prefix + ntry.getKey().toString();
+ Integer sel = (Integer)(ntry.getValue());
+ the_map.put(new_name,colors_array[sel.intValue()]);
+
+ } // end while
+
+ } // end fillParameterMap
+
+ /*--------------------------------------------------------------------------------
+ * Static initializer
+ *--------------------------------------------------------------------------------
+ */
+
+ static
+ { // Initialize the mapping of color names from render-config.xml to color selector IDs,
+ // and the mapping from "street names" for the colors to the color selector IDs.
+ HashMap m1 = new HashMap();
+ HashMap m2 = new HashMap();
+ Integer x;
+
+ x = new Integer(FRAME_BACKGROUND);
+ m1.put("frame-bg",x);
+ m2.put("frame",x);
+ x = new Integer(TITLE_BACKGROUND);
+ m1.put("title-bg",x);
+ m2.put("top.background",x);
+ m2.put("top.bg",x);
+ x = new Integer(TITLE_FOREGROUND);
+ m1.put("title-fg",x);
+ m2.put("top.foreground",x);
+ m2.put("top.fg",x);
+ x = new Integer(TITLE_LINK);
+ m1.put("title-link",x);
+ m2.put("top.link",x);
+ x = new Integer(LEFT_BACKGROUND);
+ m1.put("left-bg",x);
+ m2.put("left.background",x);
+ m2.put("left.bg",x);
+ x = new Integer(LEFT_FOREGROUND);
+ m1.put("left-fg",x);
+ m2.put("left.foreground",x);
+ m2.put("left.fg",x);
+ x = new Integer(LEFT_LINK);
+ m1.put("left-link",x);
+ m2.put("left.link",x);
+ x = new Integer(CONTENT_BACKGROUND);
+ m1.put("content-bg",x);
+ m2.put("content.background",x);
+ m2.put("content.bg",x);
+ x = new Integer(CONTENT_FOREGROUND);
+ m1.put("content-fg",x);
+ m2.put("content.foreground",x);
+ m2.put("content.fg",x);
+ x = new Integer(CONTENT_HEADER);
+ m1.put("content-hdr",x);
+ m2.put("content.header",x);
+ x = new Integer(CONTENT_DISABLED);
+ m1.put("content-disabled",x);
+ m2.put("disabled",x);
+ x = new Integer(CONTENT_ERROR);
+ m1.put("content-error",x);
+ m2.put("error",x);
+ x = new Integer(SIDEBOX_TITLE_BACKGROUND);
+ m1.put("sidebox-title-bg",x);
+ m2.put("sidebox.top.background",x);
+ m2.put("sidebox.top.bg",x);
+ x = new Integer(SIDEBOX_TITLE_FOREGROUND);
+ m1.put("sidebox-title-fg",x);
+ m2.put("sidebox.top.foreground",x);
+ m2.put("sidebox.top.fg",x);
+ x = new Integer(SIDEBOX_CONTENT_BACKGROUND);
+ m1.put("sidebox-content-bg",x);
+ m2.put("sidebox.background",x);
+ m2.put("sidebox.bg",x);
+ x = new Integer(SIDEBOX_CONTENT_FOREGROUND);
+ m1.put("sidebox-content-fg",x);
+ m2.put("sidebox.foreground",x);
+ m2.put("sidebox.fg",x);
+ x = new Integer(SIDEBOX_CONTENT_LINK);
+ m1.put("sidebox-content-link",x);
+ m2.put("sidebox.link",x);
+ x = new Integer(CONFIRM_TITLE_BACKGROUND);
+ m1.put("confirm-title-bg",x);
+ m2.put("dlg.confirm.title.background",x);
+ m2.put("dlg.confirm.title.bg",x);
+ x = new Integer(CONFIRM_TITLE_FOREGROUND);
+ m1.put("confirm-title-fg",x);
+ m2.put("dlg.confirm.title.foreground",x);
+ m2.put("dlg.confirm.title.fg",x);
+ x = new Integer(ERROR_TITLE_BACKGROUND);
+ m1.put("error-title-bg",x);
+ m2.put("dlg.error.title.background",x);
+ m2.put("dlg.error.title.bg",x);
+ x = new Integer(ERROR_TITLE_FOREGROUND);
+ m1.put("error-title-fg",x);
+ m2.put("dlg.error.title.foreground",x);
+ m2.put("dlg.error.title.fg",x);
+
+ config_map = Collections.unmodifiableMap(m1);
+ streetname_map = Collections.unmodifiableMap(m2);
+
+ } // end static initializer
+
+} // end class ColorPalette
diff --git a/src/com/silverwrist/venice/ui/config/DialogManager.java b/src/com/silverwrist/venice/ui/config/DialogManager.java
new file mode 100644
index 0000000..5c85e69
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/config/DialogManager.java
@@ -0,0 +1,184 @@
+/*
+ * 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.ui.config;
+
+import java.lang.reflect.*;
+import java.util.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.dlg.Dialog;
+
+class DialogManager
+{
+ /*--------------------------------------------------------------------------------
+ * Static data members
+ *--------------------------------------------------------------------------------
+ */
+
+ private static final String default_package;
+ private static final Class[] default_ctor_args = { RootConfig.class, Element.class };
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private Map dialog_instance_map;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ DialogManager(RootConfig cfg, Element elt) throws ConfigException
+ {
+ HashMap tmp_map = new HashMap();
+ NodeList nl = elt.getChildNodes();
+ Object[] args = null;
+ for (int i=0; i.
+ *
+ * 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.ui.config;
+
+import java.util.*;
+import javax.servlet.http.HttpServletResponse;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.helpers.*;
+import com.silverwrist.venice.util.*;
+
+public class Remapper
+{
+ /*--------------------------------------------------------------------------------
+ * Remap entries class
+ *--------------------------------------------------------------------------------
+ */
+
+ class RemapEntry implements LinkTypes
+ {
+ class RemapParameter
+ {
+ private String name;
+ private String default_value;
+
+ RemapParameter(Element cfg) throws ConfigException
+ {
+ XMLLoader loader = XMLLoader.get();
+ name = loader.configGetAttribute(cfg,"name");
+ DOMElementHelper h = new DOMElementHelper(cfg);
+ default_value = h.getElementText();
+ if (default_value==null)
+ default_value = "";
+
+ } // end constructor
+
+ final void fillParameter(RequestInput req, Map vars)
+ {
+ String val = req.getParameter(name);
+ if (val==null)
+ val = default_value;
+ vars.put(name,val);
+
+ } // end fillParameter
+
+ } // end class RemapParameter
+
+ private String source_path; // source path to be matched
+ private String target_url; // target URL with replaceable parameters
+ private int target_type; // target URL type
+ private List params; // the parameters
+
+ RemapEntry(Element cfg, RootConfig root) throws ConfigException
+ {
+ XMLLoader loader = XMLLoader.get();
+ source_path = loader.configGetAttribute(cfg,"path");
+ Element tsect = loader.configGetSubSection(cfg,"target");
+ DOMElementHelper tsect_h = new DOMElementHelper(tsect);
+ target_url = loader.configGetText(tsect_h);
+ if (tsect_h.hasAttribute("type"))
+ { // get and convert the target type
+ target_type = root.convertLinkType(loader.configGetAttribute(tsect,"type"));
+ if (target_type==-1)
+ throw new ConfigException(" has invalid type= attribute");
+
+ } // end if
+ else // the target type is not specified - default it
+ target_type = SERVLET;
+
+ NodeList nl = cfg.getChildNodes();
+ ArrayList tmp_params = new ArrayList(nl.getLength());
+ for (int i=0; i.
+ *
+ * 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.ui.config;
+
+import java.io.*;
+import java.util.*;
+import org.apache.log4j.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.core.CommunityContext;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.ui.*;
+import com.silverwrist.venice.ui.dlg.Dialog;
+import com.silverwrist.venice.ui.menus.CommunityMenu;
+import com.silverwrist.venice.ui.menus.CommunityMenuFactory;
+import com.silverwrist.venice.ui.menus.Menu;
+import com.silverwrist.venice.ui.menus.MenuComponent;
+import com.silverwrist.venice.util.*;
+
+public class RootConfig implements LinkTypes, ColorSelectors
+{
+ /*--------------------------------------------------------------------------------
+ * Static data members
+ *--------------------------------------------------------------------------------
+ */
+
+ private static final String VENICE_URL = "http://venice.sourceforge.net";
+ private static final String VENICE_IMAGE = "powered-by-venice.gif";
+ private static final int VENICE_IMAGE_WIDTH = 129;
+ private static final int VENICE_IMAGE_HEIGHT = 103;
+ private static final String VENICE_ALT = "Powered By Venice";
+
+ private static Category logger = Category.getInstance(RootConfig.class);
+
+ private static final Map link_types;
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String script_directory; // the scripts directory
+ private String temp_directory; // the temporary directory
+ private String image_path; // the images path
+ private String static_path; // the static files path
+ private String external_static_path; // the external static files path
+ private String format_path; // the JSP formatter path
+ private String blank_photo_path; // the "photo not available" path
+ private String frame_jsp_name; // the name of the frame JSP
+ private String site_title; // the title for the site
+ private File stylesheet; // the stylesheet file reference
+ private long stylesheet_lastchange; // when was the stylesheet last changed?
+ private boolean smart_tags; // do we want to allow M$ IE6 Smart Tags?
+ private String site_logo_img_tag; // the tag containing the site logo
+ private String site_logo_href = null; // the HREF to surround the site logo with
+ private int site_logo_href_type = -1; // the type of the above href
+ private String venice_logo_tag; // the HTML snippet containing the Venice logo
+ private String page_icon_tags = null; // the HTML snippet containing the page icons
+ private String font_face; // the default font face name
+ private String base_font; // the default tag
+ private Map font_sizes; // the stock font sizes
+ private ColorPalette colors; // all the colors
+ private boolean html_comments; // do we want to embed HTML comments?
+ private ButtonHolder buttons; // the button definitions
+ private String[] content_hdr; // the content header parts
+ private Remapper remapper; // the URL remapper
+ private StockMessages stock_messages; // the stock messages
+ private Map menus; // the menus
+ private DialogManager dialogs; // the dialog manager
+ private SideBoxManager sideboxes; // the sidebox manager
+ private CommunityMenuFactory comm_menu_fact; // the community menu factory
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public RootConfig(String config_file, String root_file_path) throws ConfigException
+ {
+ // Load the configuration file.
+ XMLLoader loader = XMLLoader.get();
+ Document doc = loader.loadConfigDocument(config_file);
+ Element root = loader.configGetRootElement(doc,"ui-config");
+ DOMElementHelper root_h = new DOMElementHelper(root);
+
+ // Get the section.
+ Element sect = loader.configGetSubSection(root_h,"file-paths");
+ DOMElementHelper sect_h = new DOMElementHelper(sect);
+
+ // Get the full pathname of the sidebox configuration file.
+ String sidebox_config = loader.configGetSubElementText(sect_h,"sidebox-config");
+ if (!(sidebox_config.startsWith("/")))
+ sidebox_config = root_file_path + sidebox_config;
+
+ // Get the full pathname of the services configuration file.
+ String services_config = loader.configGetSubElementText(sect_h,"services-config");
+ if (!(services_config.startsWith("/")))
+ services_config = root_file_path + services_config;
+
+ // Get the full pathname of the script directory.
+ script_directory = loader.configGetSubElementText(sect_h,"script-dir");
+ if (!(script_directory.startsWith("/")))
+ script_directory = root_file_path + script_directory;
+ if (!(script_directory.endsWith("/")))
+ script_directory = script_directory + "/";
+
+ // Test to make sure the script directory exists.
+ File t_file = new File(script_directory);
+ if (!(t_file.isDirectory()))
+ { // script directory does not exist - throw exception
+ logger.fatal(" directory \"" + script_directory + "\" is not a directory");
+ throw new ConfigException("specified is not a directory",
+ sect_h.getSubElement("script-dir"));
+
+ } // end if
+
+ // Get the full pathname of the temporary directory.
+ temp_directory = loader.configGetSubElementText(sect_h,"temp-dir");
+ if (!(temp_directory.startsWith("/")))
+ temp_directory = root_file_path + temp_directory;
+
+ // Test to make sure the temporary directory exists.
+ t_file = new File(temp_directory);
+ if (!(t_file.isDirectory()))
+ { // temporary directory does not exist - throw exception
+ logger.fatal(" directory \"" + temp_directory + "\" is not a directory");
+ throw new ConfigException("specified is not a directory",
+ sect_h.getSubElement("temp-dir"));
+
+ } // end if
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"uri-paths");
+ sect_h = new DOMElementHelper(sect);
+
+ // Get the images path.
+ image_path = loader.configGetSubElementText(sect_h,"image");
+ if (!(image_path.endsWith("/")))
+ image_path = image_path + "/";
+
+ // Get the static path.
+ static_path = loader.configGetSubElementText(sect_h,"static");
+ if (!(static_path.endsWith("/")))
+ static_path = static_path + "/";
+
+ // Get the external static path.
+ external_static_path = loader.configGetSubElementText(sect_h,"external-static");
+ if (!(external_static_path.endsWith("/")))
+ external_static_path = external_static_path + "/";
+
+ // Get the format JSP path.
+ format_path = loader.configGetSubElementText(sect_h,"format-jsp");
+ if (!(format_path.endsWith("/")))
+ format_path = format_path + "/";
+
+ // Get the pathname of the "photo not available" image.
+ blank_photo_path = loader.configGetSubElementText(sect_h,"photo-not-avail");
+ Element sect1 = sect_h.getSubElement("photo-not-avail");
+ DOMElementHelper sect1_h = new DOMElementHelper(sect1);
+ if (sect1_h.hasAttribute("fixup"))
+ blank_photo_path = image_path + blank_photo_path;
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"frame");
+ sect_h = new DOMElementHelper(sect);
+
+ // Get the name of the frame JSP.
+ String tmp = loader.configGetSubElementText(sect_h,"jsp-name");
+ frame_jsp_name = format_path + tmp;
+
+ // Get the site title.
+ site_title = sect_h.getSubElementText("site-title");
+
+ // Get the base font size.
+ Integer bf_size = sect_h.getSubElementInt("basefont-size");
+ if (bf_size==null)
+ bf_size = new Integer(3);
+
+ // Get the default stylesheet location.
+ tmp = sect_h.getSubElementText("stylesheet");
+ if ((tmp!=null) && !(tmp.startsWith("/")))
+ tmp = root_file_path + tmp;
+ if (tmp!=null)
+ { // set up stylesheet file name and stylesheet change data
+ stylesheet = new File(tmp);
+ if (stylesheet.canRead())
+ stylesheet_lastchange = stylesheet.lastModified();
+ else
+ { // the stylesheet file does not exist
+ logger.fatal("specified file \"" + tmp + "\" does not exist");
+ throw new ConfigException("specified file does not exist",
+ sect_h.getSubElement("stylesheet"));
+
+ } // end else
+
+ } // end if
+ else
+ { // just null these values out
+ stylesheet = null;
+ stylesheet_lastchange = 0;
+
+ } // end else
+
+ // Get the "Smart Tags" flag.
+ smart_tags = sect_h.hasChildElement("ms-copyright-violations");
+
+ // Retrieve the site logo.
+ sect1 = loader.configGetSubSection(sect_h,"site-logo");
+ sect1_h = new DOMElementHelper(sect1);
+ StringBuffer tmpbuf = new StringBuffer("");
+ site_logo_img_tag = tmpbuf.toString();
+
+ // Get the link URL of the logo.
+ tmp = sect1.getAttribute("href");
+ if (!(StringUtil.isStringEmpty(tmp)))
+ { // save off the HREF, get the type of the link
+ site_logo_href = tmp;
+ tmp = loader.configGetAttribute(sect1,"type");
+ itmp = (Integer)(link_types.get(tmp));
+ if (itmp==null)
+ { // this is not good!
+ logger.fatal(" type=\"" + tmp + "\" is not a valid value");
+ throw new ConfigException("invalid link type for ",sect1);
+
+ } // end if
+
+ site_logo_href_type = itmp.intValue();
+
+ } // end if
+
+ // Get the footer logo scale and build the HTML snippet that contains the Venice logo.
+ itmp = sect_h.getSubElementInt("footer-logo-scale");
+ if (itmp==null)
+ itmp = new Integer(100);
+ int tmp_width = (VENICE_IMAGE_WIDTH * itmp.intValue()) / 100;
+ int tmp_height = (VENICE_IMAGE_HEIGHT * itmp.intValue()) / 100;
+ venice_logo_tag = "";
+
+ // Get the page icon and icon type, and the "favorites icon" (MS-specific).
+ String page_icon_1 = null, page_icon_2 = null;
+ sect1 = sect_h.getSubElement("favicon");
+ if (sect1!=null)
+ { // get the URL and create the "shortcut icon" tag
+ String url = loader.configGetText(sect1);
+ page_icon_2 = "\n";
+
+ } // end if
+
+ sect1 = sect_h.getSubElement("page-icon");
+ if (sect1!=null)
+ { // get the URL and type, and create the page icon tag
+ String url = loader.configGetText(sect1);
+ String type = loader.configGetAttribute(sect1,"type");
+ page_icon_1 = "\n";
+ if (page_icon_2==null) // fill this in for the "shortcut icon" as well
+ page_icon_2 = "\n";
+
+ } // end if
+
+ if (page_icon_1==null)
+ page_icon_tags = page_icon_2; // just use "shortcut icon"
+ else
+ page_icon_tags = page_icon_1 + page_icon_2; // use both tags
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"rendering");
+ sect_h = new DOMElementHelper(sect);
+
+ // Get the default font face name.
+ font_face = loader.configGetSubElementText(sect_h,"font");
+ base_font = "";
+
+ // Load the stock font sizes.
+ sect1 = sect_h.getSubElement("font-sizes");
+ HashMap tmap;
+ NodeList nl;
+ int i;
+ if (sect1!=null)
+ { // scan through this subsection to find the stock font sizes
+ tmap = new HashMap();
+ nl = sect1.getChildNodes();
+ for (i=0; i" + getFontTag(CONTENT_HEADER,"header") + "";
+ content_hdr[1] = "";
+ content_hdr[2] = " " + getFontTag(CONTENT_HEADER,"subhead") + "";
+ content_hdr[3] = "";
+ content_hdr[4] = "\n";
+
+ // Get the "HTML Comments" flag.
+ html_comments = sect_h.hasChildElement("html-comments");
+
+ // Get the "Buttons" section and initialize it.
+ sect1 = loader.configGetSubSection(sect_h,"buttons");
+ buttons = new ButtonHolder(sect1,image_path);
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"remapper");
+
+ // Initialize the remapper object.
+ remapper = new Remapper(sect,this);
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"messages");
+
+ // Initialize the stock messages list.
+ stock_messages = new StockMessages(sect);
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"menu-definitions");
+
+ tmap = new HashMap();
+ nl = sect.getChildNodes();
+ for (i=0; i subnodes and use them to initialize menus
+ Node n = nl.item(i);
+ if (n.getNodeType()==Node.ELEMENT_NODE)
+ { // verify that it's a menu definition, then get its ID and build a menu
+ loader.configVerifyNodeName(n,"menudef");
+ String menuid = loader.configGetAttribute((Element)n,"id");
+ Menu m = new Menu((Element)n,this,menuid);
+ tmap.put(menuid,m);
+
+ } // end if
+ // else just ignore it
+
+ } // end for
+
+ if (tmap.isEmpty())
+ menus = Collections.EMPTY_MAP;
+ else
+ menus = Collections.unmodifiableMap(tmap);
+
+ // Get the section.
+ sect = loader.configGetSubSection(root_h,"dialog-definitions");
+
+ // Initialize the dialog manager.
+ dialogs = new DialogManager(this,sect);
+
+ // done with the ui-config.xml file
+ // Load up the sidebox-config.xml file.
+ doc = loader.loadConfigDocument(sidebox_config);
+ root = loader.configGetRootElement(doc,"sidebox-config");
+
+ // Create the sidebox manager.
+ sideboxes = new SideBoxManager(root);
+
+ // done with the sidebox-config.xml file
+ // Load up the services-config.xml file.
+ doc = loader.loadConfigDocument(services_config);
+ root = loader.configGetRootElement(doc,"services-config");
+ root_h = new DOMElementHelper(root);
+
+ // Get the community section and pass it to the CommunityMenuFactory.
+ comm_menu_fact = new CommunityMenuFactory(root_h.getSubElement("community"),this);
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Internal operations
+ *--------------------------------------------------------------------------------
+ */
+
+ private final String mapFontSize(String sz)
+ {
+ String rc = (String)(font_sizes.get(sz));
+ return ((rc==null) ? sz : rc);
+
+ } // end mapFontSize
+
+ /*--------------------------------------------------------------------------------
+ * External operations
+ *--------------------------------------------------------------------------------
+ */
+
+ public final String getTemporaryPath()
+ {
+ return temp_directory;
+
+ } // end getTemporaryPath
+
+ public final String getImagePath(String img)
+ {
+ return image_path + img;
+
+ } // end getImagePath
+
+ public final String getStaticPath(String s)
+ {
+ return static_path + s;
+
+ } // end getImagePath
+
+ public final String getExternalStaticPath(String s)
+ {
+ return external_static_path + s;
+
+ } // end getExternalStaticPath
+
+ public final String getFormatJSPPath(String jsp)
+ {
+ return format_path + jsp;
+
+ } // end getFormatJSPPath
+
+ public final String getScriptPath(String sname)
+ {
+ return script_directory + sname;
+
+ } // end script_directory
+
+ public final String getFrameJSPName()
+ {
+ return frame_jsp_name;
+
+ } // end getFrameJSPName
+
+ public final String getPageTitle(String t)
+ {
+ if (site_title==null)
+ return t;
+ else
+ return t + " - " + site_title;
+
+ } // end getPageTitle
+
+ public final String getBaseFontTag()
+ {
+ return base_font;
+
+ } // end getBaseFontTag
+
+ public final boolean usingStyleSheet()
+ {
+ return (stylesheet!=null);
+
+ } // end usingStyleSheet
+
+ public final boolean hasStyleSheetChanged()
+ {
+ if (stylesheet==null)
+ return false;
+ return (stylesheet.lastModified()!=stylesheet_lastchange);
+
+ } // end hasStyleSheetChanged
+
+ public final String loadStyleSheetData() throws IOException
+ {
+ StringBuffer raw_data;
+ synchronized (this)
+ { // If there's no stylesheet, don't bother.
+ if (stylesheet==null)
+ return null;
+
+ // Load the stylesheet data.
+ raw_data = IOUtil.loadText(stylesheet);
+ stylesheet_lastchange = stylesheet.lastModified();
+
+ } // end synchronized block
+
+ // Set up the replacements map to replace the various parameters.
+ HashMap vars = new HashMap();
+ vars.put("font",font_face);
+ colors.fillParameterMap("color.",vars);
+ return StringUtil.replaceAllVariables(raw_data.toString(),vars);
+
+ } // end loadStyleSheetData
+
+ public final String getColor(int selector)
+ {
+ return colors.getColor(selector);
+
+ } // end getColor
+
+ public final String getColor(String name)
+ {
+ return colors.getColor(name);
+
+ } // end getColor
+
+ public final String getFontTag(int colorsel, int size)
+ {
+ return "";
+
+ } // end getFontTag
+
+ public final String getFontTag(String color, int size)
+ {
+ StringBuffer rc = new StringBuffer("');
+ return rc.toString();
+
+ } // end getFontTag
+
+ public final String getFontTag(int colorsel, String size)
+ {
+ StringBuffer rc = new StringBuffer("