Author: jalkanen
Date: Wed Nov 25 22:52:18 2009
New Revision: 884322

URL: http://svn.apache.org/viewvc?rev=884322&view=rev
Log:
Added wiki:title handling; now the pages are created with the original title 
regardless of the case they get stored in.

Modified:
    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/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=884322&r1=884321&r2=884322&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 Nov 25 22:52:18 2009
@@ -1586,6 +1586,8 @@
                 nd.setProperty( JCRWikiPage.CONTENT_TYPE, contentType );
             }
             
+            nd.setProperty( JCRWikiPage.ATTR_TITLE, path.getName() );
+            
             // Return the new WikiPage containing the new/re-used Node
             JCRWikiPage page = new JCRWikiPage(m_engine, path, nd);
             return page;

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=884322&r1=884321&r2=884322&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 Nov 25 22:52:18 2009
@@ -64,17 +64,20 @@
 
     private static final String ATTR_CONTENT = "wiki:content";
 
+    public static final String ATTR_TITLE   = "wiki:title";
+
     /** The name of the version attribute */
-    public static final String ATTR_VERSION = "wiki:version";
+    public static final String ATTR_VERSION  = "wiki:version";
 
     /** The name of the created attribute */
-    public static final String ATTR_CREATED = "wiki:created";
+    public static final String ATTR_CREATED  = "wiki:created";
     
     /** The name of the contentType  attribute */
-    public  static final String CONTENT_TYPE  = "wiki:contentType";
+    public static final String CONTENT_TYPE  = "wiki:contentType";
+    
     
     /** The ISO8601:2000 dateformat */
-    public static final String DATEFORMAT_ISO8601_2000 = 
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+    private static final String DATEFORMAT_ISO8601_2000 = 
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
     
     private WikiPath m_path;
 
@@ -154,7 +157,15 @@
      */
     public String getName()
     {
-        return m_path.getPath();
+        //return m_path.getPath();
+        try
+        {
+            return getProperty(ATTR_TITLE).getString();
+        }
+        catch( Exception e )
+        {
+            return m_path.getPath();
+        }
     }
     
     /**


Reply via email to