venice-main-classic/web/format/topics.jsp
Eric J. Bowersox 8bcc80ddd7 * landed code for viewing topics in a conference, and for adding a topic
(first workout of HTML Checker code)
* modified the dictionary implementation to use a trie system rather than
  a set of HashSets, and also started using a new, much smaller dictionary
* general bugfixes and cleanup on other items as needed
2001-02-06 04:50:04 +00:00

181 lines
8.0 KiB
Plaintext

<%--
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@silcom.com>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.util.StringUtil" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.servlets.Variables" %>
<%@ page import = "com.silverwrist.venice.servlets.format.*" %>
<%
TopicListing data = TopicListing.retrieve(request);
Variables.failIfNull(data);
RenderData rdat = RenderConfig.createRenderData(application,request,response);
String self = "confdisp?sig=" + String.valueOf(data.getSIGID()) + "&conf="
+ String.valueOf(data.getConfID());
String tmp;
%>
<% if (rdat.useHTMLComments()) { %><!-- Topic list for conf #<%= data.getConfID() %> --><% } %>
<% rdat.writeContentHeader(out,data.getConfName() + " Topics",null); %>
<%= rdat.getStdFontTag(null,2) %>
<DIV ALIGN="LEFT">
<A HREF="<%= rdat.getEncodedServletPath("confops?sig=" + String.valueOf(data.getSIGID())) %>"><IMG
SRC="<%= rdat.getFullImagePath("bn_conference_list.gif") %>" ALT="Conference List" WIDTH=80 HEIGHT=24
BORDER=0></A>&nbsp;&nbsp;
<% if (data.canCreateTopic()) { %>
<% tmp = "confops?sig=" + String.valueOf(data.getSIGID()) + "&conf="
+ String.valueOf(data.getConfID()) + "&cmd=T"; %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>"><IMG SRC="<%= rdat.getFullImagePath("bn_add_topic.gif") %>"
ALT="Add Topic" WIDTH=80 HEIGHT=24 BORDER=0></A>&nbsp;&nbsp;
<% } // end if %>
<% if (data.canDoReadNew()) { %>
<A HREF="TODO"><IMG SRC="<%= rdat.getFullImagePath("bn_read_new.gif") %>"
ALT="Read New" WIDTH=80 HEIGHT=24 BORDER=0></A>&nbsp;&nbsp;
<% } // end if %>
<A HREF="TODO"><IMG SRC="<%= rdat.getFullImagePath("bn_manage.gif") %>"
ALT="Manage" WIDTH=80 HEIGHT=24 BORDER=0></A>&nbsp;&nbsp;
<% if (data.canAddToHotlist()) { %>
<A HREF="TODO"><IMG SRC="<%= rdat.getFullImagePath("bn_add_to_hotlist.gif") %>"
ALT="Add to HotList" WIDTH=80 HEIGHT=24 BORDER=0></A>&nbsp;&nbsp;
<% } // end if %>
</DIV>
<% if (data.anyTopics()) { %>
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=3>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%"><%= rdat.getStdFontTag(null,2) %>
<% tmp = self + "&sort="
+ String.valueOf(data.isSort(ConferenceContext.SORT_NUMBER) ? -ConferenceContext.SORT_NUMBER
: ConferenceContext.SORT_NUMBER); %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>">#</A>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<% tmp = self + "&sort="
+ String.valueOf(data.isSort(ConferenceContext.SORT_NAME) ? -ConferenceContext.SORT_NAME
: ConferenceContext.SORT_NAME); %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Topic Name</A>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<% tmp = self + "&sort="
+ String.valueOf(data.isSort(ConferenceContext.SORT_UNREAD) ? -ConferenceContext.SORT_UNREAD
: ConferenceContext.SORT_UNREAD); %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>">New</A>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<% tmp = self + "&sort="
+ String.valueOf(data.isSort(ConferenceContext.SORT_TOTAL) ? -ConferenceContext.SORT_TOTAL
: ConferenceContext.SORT_TOTAL); %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Total</A>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<% tmp = self + "&sort="
+ String.valueOf(data.isSort(ConferenceContext.SORT_DATE) ? -ConferenceContext.SORT_DATE
: ConferenceContext.SORT_DATE); %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Last Response</A>
</FONT></TD>
</TR>
<TR VALIGN=TOP><TD ALIGN=LEFT COLSPAN=5><%= rdat.getStdFontTag(null,2) %>&nbsp;</FONT></TD></TR>
<% Iterator it = data.getTopicIterator(); %>
<% while (it.hasNext()) { %>
<% TopicContext topic = (TopicContext)(it.next()); %>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%"><%= rdat.getStdFontTag(null,2) %>
<A HREF="TODO"><%= topic.getTopicNumber() %></A>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<A HREF="TODO"><%= topic.getName() %></A>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<A HREF="TODO"><%= topic.getUnreadMessages() %></A>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<A HREF="TODO"><%= topic.getTotalMessages() %></A>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<A HREF="TODO"><%= rdat.formatDateForDisplay(topic.getLastUpdateDate()) %></A>
</FONT></TD>
</TR>
<% } // end while (more topics in enumeration) %>
</TABLE><P>
<% } else { %>
<%
switch (data.getViewOption())
{
case ConferenceContext.DISPLAY_NEW:
%>
<EM>No topics with unread messages found.</EM>
<%
break;
case ConferenceContext.DISPLAY_ACTIVE:
case ConferenceContext.DISPLAY_ALL:
%>
<EM>No active topics found.</EM>
<%
break;
case ConferenceContext.DISPLAY_HIDDEN:
%>
<EM>No hidden topics found.</EM>
<%
break;
case ConferenceContext.DISPLAY_ARCHIVED:
%>
<EM>No archived topics found.</EM>
<%
break;
default:
%>
<EM>Invalid display option selected.</EM>
<%
break;
} // end switch
%>
<P>
<% } // end if %>
<DIV ALIGN="CENTER">
<B>[</B>
<% if (data.isView(ConferenceContext.DISPLAY_NEW)) { %>
<B>New</B>
<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&view=" + String.valueOf(ConferenceContext.DISPLAY_NEW)) %>">New</A>
<% } // end if %>
<B>|</B>
<% if (data.isView(ConferenceContext.DISPLAY_ACTIVE)) { %>
<B>Active</B>
<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&view=" + String.valueOf(ConferenceContext.DISPLAY_ACTIVE)) %>">Active</A>
<% } // end if %>
<B>|</B>
<% if (data.isView(ConferenceContext.DISPLAY_ALL)) { %>
<B>All</B>
<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&view=" + String.valueOf(ConferenceContext.DISPLAY_ALL)) %>">All</A>
<% } // end if %>
<B>|</B>
<% if (data.isView(ConferenceContext.DISPLAY_HIDDEN)) { %>
<B>Hidden</B>
<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&view=" + String.valueOf(ConferenceContext.DISPLAY_HIDDEN)) %>">Hidden</A>
<% } // end if %>
<B>|</B>
<% if (data.isView(ConferenceContext.DISPLAY_ARCHIVED)) { %>
<B>Archived</B>
<% } else { %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&view=" + String.valueOf(ConferenceContext.DISPLAY_ARCHIVED)) %>">Archived</A>
<% } // end if %>
<B>]</B>
</DIV>
</FONT>
<% rdat.writeFooter(out); %>