Implemented partial support for conference hotlists ("Add To Hotlist"
button, Conferences sidebox).
This commit is contained in:
@@ -326,6 +326,28 @@ public class ConfOperations extends VeniceServlet
|
||||
|
||||
} // end if ("M" command)
|
||||
|
||||
if (cmd.equals("H"))
|
||||
{ // "H" = "Add Conference To Hotlist" (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
on_error = "confdisp?sig=" + sig.getSIGID() + "&conf=" + conf.getConfID();
|
||||
|
||||
try
|
||||
{ // add to the hotlist
|
||||
conf.addToHotlist();
|
||||
|
||||
// and trap back to the conference display
|
||||
throw new RedirectResult(on_error);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // something wrong in the database
|
||||
return new ErrorBox("Database Error","Database error adding to hotlist: " + de.getMessage(),
|
||||
on_error);
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end if ("H" command)
|
||||
|
||||
if (cmd.equals("DEL"))
|
||||
{ // "DEL" = "Delete Conference (requires conference parameter)
|
||||
ConferenceContext conf = getConferenceParameter(request,sig,true,on_error);
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class SideBoxConferences implements ContentRender
|
||||
@@ -29,15 +30,17 @@ public class SideBoxConferences implements ContentRender
|
||||
*/
|
||||
|
||||
private UserContext uc;
|
||||
private List hotlist;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public SideBoxConferences(UserContext uc, String parameter)
|
||||
public SideBoxConferences(UserContext uc, String parameter) throws DataException
|
||||
{
|
||||
this.uc = uc;
|
||||
this.hotlist = uc.getConferenceHotlist();
|
||||
|
||||
} // end constructor
|
||||
|
||||
@@ -62,14 +65,34 @@ public class SideBoxConferences implements ContentRender
|
||||
|
||||
public void renderHere(Writer out, RenderData rdat) throws IOException
|
||||
{
|
||||
/* BEGIN TEMP */
|
||||
out.write("<FONT FACE=\"Arial, Helvetica\" SIZE=2><UL>\n");
|
||||
out.write("<LI>BOFH (Benevolent Dictators)</LI>\n");
|
||||
out.write("<LI>Playground (Electric Minds)</LI>\n");
|
||||
out.write("<LI>Commons (Electric Minds)</LI>\n");
|
||||
out.write("<LI>Top Ten Lists (Pamela's Lounge)</LI>\n");
|
||||
out.write("</UL></FONT>\n");
|
||||
/* END TEMP */
|
||||
out.write(rdat.getStdFontTag(null,2) + "\n");
|
||||
if (hotlist.size()>0)
|
||||
{ // display the list of conferences
|
||||
out.write("<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=2>\n");
|
||||
Iterator it = hotlist.iterator();
|
||||
while (it.hasNext())
|
||||
{ // display the names of the conferences and SIGs one by one
|
||||
ConferenceHotlistEntry hle = (ConferenceHotlistEntry)(it.next());
|
||||
ConferenceContext conf = hle.getConference();
|
||||
String href = "confdisp?sig=" + conf.getEnclosingSIG().getSIGID() + "&conf=" + conf.getConfID();
|
||||
out.write("<TR VALIGN=MIDDLE>\n<TD ALIGN=CENTER WIDTH=14><IMG SRC=\""
|
||||
+ rdat.getFullImagePath("purple-ball.gif")
|
||||
+ "\" ALT=\"*\" WIDTH=14 HEIGHT=14 BORDER=0></TD>\n");
|
||||
out.write("<TD ALIGN=LEFT>\n" + rdat.getStdFontTag(null,2) + "<B><A HREF=\""
|
||||
+ rdat.getEncodedServletPath(href) + "\">" + StringUtil.encodeHTML(conf.getName())
|
||||
+ "</A></B> (" + StringUtil.encodeHTML(conf.getEnclosingSIG().getName()) + ")</FONT>\n");
|
||||
if (conf.anyUnread())
|
||||
out.write(" <IMG SRC=\"" + rdat.getFullImagePath("tag_new.gif")
|
||||
+ "\" ALT=\"New!\" BORDER=0 WIDTH=40 HEIGHT=20>\n");
|
||||
out.write("</TD>\n</TR>\n");
|
||||
|
||||
} // end while
|
||||
|
||||
out.write("</TABLE>\n");
|
||||
|
||||
} // end if
|
||||
else
|
||||
out.write(rdat.getStdFontTag(null,2) + "<EM>You have no conferences in your hotlist.</EM></FONT>\n");
|
||||
|
||||
// write the link at the end
|
||||
out.write("<P>" + rdat.getStdFontTag(null,1) + "<B>[ <A HREF=\"" + rdat.getEncodedServletPath("TODO")
|
||||
|
||||
@@ -154,7 +154,7 @@ public class TopicListing implements JSPRender
|
||||
|
||||
public boolean canAddToHotlist()
|
||||
{
|
||||
return false; // TODO: fix this
|
||||
return conf.canAddToHotlist();
|
||||
|
||||
} // end canAddToHotlist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user