fixed several bugs related to SIG creation/deletion and a nasty brown paper

bag bug in Nuke Post!
This commit is contained in:
Eric J. Bowersox 2001-04-12 05:53:26 +00:00
parent 7e226040d4
commit 89429a4b40
6 changed files with 39 additions and 20 deletions

View File

@ -165,9 +165,9 @@ class SIGCoreData implements SIGData, SIGDataBackend
this.engine = engine;
this.datapool = datapool;
this.sigid = sigid;
this.created = (java.util.Date)(creation.clone());
this.last_access = this.created;
this.last_update = this.created;
this.created = creation;
this.last_access = creation;
this.last_update = creation;
this.read_level = DefaultLevels.newSIGRead();
this.write_level = DefaultLevels.newSIGWrite();
this.create_level = DefaultLevels.newSIGCreate();
@ -1800,7 +1800,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
Statement stmt = conn.createStatement();
// lock the tables we need to reference immediately
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, sigtoconf READ;");
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, confhotlist WRITE, sigtoconf READ;");
try
{ // first delete the SIG record itself
stmt.executeUpdate("DELETE FROM sigs WHERE sigid = " + sigid + ";");
@ -1808,6 +1808,10 @@ class SIGCoreData implements SIGData, SIGDataBackend
// now delete the members list
stmt.executeUpdate("DELETE FROM sigmember WHERE sigid = " + sigid + ";");
// We need to make sure this SIG's conferences are removed from everyone's hotlist,
// if they're present. (Bug #415474)
stmt.executeUpdate("DELETE FROM confhotlist WHERE sigid = " + sigid + ";");
// determine the number of conferences in this SIG, and the maximum conference ID
ResultSet rs = stmt.executeQuery("SELECT COUNT(*), MAX(confid) FROM sigtoconf WHERE sigid = "
+ sigid + ";");

View File

@ -746,9 +746,10 @@ class TopicMessageUserContextImpl implements TopicMessageContext
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
engine.unpublish(postid);
// Phase 1 of renumber - Renumber all posts that had a number higher than the one
// we just blew to hell.
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE num > " + x_post_num + ";");
// Phase 1 of renumber - Renumber all posts IN THIS TOPIC that had a number higher than the one
// we just blew to hell. (Must have the "topicid =" clause in there - see Bug #415473)
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE topicid = " + x_topic_id + " AND num > "
+ x_post_num + ";");
// Phase 2 of renumber - The topic now has one less post in it. Reflect that.
stmt.executeUpdate("UPDATE topics SET top_message = (top_message - 1) WHERE topicid = "

View File

@ -193,6 +193,8 @@ public class SIGOperations extends VeniceServlet
// present the "Create New SIG" dialog
CreateSIGDialog dlg = makeCreateSIGDialog();
dlg.setupDialog(engine);
dlg.setFieldValue("language","en-US");
dlg.setFieldValue("country","US");
changeMenuTop(request);
return dlg;

View File

@ -108,7 +108,7 @@ public class NewSIGWelcome implements JSPRender
public String getDisplayURL(RenderData rdat)
{
return rdat.getFullServletPath(entry_url);
return rdat.getCompleteServletPath(entry_url);
} // end getEntryURL

View File

@ -149,6 +149,17 @@ public class RenderData
} // end getFullServletPath
public String getCompleteServletPath(String name)
{
StringBuffer buf = new StringBuffer("http://");
buf.append(request.getServerName());
if (request.getServerPort()!=80)
buf.append(':').append(request.getServerPort());
buf.append(request.getContextPath()).append('/').append(name);
return buf.toString();
} // end getCompleteServletPath
public String getEncodedServletPath(String name)
{
return response.encodeURL(this.getFullServletPath(name));

View File

@ -24,12 +24,13 @@
TopicListing data = TopicListing.retrieve(request);
Variables.failIfNull(data);
RenderData rdat = RenderConfig.createRenderData(application,request,response);
String stdfont = rdat.getStdFontTag(null,2);
String self = "confdisp?" + data.getLocator();
String tmp;
%>
<% if (rdat.useHTMLComments()) { %><!-- Topic list for conf #<%= data.getConfID() %> --><% } %>
<% rdat.writeContentHeader(out,"Topics in " + data.getConfName(),null); %>
<%= rdat.getStdFontTag(null,2) %>
<%= stdfont %>
<DIV ALIGN="LEFT">
<A HREF="<%= rdat.getEncodedServletPath("confops?sig=" + data.getSIGID()) %>"><IMG
SRC="<%= rdat.getFullImagePath("bn_conference_list.gif") %>" ALT="Conference List" WIDTH=80 HEIGHT=24
@ -56,38 +57,38 @@
<% if (data.anyTopics()) { %>
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=3>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%"><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT WIDTH="1%" NOWRAP><%= stdfont %>
<% tmp = self + "&sort="
+ (data.isSort(ConferenceContext.SORT_NUMBER) ? -ConferenceContext.SORT_NUMBER
: ConferenceContext.SORT_NUMBER); %>
<B><A HREF="<%= rdat.getEncodedServletPath(tmp) %>">#</A></B>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT><%= stdfont %>
<% tmp = self + "&sort="
+ (data.isSort(ConferenceContext.SORT_NAME) ? -ConferenceContext.SORT_NAME
: ConferenceContext.SORT_NAME); %>
<B><A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Topic Name</A></B>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=RIGHT NOWRAP><%= stdfont %>
<% tmp = self + "&sort="
+ (data.isSort(ConferenceContext.SORT_UNREAD) ? -ConferenceContext.SORT_UNREAD
: ConferenceContext.SORT_UNREAD); %>
<B><A HREF="<%= rdat.getEncodedServletPath(tmp) %>">New</A></B>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=RIGHT NOWRAP><%= stdfont %>
<% tmp = self + "&sort="
+ (data.isSort(ConferenceContext.SORT_TOTAL) ? -ConferenceContext.SORT_TOTAL
: ConferenceContext.SORT_TOTAL); %>
<B><A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Total</A></B>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT NOWRAP><%= stdfont %>
<% tmp = self + "&sort="
+ (data.isSort(ConferenceContext.SORT_DATE) ? -ConferenceContext.SORT_DATE
: ConferenceContext.SORT_DATE); %>
<B><A HREF="<%= rdat.getEncodedServletPath(tmp) %>">Last Response</A></B>
</FONT></TD>
</TR>
<TR VALIGN=TOP><TD ALIGN=LEFT COLSPAN=5><%= rdat.getStdFontTag(null,2) %>&nbsp;</FONT></TD></TR>
<TR VALIGN=TOP><TD ALIGN=LEFT COLSPAN=5>&nbsp;</TD></TR>
<% Iterator it = data.getTopicIterator(); %>
<% while (it.hasNext()) { %>
<%
@ -95,10 +96,10 @@
tmp = self + "&top=" + topic.getTopicNumber() + "&rnm=1";
%>
<TR VALIGN=TOP>
<TD ALIGN=LEFT WIDTH="1%"><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT WIDTH="1%" NOWRAP><%= stdfont %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>"><%= topic.getTopicNumber() %></A>&nbsp;&nbsp;
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT><%= stdfont %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>"><%= topic.getName() %></A>
<% if (topic.isArchived() && !(data.isView(ConferenceContext.DISPLAY_ARCHIVED))) { %>
<EM>(archived)</EM>
@ -106,14 +107,14 @@
<EM>(frozen)</EM>
<% } // end if %>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=RIGHT NOWRAP><%= stdfont %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>"><%= topic.getUnreadMessages() %></A>
</FONT></TD>
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=RIGHT NOWRAP><%= stdfont %>
<A HREF="<%= rdat.getEncodedServletPath(self + "&top=" + topic.getTopicNumber()
+ "&p1=0&p2=-1") %>"><%= topic.getTotalMessages() %></A>
</FONT></TD>
<TD ALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
<TD ALIGN=LEFT NOWRAP><%= stdfont %>
<A HREF="<%= rdat.getEncodedServletPath(tmp) %>"><%= rdat.formatDateForDisplay(topic.getLastUpdateDate()) %></A>
</FONT></TD>
</TR>