[Yanel-commits] rev 44365 - in public/yanel/contributions/resources/timetracker: . htdocs src/java/org/wyona/yanel/impl/resources/timetracker

michi at wyona.com michi at wyona.com
Mon Aug 24 22:59:42 CEST 2009


Author: michi
Date: 2009-08-24 22:59:41 +0200 (Mon, 24 Aug 2009)
New Revision: 44365

Modified:
   public/yanel/contributions/resources/timetracker/
   public/yanel/contributions/resources/timetracker/htdocs/create-entry.xsl
   public/yanel/contributions/resources/timetracker/src/java/org/wyona/yanel/impl/resources/timetracker/TimeTrackerResource.java
Log:
xml started and namespace introduced


Property changes on: public/yanel/contributions/resources/timetracker
___________________________________________________________________
Name: svn:ignore
   + build


Modified: public/yanel/contributions/resources/timetracker/htdocs/create-entry.xsl
===================================================================
--- public/yanel/contributions/resources/timetracker/htdocs/create-entry.xsl	2009-08-24 20:32:09 UTC (rev 44364)
+++ public/yanel/contributions/resources/timetracker/htdocs/create-entry.xsl	2009-08-24 20:59:41 UTC (rev 44365)
@@ -4,6 +4,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:tt="http://www.wyona.org/resource/time-tracking/1.0"
 >
 
 <xsl:param name="yarep.back2realm" select="'BACK2REALM_IS_NULL'"/>
@@ -18,7 +19,7 @@
     <form>
       <table>
         <tr>
-          <td>Your name:</td><td>TODO</td>
+          <td>Your name:</td><td><xsl:value-of select="/tt:time-tracking/tt:user"/></td>
         </tr>
         <tr><td>*Date:</td><td><input type="text" name="date" value="TODO"/></td></tr>
         <tr><td>*Client/Project:</td><td><select name="client-project"><option value="todo1">TODO 1</option><option value="todo2">TODO 2</option></select></td></tr>

Modified: public/yanel/contributions/resources/timetracker/src/java/org/wyona/yanel/impl/resources/timetracker/TimeTrackerResource.java
===================================================================
--- public/yanel/contributions/resources/timetracker/src/java/org/wyona/yanel/impl/resources/timetracker/TimeTrackerResource.java	2009-08-24 20:32:09 UTC (rev 44364)
+++ public/yanel/contributions/resources/timetracker/src/java/org/wyona/yanel/impl/resources/timetracker/TimeTrackerResource.java	2009-08-24 20:59:41 UTC (rev 44365)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Wyona
+ * Copyright 2009 Wyona
  */
 
 package org.wyona.yanel.impl.resources.timetracker;
@@ -11,28 +11,26 @@
 
 import org.apache.log4j.Logger;
 
-
 /**
- * A simple Resource which extends BasicXMLResource
+ * A time tracker resource
  */
 public class TimeTrackerResource extends BasicXMLResource {
     
     private static Logger log = Logger.getLogger(TimeTrackerResource.class);
     
     /*
-     * This method overrides the method to create the InputStream called by BasicXMLResource
-     * Since you extend the BasicXMLResource this has to contain well-formed xml.
-     * Should return a InputStream which contains XML. 
-     * Use String, StingBuffer, dom, jdom, org.apache.commons.io.IOUtils and so on to generate the XML.
+     * @see org.wyona.yanel.impl.resources.BasicXMLResource#getContentXML(String)
      */
     protected InputStream getContentXML(String viewId) {
         if (log.isDebugEnabled()) {
             log.debug("requested viewId: " + viewId);
         }
-        StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"?>");
-        sb.append("<root>");
- 
-        sb.append("</root>");
+
+        StringBuilder sb = new StringBuilder("<?xml version=\"1.0\"?>");
+        sb.append("<time-tracking xmlns=\"http://www.wyona.org/resource/time-tracking/1.0\">");
+        sb.append("  <user id=\"" + "michi" + "\">" + "Michael Wechner" + "</user>");
+        sb.append("</time-tracking>");
+
         return new ByteArrayInputStream(sb.toString().getBytes());
     }
 }



More information about the Yanel-commits mailing list