second round of public beta bugfixes:

- fixed a bug in navigation between conferences via post links
- fixed the "your post is 'new'" bug (this was actually another bug, in
  postNewMessage())
- some other stuff
This commit is contained in:
Eric J. Bowersox
2001-04-07 05:30:33 +00:00
parent 8f31704563
commit 3d32fe95c5
6 changed files with 75 additions and 17 deletions

View File

@@ -75,7 +75,7 @@ public class ConfDisplay extends VeniceServlet
*--------------------------------------------------------------------------------
*/
private static Category logger = Category.getInstance(ConfDisplay.class.getName());
private static Category logger = Category.getInstance(ConfDisplay.class);
/*--------------------------------------------------------------------------------
* Internal functions

View File

@@ -80,12 +80,12 @@ public class ConfOperations extends VeniceServlet
private static boolean validateNewTopic(ServletRequest request, String on_error) throws ErrorBox
{
boolean is_title_null, is_zp_null;
//boolean is_title_null, is_zp_null;
String foo = request.getParameter("title");
if (foo==null)
throw new ErrorBox(null,"Title parameter was not specified.",on_error);
is_title_null = (foo.length()==0);
//is_title_null = (foo.length()==0);
foo = request.getParameter("pseud");
if (foo==null)
@@ -94,9 +94,13 @@ public class ConfOperations extends VeniceServlet
foo = request.getParameter("pb");
if (foo==null)
throw new ErrorBox(null,"Body text was not specified.",on_error);
is_zp_null = (foo.length()==0);
//is_zp_null = (foo.length()==0);
/* EJB 4/5/2001 - remove this for consistency. FUTURE: bring it back under a global option?
return is_title_null || is_zp_null;
-- end removed code */
return false;
} // end validateNewTopic
@@ -709,8 +713,11 @@ public class ConfOperations extends VeniceServlet
} // end catch
/* EJB 4/5/2001 - code removed for consistency - FUTURE: bring it back controlled by
a global option?
if (ntf.isNullRequest())
return null; // no title or text specified - "204 No Content"
-- end removed code */
setMyLocation(request,"confops?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&cmd=T");
return ntf;

View File

@@ -20,6 +20,7 @@ package com.silverwrist.venice.servlets.format;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.log4j.*;
import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.core.*;
@@ -30,6 +31,8 @@ public class TopicPosts implements JSPRender
*--------------------------------------------------------------------------------
*/
private static Category logger = Category.getInstance(TopicPosts.class);
// Attribute name for request attribute
protected static final String ATTR_NAME = "com.silverwrist.venice.content.TopicPosts";
@@ -60,6 +63,10 @@ public class TopicPosts implements JSPRender
TopicContext topic, int first, int last, boolean read_new, boolean show_advanced)
throws DataException, AccessError
{
if (logger.isDebugEnabled())
logger.debug("TopicPosts: sig=" + sig.getSIGID() + ", conf=" + conf.getConfID() + ", topic="
+ topic.getTopicNumber() + ", range=[" + first + ", " + last + "], rnm=" + read_new
+ ", shac=" + show_advanced);
this.engine = engine;
this.sig = sig;
this.conf = conf;
@@ -70,9 +77,12 @@ public class TopicPosts implements JSPRender
this.unread = topic.getUnreadMessages();
if (read_new)
topic.setUnreadMessages(0);
if (logger.isDebugEnabled())
logger.debug(this.unread + " unread messages");
this.messages = topic.getMessages(first,last);
this.visit_order = TopicVisitOrder.retrieve(request.getSession(true),conf.getConfID());
visit_order.visit(topic.getTopicNumber());
if (visit_order!=null)
visit_order.visit(topic.getTopicNumber());
List aliases = conf.getAliases();
topic_stem = (String)(aliases.get(0)) + "." + String.valueOf(topic.getTopicNumber()) + ".";
@@ -173,7 +183,10 @@ public class TopicPosts implements JSPRender
public int getNextTopicNumber()
{
return visit_order.getNext();
if (visit_order!=null)
return visit_order.getNext();
else
return -1;
} // end getNextTopicNumber
@@ -203,8 +216,9 @@ public class TopicPosts implements JSPRender
public String getNextLocator()
{
StringBuffer buf = new StringBuffer("sig=");
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID()).append("&top=");
buf.append(visit_order.getNext());
buf.append(sig.getSIGID()).append("&conf=").append(conf.getConfID());
if (visit_order!=null)
buf.append("&top=").append(visit_order.getNext());
return buf.toString();
} // end getNextLocator
@@ -257,7 +271,10 @@ public class TopicPosts implements JSPRender
public boolean canDoNextTopic()
{
return visit_order.isNext();
if (visit_order!=null)
return visit_order.isNext();
else
return false;
} // end canDoNextTopic

View File

@@ -99,13 +99,9 @@ public class TopicVisitOrder
TopicVisitOrder tvo = (TopicVisitOrder)(session.getAttribute(ATTRIBUTE));
if (tvo!=null)
{ // make sure the conference is OK
if (tvo.confid!=confid)
{ // wrong conference - remove this
session.removeAttribute(ATTRIBUTE);
if (tvo.confid!=confid) // wrong conference - remove this
tvo = null;
} // end if
} // end if
return tvo;