added topic links at the bottom of "published" posts, fixed the log in or
create problem when going through PostShortcut
This commit is contained in:
@@ -98,7 +98,10 @@ public class PostShortcut extends VeniceServlet
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // we can't get to the conference...
|
||||
return new ErrorBox("Access Error",ae.getMessage(),null);
|
||||
if (user.isLoggedIn())
|
||||
return new ErrorBox("Access Error",ae.getMessage(),null);
|
||||
else
|
||||
return new LogInOrCreate("go/" + raw_link);
|
||||
|
||||
} // end catch
|
||||
|
||||
@@ -122,7 +125,10 @@ public class PostShortcut extends VeniceServlet
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // we can't get to the topic...
|
||||
return new ErrorBox("Access Error",ae.getMessage(),null);
|
||||
if (user.isLoggedIn())
|
||||
return new ErrorBox("Access Error",ae.getMessage(),null);
|
||||
else
|
||||
return new LogInOrCreate("go/" + raw_link);
|
||||
|
||||
} // end catch
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import org.apache.log4j.*;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.except.*;
|
||||
@@ -33,6 +34,8 @@ public class TopDisplay implements ContentRender, ColorSelectors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(TopDisplay.class);
|
||||
|
||||
private static final String ATTR_NAME = "com.silverwrist.venice.TopDisplay";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
@@ -125,6 +128,7 @@ public class TopDisplay implements ContentRender, ColorSelectors
|
||||
} // end try
|
||||
catch (ServletException se)
|
||||
{ // since we can't throw ServletException, we throw IOException
|
||||
logger.error("top_content.jsp failure",se);
|
||||
throw new IOException("Failure including top_content.jsp");
|
||||
|
||||
} // end catch
|
||||
@@ -162,7 +166,8 @@ public class TopDisplay implements ContentRender, ColorSelectors
|
||||
|
||||
} // end try
|
||||
catch (ServletException se)
|
||||
{ // since we can't throw ServletException, we throw IOException
|
||||
{ // since we can't throw ServletException, we write an error message
|
||||
logger.error("sidebox #" + i + " failure",se);
|
||||
out.write(rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,2) + "<EM>failure rendering class "
|
||||
+ sideboxes[i].getClass().getName() + ": " + StringUtil.encodeHTML(se.getMessage())
|
||||
+ "</EM></FONT>\n");
|
||||
@@ -173,9 +178,13 @@ public class TopDisplay implements ContentRender, ColorSelectors
|
||||
rdat.flushOutput(); // now make sure the included page is properly flushed
|
||||
|
||||
} // end else if
|
||||
else // this is bogus - just display a little error here
|
||||
else
|
||||
{ // this is bogus - just display a little error here
|
||||
logger.error("sidebox #" + i + " class " + sideboxes[i].getClass().getName() + " cannot be rendered");
|
||||
out.write(rdat.getStdFontTag(SIDEBOX_CONTENT_FOREGROUND,2) + "<EM>cannot display sidebox of class: "
|
||||
+ sideboxes[i].getClass().getName() + "</EM></FONT>\n");
|
||||
|
||||
} // end else
|
||||
|
||||
// close up the framework of this sidebox
|
||||
out.write("</TD></TR></TABLE><P>\n");
|
||||
@@ -215,6 +224,29 @@ public class TopDisplay implements ContentRender, ColorSelectors
|
||||
|
||||
} // end getPosterName
|
||||
|
||||
public static String getTopicPostLink(RenderData rdat, TopicMessageContext msg)
|
||||
{
|
||||
try
|
||||
{ // retrieve the topic post link and name, and combine them
|
||||
TopicContext topic = msg.getEnclosingTopic();
|
||||
String plink = topic.getPostLink();
|
||||
return "<A HREF=\"" + rdat.getEncodedServletPath("go/" + plink) + "\">" + topic.getName() + "</A>";
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // just return null on failure
|
||||
return null;
|
||||
|
||||
} // end catch
|
||||
catch (Exception e)
|
||||
{ // temporary guard point here
|
||||
logger.error("Caught in getTopicPostLink:",e);
|
||||
return null;
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end getTopicPostLink
|
||||
|
||||
public static String getMessageBodyText(TopicMessageContext msg)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user