You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2009/09/16 22:38:37 UTC

svn commit: r815957 - in /incubator/jspwiki/trunk: ./ src/WebContent/templates/default/ src/java/org/apache/wiki/ src/java/org/apache/wiki/content/ src/java/org/apache/wiki/content/jcr/

Author: metskem
Date: Wed Sep 16 20:38:36 2009
New Revision: 815957

URL: http://svn.apache.org/viewvc?rev=815957&view=rev
Log:
3.0.0-svn-157
        
        * JSPWIKI-601: lastModified dates were not shown in page versions, replaced 
        prefs.DateFormat with prefs.TimeFormat on multiple places.
        Also attachment created dates were not shown (attachments don't have
        a lastModified date, but a created Date).

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentInfoTab.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentTab.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsBottom.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfoTab.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp
    incubator/jspwiki/trunk/src/WebContent/templates/default/WorkflowContent.jsp
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Wed Sep 16 20:38:36 2009
@@ -1,3 +1,12 @@
+2009-09-16 Harry Metske <me...@apache.org>
+
+        * 3.0.0-svn-157
+        
+        * JSPWIKI-601: lastModified dates were not shown in page versions, replaced 
+        prefs.DateFormat with prefs.TimeFormat on multiple places.
+        Also attachment created dates were not shown (attachments don't have
+        a lastModified date, but a created Date).
+
 2009-09-12 Harry Metske <me...@apache.org>
 
         * 3.0.0-svn-156

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentInfoTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentInfoTab.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentInfoTab.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentInfoTab.jsp Wed Sep 16 20:38:36 2009
@@ -29,6 +29,8 @@
 <%@ page import="org.apache.wiki.action.WikiContextFactory" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ page import="org.apache.wiki.api.WikiPage" %>
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="org.apache.wiki.content.jcr.JCRWikiPage" %>
 <%
   WikiContext c = WikiContextFactory.findContext( pageContext );
   WikiPage wikiPage = c.getPage();
@@ -171,7 +173,7 @@
               <fmt:formatNumber value="<%=Double.toString(att.getSize()/1000.0) %>" groupingUsed="false" maxFractionDigits="1" minFractionDigits="1" />&nbsp;<fmt:message key="info.kilobytes" />
             </td>
       	    <td style="white-space:nowrap;">
-      	      <fmt:formatDate value="<%= att.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+      	      <fmt:formatDate value="<%= new SimpleDateFormat(JCRWikiPage.DATEFORMAT_ISO8601_2000).parse(att.getAttribute(JCRWikiPage.ATTR_CREATED).toString()) %>" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
       	    </td>
             <td><wiki:Author/></td>
             <td class='changenote'>

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentTab.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentTab.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/AttachmentTab.jsp Wed Sep 16 20:38:36 2009
@@ -26,6 +26,8 @@
 <%@ page import="org.apache.wiki.action.WikiContextFactory" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ page import="org.apache.wiki.api.WikiPage" %>
+<%@ page import="org.apache.wiki.content.jcr.JCRWikiPage" %>
+<%@ page import="java.text.SimpleDateFormat" %>
 <%@ page errorPage="/Error.jsp" %>
 <%
   int MAXATTACHNAMELENGTH = 30;
@@ -120,7 +122,7 @@
                 <td style="text-align:center;">
                   <a href="<wiki:PageInfoLink format='url' />" title="<fmt:message key='attach.moreinfo.title' />"><wiki:PageVersion/></a>
                 </td>
-            	  <td style="white-space:nowrap;"><fmt:formatDate value="<%= att.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" /></td>
+            	  <td style="white-space:nowrap;"><fmt:formatDate value="<%= new SimpleDateFormat(JCRWikiPage.DATEFORMAT_ISO8601_2000).parse(att.getAttribute(JCRWikiPage.ATTR_CREATED).toString()) %>" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" /></td>
                 <td><wiki:Author/></td>
                 <wiki:Permission permission="delete">
                   <td>

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsBottom.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsBottom.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsBottom.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsBottom.jsp Wed Sep 16 20:38:36 2009
@@ -28,14 +28,14 @@
       <wiki:CheckVersion mode="latest">
          <fmt:message key="info.lastmodified">
             <fmt:param><wiki:PageVersion/></fmt:param>
-            <fmt:param><wiki:DiffLink version="latest" newVersion="previous"><wiki:PageDate format='${prefs["DateFormat"]}' /></wiki:DiffLink></fmt:param>
+            <fmt:param><wiki:DiffLink version="latest" newVersion="previous"><wiki:PageDate format='${prefs["TimeFormat"]}' /></wiki:DiffLink></fmt:param>
             <fmt:param><wiki:Author/></fmt:param>
          </fmt:message>
       </wiki:CheckVersion>
   
       <wiki:CheckVersion mode="notlatest">
         <fmt:message key="actions.publishedon">
-           <fmt:param><wiki:PageDate format='${prefs["DateFormat"]}' /></fmt:param>
+           <fmt:param><wiki:PageDate format='${prefs["TimeFormat"]}' /></fmt:param>
            <fmt:param><wiki:Author/></fmt:param>
         </fmt:message>
       </wiki:CheckVersion>

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfoTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfoTab.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfoTab.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfoTab.jsp Wed Sep 16 20:38:36 2009
@@ -85,7 +85,7 @@
       <fmt:param><wiki:PageVersion>1</wiki:PageVersion></fmt:param>
       <fmt:param>
         <a href="<wiki:DiffLink format='url' version='latest' newVersion='previous' />" title="<fmt:message key='info.pagediff.title' />">
-          <fmt:formatDate value="<%= wikiPage.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+          <fmt:formatDate value="<%= wikiPage.getLastModified() %>" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
         </a>
       </fmt:param>
       <fmt:param><wiki:Author/></fmt:param>
@@ -98,7 +98,7 @@
     <fmt:message key='info.createdon'>
       <fmt:param>
         <wiki:Link version="1">
-          <fmt:formatDate value="<%= firstPage.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+          <fmt:formatDate value="<%= firstPage.getLastModified() %>" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
         </wiki:Link>
       </fmt:param>
       <fmt:param><%= creationAuthor %></fmt:param>
@@ -185,7 +185,7 @@
             </wiki:LinkTo>
           </td>
       
-          <td><fmt:formatDate value="<%= currentPage.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" /></td>
+          <td><fmt:formatDate value="<%= currentPage.getLastModified() %>" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" /></td>
           <td style="white-space:nowrap;text-align:right;">
             <c:set var="ff"><wiki:PageSize/></c:set>
             <fmt:formatNumber value='${ff/1000}' maxFractionDigits='3' minFractionDigits='1' />&nbsp;<fmt:message key="info.kilobytes" />

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp Wed Sep 16 20:38:36 2009
@@ -126,14 +126,14 @@
        <td><fmt:message key="prefs.creationdate" /></td>
        <td class="formvalue">
          <%--<wiki:UserProfile property="created"/>--%>
- 	     <fmt:formatDate value="${profile.Created}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+ 	     <fmt:formatDate value="${profile.Created}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
        </td>
      </tr>
      <tr class="additinfo">
        <td><fmt:message key="prefs.profile.lastmodified" /></td>
        <td class="formvalue">
          <%--<wiki:UserProfile property="modified"/>--%>
- 	     <fmt:formatDate value="${profile.LastModified}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+ 	     <fmt:formatDate value="${profile.LastModified}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
        </td>
      </tr>
      </wiki:UserProfile>

Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/WorkflowContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/WorkflowContent.jsp?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/WorkflowContent.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/WorkflowContent.jsp Wed Sep 16 20:38:36 2009
@@ -100,7 +100,7 @@
           <td align="left"><c:out value="${decision.owner.name}" /></td>
           <!-- When did the actor start this step? -->
           <td align="left">
-            <fmt:formatDate value="${decision.startTime}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+            <fmt:formatDate value="${decision.startTime}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
 		  </td>
         </tr>
         <!-- Hidden row with Decision details, if there are any -->
@@ -179,7 +179,7 @@
           <td align="left"><c:out value="${workflow.currentActor.name}" /></td>
           <!-- When did the actor start this step? -->
           <td align="left">
-            <fmt:formatDate value="${workflow.currentStep.startTime}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
+            <fmt:formatDate value="${workflow.currentStep.startTime}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
           </td>
         </tr>
         <% i++; %>

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Wed Sep 16 20:38:36 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "156";
+    public static final String     BUILD         = "157";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java Wed Sep 16 20:38:36 2009
@@ -450,9 +450,9 @@
         
         nd.setProperty( JCRWikiPage.ATTR_VERSION, version+1 );
         
-        if( !nd.hasProperty( "wiki:created" ) )
+        if( !nd.hasProperty( JCRWikiPage.ATTR_CREATED ) )
         {
-            nd.setProperty( "wiki:created", Calendar.getInstance() );
+            nd.setProperty( JCRWikiPage.ATTR_CREATED, Calendar.getInstance() );
         }
         
         if( nd.isNew() )

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java?rev=815957&r1=815956&r2=815957&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java Wed Sep 16 20:38:36 2009
@@ -65,10 +65,16 @@
 
     /** The name of the version attribute */
     public static final String ATTR_VERSION = "wiki:version";
+
+    /** The name of the created attribute */
+    public static final String ATTR_CREATED = "wiki:created";
     
     /** The name of the contentType  attribute */
     public  static final String CONTENTTYPE  = "wiki:contentType";
     
+    /** The ISO8601:2000 dateformat */
+    public static final String DATEFORMAT_ISO8601_2000 = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+    
     private WikiPath m_path;
 
     private WikiEngine m_engine;
@@ -173,10 +179,10 @@
         catch( RepositoryException e )
         {
             // the following exception still occurs quite often, so no stacktrace for now
-            log.warn( "RepositoryException occurred while getting Attribute " + key + " : "  +  e );
+            log.info( "RepositoryException occurred while getting Attribute " + key + " : "  +  e );
         }
         // until this is fixed we want some more diagnostic info 
-        log.warn("attribute value for key " + key + " is not Serializable, returning null value");
+        log.info("attribute value for key " + key + " is not Serializable, returning null value");
         return null;
     }
 
@@ -269,7 +275,7 @@
             }
             else
             {
-                throw new IllegalStateException( "The value returned by " + key + " was not a Serializalble, as expected.");
+                throw new IllegalStateException( "The value returned by " + key + " was not a Serializable, as expected.");
             }
         }
         catch(RepositoryException e) {}
@@ -781,4 +787,4 @@
     }
     
 
-}
\ No newline at end of file
+}