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,13 +390,64 @@ 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);
if (read_new)
{ // we need to generate a TopicPosts view
TopicPosts tpos = null;
try
{ // generate a topic list first
List topic_list = conf.getTopicList(opts.getViewOption(conf.getConfID()),
opts.getSortOption(conf.getConfID()));
// now generate the topic visit order
TopicVisitOrder ord = TopicVisitOrder.initialize(request.getSession(true),conf.getConfID(),
topic_list);
// 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;
} // 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; TopicListing tl = null;
try try
{ // create the topic lict { // create the topic lict
@ -417,6 +468,8 @@ public class ConfDisplay extends VeniceServlet
return tl; return tl;
} // end else (not reading new messages, but just displaying topics)
} // end else (topics in a conference) } // end else (topics in a conference)
} // end doVeniceGet } // end doVeniceGet

View File

@ -135,9 +135,12 @@ 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; short next;
try try
{ // attempt to get the value of the "next topic" parameter { // attempt to get the value of the "next topic" parameter
@ -160,10 +163,11 @@ public class PostMessage extends VeniceServlet
} // end catch } // end catch
// where do we want to go now? target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
String target = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID() + "&top="
+ next + "&rnm=1"; + next + "&rnm=1";
} // end else
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); %>