ContactInfoImpl
object.
*
@@ -60,6 +77,8 @@ class ContactInfoImpl implements ContactInfo, Stashable
*/
ContactInfoImpl(int owner_uid)
{
+ if (logger.isDebugEnabled())
+ logger.debug("new ContactInfoImpl (empty) for UID = " + owner_uid);
makeEmpty(owner_uid,-1);
} // end constructor
@@ -72,6 +91,8 @@ class ContactInfoImpl implements ContactInfo, Stashable
*/
ContactInfoImpl(int owner_uid, int owner_sigid)
{
+ if (logger.isDebugEnabled())
+ logger.debug("new ContactInfoImpl (empty) for UID = " + owner_uid + ", SIGID = " + owner_sigid);
makeEmpty(owner_uid,owner_sigid);
} // end constructor
@@ -85,6 +106,8 @@ class ContactInfoImpl implements ContactInfo, Stashable
*/
ContactInfoImpl(DataPool dp, int contactid) throws DataException
{
+ if (logger.isDebugEnabled())
+ logger.debug("new ContactInfoImpl (loading CID " + contactid + ")");
Connection conn = null;
try
@@ -95,6 +118,7 @@ class ContactInfoImpl implements ContactInfo, Stashable
} // end try
catch (SQLException e)
{ // turn SQLExceptions at this level into DataExceptions
+ logger.error("DB error loading contact ID " + contactid + ": " + e.getMessage(),e);
throw new DataException("Unable to look up contact info: " + e.getMessage(),e);
} // end catch
@@ -107,6 +131,11 @@ class ContactInfoImpl implements ContactInfo, Stashable
} // end constructor
+ /*--------------------------------------------------------------------------------
+ * Internal functions
+ *--------------------------------------------------------------------------------
+ */
+
private void makeEmpty(int owner_uid, int owner_sigid)
{
this.contactid = -1;
@@ -180,18 +209,28 @@ class ContactInfoImpl implements ContactInfo, Stashable
last_update = SQLUtil.getFullDateTime(rs,"lastupdate");
} // end if
- else // contact was not found
+ else
+ { // contact was not found
+ logger.error("contact ID " + contactid + " not found in database");
throw new DataException("Contact was not found.");
+ } // end else
+
} // end try
catch (SQLException e)
{ // map all SQLExceptions into DataExceptions
+ logger.error("DB error loading contact ID " + contactid + ": " + e.getMessage(),e);
throw new DataException("Unable to look up contact info: " + e.getMessage(),e);
} // end catch
} // end loadData
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface ContactInfo
+ *--------------------------------------------------------------------------------
+ */
+
public int getContactID()
{
return contactid;
@@ -559,6 +598,11 @@ class ContactInfoImpl implements ContactInfo, Stashable
} // end getModified
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface Stashable
+ *--------------------------------------------------------------------------------
+ */
+
public int getStashableUID()
{
return getOwnerUID();
@@ -567,6 +611,8 @@ class ContactInfoImpl implements ContactInfo, Stashable
public void stash(Connection conn) throws DataException, SQLException
{
+ if (logger.isDebugEnabled())
+ logger.debug("stashing contact ID " + contactid);
java.util.Date update = null;
Statement stmt = conn.createStatement();
StringBuffer buf;
@@ -653,10 +699,19 @@ class ContactInfoImpl implements ContactInfo, Stashable
int new_contactid;
ResultSet rs = stmt.executeQuery("SELECT LAST_INSERT_ID();");
if (rs.next())
+ { // found the contact ID...
new_contactid = rs.getInt(1);
+ if (logger.isDebugEnabled())
+ logger.debug("created new contact ID " + new_contactid);
+
+ } // end if
else
+ { // error reading back the contact ID
+ logger.error("unable to read back contact ID");
throw new DataException("unable to read back new contact ID");
+ } // end else
+
// and patch the database table so we know what our contact ID is
buf.setLength(0);
if (owner_sigid>=0)
diff --git a/src/com/silverwrist/venice/core/impl/EngineBackend.java b/src/com/silverwrist/venice/core/impl/EngineBackend.java
index fbb7dde..76033f7 100644
--- a/src/com/silverwrist/venice/core/impl/EngineBackend.java
+++ b/src/com/silverwrist/venice/core/impl/EngineBackend.java
@@ -36,6 +36,7 @@ public interface EngineBackend
public static final int IP_MAXSEARCHRETURN = 2;
public static final int IP_MAXSIGMEMBERDISPLAY = 3;
public static final int IP_MAXCONFMEMBERDISPLAY = 4;
+ public static final int IP_NUMFRONTPAGEPOSTS = 5;
public abstract SimpleEmailer createEmailer();
@@ -83,4 +84,10 @@ public interface EngineBackend
public abstract SideBoxDescriptor getMasterSideBoxDescriptor(int id);
+ public abstract void startPublish();
+
+ public abstract void publishNew(PublishedMessageImpl pubmsg);
+
+ public abstract void unpublish(long postid);
+
} // end interface EngineBackend
diff --git a/src/com/silverwrist/venice/core/impl/PublishedMessageImpl.java b/src/com/silverwrist/venice/core/impl/PublishedMessageImpl.java
new file mode 100644
index 0000000..0f1fa3a
--- /dev/null
+++ b/src/com/silverwrist/venice/core/impl/PublishedMessageImpl.java
@@ -0,0 +1,426 @@
+/*
+ * 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 <% } // end if (can nuke) %> + <% if (msg.canPublish()) { %> + ">" ALT="Publish" WIDTH=80 HEIGHT=24 + BORDER=0>
+ <% } // end if (can publish) %>
<% } // end if (showing advanced controls) %>
<% can_line = true; %>
diff --git a/web/format/top_content.jsp b/web/format/top_content.jsp
index 385cfce..f7e45e0 100644
--- a/web/format/top_content.jsp
+++ b/web/format/top_content.jsp
@@ -26,5 +26,29 @@
RenderData rdat = RenderConfig.createRenderData(application,request,response);
%>
<% if (rdat.useHTMLComments()) { %><% } %>
-<% rdat.writeContentHeader(out,"Venice Currents",null); %>
-TODO: Something profound goes here. :-)
\ No newline at end of file
+<% if (data.displayWelcome()) { %>
+ <% rdat.writeContentHeader(out,rdat.getStockMessage("welcome-top"),null); %>
+ <%= rdat.getStdFontTag(null,1) %><% rdat.writeStockMessage(out,"welcome"); %>
+<% } // end if %>
+<% rdat.writeContentHeader(out,rdat.getStockMessage("currents-top"),null); %>
+<% int ntp = data.getNumTopPosts(); %>
+<% if (ntp>0) { %>
+ <% for (int i=0; i
+
<% } %>
+ <%
+ TopicMessageContext msg = data.getTopPost(i);
+ String poster = data.getPosterName(msg);
+ %>
+ <%= rdat.getStdFontTag(null,1) %>
+ <%= msg.getPseud() %>
+ (
+ " TARGET="_blank"><%= poster %>,
+ <%= rdat.formatDateForDisplay(msg.getPostDate()) %>
+ )
+ <%= rdat.rewritePostData(data.getMessageBodyText(msg)) %>
+
+ <% } // end for %>
+<% } else { %>
+ <%= rdat.getStdFontTag(null,1) %>No front page postings found.
+<% } // end if %>
\ No newline at end of file
diff --git a/web/images/bn_publish.gif b/web/images/bn_publish.gif
new file mode 100644
index 0000000..81166cc
Binary files /dev/null and b/web/images/bn_publish.gif differ