logo       

roller/docroot/weblog comment-display.jspf,1.2,1.3 comment-form.jspf,1.1,1.: msg#00145

Subject: roller/docroot/weblog comment-display.jspf,1.2,1.3 comment-form.jspf,1.1,1.2 comment-preview.jsp,1.2,1.3 comments-delete.jsp,1.1,1.2 comments.jsp,1.2,1.3
Update of /cvsroot/roller/roller/docroot/weblog
In directory usw-pr-cvs1:/tmp/cvs-serv22713/docroot/weblog

Modified Files:
        comment-display.jspf comment-form.jspf comment-preview.jsp 
        comments-delete.jsp comments.jsp 
Log Message:
Make Comment HTML-escaping and "autoformatting" RollerConfigs.
add the following to roller-config.xml
    <autoformatComments>true</autoformatComments>
    <escapeCommentHtml>true</escapeCommentHtml>

Index: comment-display.jspf
===================================================================
RCS file: /cvsroot/roller/roller/docroot/weblog/comment-display.jspf,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** comment-display.jspf        12 Nov 2002 20:32:37 -0000      1.2
--- comment-display.jspf        13 Nov 2002 04:59:22 -0000      1.3
***************
*** 1,7 ****
! <%@ page import="org.apache.commons.lang.StringUtils" %>
! 
         <td class="rTd">
!         <p>
!             <bean:write name="comment" property="content" filter="false"/>
          </p>
          <span>Posted by 
--- 1,11 ----
! <%@ page 
import="org.apache.commons.lang.StringUtils,org.roller.util.Utilities" %>
! <%-- I need to find a way to do this stuff with tags, maybe JSTL? --%>
         <td class="rTd">
!         <p><%
!             String content = comment.getContent();
!             if (escapeHtml) content = Utilities.escapeHTML( content );
!             if (autoformat) content = StringUtils.replace(content, "\n", "<br 
/>");
!             %>
!             <%= content %>
          </p>
          <span>Posted by 

Index: comment-form.jspf
===================================================================
RCS file: /cvsroot/roller/roller/docroot/weblog/comment-form.jspf,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** comment-form.jspf   9 Nov 2002 15:00:52 -0000       1.1
--- comment-form.jspf   13 Nov 2002 04:59:23 -0000      1.2
***************
*** 5,9 ****
  WeblogEntryData entry = rreq.getWeblogEntry();
  WebsiteData website = 
rreq.getRoller().getUserManager().retrieveWebsite(entry.getWebsiteId());
! if (website.getAllowComments().booleanValue()) {
  %>
  <html:form action="/comment" method="post" focus="title">
--- 5,10 ----
  WeblogEntryData entry = rreq.getWeblogEntry();
  WebsiteData website = 
rreq.getRoller().getUserManager().retrieveWebsite(entry.getWebsiteId());
! if (website.getAllowComments().booleanValue()) 
! {
  %>
  <html:form action="/comment" method="post" focus="title">

Index: comment-preview.jsp
===================================================================
RCS file: /cvsroot/roller/roller/docroot/weblog/comment-preview.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** comment-preview.jsp 9 Nov 2002 23:51:09 -0000       1.2
--- comment-preview.jsp 13 Nov 2002 04:59:23 -0000      1.3
***************
*** 4,7 ****
--- 4,9 ----
  <%@ page import="org.roller.model.Roller" %>
  <%@ page import="org.roller.model.UserData" %>
+ <%@ page import="org.roller.presentation.RollerConfig" %>
+ <%@ page import="org.roller.presentation.RollerContext" %>
  <%@ page import="org.roller.presentation.RollerRequest" %>
  
***************
*** 12,16 ****
  <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
  <%@ taglib uri="/WEB-INF/roller.tld" prefix="roller" %>
! 
  <html xmlns="http://www.w3.org/1999/xhtml";>
  
--- 14,23 ----
  <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
  <%@ taglib uri="/WEB-INF/roller.tld" prefix="roller" %>
! <%
! RollerContext rc = RollerContext.getRollerContext(request);
! RollerConfig rollerConfig = rc.getRollerConfig();
! boolean escapeHtml = rollerConfig.getEscapeCommentHtml();
! boolean autoformat = rollerConfig.getAutoformatComments();
! %>
  <html xmlns="http://www.w3.org/1999/xhtml";>
  

Index: comments-delete.jsp
===================================================================
RCS file: /cvsroot/roller/roller/docroot/weblog/comments-delete.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** comments-delete.jsp 9 Nov 2002 23:51:09 -0000       1.1
--- comments-delete.jsp 13 Nov 2002 04:59:23 -0000      1.2
***************
*** 1,7 ****
  
  <%@ include file="/theme/header.jsp" %>
  <div>
  
! <span class="statusMsg"><bean:write name="blogEntry" property="title" 
scope="request" /></span>
  
  <html:form action="/comment" method="post" focus="title">
--- 1,16 ----
  
  <%@ include file="/theme/header.jsp" %>
+ <%@ page import="org.roller.presentation.RollerConfig" %>
+ <%@ page import="org.roller.presentation.RollerContext" %>
+ <%
+ RollerContext rc = RollerContext.getRollerContext(request);
+ RollerConfig rollerConfig = rc.getRollerConfig();
+ boolean escapeHtml = rollerConfig.getEscapeCommentHtml();
+ boolean autoformat = rollerConfig.getAutoformatComments();
+ %>
  <div>
  
! <span class="statusMsg"><bean:write name="blogEntry" property="title" 
!     scope="request" filter="false" /></span>
  
  <html:form action="/comment" method="post" focus="title">

Index: comments.jsp
===================================================================
RCS file: /cvsroot/roller/roller/docroot/weblog/comments.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** comments.jsp        9 Nov 2002 23:51:09 -0000       1.2
--- comments.jsp        13 Nov 2002 04:59:23 -0000      1.3
***************
*** 4,7 ****
--- 4,9 ----
  <%@ page import="org.roller.model.Roller" %>
  <%@ page import="org.roller.model.UserData" %>
+ <%@ page import="org.roller.presentation.RollerConfig" %>
+ <%@ page import="org.roller.presentation.RollerContext" %>
  <%@ page import="org.roller.presentation.RollerRequest" %>
  <%@ page import="org.apache.commons.lang.StringUtils" %>
***************
*** 13,17 ****
  <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
  <%@ taglib uri="/WEB-INF/roller.tld" prefix="roller" %>
! 
  <html xmlns="http://www.w3.org/1999/xhtml";>
  
--- 15,24 ----
  <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
  <%@ taglib uri="/WEB-INF/roller.tld" prefix="roller" %>
! <%
! RollerContext rc = RollerContext.getRollerContext(request);
! RollerConfig rollerConfig = rc.getRollerConfig();
! boolean escapeHtml = rollerConfig.getEscapeCommentHtml();
! boolean autoformat = rollerConfig.getAutoformatComments();
! %>
  <html xmlns="http://www.w3.org/1999/xhtml";>
  
***************
*** 37,45 ****
  <div>
  
! <span class="statusMsg"><bean:write name="blogEntry" property="title" 
scope="request" /></span>
  
  <table class="rTable">
! <logic:iterate id="comment" indexId="count" name="blogComments" 
scope="request"
!     type="org.roller.model.CommentData">
      <%
      if (count.intValue() % 2 == 0) out.println("\t<tr class=\"rEvenTr\">");
--- 44,53 ----
  <div>
  
! <span class="statusMsg"><bean:write name="blogEntry" property="title" 
!     scope="request" filter="false" /></span>
  
  <table class="rTable">
! <logic:iterate id="comment" indexId="count" name="blogComments" 
!     scope="request" type="org.roller.model.CommentData">
      <%
      if (count.intValue() % 2 == 0) out.println("\t<tr class=\"rEvenTr\">");




-------------------------------------------------------
This sf.net email is sponsored by: 
To learn the basics of securing your web site with SSL, 
click here to get a FREE TRIAL of a Thawte Server Certificate: 
http://www.gothawte.com/rd522.html


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe