You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/01/06 16:01:18 UTC

svn commit: r124387 - /lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java

Author: andreas
Date: Thu Jan  6 07:01:16 2005
New Revision: 124387

URL: http://svn.apache.org/viewcvs?view=rev&rev=124387
Log:
replaced element.setNodeValue() by DocumentHelper.setSimpleElementText()
Modified:
   lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java?view=diff&rev=124387&p1=lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java&r1=124386&p2=lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java&r2=124387
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java	(original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/authoring/NewBlogEntryCreator.java	Thu Jan  6 07:01:16 2005
@@ -29,6 +29,7 @@
 import org.w3c.dom.Document;
 
 import org.apache.lenya.ac.Identity;
+import org.apache.lenya.xml.DocumentHelper;
 
 import java.io.File;
 import java.text.DateFormat;
@@ -82,18 +83,22 @@
 
        // Replace id
         Element element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'id']");
-        element.setNodeValue("tag:bob.blog," + year + ":" + month + ":" + day + ":" + childId);
+//        element.setNodeValue("tag:bob.blog," + year + ":" + month + ":" + day + ":" + childId);
 
+        DocumentHelper.setSimpleElementText(element, "tag:bob.blog," + year + ":" + month + ":" + day + ":" + childId);
+        
         // Replace title 
         element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'title']");
-        element.setNodeValue((String)parameters.get("title"));
+//        element.setNodeValue((String)parameters.get("title"));
+        DocumentHelper.setSimpleElementText(element, (String)parameters.get("title"));
         element.setAttribute("rel","alternate");
         element.setAttribute("href","http://bob.blog");
         element.setAttribute("type","text/xml");
 
         // Replace Summary
         element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'summary']");
-        element.setNodeValue("Summary");
+//        element.setNodeValue("Summary");
+        DocumentHelper.setSimpleElementText(element, "Summary");
 
 
         // Replace author
@@ -115,10 +120,10 @@
         String datestr = datefmt.format(date) + dateofs.substring(0, 3) + ":" + dateofs.substring(3, 5);
 
         element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'created']");
-        element.setNodeValue(datestr);
+        DocumentHelper.setSimpleElementText(element, datestr);
         element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'issued']");
-        element.setNodeValue(datestr);
+        DocumentHelper.setSimpleElementText(element, datestr);
         element = (Element) XPathAPI.selectSingleNode(parent, "/*[local-name() = 'entry']/*[local-name() = 'modified']");
-        element.setNodeValue(datestr);
+        DocumentHelper.setSimpleElementText(element, datestr);
     }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org