You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2008/12/09 19:54:57 UTC
svn commit: r724822 - in /incubator/jspwiki/trunk: ./ src/com/ecyrd/jspwiki/
src/com/ecyrd/jspwiki/content/ src/com/ecyrd/jspwiki/providers/
Author: jalkanen
Date: Tue Dec 9 10:54:56 2008
New Revision: 724822
URL: http://svn.apache.org/viewvc?rev=724822&view=rev
Log:
Added WikiName class.
Added:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/ContentManager.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/WikiName.java
- copied unchanged from r724816, incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java
Modified:
incubator/jspwiki/trunk/ChangeLog
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/ProviderException.java
Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=724822&r1=724821&r2=724822&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Tue Dec 9 10:54:56 2008
@@ -1,3 +1,11 @@
+2008-12-05 Janne Jalkanen <ja...@apache.org>
+
+ * 3.0.0-svn-28
+
+ * Brought in the WikiName class, which should now be used
+ instead of Strings to denote page names internally wherever
+ possible.
+
2008-12-06 Andrew Jaquith <ajaquith AT apache DOT org>
* 3.0.0-svn-27
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java?rev=724822&r1=724821&r2=724822&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java Tue Dec 9 10:54:56 2008
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "27";
+ public static final String BUILD = "28";
/**
* This is the generic version string you should use
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java?rev=724822&r1=724821&r2=724822&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java Tue Dec 9 10:54:56 2008
@@ -28,6 +28,7 @@
import com.ecyrd.jspwiki.auth.acl.Acl;
import com.ecyrd.jspwiki.auth.acl.AclEntry;
import com.ecyrd.jspwiki.auth.acl.AclImpl;
+import com.ecyrd.jspwiki.content.WikiName;
import com.ecyrd.jspwiki.providers.WikiPageProvider;
/**
@@ -45,9 +46,8 @@
{
private static final long serialVersionUID = 1L;
- private String m_name;
+ private WikiName m_name;
private WikiEngine m_engine;
- private String m_wiki;
private Date m_lastModified;
private long m_fileSize = -1;
private int m_version = WikiPageProvider.LATEST_VERSION;
@@ -74,13 +74,18 @@
* Create a new WikiPage using a given engine and name.
*
* @param engine The WikiEngine that owns this page.
- * @param name The name of the page.
+ * @param name The path of the page.
*/
- public WikiPage( WikiEngine engine, String name )
+ public WikiPage( WikiEngine engine, String path )
{
m_engine = engine;
- m_name = name;
- m_wiki = engine.getApplicationName();
+ m_name = WikiName.valueOf( path );
+ }
+
+ public WikiPage( WikiEngine engine, WikiName name )
+ {
+ m_engine = engine;
+ m_name = name;
}
/**
@@ -90,7 +95,7 @@
*/
public String getName()
{
- return m_name;
+ return m_name.getPath();
}
/**
@@ -101,7 +106,7 @@
*/
public String getQualifiedName()
{
- return m_wiki + ":" + m_name;
+ return m_name.toString();
}
/**
@@ -270,9 +275,10 @@
*
* @return The name of the wiki.
*/
+ // FIXME: Should we rename this method?
public String getWiki()
{
- return m_wiki;
+ return m_name.getSpace();
}
/**
@@ -314,7 +320,7 @@
*/
public String toString()
{
- return "WikiPage ["+m_wiki+":"+m_name+",ver="+m_version+",mod="+m_lastModified+"]";
+ return "WikiPage ["+m_name+",ver="+m_version+",mod="+m_lastModified+"]";
}
/**
@@ -328,8 +334,6 @@
public Object clone()
{
WikiPage p = new WikiPage( m_engine, m_name );
-
- p.m_wiki = m_wiki;
p.m_author = m_author;
p.m_version = m_version;
Added: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/ContentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/ContentManager.java?rev=724822&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/ContentManager.java (added)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/ContentManager.java Tue Dec 9 10:54:56 2008
@@ -0,0 +1,30 @@
+/*
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+package com.ecyrd.jspwiki.content;
+
+/**
+ * Please see JSPWIKI_JCR_BRANCH for a functioning version.
+ * Exists in the trunk only to provide useful constants for now.
+ */
+public class ContentManager
+{
+ protected static final String DEFAULT_SPACE = "Main";
+}
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/ProviderException.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/ProviderException.java?rev=724822&r1=724821&r2=724822&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/ProviderException.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/providers/ProviderException.java Tue Dec 9 10:54:56 2008
@@ -42,4 +42,9 @@
{
super( msg );
}
+
+ public ProviderException( String string, Throwable rootCause )
+ {
+ super( string, rootCause );
+ }
}