fixed bug with not allowing attachments with Post & Go Topics; fixed

compile error with removal of Smart Tags; made "New!" flags on conferences
actually *do* something (read new messages)
This commit is contained in:
Eric J. Bowersox 2001-06-28 03:54:27 +00:00
parent a9847865d9
commit e108be62da
5 changed files with 100 additions and 41 deletions

View File

@ -390,32 +390,85 @@ public class ConfDisplay extends VeniceServlet
{ // we're displaying the conference's topic list { // we're displaying the conference's topic list
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("MODE: display topics in conference"); logger.debug("MODE: display topics in conference");
setMyLocation(request,"confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID());
String on_error = "confops?sig=" + sig.getSIGID(); String on_error = "confops?sig=" + sig.getSIGID();
String my_location = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
boolean read_new = !(StringUtil.isStringEmpty(request.getParameter("rnm")));
if (read_new)
my_location += "&rn=1";
setMyLocation(request,my_location);
// get any changes to view or sort options // get any changes to view or sort options
TopicSortHolder opts = TopicSortHolder.retrieve(request.getSession(true)); TopicSortHolder opts = TopicSortHolder.retrieve(request.getSession(true));
getViewSortDefaults(request,conf.getConfID(),opts,on_error); getViewSortDefaults(request,conf.getConfID(),opts,on_error);
TopicListing tl = null; if (read_new)
try { // we need to generate a TopicPosts view
{ // create the topic lict TopicPosts tpos = null;
tl = new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
opts.getSortOption(conf.getConfID()));
} // end try try
catch (DataException de) { // generate a topic list first
{ // there was a database error retrieving topics List topic_list = conf.getTopicList(opts.getViewOption(conf.getConfID()),
return new ErrorBox("Database Error","Database error listing topics: " + de.getMessage(),on_error); opts.getSortOption(conf.getConfID()));
} // end catch // now generate the topic visit order
catch (AccessError ae) TopicVisitOrder ord = TopicVisitOrder.initialize(request.getSession(true),conf.getConfID(),
{ // we were unable to retrieve the topic list topic_list);
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch // use the new visit order to get the topic we need to visit
short topic_nbr = ord.getNext();
Iterator it = topic_list.iterator();
while (it.hasNext())
{ // locate the first topic to be read
topic = (TopicContext)(it.next());
if (topic.getTopicNumber()==topic_nbr)
break;
return tl; } // end while
// determine what the post interval is we want to display
PostInterval piv = getInterval(engine,request,topic,on_error);
// create the topic posts view
tpos = new TopicPosts(request,engine,sig,conf,topic,piv.getFirst(),piv.getLast(),true,false);
} // end try
catch (DataException de)
{ // there was a database error retrieving messages
return new ErrorBox("Database Error","Database error listing messages: " + de.getMessage(),on_error);
} // end catch
catch (AccessError ae)
{ // we were unable to retrieve the message list
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
return tpos; // this is what we need!
} // end if (creating a "read new" topic list view)
else
{ // topic listing only...
TopicListing tl = null;
try
{ // create the topic lict
tl = new TopicListing(request,sig,conf,opts.getViewOption(conf.getConfID()),
opts.getSortOption(conf.getConfID()));
} // end try
catch (DataException de)
{ // there was a database error retrieving topics
return new ErrorBox("Database Error","Database error listing topics: " + de.getMessage(),on_error);
} // end catch
catch (AccessError ae)
{ // we were unable to retrieve the topic list
return new ErrorBox("Access Error",ae.getMessage(),on_error);
} // end catch
return tl;
} // end else (not reading new messages, but just displaying topics)
} // end else (topics in a conference) } // end else (topics in a conference)

View File

@ -135,34 +135,38 @@ public class PostMessage extends VeniceServlet
if (!(yes.equals(request.getParameter("slip")))) if (!(yes.equals(request.getParameter("slip"))))
topic.fixSeen(); // no slippage = make sure we mark all as read topic.fixSeen(); // no slippage = make sure we mark all as read
if (go_topics) // jump back to the topic list, puhleaze // where do we want to go now?
throw new RedirectResult("confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID()); String target;
if (go_topics)
target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
else
{ // figure out what topic to go to next
short next;
try
{ // attempt to get the value of the "next topic" parameter
if (go_next)
{ // get the "next topic" parameter
String foo = request.getParameter("next");
if (StringUtil.isStringEmpty(foo))
next = topic.getTopicNumber();
else
next = Short.parseShort(foo);
short next; } // end if
try
{ // attempt to get the value of the "next topic" parameter
if (go_next)
{ // get the "next topic" parameter
String foo = request.getParameter("next");
if (StringUtil.isStringEmpty(foo))
next = topic.getTopicNumber();
else else
next = Short.parseShort(foo); next = topic.getTopicNumber();
} // end if } // end try
else catch (NumberFormatException nfe)
{ // just default me
next = topic.getTopicNumber(); next = topic.getTopicNumber();
} // end try } // end catch
catch (NumberFormatException nfe)
{ // just default me
next = topic.getTopicNumber();
} // end catch target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
+ next + "&rnm=1";
// where do we want to go now? } // end else
String target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
+ next + "&rnm=1";
if (yes.equals(request.getParameter("attach"))) if (yes.equals(request.getParameter("attach")))
return new AttachmentForm(sig,conf,msg,target); // go to upload an attachment return new AttachmentForm(sig,conf,msg,target); // go to upload an attachment

View File

@ -135,7 +135,7 @@ public class RenderData
} // end canGZIPEncode } // end canGZIPEncode
boolean noSmartTags() public boolean noSmartTags()
{ {
return rconf.noSmartTags(); return rconf.noSmartTags();

View File

@ -82,8 +82,9 @@ public class SideBoxConferences implements ContentRender
+ rdat.getEncodedServletPath(href) + "\">" + StringUtil.encodeHTML(conf.getName()) + rdat.getEncodedServletPath(href) + "\">" + StringUtil.encodeHTML(conf.getName())
+ "</A></B> (" + StringUtil.encodeHTML(conf.getEnclosingSIG().getName()) + ")</FONT>\n"); + "</A></B> (" + StringUtil.encodeHTML(conf.getEnclosingSIG().getName()) + ")</FONT>\n");
if (conf.anyUnread()) if (conf.anyUnread())
out.write("&nbsp;<IMG SRC=\"" + rdat.getFullImagePath("tag_new.gif") out.write("&nbsp;<A HREF=\"" + rdat.getEncodedServletPath(href + "&rnm=1") + "\"><IMG SRC=\""
+ "\" ALT=\"New!\" BORDER=0 WIDTH=40 HEIGHT=20>\n"); + rdat.getFullImagePath("tag_new.gif")
+ "\" ALT=\"New!\" BORDER=0 WIDTH=40 HEIGHT=20></A>\n");
out.write("</TD>\n</TR>\n"); out.write("</TD>\n</TR>\n");
} // end while } // end while

View File

@ -39,7 +39,8 @@
<A HREF="<%= rdat.getEncodedServletPath(path) %>"><%= StringUtil.encodeHTML(data.getConferenceName(i)) %></A> - <A HREF="<%= rdat.getEncodedServletPath(path) %>"><%= StringUtil.encodeHTML(data.getConferenceName(i)) %></A> -
Latest activity: <%= rdat.getActivityString(data.getLastUpdateDate(i)) %> Latest activity: <%= rdat.getActivityString(data.getLastUpdateDate(i)) %>
<% if (data.anyUnread(i)) { %> <% if (data.anyUnread(i)) { %>
<IMG SRC="<%= rdat.getFullImagePath("tag_new.gif") %>" ALT=\"New!\" BORDER=0 WIDTH=40 HEIGHT=20> <A HREF="<%= rdat.getEncodedServletPath(path + "&rnm=1") %>"><IMG
SRC="<%= rdat.getFullImagePath("tag_new.gif") %>" ALT="New!" BORDER=0 WIDTH=40 HEIGHT=20></A>
<% } // end if %> <% } // end if %>
<BR> <BR>
<% int count = data.getNumHosts(i); %> <% int count = data.getNumHosts(i); %>