Merge of the NewUI changes into the trunk

This commit is contained in:
Eric J. Bowersox
2002-01-07 02:05:37 +00:00
parent b86ef1c3b0
commit c3e2870572
516 changed files with 32853 additions and 26097 deletions

View File

@@ -0,0 +1,53 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
rc = null;
try
{ // add to the hotlist
conf.addToHotlist();
// trap back to the topics list
rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
} // end try
catch (e)
{ // error doing the add
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error adding to hotlist: " + e.message,
"conf/conferences.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

79
scripts/conf/alias_add.js Normal file
View File

@@ -0,0 +1,79 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/aliases.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error",
"You do not have permission to change this conference's aliases.",on_error));
vlib.done();
} // end if
alias = rinput.getParameter("alias");
if (vlib.emptyString(alias))
{ // this is a no-op
vlib.output(new NullResponse());
vlib.done();
} // end if
if (!(vlib.validVeniceID(alias)))
{ // we're not a valid Venice ID
on_error += ("&errmsg="
+ vlib.encodeURL("The alias you have entered is not a valid identifier. Please try again."));
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
rc = null;
try
{ // add the alias
conf.addAlias(alias);
// bounce back to the aliases display
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error in the alias definitions
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error adding alias: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -0,0 +1,70 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/aliases.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error",
"You do not have permission to change this conference's aliases.",on_error));
vlib.done();
} // end if
alias = rinput.getParameter("alias");
if (vlib.emptyString(alias))
{ // this is a no-op
vlib.output(new NullResponse());
vlib.done();
} // end if
rc = null;
try
{ // remove the alias
conf.removeAlias(alias);
// bounce back to the aliases display
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error in the alias definitions
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error removing alias: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

62
scripts/conf/aliases.js Normal file
View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error",
"You do not have permission to change this conference's aliases.",on_error));
vlib.done();
} // end if
rc = null;
try
{ // get the aliases list
rinput.setRequestAttribute("conference.aliases.list",conf.aliases);
rinput.setRequestAttribute("conference.aliases.error_message",rinput.getParameter("errmsg"));
// create the resulting view
rc = new JSPView("Manage Conference Aliases: " + conf.name,"conf/aliases.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error in the alias definitions
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting aliases: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
rc = null;
try
{ // get the flag and set the archived status
flag = rinput.getParameterInt("flag",0);
topic.setArchived(flag==1);
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting archived status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,57 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
rc = null;
try
{ // get a topic list from the conference
topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
rinput.setRequestAttribute("conference.reports.topiclist",topics);
// create the result view
rc = new JSPView("Conference Reports: " + conf.name,"conf/report_menu.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error generating the topic list
etype = vlib.exceptionType(e) + "";
if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -0,0 +1,71 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
rc = null;
try
{ // generate the conference listing
clist = comm.conferences;
// get the list of hosts for each conference
hlist = new ArrayList(clist.size());
for (i=0; i<clist.size(); i++)
{ // load the hosts
c = vlib.castConferenceContext(clist.get(i));
hlist.add(c.hosts);
} // end for
// save them off as request attributes
rinput.setRequestAttribute("conferences.list",clist);
rinput.setRequestAttribute("conferences.hosts.list",hlist);
// create the JSP view
rc = new JSPView("Conference Listing: " + comm.name,"conf/conferences.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
rc.pageQID = "go/" + comm.alias + "!";
} // end try
catch (e)
{ // do something with the exception
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error finding conferences: " + e.message,
"comm/show.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
{ // an Access Error might be because we aren't logged in
if (rinput.user.isLoggedIn())
rc = new ErrorBox("Access Error",e.message,"comm/show.js.vs?cc=" + comm.communityID);
else
rc = new LogInOrCreate();
} // end else if
else
rc = e;
} // end catch
vlib.output(rc); // all done!

106
scripts/conf/create.js Normal file
View File

@@ -0,0 +1,106 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.dlg);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canCreateConference()))
{ // can't create a conference
vlib.output(new ErrorBox("Access Error","You are not permitted to create conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
dlg = rinput.getDialog("conf.create");
if ("GET"==rinput.verb)
{ // return the dialog to be filled in
dlg.setSubtitle("in Community: " + comm.name);
dlg.setValue("cc",comm.communityID + "");
vlib.output(dlg);
vlib.done();
} // end if
op = dlg.whichButton(rinput) + "";
if (op=="cancel")
{ // they canceled - redirect back to the conferences list
vlib.output(new Redirect("conf/conferences.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET));
vlib.done();
} // end if
dlg.load(rinput); // load the dialog
rc = null;
if (op=="create")
{ // we actually want to create the conference...
try
{ // first validate the dialog
dlg.validate();
// now validate that the alias doesn't exist yet
if (rinput.engine.confAliasExists(dlg.getValue("alias")))
throw new ValidationException("That alias is already used by another conference on the system.");
// OK, create the conference!
pvt = ("1"==dlg.getValue("ctype"));
conf = comm.createConference(dlg.getValue("name"),dlg.getValue("alias"),dlg.getValue("descr"),pvt,
dlg.getValue("hide").booleanValue());
// now bounce to the new conference's topic list so we can start setting it up
rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error creating the conference
etype = vlib.exceptionType(e) + "";
if (etype.match("ValidationException"))
{ // reset the dialog and try again
dlg.setErrorMessage(e.message + " Please try again.");
dlg.setSubtitle("in Community: " + comm.name);
rc = dlg;
} // end if
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error creating conference: " + e.message,
"conf/conferences.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
} // end if
else
{ // error - don't know what button was clicked
logger.error("no known button click on POST to conf/create.js");
rc = new ErrorBox("Internal Error","Unknown command button pressed",
"conf/conferences.js.vs?cc=" + comm.communityID);
} // end else
vlib.output(rc); // all done!

111
scripts/conf/custom.js Normal file
View File

@@ -0,0 +1,111 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error",
"You do not have permission to change this conference's customizations.",on_error));
vlib.done();
} // end if
rc = null;
if ("GET"==rinput.verb)
{ // display the customization dialog
try
{ // retrieve the existing customizations
tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
if (tmp==null)
tmp = "";
rinput.setRequestAttribute("conference.custom.top",tmp);
tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
if (tmp==null)
tmp = "";
rinput.setRequestAttribute("conference.custom.bottom",tmp);
// create the view
rc = new JSPView("Customize Conference: " + conf.name,"conf/custom.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error in getting custom blocks
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting customization blocks: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("cancel"))
{ // cancelled - bail out!
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
if (!(rinput.isImageButtonClicked("update")))
{ // what button got pressed?!?!?
logger.error("no known button click on POST to conf/custom.js");
vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
vlib.done();
} // end if
try
{ // reset the custom blocks
conf.setCustomBlock(ConferenceContext.CUST_BLOCK_TOP,rinput.getParameter("tx"));
conf.setCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM,rinput.getParameter("bx"));
// bounce back to the manage conference menu
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error changing customizations
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting customizations: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error",
"You do not have permission to change this conference's customizations.",on_error));
vlib.done();
} // end if
rc = null;
try
{ // clear the custom blocks
conf.removeCustomBlocks();
// bounce back to the manage conference menu
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error changing customizations
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error removing customizations: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

84
scripts/conf/delete.js Normal file
View File

@@ -0,0 +1,84 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canManageConferences()))
{ // can't manage conferences, bail out
vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
if (!(conf.canDeleteConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to delete this conference.",
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID));
vlib.done();
} // end if
CONFIRM_attr = "conferences.manage.delete.ConfirmBox";
CONFIRM_param = "confirm";
rc = null;
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
{ // it is confirmed - we want to delete the conference!
try
{ // delete the conference (using the alias function to avoid using the delete keyword)
conf.deleteConference();
// trap back to the conferences list
rc = new Redirect("conf/conferences.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // handle error in deletion
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error deleting conference: " + e.message,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
else
rc = e;
} // end catch
} // end if
else // come up with the confirm box
rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Conference",
"You are about to permanently delete the '" + conf.name
+ "' conference! Are you sure you want to do this?",
"conf/delete.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,
LinkTypes.SERVLET);
vlib.output(rc); // all done!

View File

@@ -0,0 +1,70 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
CONFIRM_attr = "conferences.topic.delete.ConfirmBox";
CONFIRM_param = "confirm";
rc = null;
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
{ // it is confirmed - we want to delete the topic!
try
{ // delete the bloody thing!
topic.deleteTopic();
// bounce back to the topic list on success
rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error deleting
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error deleting topic: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
} // end if
else // come up with the confirm box
rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Topic",
"You are about to delete topic " + topic.topicNumber + " ('" + topic.name
+ "') from the '" + conf.name + "' conference! Are you sure you want to do this?",
"conf/delete_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber,LinkTypes.SERVLET,on_error,LinkTypes.SERVLET);
vlib.output(rc); // all done...

171
scripts/conf/edit.js Normal file
View File

@@ -0,0 +1,171 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.dlg);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// Define a simple function to set up the dialog stuff.
function setupDialog(dlg,conf)
{
dlg.setSubtitle(conf.name);
sinf = conf.securityInfo;
dlg.sendMessage("read_lvl","setRoleList",sinf.getRoleList("Conference.Read"));
dlg.sendMessage("post_lvl","setRoleList",sinf.getRoleList("Conference.Post"));
dlg.sendMessage("create_lvl","setRoleList",sinf.getRoleList("Conference.Create"));
dlg.sendMessage("hide_lvl","setRoleList",sinf.getRoleList("Conference.Hide"));
dlg.sendMessage("nuke_lvl","setRoleList",sinf.getRoleList("Conference.Nuke"));
dlg.sendMessage("change_lvl","setRoleList",sinf.getRoleList("Conference.Change"));
dlg.sendMessage("delete_lvl","setRoleList",sinf.getRoleList("Conference.Delete"));
dlg.setEnabled("hide",conf.canSetHideList());
} // end setupDialog
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to change this conference's attributes.",
on_error));
vlib.done();
} // end if
dlg = rinput.getDialog("conf.edit");
rc = null;
if ("GET"==rinput.verb)
{ // set up the dialog
setupDialog(dlg,conf);
try
{ // fill the dialog with the conference information
dlg.setValue("cc",comm.communityID + "");
dlg.setValue("conf",conf.confID + "");
dlg.setValue("name",conf.name);
dlg.setValue("descr",conf.description);
if (conf.canSetHideList() && conf.getHideList())
dlg.setValue("hide",1);
dlg.setValue("read_lvl",conf.getReadLevel() + "");
dlg.setValue("post_lvl",conf.getPostLevel() + "");
dlg.setValue("create_lvl",conf.getCreateLevel() + "");
dlg.setValue("hide_lvl",conf.getHideLevel() + "");
dlg.setValue("nuke_lvl",conf.getNukeLevel() + "");
dlg.setValue("change_lvl",conf.getChangeLevel() + "");
dlg.setValue("delete_lvl",conf.getDeleteLevel() + "");
props = conf.properties;
if (props.displayPostPictures)
dlg.setValue("pic_in_post",1);
rc = dlg;
} // end try
catch (e)
{ // error initializing dialog
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting up dialog: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);
vlib.done();
} // end if
// everything that follows is for a POST operation
op = dlg.whichButton(rinput) + "";
if (op=="cancel")
{ // user cancelled profile update - bounce back to the target
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
if (op!="update")
{ // what the hell was that button?
logger.error("no known button click on POST to conf/edit.js");
vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
vlib.done();
} // end if
dlg.load(rinput); // load the values into the dialog
try
{ // validate the dialog
dlg.validate();
// get all the levels out of the dialog
read_lvl = dlg.getValue("read_lvl").intValue();
post_lvl = dlg.getValue("post_lvl").intValue();
create_lvl = dlg.getValue("create_lvl").intValue();
hide_lvl = dlg.getValue("hide_lvl").intValue();
nuke_lvl = dlg.getValue("nuke_lvl").intValue();
change_lvl = dlg.getValue("change_lvl").intValue();
delete_lvl = dlg.getValue("delete_lvl").intValue();
// set the various conference attributes
conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl);
conf.name = dlg.getValue("name");
conf.description = dlg.getValue("descr");
if (conf.canSetHideList())
conf.setHideList(dlg.getValue("hide").booleanValue());
// set the conference properties
props = conf.properties;
props.displayPostPictures = dlg.getValue("pic_in_post").booleanValue();
conf.properties = props;
// bounce back to the manage display
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error editing the conference
etype = vlib.exceptionType(e) + "";
if (etype.match("ValidationException"))
{ // reset the dialog and try again
dlg.setErrorMessage(e.message + " Please try again.");
setupDialog(dlg,conf);
rc = dlg;
} // end if
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error editing conference: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

113
scripts/conf/email.js Normal file
View File

@@ -0,0 +1,113 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
rc = null;
if ("GET"==rinput.verb)
{ // display the dialog
try
{ // we need the topic list
tlist = conf.getTopicList(ConferenceContext.DISPLAY_ALL,ConferenceContext.SORT_NAME);
rinput.setRequestAttribute("topic.email.list",tlist);
// create the dialog
rc = new JSPView("Conference E-Mail: " + conf.name,"conf/email.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // unable to get topic list
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting up dialog: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("cancel"))
{ // cancelled - bail out!
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
if (!(rinput.isImageButtonClicked("send")))
{ // what button got pressed?!?!?
logger.error("no known button click on POST to conf/email.js");
vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
vlib.done();
} // end if
try
{ // retrieve the topic we want to send to
topic = null;
tnum = rinput.getParameterShort("top",0);
if (tnum>0)
topic = conf.getTopic(tnum);
// retrieve other parameters
posters = (rinput.getParameterInt("porl",0)==0)
ndays = -1;
if ("Y"==rinput.getParameter("xday"))
ndays = rinput.getParameterInt("day",-1);
// send the E-mail!
if (topic!=null)
topic.sendMailToParticipants(posters,ndays,rinput.getParameter("subj"),rinput.getParameter("pb"));
else
conf.sendMailToParticipants(posters,ndays,rinput.getParameter("subj"),rinput.getParameter("pb"));
// bounce back to the manage conference menu
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // exception sending the E-mail
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error sending E-mail: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done....

117
scripts/conf/find.js Normal file
View File

@@ -0,0 +1,117 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
on_error = "conf/conferences.js.vs?cc=" + comm.communityID;
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(false,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the topic
topic = null;
if (conf!=null)
{ // get the topic
on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
topic = currc.getTopic(false,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
if (topic!=null)
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber;
} // end if
view = new FindPostsView(comm,conf,topic);
view.maxResults = rinput.engine.getStdNumSearchResults();
if ("GET"==rinput.verb)
{ // display the find dialog
vlib.output(view);
vlib.done();
} // end if
// Retrieve the search term parameter.
tmp = rinput.getParameter("term");
if (tmp==null)
view.term = "";
else
view.term = tmp;
// Retrieve the offset and find count parameters.
view.offset = rinput.getParameterInt("ofs",0);
view.findCount = rinput.getParameterInt("fcount",-1);
// Adjust the search return offset based on the command button click.
if (rinput.isImageButtonClicked("search"))
view.offset = 0;
else if (rinput.isImageButtonClicked("previous"))
view.offset = Math.max(view.offset - view.maxResults,0); // go backwards
else if (rinput.isImageButtonClicked("next"))
view.offset += view.maxResults; // go forwards instead
else
throw new InternalStateError("Unable to determine what action triggered the form.");
rc = null;
try
{ // do the search
if (topic!=null)
{ // search the topic
view.results = topic.searchPosts(term,offset,view.maxResults);
if (view.findCount<0)
view.findCount = topic.getSearchPostCount(term);
} // end if
else if (conf!=null)
{ // search the conference
view.results = conf.searchPosts(term,offset,view.maxResults);
if (view.findCount<0)
view.findCount = conf.getSearchPostCount(term);
} // end else if
else
{ // search the community
view.results = comm.searchPosts(term,offset,view.maxResults);
if (view.findCount<0)
view.findCount = comm.getSearchPostCount(term);
} // end else
rc = view;
} // end try
catch (e)
{ // error doing the find
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error on find: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);

54
scripts/conf/fixseen.js Normal file
View File

@@ -0,0 +1,54 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/manage_conf.js.vs?cc=" + comm.communityID);
rc = null;
try
{ // the dreaded fixseen :-)
conf.fixSeen();
// don't change the current view
rc = new NullResponse();
} // end try
catch (e)
{ // error resetting the pseud
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error catching up conference: " + e.message,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
rc = null;
try
{ // get the flag and set the frozen status
flag = rinput.getParameterInt("flag",0);
topic.setFrozen(flag==1);
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting frozen status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,61 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
// get the message under consideration
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
+ conf.confID + "&top=" + topic.topicNumber);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
+ "&p1=" + msg.getPostNumber() + "&shac=1";
rc = null;
try
{ // get the flag and set the hide status
flag = rinput.getParameterInt("flag",0);
msg.setHidden(flag==1);
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
rc = null;
try
{ // get the flag and set the hide status
flag = rinput.getParameterInt("flag",0);
topic.setHidden(flag==1);
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

47
scripts/conf/hotlist.js Normal file
View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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);
// get the request object
rinput = bsf.lookupBean("request");
rc = null;
try
{ // get the hotlist and save it off for the display
rinput.setRequestAttribute("user.conf.hotlist",rinput.user.getConferenceHotlist());
// create a JSPView with the hot list
rc = new JSPView("Your Conference Hotlist","conf/hotlist.jsp");
rc.menuSelector = Content.MENU_SELECTOR_TOP;
} // end try
catch (e)
{ // unable to get the hotlist
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Error getting hotlist: " + e.message,"top.js.vs");
else
rc = e;
} // end catch
vlib.output(rc);

View File

@@ -0,0 +1,64 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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);
// get the request object
rinput = bsf.lookupBean("request");
// get the two index values
ndx = rinput.getParameterInt("ndx",-1);
if (ndx<0)
{ // index values out of range
vlib.output(new ErrorBox(null,"Invalid index parameter.","conf/hotlist.js.vs"));
vlib.done();
} // end if
rc = null;
try
{ // get the hotlist and further check the parameters
hotlist = rinput.user.getConferenceHotlist();
if (ndx>=hotlist.size())
throw new ErrorBox(null,"Invalid index parameter.","conf/hotlist.js.vs");
// get the hotlist entry and conference
ntry = vlib.castConferenceHotlistEntry(hotlist.get(ndx));
conf = ntry.getConference();
// remove the conference
conf.removeFromHotlist();
// bounce back to the hotlist screen
rc = new Redirect("conf/hotlist.js.vs",LinkTypes.SERVLET);
} // end try
catch (e)
{ // error adjusting the hotlist sequence
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Error adjusting hotlist: " + e.message,"conf/hotlist.js.vs");
else
rc = e;
} // end catch
vlib.output(rc); // all done

View File

@@ -0,0 +1,82 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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);
// get the request object
rinput = bsf.lookupBean("request");
// get the two index values
ndx = rinput.getParameterInt("ndx",-1);
ndx2 = rinput.getParameterInt("ndx2",-1);
if ((ndx<0) || (ndx2<0) || (ndx==ndx2))
{ // index values out of range
vlib.output(new ErrorBox(null,"Invalid index parameters.","conf/hotlist.js.vs"));
vlib.done();
} // end if
rc = null;
try
{ // get the hotlist and further check the parameters
hotlist = rinput.user.getConferenceHotlist();
if ((ndx>=hotlist.size()) || (ndx2>=hotlist.size()))
throw new ErrorBox(null,"Invalid index parameters.","conf/hotlist.js.vs");
// get the hotlist entries
entry1 = vlib.castConferenceHotlistEntry(hotlist.get(ndx));
entry2 = vlib.castConferenceHotlistEntry(hotlist.get(ndx2));
// get the sequence numbers
seq1 = entry1.getSequence();
seq2 = entry2.getSequence();
// now reassign the sequences
entry1.setHotlistSequence(seq2);
restore = true;
try
{ // set the second sequence
entry2.setHotlistSequence(seq1);
restore = false;
} // end try
finally
{ // restore the first sequence on error
if (restore)
entry1.setHotlistSequence(seq1);
} // end finally
// bounce back to the hotlist screen
rc = new Redirect("conf/hotlist.js.vs",LinkTypes.SERVLET);
} // end try
catch (e)
{ // error adjusting the hotlist sequence
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Error adjusting hotlist: " + e.message,"conf/hotlist.js.vs");
else
rc = e;
} // end catch
vlib.output(rc); // all done

View File

@@ -0,0 +1,96 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canSendInvitation()))
{ // you can't send an invitation
vlib.output(new ErrorBox("Conference Error","You are not permitted to send an invitation.",on_error));
vlib.done();
} // end if
if ("GET"==rinput.verb)
{ // set up the invitation screen parameters
rinput.setRequestAttribute("invitation.title","Send Conference Invitation:");
rinput.setRequestAttribute("invitation.subtitle",conf.name);
rinput.setRequestAttribute("invitation.action",rinput.formatURL("conf/invite_conf.js.vs",LinkTypes.SERVLET));
rinput.setRequestAttribute("invitation.params",
"<INPUT TYPE=\"HIDDEN\" NAME=\"cc\" VALUE=\"" + comm.communityID
+ "\"><INPUT TYPE=\"HIDDEN\" NAME=\"conf\" VALUE=\"" + conf.confID + "\">");
// create the invitation and display it
view = new JSPView("Send Invitation","comm/invite.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
view.pageQID = "conf/invite_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
vlib.output(view);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("cancel"))
{ // bounce back to the base page
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
rc = null;
if (rinput.isImageButtonClicked("send"))
{ // do the actual send!
try
{ // send out the invitation and then redirect back
conf.sendInvitation(rinput.getParameter("addr"),rinput.getParameter("pb"));
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // exception sending the invitation
etype = vlib.exceptionType(e) + "";
if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error sending invitation: " + e.message,on_error);
else if (etype.match("EmailException"))
rc = new ErrorBox("E-Mail Error","Error sending E-mail: " + e.message,on_error);
else
rc = e;
} // end catch
} // end if
else
{ // no known button pressed
logger.error("no known button click on POST to conf/invite_conf.js");
rc = new ErrorBox("Internal Error","Unknown command button pressed",on_error);
} // end else
vlib.output(rc);

View File

@@ -0,0 +1,103 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber;
if (!(topic.canSendInvitation()))
{ // you can't send an invitation
vlib.output(new ErrorBox("Conference Error","You are not permitted to send an invitation.",on_error));
vlib.done();
} // end if
if ("GET"==rinput.verb)
{ // set up the invitation screen parameters
rinput.setRequestAttribute("invitation.title","Send Topic Invitation:");
rinput.setRequestAttribute("invitation.subtitle",topic.name);
rinput.setRequestAttribute("invitation.action",
rinput.formatURL("conf/invite_topic.js.vs",LinkTypes.SERVLET));
rinput.setRequestAttribute("invitation.params",
"<INPUT TYPE=\"HIDDEN\" NAME=\"cc\" VALUE=\"" + comm.communityID
+ "\"><INPUT TYPE=\"HIDDEN\" NAME=\"conf\" VALUE=\"" + conf.confID
+ "\"><INPUT TYPE=\"HIDDEN\" NAME=\"top\" VALUE=\"" + topic.topicNumber + "\">");
// create the invitation and display it
view = new JSPView("Send Invitation","comm/invite.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
view.pageQID = "conf/invite_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber;
vlib.output(view);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("cancel"))
{ // bounce back to the base page
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
rc = null;
if (rinput.isImageButtonClicked("send"))
{ // do the actual send!
try
{ // send out the invitation and then redirect back
topic.sendInvitation(rinput.getParameter("addr"),rinput.getParameter("pb"));
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // exception sending the invitation
etype = vlib.exceptionType(e) + "";
if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error sending invitation: " + e.message,on_error);
else if (etype.match("EmailException"))
rc = new ErrorBox("E-Mail Error","Error sending E-mail: " + e.message,on_error);
else
rc = e;
} // end catch
} // end if
else
{ // no known button pressed
logger.error("no known button click on POST to conf/invite_topic.js");
rc = new ErrorBox("Internal Error","Unknown command button pressed",on_error);
} // end else
vlib.output(rc);

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/conf_reports.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
// get the current topic (where applicable)
topic = currc.getTopic(false,on_error);
rc = null;
try
{ // construct the activity list
my_list = null;
my_title = null;
title1 = null;
title2 = null;
nullmsg = null;
if (topic!=null)
{ // get the reader list from the topic
my_list = topic.getActiveReaders();
if (my_list.isEmpty())
nullmsg = "No readers in topic \"" + topic.name + "\" found.";
my_title = "Users Reading Topic " + topic.name;
title1 = "Readers in Topic:";
title2 = topic.name;
} // end if
else
{ // get the reader list from the conference
my_list = conf.getActiveReaders();
if (my_list.isEmpty())
nullmsg = "No readers in conference \"" + vlib.encodeHTML(conf.name) + "\" found.";
my_title = "Users Reading Conference " + conf.name;
title1 = "Readers in Conference:";
title2 = conf.name;
} // end else
// save off the attributes
rinput.setRequestAttribute("conference.activity.list",my_list);
rinput.setRequestAttribute("conference.activity.nullmessage",nullmsg);
rinput.setRequestAttribute("conference.activity.posters",Boolean.FALSE);
rinput.setRequestAttribute("conference.activity.title",title1);
rinput.setRequestAttribute("conference.activity.subtitle",title2);
// create the view
rc = new JSPView(my_title,"conf/activity_report.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error getting the list of readers
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting reader list: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

86
scripts/conf/manage.js Normal file
View File

@@ -0,0 +1,86 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canManageConferences()))
{ // can't manage conferences, bail out
vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
rc = null;
try
{ // get the conference list
conf_list = comm.getConferences();
// allocate arrays to hold the next/previous/hidden data
a_next = vlib.createIntArray(conf_list.size());
a_prev = vlib.createIntArray(conf_list.size());
a_hidden = vlib.createBooleanArray(conf_list.size());
// determine the next/previous/hidden data in advance
prev_id = -1;
for (i=0; i<conf_list.size(); i++)
{ // fill the various arrays
conf = vlib.castConferenceContext(conf_list.get(i));
a_hidden[i] = conf.hideList;
a_prev[i] = prev_id;
if (i>0)
a_next[i-1] = conf.confID;
prev_id = conf.confID;
} // end for
a_next[conf_list.size()-1] = -1;
// save off the data for the JSP page
rinput.setRequestAttribute("conference.list",conf_list);
rinput.setRequestAttribute("conference.prev.array",a_prev);
rinput.setRequestAttribute("conference.next.array",a_next);
rinput.setRequestAttribute("conference.hidden.array",a_hidden);
// create the return view
rc = new JSPView("Manage Conference List","conf/manage_list.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error in getting the conference sequence stuff
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting conference list: " + e.message,
"conf/conferences.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,45 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
if (conf.canChangeConference() || conf.canDeleteConference())
{ // create the host tools menu
vars = new HashMap();
vars.put("cid",comm.communityID + "");
vars.put("confid",conf.confID + "");
rinput.setRequestAttribute("conference.host.tools.menu",rinput.getMenu("conf.host.tools",vars));
} // end if
// create and output the view
view = new JSPView("Manage Conference: " + conf.name,"conf/manage_conf.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
vlib.output(view);

View File

@@ -0,0 +1,82 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canManageConferences()))
{ // can't manage conferences, bail out
vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
if (!(conf.canDeleteConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to delete this conference.",
"conf/manage.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
CONFIRM_attr = "conferences.manage_list.delete.ConfirmBox";
CONFIRM_param = "confirm";
rc = null;
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
{ // it is confirmed - we want to delete the conference!
try
{ // delete the conference (using the alias function to avoid using the delete keyword)
conf.deleteConference();
// trap back to the manage display
rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // handle error in deletion
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error deleting conference: " + e.message,
"conf/manage.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
} // end if
else // come up with the confirm box
rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Delete Conference",
"You are about to permanently delete the '" + conf.name
+ "' conference! Are you sure you want to do this?",
"conf/manage_list_delete.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,
LinkTypes.SERVLET,"conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
vlib.output(rc); // all done!

View File

@@ -0,0 +1,72 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canManageConferences()))
{ // can't manage conferences, bail out
vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to modify this conference.",
"conf/manage.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
// get the flag value
hide_flag = (rinput.getParameterInt("flag",0)==1);
rc = null;
try
{ // set the hide flag
conf.hideList = hide_flag;
// trap back to the manage display
rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // handle errors here
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting hide flag: " + e.message,
"conf/manage.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,89 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
if (!(comm.canManageConferences()))
{ // can't manage conferences, bail out
vlib.output(new ErrorBox("Access Error","You are not permitted to manage conferences in this community.",
"conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/manage.js.vs?cc=" + comm.communityID);
// we need another conference here - get that conference parameter
other_conf = currc.getConferenceParam("other",true,"conf/manage.js.vs?cc=" + comm.communityID);
if (!(conf.canChangeConference()) || !(other_conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to modify this conference.",
"conf/manage.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
rc = null;
try
{ // get the two sequences for starters
this_seq = conf.sequence;
other_seq = other_conf.sequence;
// now exchange them
conf.sequence = other_seq;
restore = true;
try
{ // set the second conference sequence
other_conf.sequence = this_seq;
restore = false;
} // end try
finally
{ // undo first set on error
if (restore)
conf.sequence = this_seq;
} // end finally
// trap back to the manage display
rc = new Redirect("conf/manage.js.vs?cc=" + comm.communityID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error in exchanging the conference positions
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error changing sequence: " + e.message,
"conf/manage.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,"conf/manage.js.vs?cc=" + comm.communityID);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -0,0 +1,57 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
rc = null;
try
{ // save off the attributes we require
rinput.setRequestAttribute("topic.bozos.list",topic.getBozos());
// return the view
rc = new JSPView("Manage Topic: " + topic.name,"conf/manage_topic.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error in generating bozos list
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting filter list: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

222
scripts/conf/membership.js Normal file
View File

@@ -0,0 +1,222 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.conf.view);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// Function which sets the correct conference access level onto each entry of the input list.
function augmentList(conf,list)
{
var rl = new ArrayList(list.size());
var it = list.iterator();
while (it.hasNext())
{ // get the conference level and add it to the UserFound object
var uf = vlib.castUserFound(it.next());
var level = conf.getMemberLevel(uf.UID);
rl.add(uf.createNewLevel(level));
} // end while
return rl;
} // end augmentList
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if (!(conf.canChangeConference()))
{ // you can't fiddle with this conference
vlib.output(new ErrorBox("Access Error","You do not have permission to change this conference's membership.",
on_error));
vlib.done();
} // end if
// create the view object
view = new ConfMemberView(rinput.engine.getStdNumSearchResults(),conf);
rc = null;
if ("GET"==rinput.verb)
{ // set up the initial state of the view
try
{ // get the conference membership list
mbr_list = conf.getMemberList();
view.simple = true;
view.results = mbr_list;
view.findCount = mbr_list.size();
rc = view;
} // end try
catch (e)
{ // we can get at least one exception here
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error retrieving membership list: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("update"))
{ // do an update of privileges in this conference
list_uids = vlib.splitList(rinput.getParameter("listuids"),":");
try
{ // loop through the defined UIDs and check the level...
it = list_uids.iterator();
while (it.hasNext())
{ // get the current and new levels, compare them, and reset if needed
x = it.next();
cur_level = rinput.getParameterInt("zxcur_" + x,-1);
new_level = rinput.getParameterInt("zxnew_" + x,-1);
if (cur_level!=new_level)
conf.setMembership(parseInt(x,10),new_level);
} // end while
} // end try
catch (e)
{ // the update might throw an error message
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error adjusting permissions: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
vlib.output(rc); // bail out now with the error message
vlib.done();
} // end catch
} // end if
// Carry on with the search operation now.
try
{ // handle the actual search
if ("1"==rinput.getParameter("sl"))
{ // Set up some of the easy initial parameters.
view.simple = true;
// Retrieve the offset and find count.
view.offset = rinput.getParameterInt("ofs",0);
// view.findCount = rinput.getParameterInt("fcount",-1); (N.B.: will get reassigned below)
// Adjust the offset based on the button clicked.
if (rinput.isImageButtonClicked("search"))
throw new ValidationException("Invalid button clicked."); // can't happen
else if (rinput.isImageButtonClicked("previous"))
view.offset = Math.max(view.offset-view.maxResults,0);
else if (rinput.isImageButtonClicked("next"))
view.offset += view.maxResults;
else if (!(rinput.isImageButtonClicked("update")))
throw new ValidationException("Unable to determine what action triggered the form.");
// Get the list and subset it if necessary.
// N.B.: Since the update function can reduce the size of the member list, we need to take into account
// that the find count will need updating and the offset may be in the wrong place for the list now.
mbr_list = conf.getMemberList();
view.findCount = mbr_list.size();
while ((view.offset>0) && (view.offset>=view.findCount))
view.offset = Math.max(view.offset-view.maxResults,0);
if (view.offset==0)
view.results = mbr_list;
else
view.results = mbr_list.subList(offset,mbr_list.size());
} // end if
else
{ // This is a search operation...
view.simple = false;
// Get the search field parameter.
x = rinput.getParameterInt("field",SearchMode.FIELD_USER_NAME);
if ( (x!=SearchMode.FIELD_USER_NAME) && (x!=SearchMode.FIELD_USER_DESCRIPTION)
&& (x!=SearchMode.FIELD_USER_GIVEN_NAME) && (x!=SearchMode.FIELD_USER_FAMILY_NAME))
throw new ValidationException("The search field parameter is not valid.");
view.field = x;
// Get the search mode parameter.
x = rinput.getParameterInt("mode",SearchMode.SEARCH_PREFIX);
if ( (x!=SearchMode.SEARCH_PREFIX) && (x!=SearchMode.SEARCH_SUBSTRING)
&& (x!=SearchMode.SEARCH_REGEXP))
throw new ValidationException("The search mode parameter is not valid.");
view.mode = x;
// Get the search term parameter.
view.term = rinput.getParameter("term");
if (view.term==null)
view.term = "";
// Retrieve the offset and find count.
view.offset = rinput.getParameterInt("ofs",0);
view.findCount = rinput.getParameterInt("fcount",-1);
// Adjust the offset based on the button clicked.
if (rinput.isImageButtonClicked("search"))
view.offset = 0; // begin a new search
else if (rinput.isImageButtonClicked("previous"))
view.offset = Math.max(view.offset-view.maxResults,0);
else if (rinput.isImageButtonClicked("next"))
view.offset += view.maxResults;
else if (!(rinput.isImageButtonClicked("update")))
throw new ValidationException("Unable to determine what action triggered the form.");
// Perform the search! (Note that we search on COMMUNITY members, not CONFERENCE members, as this is the
// way that we add additional members to a conference.)
tmp_results = comm.searchForMembers(view.field,view.mode,view.term,view.offset,view.maxResults);
view.results = augmentList(conf,tmp_results);
if (view.findCount<0)
view.findCount = comm.getSearchMemberCount(view.field,view.mode,view.term);
} // end else (search operation)
rc = view;
} // end try
catch (e)
{ // handle an error in search
etype = vlib.exceptionType(e) + "";
if (etype.match("ValidationException"))
rc = new ErrorBox("Find Error",e.message + " Please try again.",on_error);
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting member list: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,61 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
// get the message under consideration
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
+ conf.confID + "&top=" + topic.topicNumber);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
+ "&p1=" + msg.getPostNumber() + "&shac=1";
rc = null;
try
{ // get the flag and set the hide status
flag = rinput.getParameterInt("flag",0);
topic.setBozo(msg.creatorUID,(flag==1));
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting hide status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

145
scripts/conf/new_topic.js Normal file
View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
if ("GET"==rinput.verb)
{ // create the blank "New Topic Form"
rinput.setRequestAttribute("postbox.newtopic","");
rinput.setRequestAttribute("postbox.pseud",conf.defaultPseud);
rinput.setRequestAttribute("postbox.data","");
view = new JSPView("Create New Topic","conf/new_topic.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
vlib.output(view);
vlib.done();
} // end if
if (rinput.isImageButtonClicked("cancel"))
{ // they cancelled - bail out
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
if (rinput.isImageButtonClicked("preview"))
{ // generate a preview! start by passing all the data through the HTML checker as needed
try
{ // escape the title
checker = rinput.engine.getEscapingChecker();
checker.append(rinput.getParameter("title"));
checker.finish();
rinput.setRequestAttribute("postbox.newtopic",checker.getValue());
// escape the pseud
checker.reset();
checker.append(rinput.getParameter("pseud"));
checker.finish();
rinput.setRequestAttribute("postbox.pseud",checker.getValue());
// escape the data
postdata = rinput.getParameter("pb");
checker.reset();
checker.append(postdata);
checker.finish();
rinput.setRequestAttribute("postbox.data",checker.getValue());
// run the preview
checker = conf.getNewTopicPreviewChecker();
checker.append(postdata);
checker.finish();
rinput.setRequestAttribute("preview.text",checker.getValue());
rinput.setRequestAttribute("preview.num_errors",new java.lang.Integer(checker.getCounter("spelling")));
} // end try
catch (e)
{ // watch out for spurious HTMLCheckerExceptions
etype = vlib.exceptionType(e) + "";
if (etype.match("HTMLCheckerException"))
throw new InternalStateError("spurious HTMLCheckerException thrown");
else
throw new InternalStateError("unknown exception thrown in new_topic.js preview: " + e);
} // end catch
// save off any additional parameters we need
tmp = rinput.getParameter("attach");
if (!(vlib.emptyString(tmp)))
rinput.setRequestAttribute("postbox.attach","Y");
// create a JSPView for the preview and output it
view = new JSPView("Preview New Topic","conf/new_topic.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
vlib.output(view);
vlib.done();
} // end if
if (!(rinput.isImageButtonClicked("post1")))
{ // there were only the three buttons - bug out!
logger.error("no known button click on POST to conf/new_topic.js");
vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
vlib.done();
} // end if
rc = null;
try
{ // add the new topic!
topic = conf.addTopic(rinput.getParameter("title"),rinput.getParameter("pseud"),rinput.getParameter("pb"));
// decide where we go from here
if (vlib.emptyString(rinput.getParameter("attach")))
rc = new Redirect(on_error,LinkTypes.SERVLET); // bounce straight to our new view!
else
{ // we need to display the attachment form
msg = topic.getMessage(0); // the message the attachment gets hooked to
rinput.setRequestAttribute("attachment.postid",msg.postID + "");
rinput.setRequestAttribute("attachment.target",on_error);
rc = new JSPView("Upload Attachment","conf/attachment.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end else
} // end try
catch (e)
{ // new topic creation failed
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error creating topic: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,82 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
// get the message under consideration
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
+ conf.confID + "&top=" + topic.topicNumber);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
+ "&p1=" + msg.getPostNumber() + "&shac=1";
CONFIRM_attr = "conferences.message.nuke.ConfirmBox";
CONFIRM_param = "confirm";
rc = null;
try
{ // do the nuke here...
if (ConfirmBox.isConfirmed(rinput,CONFIRM_attr,CONFIRM_param))
{ // it is confirmed - we want to nuke the message!
msg.nuke();
// bounce back to the topic display afterwards
rc = new Redirect("conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber,LinkTypes.SERVLET);
} // end if
else
{ // come up with the confirm box (this may throw exceptions too)
aliases = conf.aliases;
rc = new ConfirmBox(rinput,CONFIRM_attr,CONFIRM_param,"Nuke Message",
"You are about to nuke message <" + aliases.get(0).toString() + "." + topic.topicNumber
+ "." + msg.postNumber + ">, originally composed by <" + msg.creatorName
+ ">! Are you sure you want to do this?",
"conf/nuke_message.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber + "&msg=" + msg.postNumber,LinkTypes.SERVLET,on_error,
LinkTypes.SERVLET);
} // end else
} // end try
catch (e)
{ // error deleting
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error nuking message: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

View File

@@ -0,0 +1,227 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(java.util);
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.htmlcheck);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber;
if (rinput.isImageButtonClicked("cancel"))
{ // cancelling - go back where we came from
vlib.output(new Redirect(on_error,LinkTypes.SERVLET));
vlib.done();
} // end if
// get the current post number
post_num = rinput.getParameterInt("sd",-1);
if (post_num<0)
{ // this value is critical for slippage detection - we must have it
vlib.output(new ErrorBox(null,"Invalid parameter.",on_error));
vlib.done();
} // end if
// get the raw post data
raw_postdata = rinput.getParameter("pb");
if (raw_postdata==null)
raw_postdata = "";
if (rinput.isImageButtonClicked("preview"))
{ // generate a preview! start by passing all the data through the HTML checker as needed
try
{ // escape the pseud
checker = rinput.engine.getEscapingChecker();
checker.append(rinput.getParameter("pseud"));
checker.finish();
rinput.setRequestAttribute("postbox.pseud",checker.getValue());
// escape the data
checker.reset();
checker.append(raw_postdata);
checker.finish();
rinput.setRequestAttribute("postbox.data",checker.getValue());
// run the preview
checker = topic.getPreviewChecker();
checker.append(raw_postdata);
checker.finish();
rinput.setRequestAttribute("preview.text",checker.getValue());
rinput.setRequestAttribute("preview.num_errors",new java.lang.Integer(checker.getCounter("spelling")));
} // end try
catch (e)
{ // watch out for spurious HTMLCheckerExceptions
etype = vlib.exceptionType(e) + "";
if (etype.match("HTMLCheckerException"))
throw new InternalStateError("spurious HTMLCheckerException thrown");
else
throw new InternalStateError("unknown exception thrown in post_message.js preview: " + e);
} // end catch
// save off any additional parameters we need
tmp = rinput.getParameter("next");
if (tmp!=null)
rinput.setRequestAttribute("postbox.hidden.next",tmp);
rinput.setRequestAttribute("postbox.hidden.sd",post_num + "");
tmp = rinput.getParameter("attach");
if (!(vlib.emptyString(tmp)))
rinput.setRequestAttribute("postbox.attach","Y");
tmp = rinput.getParameter("slip");
if (!(vlib.emptyString(tmp)))
rinput.setRequestAttribute("postbox.hidden.slip","Y");
// create a JSPView for the preview and output it
view = new JSPView("Previewing Message","conf/preview.jsp");
view.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
vlib.output(view);
vlib.done();
} // end if
if (!(rinput.isImageButtonClicked("post") || rinput.isImageButtonClicked("postnext")
|| rinput.isImageButtonClicked("posttopics")))
{ // one of the three POST buttons MUST have been checked!
logger.error("no known button click on POST to conf/post_message.js");
vlib.output(new ErrorBox("Internal Error","Unknown command button pressed",on_error));
vlib.done();
} // end if
if (post_num!=topic.getTotalMessages())
{ // slippage detected! generate parameters for the Slippage view
rc = null;
try
{ // get the list of messages associated with the slippage
rinput.setRequestAttribute("slippage.messages",topic.getMessages(post_num,topic.totalMessages-1));
// generate the topic stem
aliases = conf.aliases;
rinput.setRequestAttribute("slippage.topic_stem",
aliases.get(0).toString() + "." + topic.topicNumber + ".");
// escape the pseud
checker = rinput.engine.getEscapingChecker();
checker.append(rinput.getParameter("pseud"));
checker.finish();
rinput.setRequestAttribute("postbox.pseud",checker.getValue());
// escape the data
checker.reset();
checker.append(raw_postdata);
checker.finish();
rinput.setRequestAttribute("postbox.data",checker.getValue());
// save off any additional parameters we need
tmp = rinput.getParameter("next");
if (tmp!=null)
rinput.setRequestAttribute("postbox.hidden.next",tmp);
rinput.setRequestAttribute("postbox.hidden.sd",topic.totalMessages + "");
tmp = rinput.getParameter("attach");
if (!(vlib.emptyString(tmp)))
rinput.setRequestAttribute("postbox.attach","Y");
// create the slippage view
rc = new JSPView("Slippage or Double-Click Detected","conf/slippage.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // handle an exception generating the slippage view
etype = vlib.exceptionType(e) + "";
if (etype.match("HTMLCheckerException"))
throw new InternalStateError("spurious HTMLCheckerException thrown");
else if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error generating slippage view: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc);
vlib.done();
} // end if
rc = null;
try
{ // actually post the darn thing!
msg = topic.postNewMessage(0,rinput.getParameter("pseud"),raw_postdata);
// If there was no slippage, make sure we mark the new post as "read."
if (!(rinput.hasParameter("slip")))
topic.fixSeen();
// Where do we want to go now?
tmp = "";
if (rinput.isImageButtonClicked("posttopics"))
tmp = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
else
{ // find the topic number to go to next and compute the new URL
my_topicnum = -1;
if (rinput.isImageButtonClicked("postnext"))
my_topicnum = rinput.getParameterShort("next",topic.topicNumber);
else
my_topicnum = topic.topicNumber;
tmp = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + my_topicnum
+ "&rnm=1";
} // end else
if (vlib.emptyString(rinput.getParameter("attach")))
rc = new Redirect(tmp,LinkTypes.SERVLET); // bounce straight to our new view!
else
{ // we need to display the attachment form
rinput.setRequestAttribute("attachment.postid",msg.postID + "");
rinput.setRequestAttribute("attachment.target",tmp);
rc = new JSPView("Upload Attachment","conf/attachment.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end else
} // end try
catch (e)
{ // handle an error in doing the post
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error posting message: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
on_error = "conf/conf_reports.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
// get the current topic (where applicable)
topic = currc.getTopic(false,on_error);
rc = null;
try
{ // construct the activity list
my_list = null;
my_title = null;
title1 = null;
title2 = null;
nullmsg = null;
if (topic!=null)
{ // get the poster list from the topic
my_list = topic.getActivePosters();
if (my_list.isEmpty())
nullmsg = "No posters to topic \"" + topic.name + "\" found.";
my_title = "Users Posting in Topic " + topic.name;
title1 = "Posters in Topic:";
title2 = topic.name;
} // end if
else
{ // get the poster list from the conference
my_list = conf.getActivePosters();
if (my_list.isEmpty())
nullmsg = "No posters to conference \"" + vlib.encodeHTML(conf.name) + "\" found.";
my_title = "Users Posting in Conference " + conf.name;
title1 = "Posters in Conference:";
title2 = conf.name;
} // end else
// save off the attributes
rinput.setRequestAttribute("conference.activity.list",my_list);
rinput.setRequestAttribute("conference.activity.nullmessage",nullmsg);
rinput.setRequestAttribute("conference.activity.posters",Boolean.TRUE);
rinput.setRequestAttribute("conference.activity.title",title1);
rinput.setRequestAttribute("conference.activity.subtitle",title2);
// create the view
rc = new JSPView(my_title,"conf/activity_report.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
} // end try
catch (e)
{ // error getting the list of posters
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error getting poster list: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done...

143
scripts/conf/posts.js Normal file
View File

@@ -0,0 +1,143 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importClass(java.awt.Dimension);
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.conf.view);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
SCALING_NUM = 1;
SCALING_DENOM = 2;
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
on_error = "conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID;
topic = currc.getTopic(true,on_error);
// if we need to restore posts in another topic, do so
read_new = true;
if (rinput.hasParameter("rtop") && rinput.hasParameter("rct"))
{ // retrieve the "other topic"
other_topic = currc.getOptionalTopic("rtop");
if (other_topic!=null)
{ // get the number of unread messages
nunread = rinput.getParameterInt("rct",0);
if ((nunread>0) && (nunread<=other_topic.totalMessages))
{ // set the unread message count
try
{ // reset the unread messages
other_topic.unreadMessages = nunread;
} // end try
catch (e)
{ // it didn't work - ignore the error
logger.warn("exception setting unread messages: " + e);
} // end catch
if (topic.topicID==other_topic.topicID)
read_new = false; // don't do a read new if we just restored this topic
} // end if
else // ignore this
logger.warn("number of unread messages out of range");
} // end if
} // end if
// get the post interval
piv = currc.getPostInterval(on_error);
// get the "read new" parameter
if (read_new)
read_new = rinput.hasParameter("rnm");
rc = null;
try
{ // create the view
rc = new PostsView(comm,currc);
logger.debug(rc.unread + " unread messages");
// fill in parameters
rc.first = piv.first;
rc.last = piv.last;
rc.showAdvanced = rinput.hasParameter("shac");
rc.noBozos = rinput.hasParameter("nbz");
rc.messages = topic.getMessages(piv.first,piv.last);
rc.topCustom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
rc.bottomCustom = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
rc.title = topic.name;
rc.subtitle = topic.totalMessages + " Total; " + rc.unread + " New; Last: "
+ rinput.formatDate(topic.lastUpdateDate);
// do a "read new" on this topic
if (read_new)
topic.unreadMessages = 0;
// visit the topic
visit_order = currc.getTopicVisitOrder();
if (visit_order!=null)
visit_order.visit(topic.topicNumber);
rc.topicVisitOrder = visit_order;
// get the aliases list and synthesize the topic stem and QID
aliases = conf.aliases;
tmp = aliases.get(0).toString() + "." + topic.topicNumber;
rc.topicStem = tmp + ".";
rc.pageQID = "go/" + comm.alias + "!" + tmp;
if (conf.displayPostPictures() && rinput.user.displayPostPictures())
{ // set up the user p[hoto dimensions
old_psz = rinput.engine.getUserPhotoSize();
rc.photoDims = new Dimension((old_psz.width * SCALING_NUM) / SCALING_DENOM,
(old_psz.height * SCALING_NUM) / SCALING_DENOM);
} // end if
rc.buildInternals(rinput.user); // build the bozo filter and user photo lists in compiled code
} // end try
catch (e)
{ // handle an exception here
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error listing messages: " + e.message,on_error);
else if (etype.match("AccessError"))
{ // unable to get message list - maybe we weren't logged in
if (rinput.user.isLoggedIn())
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = new LogInOrCreate();
} // end else if
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,60 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
// get the message under consideration
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
+ conf.confID + "&top=" + topic.topicNumber);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
+ "&p1=" + msg.getPostNumber() + "&shac=1";
rc = null;
try
{ // publish it!
msg.publish();
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error publishing
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error publishing message: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

66
scripts/conf/read_new.js Normal file
View File

@@ -0,0 +1,66 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
rc = null;
try
{ // get the topic list, using the current view and sort options
topic_list = conf.getTopicList(currc.viewOption,currc.sortOption);
// initialize and return the topic visit order
ord = currc.newTopicVisitOrder(topic_list);
if (ord.isNext()) // retrieve the first topic number from the list and bounce directly there
rc = new Redirect("conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ ord.getNext() + "&rnm=1",LinkTypes.SERVLET);
else // no unread messages - bounce to the topics list
rc = new Redirect("conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error generating the topic list
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,
"conf/conferences.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
{ // they might not be logged in, that's all
if (rinput.user.isLoggedIn())
rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
else
rc = new LogInOrCreate();
} // end else if
else
rc = e;
} // end catch
vlib.output(rc);

View File

@@ -0,0 +1,58 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber;
rc = null;
try
{ // get the UID and clear the bozo status
uid = rinput.getParameterInt("u",-1);
if (uid>0)
topic.setBozo(uid,false);
// bounce back to the Manage Topics display
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // handle an error message
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting filter: " + e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done

View File

@@ -0,0 +1,60 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
// get the message under consideration
msg = currc.getTopicMessageParam("msg",true,"conf/posts.js.vs?cc=" + comm.communityID + "&conf="
+ conf.confID + "&top=" + topic.topicNumber);
on_error = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + topic.topicNumber
+ "&p1=" + msg.getPostNumber() + "&shac=1";
rc = null;
try
{ // scribble it!
msg.scribble();
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error scribbling
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error scribbling message: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

53
scripts/conf/set_pseud.js Normal file
View File

@@ -0,0 +1,53 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(Packages.com.silverwrist.venice.core);
importPackage(Packages.com.silverwrist.venice.except);
importPackage(Packages.com.silverwrist.venice.ui);
importPackage(Packages.com.silverwrist.venice.ui.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/manage_conf.js.vs?cc=" + comm.communityID);
rc = null;
try
{ // change the default pseud
pseud = rinput.getParameter("pseud");
if (pseud!=null)
conf.defaultPseud = pseud;
// don't change the current view
rc = new NullResponse();
} // end try
catch (e)
{ // error resetting the pseud
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting pseud: " + e.message,
"conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -0,0 +1,57 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the current topic
topic = currc.getTopic(true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
on_error = "conf/manage_topic.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top="
+ topic.topicNumber;
rc = null;
try
{ // get the flag and set the archived status
flag = rinput.getParameterInt("flag",0);
topic.setSubscribed(flag==1);
rc = new Redirect(on_error,LinkTypes.SERVLET);
} // end try
catch (e)
{ // error setting the hide topic
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error setting subscription status: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

125
scripts/conf/topics.js Normal file
View File

@@ -0,0 +1,125 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
importPackage(Packages.com.silverwrist.venice.ui.view);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the view option
view_opt = currc.viewOption;
if (rinput.hasParameter("view"))
{ // get the new view option
view_opt = rinput.getParameterInt("view",view_opt);
if ( (view_opt!=ConferenceContext.DISPLAY_NEW) && (view_opt!=ConferenceContext.DISPLAY_ACTIVE)
&& (view_opt!=ConferenceContext.DISPLAY_ALL) && (view_opt!=ConferenceContext.DISPLAY_HIDDEN)
&& (view_opt!=ConferenceContext.DISPLAY_ARCHIVED))
{ // the view option is invalid
vlib.output(new ErrorBox(null,"Invalid view parameter.","conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
currc.viewOption = view_opt; // save the changed view option
} // end if
// get the sort option
sort_opt = currc.sortOption;
if (rinput.hasParameter("sort"))
{ // get and test the new sort option
sort_opt = rinput.getParameterInt("sort",sort_opt);
tmp_sort = ((sort_opt<0) ? -sort_opt : sort_opt);
if ( (tmp_sort!=ConferenceContext.SORT_NUMBER) && (tmp_sort!=ConferenceContext.SORT_NAME)
&& (tmp_sort!=ConferenceContext.SORT_UNREAD) && (tmp_sort!=ConferenceContext.SORT_TOTAL)
&& (tmp_sort!=ConferenceContext.SORT_DATE))
{ // the sort option is invalid
vlib.output(new ErrorBox(null,"Invalid sort parameter.","conf/conferences.js.vs?cc=" + comm.communityID));
vlib.done();
} // end if
currc.sortOption = sort_opt; // save the changed sort option
} // end if
rc = null;
try
{ // get the topic list
topic_list = conf.getTopicList(view_opt,sort_opt);
// initialize the visit order
ord = currc.newTopicVisitOrder(topic_list);
// get the aliases list...
aliases = conf.aliases;
// set the attributes we want to carry into the page
rinput.setRequestAttribute("topics.list",topic_list);
tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_TOP);
if (tmp==null)
tmp = "";
rinput.setRequestAttribute("conference.custom.top",tmp);
tmp = conf.getCustomBlock(ConferenceContext.CUST_BLOCK_BOTTOM);
if (tmp==null)
tmp = "";
rinput.setRequestAttribute("conference.custom.bottom",tmp);
if (ord.isNext())
{ // precalculate the "Read New" link and pass it to the page
tmp = "conf/posts.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID + "&top=" + ord.getNext()
+ "&rnm=1";
rinput.setRequestAttribute("conference.readnew",tmp);
} // end if
// create a JSPView to return
rc = new JSPView("Topics in " + conf.name,"conf/topics.jsp");
rc.menuSelector = Content.MENU_SELECTOR_COMMUNITY;
rc.pageQID = "go/" + comm.alias + "!" + aliases.get(0);
} // end try
catch (e)
{ // error generating the topic list
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error listing topics: " + e.message,
"conf/conferences.js.vs?cc=" + comm.communityID);
else if (etype.match("AccessError"))
{ // they might not be logged in, that's all
if (rinput.user.isLoggedIn())
rc = new ErrorBox("Access Error",e.message,"conf/conferences.js.vs?cc=" + comm.communityID);
else
rc = new LogInOrCreate();
} // end else if
else
rc = e;
} // end catch
vlib.output(rc);

View File

@@ -0,0 +1,84 @@
// The contents of this file are subject to the Mozilla Public License Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
importPackage(java.util);
importPackage(Packages.com.silverwrist.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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object
rinput = bsf.lookupBean("request");
if (rinput.isFileParam("target"))
{ // the target should be a normal parameter
logger.error("Internal Error: 'target' should be a normal param");
vlib.output(new ErrorBox(null,"Internal Error: 'target' should be a normal param","top.js.vs"));
vlib.done();
} // end if
// Get the operations target.
target = rinput.getParameter("target");
logger.debug("Target URL: " + target);
rinput.location = target;
// also check on file parameter status
if (!(rinput.isFileParam("thefile")))
{ // bogus file parameter
logger.error("Internal Error: 'thefile' should be a file param");
vlib.output(new ErrorBox(null,"Internal Error: 'thefile' should be a file param",target));
vlib.done();
} // end if
// get the community
comm = rinput.getCommunity(true,target);
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,target);
// get the message we're attaching to
msg = currc.getMessageParam("msg",true,target);
rc = null;
try
{ // do the attachment!
msg.attachData(rinput.getParameterType("thefile"),rinput.getParameter("thefile"),
rinput.getParameterSize("thefile"),rinput.getParameterDataStream("thefile"));
// now bounce us where we wanted to go in the first place
rc = new Redirect(target,LinkTypes.SERVLET);
} // end try
catch (e)
{ // failure in setting attachment
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error saving attachment: " + e.message,target);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,target);
else if (etype.match("ServletMultipartException"))
rc = new ErrorBox("Internal Error",e.message,target);
else
rc = e;
} // end catch
vlib.output(rc); // all done!

View File

@@ -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 <http://www.mozilla.org/MPL/>.
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
// language governing rights and limitations under the License.
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
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.conf);
importPackage(Packages.com.silverwrist.venice.ui.helpers);
// get the request object and the community
rinput = bsf.lookupBean("request");
comm = rinput.getCommunity(true,"top.js.vs");
// get the current conference
currc = new CurrentConference(rinput);
conf = currc.getConference(true,"conf/conferences.js.vs?cc=" + comm.communityID);
// get the message we're looking in
msg = currc.getMessageParam("msg",true,"conf/topics.js.vs?cc=" + comm.communityID + "&conf=" + conf.confID);
rc = null;
try
{ // retrieve the attachment data and send it out
if (msg.hasAttachment())
rc = new AttachmentContent(msg);
else
rc = new ErrorBox(null,"This message has no attachment.",null);
} // end try
catch (e)
{ // failure in retrieving attachment
etype = vlib.exceptionType(e) + "";
if (etype.match("DataException"))
rc = new ErrorBox("Database Error","Database error retrieving attachment: " + e.message,on_error);
else if (etype.match("AccessError"))
rc = new ErrorBox("Access Error",e.message,on_error);
else
rc = e;
} // end catch
vlib.output(rc); // all done!