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.engine = engine;
this.datapool = datapool; this.datapool = datapool;
this.sigid = sigid; this.sigid = sigid;
this.created = (java.util.Date)(creation.clone()); this.created = creation;
this.last_access = this.created; this.last_access = creation;
this.last_update = this.created; this.last_update = creation;
this.read_level = DefaultLevels.newSIGRead(); this.read_level = DefaultLevels.newSIGRead();
this.write_level = DefaultLevels.newSIGWrite(); this.write_level = DefaultLevels.newSIGWrite();
this.create_level = DefaultLevels.newSIGCreate(); this.create_level = DefaultLevels.newSIGCreate();
@ -1800,7 +1800,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
// lock the tables we need to reference immediately // 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 try
{ // first delete the SIG record itself { // first delete the SIG record itself
stmt.executeUpdate("DELETE FROM sigs WHERE sigid = " + sigid + ";"); stmt.executeUpdate("DELETE FROM sigs WHERE sigid = " + sigid + ";");
@ -1808,6 +1808,10 @@ class SIGCoreData implements SIGData, SIGDataBackend
// now delete the members list // now delete the members list
stmt.executeUpdate("DELETE FROM sigmember WHERE sigid = " + sigid + ";"); 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 // 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 = " ResultSet rs = stmt.executeQuery("SELECT COUNT(*), MAX(confid) FROM sigtoconf WHERE sigid = "
+ sigid + ";"); + sigid + ";");

View File

@ -746,9 +746,10 @@ class TopicMessageUserContextImpl implements TopicMessageContext
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0) if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
engine.unpublish(postid); engine.unpublish(postid);
// Phase 1 of renumber - Renumber all posts that had a number higher than the one // Phase 1 of renumber - Renumber all posts IN THIS TOPIC that had a number higher than the one
// we just blew to hell. // we just blew to hell. (Must have the "topicid =" clause in there - see Bug #415473)
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE num > " + x_post_num + ";"); 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. // 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 = " 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 // present the "Create New SIG" dialog
CreateSIGDialog dlg = makeCreateSIGDialog(); CreateSIGDialog dlg = makeCreateSIGDialog();
dlg.setupDialog(engine); dlg.setupDialog(engine);
dlg.setFieldValue("language","en-US");
dlg.setFieldValue("country","US");
changeMenuTop(request); changeMenuTop(request);
return dlg; return dlg;

View File

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

View File

@ -149,6 +149,17 @@ public class RenderData
} // end getFullServletPath } // 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) public String getEncodedServletPath(String name)
{ {
return response.encodeURL(this.getFullServletPath(name)); return response.encodeURL(this.getFullServletPath(name));

View File

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