2002-01-06 19:05:37 -07:00
|
|
|
// 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.
|
|
|
|
//
|
2006-01-25 21:40:34 -07:00
|
|
|
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
|
2002-01-06 19:05:37 -07:00
|
|
|
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
2004-07-11 02:08:27 -06:00
|
|
|
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
2002-01-06 19:05:37 -07:00
|
|
|
//
|
|
|
|
// 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
|
2004-07-11 02:08:27 -06:00
|
|
|
topic_list = conf.getTopicList(view_opt,sort_opt,false);
|
2002-01-06 19:05:37 -07:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
|