added "sticky" topic facility to cause topics to always float at the top of

the topic list when it's set
This commit is contained in:
Eric J. Bowersox
2004-07-11 08:08:27 +00:00
parent f0bf5e31ee
commit 477aac51f0
26 changed files with 1061 additions and 809 deletions

View File

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -34,7 +34,7 @@ on_error = "conf/manage_conf.js.vs?cc=" + comm.communityID + "&conf=" + conf.con
rc = null;
try
{ // get a topic list from the conference
topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
topics = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER,true);
rinput.setRequestAttribute("conference.reports.topiclist",topics);
// create the result view

View File

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -35,7 +35,7 @@ if ("GET"==rinput.verb)
{ // display the dialog
try
{ // we need the topic list
tlist = conf.getTopicList(ConferenceContext.DISPLAY_ALL,ConferenceContext.SORT_NAME);
tlist = conf.getTopicList(ConferenceContext.DISPLAY_ALL,ConferenceContext.SORT_NAME,true);
rinput.setRequestAttribute("topic.email.list",tlist);
// create the dialog

View File

@@ -45,7 +45,7 @@ try
{ // figure out what to do here
if ("GET"==rinput.verb)
{ // load and display the JSP page for the form
l = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER);
l = conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NUMBER,true);
rinput.setRequestAttribute("topic.list",l);
rc = new JSPView("Export Messages: " + conf.name,"conf/export.jsp");

View File

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2002-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -58,7 +58,7 @@ if ("GET"==rinput.verb)
rc = null;
try
{ // get the list of topics in the conference
in_list = vlib.castList(conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NAME));
in_list = vlib.castList(conf.getTopicList(ConferenceContext.GET_ALL,ConferenceContext.SORT_NAME,true));
out_list = vlib.createList();
it = in_list.iterator();
while (it.hasNext())

View File

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -113,7 +113,7 @@ try
rc.pageQID = "go/" + comm.alias + "!" + tmp;
if (conf.displayPostPictures() && rinput.user.displayPostPictures())
{ // set up the user p[hoto dimensions
{ // set up the user photo dimensions
old_psz = rinput.engine.getUserPhotoSize();
rc.photoDims = new Dimension((old_psz.width * SCALING_NUM) / SCALING_DENOM,
(old_psz.height * SCALING_NUM) / SCALING_DENOM);

View File

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -32,7 +32,7 @@ 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);
topic_list = conf.getTopicList(currc.viewOption,currc.sortOption,false);
// initialize and return the topic visit order
ord = currc.newTopicVisitOrder(topic_list);

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@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2004 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 sticky status
flag = rinput.getParameterInt("flag",0);
topic.setSticky(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 sticky 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

@@ -8,9 +8,9 @@
//
// The Original Code is the Venice Web Communities System.
//
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
// Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
// Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
//
// Contributor(s):
@@ -70,7 +70,7 @@ if (rinput.hasParameter("sort"))
rc = null;
try
{ // get the topic list
topic_list = conf.getTopicList(view_opt,sort_opt);
topic_list = conf.getTopicList(view_opt,sort_opt,false);
// initialize the visit order
ord = currc.newTopicVisitOrder(topic_list);