venice-main-classic/web/format/conf/topics.jsp
2002-01-07 02:05:37 +00:00

253 lines
11 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.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.ui.conf.CurrentConference" %>
<%@ page import = "com.silverwrist.venice.ui.view.JSPView" %>
<%@ taglib uri="/tlds/util" prefix="util" %>
<%@ taglib uri="/tlds/community" prefix="comm" %>
<%@ taglib uri="/tlds/conference" prefix="conf" %>
<%@ taglib uri="/tlds/topic" prefix="topic" %>
<%!
// since these values are used frequently in this page, redeclare them from ConferenceContext
// to help minimize the clutter
private static final int DISPLAY_NEW = ConferenceContext.DISPLAY_NEW;
private static final int DISPLAY_ACTIVE = ConferenceContext.DISPLAY_ACTIVE;
private static final int DISPLAY_ALL = ConferenceContext.DISPLAY_ALL;
private static final int DISPLAY_HIDDEN = ConferenceContext.DISPLAY_HIDDEN;
private static final int DISPLAY_ARCHIVED = ConferenceContext.DISPLAY_ARCHIVED;
private static final int SORT_NUMBER = ConferenceContext.SORT_NUMBER;
private static final int SORT_NAME = ConferenceContext.SORT_NAME;
private static final int SORT_UNREAD = ConferenceContext.SORT_UNREAD;
private static final int SORT_TOTAL = ConferenceContext.SORT_TOTAL;
private static final int SORT_DATE = ConferenceContext.SORT_DATE;
%>
<%
JSPView view = JSPView.get(request);
CurrentConference currc = CurrentConference.get(request);
final int view_opt = currc.getViewOption();
final int sort_opt = currc.getSortOption();
final String base_locator = "cc=" + view.getCommunity().getCommunityID() + "&conf="
+ currc.getConference().getConfID();
%>
<util:comment>Topic list for conference "<conf:name/>"</util:comment>
<util:header><util:title>Topics in <conf:name/></util:title></util:header>
<%= view.getRequestAttribute("conference.custom.top").toString() %>
<util:font color="content.fg" size="content">
<DIV ALIGN="LEFT" CLASS="content">
<util:xlink>
<util:href type="servlet">conf/conferences.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="conf_list"/></util:text>
</util:xlink>&nbsp;
<topic:can_create>
<util:xlink>
<util:href type="servlet">conf/new_topic.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="add_topic"/></util:text>
</util:xlink>&nbsp;
</topic:can_create>
<% final String rnew = (String)(view.getRequestAttribute("conference.readnew")); %>
<% if (rnew!=null) { %>
<util:xlink>
<util:href type="servlet"><%= rnew %></util:href>
<util:text><util:button id="read_new"/></util:text>
</util:xlink>&nbsp;
<% } // end if %>
<util:xlink>
<util:href type="servlet">conf/find.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="find"/></util:text>
</util:xlink>&nbsp;
<util:xlink>
<util:href type="servlet">conf/manage_conf.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="manage"/></util:text>
</util:xlink>&nbsp;
<conf:can_add_to_hotlist>
<util:xlink>
<util:href type="servlet">conf/add_to_hotlist.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="add_to_hotlist"/></util:text>
</util:xlink>&nbsp;
</conf:can_add_to_hotlist>
</DIV>
<% out.flush(); response.flushBuffer(); %>
<% final List topics = (List)(view.getRequestAttribute("topics.list")); %>
<% if (topics.size()>0) { %>
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=3>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%" CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<B><util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_NUMBER) ? -SORT_NUMBER : SORT_NUMBER) %></util:href>
<util:text>#</util:text>
</util:xlink></B>&nbsp;&nbsp;
</util:font></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<B><util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_NAME) ? -SORT_NAME : SORT_NAME) %></util:href>
<util:text>Topic Name</util:text>
</util:xlink></B>
</util:font></TD>
<TD ALIGN=RIGHT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<B><util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_UNREAD) ? -SORT_UNREAD : SORT_UNREAD) %></util:href>
<util:text>New</util:text>
</util:xlink></B>
</util:font></TD>
<TD ALIGN=RIGHT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<B><util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_TOTAL) ? -SORT_TOTAL : SORT_TOTAL) %></util:href>
<util:text>Total</util:text>
</util:xlink></B>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<B><util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_DATE) ? -SORT_DATE : SORT_DATE) %></util:href>
<util:text>Last Response</util:text>
</util:xlink></B>
</util:font></TD>
</TR>
<% out.flush(); response.flushBuffer(); %>
<TR VALIGN=TOP><TD ALIGN=LEFT COLSPAN=5>&nbsp;</TD></TR>
<%
Iterator it = topics.iterator();
while (it.hasNext()) {
TopicContext topic = (TopicContext)(it.next());
short num = topic.getTopicNumber();
String my_locator = base_locator + "&top=" + num;
%>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%" CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= num %></util:text>
</util:xlink>&nbsp;&nbsp;
</util:font></TD>
<TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= topic.getName() %></util:text>
</util:xlink>
<% if (topic.isArchived() && (view_opt!=DISPLAY_ARCHIVED)) { %>
<EM>(archived)</EM>
<% } else if (topic.isFrozen()) { %>
<EM>(frozen)</EM>
<% } // end if %>
</util:font></TD>
<TD ALIGN=RIGHT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= topic.getUnreadMessages() %></util:text>
</util:xlink>
</util:font></TD>
<TD ALIGN=RIGHT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&p1=0&p2=-1</util:href>
<util:text><%= topic.getTotalMessages() %></util:text>
</util:xlink>
</util:font></TD>
<TD ALIGN=LEFT CLASS="content" NOWRAP><util:font color="content.fg" size="content">
<util:xlink>
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= view.formatDate(topic.getLastUpdateDate()) %></util:text>
</util:xlink>
</util:font></TD>
</TR>
<%
out.flush();
response.flushBuffer();
} // end while (more topics in enumeration)
%>
</TABLE><P>
<% } else { %>
<EM><%
switch (view_opt)
{
case DISPLAY_NEW:
out.write("No topics with unread messages found.");
break;
case DISPLAY_ACTIVE:
case DISPLAY_ALL:
out.write("No active topics found.");
break;
case DISPLAY_HIDDEN:
out.write("No hidden topics found.");
break;
case DISPLAY_ARCHIVED:
out.write("No archived topics found.");
break;
default:
out.write("Invalid display option selected.");
break;
} // end switch
%></EM>
<P>
<% } // end if %>
<% out.flush(); response.flushBuffer(); %>
<DIV ALIGN="CENTER" CLASS="content">
<B>[</B>
<% if (view_opt==DISPLAY_NEW) { %>
<B>New</B>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_NEW %></util:href>
<util:text>New</util:text>
</util:xlink>
<% } // end if %>
<B>|</B>
<% if (view_opt==DISPLAY_ACTIVE) { %>
<B>Active</B>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ACTIVE %></util:href>
<util:text>Active</util:text>
</util:xlink>
<% } // end if %>
<B>|</B>
<% if (view_opt==DISPLAY_ALL) { %>
<B>All</B>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ALL %></util:href>
<util:text>All</util:text>
</util:xlink>
<% } // end if %>
<B>|</B>
<% if (view_opt==DISPLAY_HIDDEN) { %>
<B>Hidden</B>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_HIDDEN %></util:href>
<util:text>Hidden</util:text>
</util:xlink>
<% } // end if %>
<B>|</B>
<% if (view_opt==DISPLAY_ARCHIVED) { %>
<B>Archived</B>
<% } else { %>
<util:xlink>
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ARCHIVED %></util:href>
<util:text>Archived</util:text>
</util:xlink>
<% } // end if %>
<B>]</B>
</DIV>
</util:font>
<%= view.getRequestAttribute("conference.custom.bottom").toString() %>