jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r728285 - in /incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH: ./ src/com/ecyrd/jspwiki/ src/com/ecyrd/jspwiki/action/ src/com/ecyrd/jspwiki/attachment/ src/com/ecyrd/jspwiki/content/ src/webdocs/ src/webdocs/templates/default/ src/webdocs/te...
Date Sat, 20 Dec 2008 14:04:10 GMT
Author: jalkanen
Date: Sat Dec 20 06:04:09 2008
New Revision: 728285

URL: http://svn.apache.org/viewvc?rev=728285&view=rev
Log:
Merged with trunk r728284

Added:
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/JCRWikiPage.java
      - copied, changed from r728284, incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/JCRWikiPage.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiPage.java
      - copied, changed from r728284, incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java
Modified:
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/ChangeLog
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/action/WikiContextFactory.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/attachment/Attachment.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/ContentManager.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Comment.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Delete.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Diff.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Edit.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Search.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AJAXSearch.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AttachmentTab.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/InfoContent.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageActionsBottom.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageTab.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/FCK.jsp
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/plain.jsp

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/ChangeLog?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/ChangeLog Sat Dec 20 06:04:09 2008
@@ -2,9 +2,10 @@
 
         * 3.0.0-svn-35
         
-        * First step in refactoring WikiPage into an interface.  The WikiPage
+        * First step in refactoring WikiPage into a proper interface.  The WikiPage
         constructors are now deprecated, and most of the code now uses 
-        WikiEngine.createPage().
+        WikiEngine.createPage().  Also, the WikiPage class is now an interface,
+        though it still retains some methods which should not be in the interface.
         
         * Also created a WikiContextFactory.newViewContext(WikiPage) to get rid
         of all the null arguments.

Copied: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/JCRWikiPage.java (from r728284, incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/JCRWikiPage.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/JCRWikiPage.java?p2=incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/JCRWikiPage.java&p1=incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/JCRWikiPage.java&r1=728284&r2=728285&rev=728285&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/JCRWikiPage.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/JCRWikiPage.java Sat Dec 20 06:04:09 2008
@@ -25,9 +25,17 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
+import org.apache.jspwiki.api.WikiException;
+
 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.ContentManager;
 import com.ecyrd.jspwiki.content.WikiName;
 import com.ecyrd.jspwiki.providers.WikiPageProvider;
 
@@ -58,6 +66,8 @@
 
     private Acl m_accessList = null;
     
+    private Node             m_node = null;
+
     /**
      *  Use {@link WikiEngine#createPage(String)} instead.
      *  @deprecated
@@ -78,6 +88,25 @@
         m_name   = name;
     }
 
+    
+    public JCRWikiPage( WikiEngine engine, Node nd ) throws WikiException, RepositoryException
+    {
+        m_engine = engine;
+        m_name   = ContentManager.getWikiPath( nd.getPath() );
+        m_node   = nd;
+    }
+
+    // FIXME: This should be a part of the constructor
+    public void setJCRNode(Node nd)
+    {
+        m_node = nd;
+    }
+    
+    public Node getJCRNode()
+    {
+        return m_node;
+    }
+
     /* (non-Javadoc)
      * @see com.ecyrd.jspwiki.WikiPage#getName()
      */
@@ -336,4 +365,53 @@
     {
         return m_name.hashCode() * m_version;
     }
+    
+    public void save() throws WikiException
+    {
+        try
+        {
+            if( m_node.isNew() )
+                m_node.getParent().save();
+            else
+                m_node.save();
+        }
+        catch( RepositoryException e )
+        {
+            throw new WikiException("Save failed",e);
+        }
+    }
+    
+    private static final String ATTR_CONTENT = "wiki:content";
+    
+    public String getContentAsString() throws WikiException
+    {
+        try
+        {
+            Property p = m_node.getProperty( ATTR_CONTENT );
+                
+            return p.getString();
+        }
+        catch( PathNotFoundException e )
+        {
+        }
+        catch( RepositoryException e )
+        {
+            throw new WikiException("Unable to get property",e);
+        }
+        
+        return null;
+    }
+
+    public void setContent( String content ) throws WikiException
+    {
+        try
+        {
+            m_node.setProperty( ATTR_CONTENT, content );
+        }
+        catch( RepositoryException e )
+        {
+            throw new WikiException("Unable to set content",e);
+        }
+    }
+
 }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/PageManager.java?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/PageManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/PageManager.java Sat Dec 20 06:04:09 2008
@@ -251,9 +251,7 @@
     public WikiPage getPageInfo( String pageName, int version )
         throws ProviderException
     {
-        WikiContext context = m_engine.getWikiContextFactory().newViewContext( null, 
-                                                                               null, 
-                                                                               new WikiPage(m_engine,pageName) );
+        WikiContext context = m_engine.getWikiContextFactory().newViewContext( new JCRWikiPage(m_engine,pageName) );
         
         try
         {
@@ -277,9 +275,7 @@
     public List getVersionHistory( String pageName )
         throws ProviderException
     {
-        WikiContext context = m_engine.getWikiContextFactory().newViewContext( null, 
-                                                                               null, 
-                                                                               new WikiPage(m_engine,pageName) );
+        WikiContext context = m_engine.getWikiContextFactory().newViewContext( new JCRWikiPage(m_engine,pageName) );
 
         return m_engine.getContentManager().getVersionHistory( context, pageName );
     }
@@ -324,9 +320,7 @@
     public boolean pageExists( String pageName )
         throws ProviderException
     {
-        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( null, 
-                                                                           null, 
-                                                                           new WikiPage(m_engine,pageName) );
+        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( new JCRWikiPage(m_engine,pageName) );
 
         return m_engine.getContentManager().pageExists( ctx, pageName );
     }
@@ -343,9 +337,7 @@
     public boolean pageExists( String pageName, int version )
         throws ProviderException
     {
-        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( null, 
-                                                                           null, 
-                                                                           new WikiPage(m_engine,pageName) );
+        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( new JCRWikiPage(m_engine,pageName) );
 
         try
         {

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java Sat Dec 20 06:04:09 2008
@@ -1891,7 +1891,7 @@
     @SuppressWarnings("deprecation")
     public WikiPage createPage( WikiName name )
     {
-        return new WikiPage( this, name );
+        return new JCRWikiPage( this, name );
     }
     
     /**

Copied: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiPage.java (from r728284, incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiPage.java?p2=incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiPage.java&p1=incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java&r1=728284&r2=728285&rev=728285&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiPage.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/WikiPage.java Sat Dec 20 06:04:09 2008
@@ -23,6 +23,12 @@
 import java.util.Date;
 import java.util.Map;
 
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
+import org.apache.jspwiki.api.WikiException;
+
 import com.ecyrd.jspwiki.auth.acl.Acl;
 
 /**
@@ -232,4 +238,9 @@
      */
     public int compareTo( Object o );
     
+    public void save() throws WikiException;
+    
+    public String getContentAsString() throws WikiException;
+
+    public void setContent( String content ) throws WikiException;
 }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/action/WikiContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/action/WikiContextFactory.java?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/action/WikiContextFactory.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/action/WikiContextFactory.java Sat Dec 20 06:04:09 2008
@@ -656,7 +656,7 @@
     //       very descriptive.
     public WikiContext newEmptyContext()
     {
-        WikiPage page = new WikiPage(m_engine,"__DUMMY__");
+        WikiPage page = m_engine.createPage( "__DUMMY__");
         return newViewContext( null, null, page );
     }
 }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/attachment/Attachment.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/attachment/Attachment.java?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/attachment/Attachment.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/attachment/Attachment.java Sat Dec 20 06:04:09 2008
@@ -20,6 +20,7 @@
  */
 package com.ecyrd.jspwiki.attachment;
 
+import com.ecyrd.jspwiki.JCRWikiPage;
 import com.ecyrd.jspwiki.WikiEngine;
 import com.ecyrd.jspwiki.WikiPage;
 
@@ -30,7 +31,7 @@
  *  @author Erik Bunn
  */
 public class Attachment
-    extends WikiPage
+    extends JCRWikiPage
 {
     private String m_fileName;
     private String m_parentName;

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/ContentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/ContentManager.java?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/ContentManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/ContentManager.java Sat Dec 20 06:04:09 2008
@@ -313,7 +313,7 @@
                 
                 // Hack to make sure we don't add the space root node. 
                 if( n.getDepth() != 2 )
-                    result.add( new WikiPage(ctx.getEngine(), n ) );
+                    result.add( new JCRWikiPage(ctx.getEngine(), n ) );
             }
         }
         catch( RepositoryException e )
@@ -344,9 +344,7 @@
             throw new WikiException("Illegal page name");
         }
 
-        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( null, 
-                                                                           null, 
-                                                                           new WikiPage(m_engine,path) );
+        WikiContext ctx = m_engine.getWikiContextFactory().newViewContext( m_engine.createPage(path) );
         WikiPage p = getPage( ctx, path, version );
         
         return p.getContentAsString();
@@ -550,7 +548,7 @@
         throws ProviderException
     {
         List<WikiPage> result = new ArrayList<WikiPage>();
-        WikiPage base = getPage(ctx,path);
+        JCRWikiPage base = getPage(ctx,path);
 
         Node baseNode = base.getJCRNode();
         
@@ -562,7 +560,7 @@
             {
                 Version v = vi.nextVersion();
                 
-                result.add( new WikiPage(m_engine,v) );
+                result.add( new JCRWikiPage(m_engine,v) );
             }
         }
         catch( RepositoryException e )
@@ -680,12 +678,13 @@
     {
         fireEvent( WikiPageEvent.PAGE_DELETE_REQUEST, page.getName() );
 
+        JCRWikiPage jcrPage = (JCRWikiPage)page;
         try
         {
-            page.getJCRNode().remove();
-            page.save();
+            jcrPage.getJCRNode().remove();
+            jcrPage.save();
             
-            fireEvent( WikiPageEvent.PAGE_DELETED, page.getName() );
+            fireEvent( WikiPageEvent.PAGE_DELETED, jcrPage.getName() );
         }
         catch( RepositoryException e )
         {
@@ -708,7 +707,7 @@
         VersionHistory vh;
         try
         {
-            Node nd = page.getJCRNode();
+            Node nd = ((JCRWikiPage)page).getJCRNode();
             
             // Remove version history
             if( nd.isNodeType( "mix:versionable" ) )
@@ -1004,7 +1003,7 @@
      *  @param contentType
      *  @return
      */
-    public WikiPage addPage( WikiContext context, String path, String contentType ) throws WikiException
+    public JCRWikiPage addPage( WikiContext context, String path, String contentType ) throws WikiException
     {
         try
         {
@@ -1012,8 +1011,7 @@
         
             Node nd = session.getRootNode().addNode( getJCRPath(null, path) );
             
-            WikiPage page = new WikiPage(m_engine, path);
-            page.setJCRNode( nd );
+            JCRWikiPage page = new JCRWikiPage(m_engine, nd);
             
             return page;
         }
@@ -1029,15 +1027,14 @@
      *  @param path
      *  @return
      */
-    public WikiPage getPage( WikiContext context, String path ) throws ProviderException
+    public JCRWikiPage getPage( WikiContext context, String path ) throws ProviderException
     {
         try
         {
             Session session = getJCRSession( context );
         
             Node nd = session.getRootNode().getNode( getJCRPath(context, path) );
-            WikiPage page = new WikiPage(m_engine, path);
-            page.setJCRNode( nd );
+            JCRWikiPage page = new JCRWikiPage(m_engine, nd);
             
             return page;
         }
@@ -1049,9 +1046,13 @@
         {
             throw new ProviderException( "Unable to get a page", e );
         }
+        catch( WikiException e )
+        {
+            throw new ProviderException("Unable to get a  page",e);
+        }
     }
 
-    public WikiPage getPage( WikiContext context, String path, int version ) throws WikiException
+    public JCRWikiPage getPage( WikiContext context, String path, int version ) throws WikiException
     {
         try
         {
@@ -1063,8 +1064,7 @@
             
             Version v = vh.getVersion( Integer.toString( version ) );
             
-            WikiPage page = new WikiPage(m_engine, path);
-            page.setJCRNode( v );
+            JCRWikiPage page = new JCRWikiPage(m_engine, v);
             
             return page;
         }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Comment.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Comment.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Comment.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Comment.jsp Sat Dec 20 06:04:09 2008
@@ -60,8 +60,8 @@
     String remember = request.getParameter("remember");
     String changenote = TextUtil.replaceEntities( request.getParameter( "changenote" ) );
 
-    WikiPage wikipage = wikiContext.getPage();
-    WikiPage latestversion = wiki.getPage( pagereq );
+    JCRWikiPage wikipage = wikiContext.getPage();
+    JCRWikiPage latestversion = wiki.getPage( pagereq );
     if( latestversion == null )
     {
         latestversion = wikiContext.getPage();
@@ -111,7 +111,7 @@
 
         //  Modifications are written here before actual saving
 
-        WikiPage modifiedPage = (WikiPage)wikiContext.getPage().clone();
+        JCRWikiPage modifiedPage = (JCRWikiPage)wikiContext.getPage().clone();
 
         //  FIXME: I am not entirely sure if the JSP page is the
         //  best place to check for concurrent changes.  It certainly
@@ -121,7 +121,7 @@
         
         if( !SpamFilter.checkHash(wikiContext,pageContext) )
         {
-            return;
+    return;
         }
         
         //
@@ -139,9 +139,9 @@
         modifiedPage.setAuthor( storedUser );
 
         if( changenote != null )
-            modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote );
+    modifiedPage.setAttribute( JCRWikiPage.CHANGENOTE, changenote );
         else
-            modifiedPage.removeAttribute( WikiPage.CHANGENOTE );
+    modifiedPage.removeAttribute( JCRWikiPage.CHANGENOTE );
         
         //
         //  Build comment part
@@ -156,7 +156,7 @@
         //
         if( pageText.length() > 0 )
         {
-            pageText.append( "\n\n----\n\n" );
+    pageText.append( "\n\n----\n\n" );
         }
         
         String commentText = EditorManager.getEditedText(pageContext);
@@ -175,57 +175,57 @@
         log.debug("Author name ="+author);
         if( author != null && author.length() > 0 )
         {
-            String signature = author;
+    String signature = author;
 
-            if( link != null && link.length() > 0 )
-            {
-                link = HttpUtil.guessValidURI( link );
+    if( link != null && link.length() > 0 )
+    {
+        link = HttpUtil.guessValidURI( link );
 
-                signature = "["+author+"|"+link+"]";
-            }
+        signature = "["+author+"|"+link+"]";
+    }
 
-            Calendar cal = Calendar.getInstance();
-            SimpleDateFormat fmt = Preferences.getDateFormat( wikiContext ,  TimeFormat.DATETIME);
+    Calendar cal = Calendar.getInstance();
+    SimpleDateFormat fmt = Preferences.getDateFormat( wikiContext ,  TimeFormat.DATETIME);
 
-            pageText.append("\n\n--"+signature+", "+fmt.format(cal.getTime()));
+    pageText.append("\n\n--"+signature+", "+fmt.format(cal.getTime()));
 
-            //SimpleDateFormat fmt = new SimpleDateFormat( "YYYY-MM-DDThh:mm" ); //ISO-8601 format
-            //pageText.append("\n\n--"+signature+", [{Date value='"+fmt.format(cal.getTime())+"' }]");
+    //SimpleDateFormat fmt = new SimpleDateFormat( "YYYY-MM-DDThh:mm" ); //ISO-8601 format
+    //pageText.append("\n\n--"+signature+", [{Date value='"+fmt.format(cal.getTime())+"' }]");
         }
 
         if( TextUtil.isPositive(remember) )
         {
-            if( link != null )
-            {
-                Cookie linkcookie = new Cookie("link", link);
-                linkcookie.setMaxAge(1001*24*60*60);
-                response.addCookie( linkcookie );
-            }
+    if( link != null )
+    {
+        Cookie linkcookie = new Cookie("link", link);
+        linkcookie.setMaxAge(1001*24*60*60);
+        response.addCookie( linkcookie );
+    }
 
-            CookieAssertionLoginModule.setUserCookie( response, author );
+    CookieAssertionLoginModule.setUserCookie( response, author );
         }
         else
         {
-            session.removeAttribute("link");
-            session.removeAttribute("author");
+    session.removeAttribute("link");
+    session.removeAttribute("author");
         }
 
         try
         {
-            wikiContext.setPage( modifiedPage );
-            wiki.saveText( wikiContext, pageText.toString() );
+    wikiContext.setPage( modifiedPage );
+    wiki.saveText( wikiContext, pageText.toString() );
         }
         catch( DecisionRequiredException e )
         {
         	String redirect = wikiContext.getURL(WikiContext.VIEW,"ApprovalRequiredForPageChanges");
-            response.sendRedirect( redirect );
-            return;
+    response.sendRedirect( redirect );
+    return;
         }
         catch( RedirectException e )
         {
-            session.setAttribute( VariableManager.VAR_MSG, e.getMessage() );
-            response.sendRedirect( e.getRedirect() );
-            return;
+    session.setAttribute( VariableManager.VAR_MSG, e.getMessage() );
+    response.sendRedirect( e.getRedirect() );
+    return;
         }
         response.sendRedirect(wiki.getViewURL(pagereq));
         return;
@@ -244,8 +244,8 @@
 
         if( lock != null )
         {
-            wiki.getPageManager().unlockPage( lock );
-            session.removeAttribute( "lock-"+pagereq );
+    wiki.getPageManager().unlockPage( lock );
+    session.removeAttribute( "lock-"+pagereq );
         }
         response.sendRedirect( wiki.getViewURL(pagereq) );
         return;
@@ -264,8 +264,8 @@
     if( d != null ) lastchange = d.getTime();
 
     pageContext.setAttribute( "lastchange",
-                              Long.toString( lastchange ),
-                              PageContext.REQUEST_SCOPE );
+                      Long.toString( lastchange ),
+                      PageContext.REQUEST_SCOPE );
 
     //  This is a hack to get the preview to work.
     // pageContext.setAttribute( "comment", Boolean.TRUE, PageContext.REQUEST_SCOPE );
@@ -274,7 +274,7 @@
     //  Attempt to lock the page.
     //
     PageLock lock = wiki.getPageManager().lockPage( wikipage,
-                                                    storedUser );
+                                            storedUser );
 
     if( lock != null )
     {
@@ -287,7 +287,6 @@
     response.setDateHeader( "Expires", new Date().getTime() );
     response.setDateHeader( "Last-Modified", new Date().getTime() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
-                                                            wikiContext.getTemplate(),
-                                                            "EditTemplate.jsp" );
-
+                                                    wikiContext.getTemplate(),
+                                                    "EditTemplate.jsp" );
 %><wiki:Include page="<%=contentPage%>" />

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Delete.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Delete.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Delete.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Delete.jsp Sat Dec 20 06:04:09 2008
@@ -18,8 +18,8 @@
     WikiContext wikiContext = wiki.createContext( request, WikiContext.DELETE );
     String pagereq = wikiContext.getPage().getName();
 
-    WikiPage wikipage      = wikiContext.getPage();
-    WikiPage latestversion = wiki.getPage( pagereq );
+    JCRWikiPage wikipage      = wikiContext.getPage();
+    JCRWikiPage latestversion = wiki.getPage( pagereq );
 
     String delete = request.getParameter( "delete" );
     String deleteall = request.getParameter( "delete-all" );
@@ -49,17 +49,17 @@
         
         for( Enumeration params = request.getParameterNames(); params.hasMoreElements(); )
         {
-            String paramName = (String)params.nextElement();
-            
-            if( paramName.startsWith("delver") )
-            {
-                int version = Integer.parseInt( paramName.substring(7) );
-                
-                WikiPage p = wiki.getPage( pagereq, version );
-                
-                log.debug("Deleting version "+version);
-                wiki.deleteVersion( p );
-            }
+    String paramName = (String)params.nextElement();
+    
+    if( paramName.startsWith("delver") )
+    {
+        int version = Integer.parseInt( paramName.substring(7) );
+        
+        JCRWikiPage p = wiki.getPage( pagereq, version );
+        
+        log.debug("Deleting version "+version);
+        wiki.deleteVersion( p );
+    }
         }
         
         response.sendRedirect(wiki.getURL( WikiContext.INFO, redirTo, null, false ));
@@ -70,7 +70,7 @@
     // FIXME: not so.
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
-                                                            wikiContext.getTemplate(),
-                                                            "EditTemplate.jsp" );
+                                                    wikiContext.getTemplate(),
+                                                    "EditTemplate.jsp" );
 %><wiki:Include page="<%=contentPage%>" />
 

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Diff.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Diff.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Diff.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Diff.jsp Sat Dec 20 06:04:09 2008
@@ -32,7 +32,7 @@
     // FIXME: There is a set of unnecessary conversions here: InsertDiffTag
     //        does the String->int conversion anyway.
 
-    WikiPage wikipage = wikiContext.getPage();
+    JCRWikiPage wikipage = wikiContext.getPage();
 
     String srev1 = request.getParameter("r1");
     String srev2 = request.getParameter("r2");
@@ -54,23 +54,23 @@
 
         if( lastver > 1 )
         {
-            ver2 = lastver-1;
+    ver2 = lastver-1;
         }
     }
 
     pageContext.setAttribute( InsertDiffTag.ATTR_OLDVERSION,
-                              new Integer(ver1),
-                              PageContext.REQUEST_SCOPE );
+                      new Integer(ver1),
+                      PageContext.REQUEST_SCOPE );
     pageContext.setAttribute( InsertDiffTag.ATTR_NEWVERSION,
-                              new Integer(ver2),
-                              PageContext.REQUEST_SCOPE );
+                      new Integer(ver2),
+                      PageContext.REQUEST_SCOPE );
 
     // log.debug("Request for page diff for '"+pagereq+"' from "+request.getRemoteAddr()+" by "+request.getRemoteUser()+".  R1="+ver1+", R2="+ver2 );
 
     // Set the content type and include the response content
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
-                                                            wikiContext.getTemplate(),
-                                                            "ViewTemplate.jsp" );
+                                                    wikiContext.getTemplate(),
+                                                    "ViewTemplate.jsp" );
 %><wiki:Include page="<%=contentPage%>" />
 <% } finally { w.exitState(); } %>
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Edit.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Edit.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Edit.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Edit.jsp Sat Dec 20 06:04:09 2008
@@ -66,8 +66,8 @@
         text = new HtmlStringToWikiTranslator().translate(htmlText,wikiContext);
     }
 
-    WikiPage wikipage = wikiContext.getPage();
-    WikiPage latestversion = wiki.getPage( pagereq );
+    JCRWikiPage wikipage = wikiContext.getPage();
+    JCRWikiPage latestversion = wiki.getPage( pagereq );
 
     if( latestversion == null )
     {
@@ -97,10 +97,10 @@
         
         if( !SpamFilter.checkHash(wikiContext,pageContext) )
         {
-            return;
+    return;
         }
         
-        WikiPage modifiedPage = (WikiPage)wikiContext.getPage().clone();
+        JCRWikiPage modifiedPage = (JCRWikiPage)wikiContext.getPage().clone();
 
         //  FIXME: I am not entirely sure if the JSP page is the
         //  best place to check for concurrent changes.  It certainly
@@ -110,15 +110,15 @@
 
         if( !h.equals(spamhash) )
         {
-            //
-            // Someone changed the page while we were editing it!
-            //
-
-            log.info("Page changed, warning user.");
-
-            session.setAttribute( EditorManager.REQ_EDITEDTEXT, EditorManager.getEditedText(pageContext) );
-            response.sendRedirect( wiki.getURL(WikiContext.CONFLICT, pagereq, null, false) );
-            return;
+    //
+    // Someone changed the page while we were editing it!
+    //
+
+    log.info("Page changed, warning user.");
+
+    session.setAttribute( EditorManager.REQ_EDITEDTEXT, EditorManager.getEditedText(pageContext) );
+    response.sendRedirect( wiki.getURL(WikiContext.CONFLICT, pagereq, null, false) );
+    return;
         }
 
         //
@@ -141,11 +141,11 @@
 
         if( changenote != null && changenote.length() > 0 )
         {
-            modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote );
+    modifiedPage.setAttribute( JCRWikiPage.CHANGENOTE, changenote );
         }
         else
         {
-            modifiedPage.removeAttribute( WikiPage.CHANGENOTE );
+    modifiedPage.removeAttribute( JCRWikiPage.CHANGENOTE );
         }
 
         //
@@ -154,7 +154,7 @@
 
         if( text == null )
         {
-            throw new ServletException( "No parameter text set!" );
+    throw new ServletException( "No parameter text set!" );
         }
 
         //
@@ -164,48 +164,48 @@
 
         try
         {
-            wikiContext.setPage( modifiedPage );
+    wikiContext.setPage( modifiedPage );
+
+    if( captcha != null )
+    {
+        wikiContext.setVariable( "captcha", Boolean.TRUE );
+        session.removeAttribute( "captcha" );
+    }
 
-            if( captcha != null )
-            {
-                wikiContext.setVariable( "captcha", Boolean.TRUE );
-                session.removeAttribute( "captcha" );
-            }
-
-            if( append != null )
-            {
-                StringBuffer pageText = new StringBuffer(wiki.getText( pagereq ));
-
-                pageText.append( text );
-
-                wiki.saveText( wikiContext, pageText.toString() );
-            }
-            else
-            {
-                wiki.saveText( wikiContext, text );
-            }
+    if( append != null )
+    {
+        StringBuffer pageText = new StringBuffer(wiki.getText( pagereq ));
+
+        pageText.append( text );
+
+        wiki.saveText( wikiContext, pageText.toString() );
+    }
+    else
+    {
+        wiki.saveText( wikiContext, text );
+    }
         }
         catch( DecisionRequiredException ex )
         {
         	String redirect = wikiContext.getURL(WikiContext.VIEW,"ApprovalRequiredForPageChanges");
-            response.sendRedirect( redirect );
-            return;
+    response.sendRedirect( redirect );
+    return;
         }
         catch( RedirectException ex )
         {
-            // FIXME: Cut-n-paste code.
-            wikiContext.getWikiSession().addMessage( ex.getMessage() ); // FIXME: should work, but doesn't
-            session.setAttribute( "message", ex.getMessage() );
-            session.setAttribute(EditorManager.REQ_EDITEDTEXT,
-                                 EditorManager.getEditedText(pageContext));
-            session.setAttribute("author",user);
-            session.setAttribute("link",link != null ? link : "" );
-            if( htmlText != null ) session.setAttribute( EditorManager.REQ_EDITEDTEXT, text );
-
-            session.setAttribute("changenote", changenote != null ? changenote : "" );
-            session.setAttribute(SpamFilter.getHashFieldName(request), spamhash);
-            response.sendRedirect( ex.getRedirect() );
-            return;
+    // FIXME: Cut-n-paste code.
+    wikiContext.getWikiSession().addMessage( ex.getMessage() ); // FIXME: should work, but doesn't
+    session.setAttribute( "message", ex.getMessage() );
+    session.setAttribute(EditorManager.REQ_EDITEDTEXT,
+                         EditorManager.getEditedText(pageContext));
+    session.setAttribute("author",user);
+    session.setAttribute("link",link != null ? link : "" );
+    if( htmlText != null ) session.setAttribute( EditorManager.REQ_EDITEDTEXT, text );
+
+    session.setAttribute("changenote", changenote != null ? changenote : "" );
+    session.setAttribute(SpamFilter.getHashFieldName(request), spamhash);
+    response.sendRedirect( ex.getRedirect() );
+    return;
         }
 
         response.sendRedirect(wiki.getViewURL(pagereq));
@@ -215,7 +215,7 @@
     {
         log.debug("Previewing "+pagereq);
         session.setAttribute(EditorManager.REQ_EDITEDTEXT,
-                             EditorManager.getEditedText(pageContext));
+                     EditorManager.getEditedText(pageContext));
         session.setAttribute("author",user);
         session.setAttribute("link",link != null ? link : "" );
 
@@ -232,8 +232,8 @@
 
         if( lock != null )
         {
-            wiki.getPageManager().unlockPage( lock );
-            session.removeAttribute( "lock-"+pagereq );
+    wiki.getPageManager().unlockPage( lock );
+    session.removeAttribute( "lock-"+pagereq );
         }
         response.sendRedirect( wiki.getViewURL(pagereq) );
         return;
@@ -251,14 +251,14 @@
     String lastchange = SpamFilter.getSpamHash( latestversion, request );
 
     pageContext.setAttribute( "lastchange",
-                              lastchange,
-                              PageContext.REQUEST_SCOPE );
+                      lastchange,
+                      PageContext.REQUEST_SCOPE );
 
     //
     //  Attempt to lock the page.
     //
     PageLock lock = wiki.getPageManager().lockPage( wikipage,
-                                                    user );
+                                            user );
 
     if( lock != null )
     {
@@ -266,7 +266,6 @@
     }
 
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
-                                                            wikiContext.getTemplate(),
-                                                            "EditTemplate.jsp" );
-
+                                                    wikiContext.getTemplate(),
+                                                    "EditTemplate.jsp" );
 %><wiki:Include page="<%=contentPage%>" />
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Search.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Search.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Search.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/Search.jsp Sat Dec 20 06:04:09 2008
@@ -32,73 +32,73 @@
 
         try
         {
-            list = wiki.findPages( query );
+    list = wiki.findPages( query );
 
-            //
-            //  Filter down to only those that we actually have a permission to view
-            //
-            AuthorizationManager mgr = wiki.getAuthorizationManager();
-        
-            ArrayList filteredList = new ArrayList();
-            
-            for( Iterator i = list.iterator(); i.hasNext(); )
-            {
-                SearchResult r = (SearchResult)i.next();
-            
-                WikiPage p = r.getPage();
-            
-                PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION );
+    //
+    //  Filter down to only those that we actually have a permission to view
+    //
+    AuthorizationManager mgr = wiki.getAuthorizationManager();
+        
+    ArrayList filteredList = new ArrayList();
+    
+    for( Iterator i = list.iterator(); i.hasNext(); )
+    {
+        SearchResult r = (SearchResult)i.next();
+    
+        JCRWikiPage p = r.getPage();
+    
+        PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION );
 
-                try
-                {            
-                    if( mgr.checkPermission( wikiContext.getWikiSession(), pp ) )
-                    {
-                        filteredList.add( r );
-                    }
-                }
-                catch( Exception e ) { log.error( "Searching for page "+p, e ); }
+        try
+        {            
+            if( mgr.checkPermission( wikiContext.getWikiSession(), pp ) )
+            {
+                filteredList.add( r );
             }
+        }
+        catch( Exception e ) { log.error( "Searching for page "+p, e ); }
+    }
         
-            pageContext.setAttribute( "searchresults",
-                                      filteredList,
-                                      PageContext.REQUEST_SCOPE );
+    pageContext.setAttribute( "searchresults",
+                              filteredList,
+                              PageContext.REQUEST_SCOPE );
         }
         catch( Exception e )
         {
-            wikiContext.getWikiSession().addMessage( e.getMessage() );
+    wikiContext.getWikiSession().addMessage( e.getMessage() );
         }
         
         query = TextUtil.replaceEntities( query );
 
         pageContext.setAttribute( "query",
-                                  query,
-                                  PageContext.REQUEST_SCOPE );
+                          query,
+                          PageContext.REQUEST_SCOPE );
         
         //
         //  Did the user click on "go"?
         //           
         if( go != null )
         {
-            if( list != null && list.size() > 0 )
-            {
-                SearchResult sr = (SearchResult) list.iterator().next();
-                
-                WikiPage wikiPage = sr.getPage();
-                
-                String url = wikiContext.getViewURL( wikiPage.getName() );
-                
-                response.sendRedirect( url );
-                
-                return;
-            }
+    if( list != null && list.size() > 0 )
+    {
+        SearchResult sr = (SearchResult) list.iterator().next();
+        
+        JCRWikiPage wikiPage = sr.getPage();
+        
+        String url = wikiContext.getViewURL( wikiPage.getName() );
+        
+        response.sendRedirect( url );
+        
+        return;
+    }
         }                              
     }
 
     // Set the content type and include the response content
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
-                                                            wikiContext.getTemplate(),
-                                                            "ViewTemplate.jsp" );
+                                                    wikiContext.getTemplate(),
+                                                    "ViewTemplate.jsp" );
 %><wiki:Include page="<%=contentPage%>" /><%
     log.debug("SEARCH COMPLETE");
 %>

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AJAXSearch.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AJAXSearch.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AJAXSearch.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AJAXSearch.jsp Sat Dec 20 06:04:09 2008
@@ -25,7 +25,7 @@
   WikiEngine wiki;
 %>
 <%
-  /* ********************* actual start ********************* */
+    /* ********************* actual start ********************* */
   /* FIXME: too much hackin on this level -- should better happen in toplevel jsp's */
   /* Create wiki context and check for authorization */
   WikiContext wikiContext = wiki.createContext( request, WikiContext.FIND );
@@ -47,7 +47,7 @@
       {
         SearchResult r = (SearchResult)i.next();
     
-        WikiPage p = r.getPage();
+        JCRWikiPage p = r.getPage();
     
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION );
 
@@ -55,7 +55,7 @@
         {            
           if( mgr.checkPermission( wikiContext.getWikiSession(), pp ) )
           {
-            items.add( r );
+    items.add( r );
           }
         }
         catch( Exception e ) { log.error( "Searching for page "+p, e ); }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AttachmentTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AttachmentTab.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AttachmentTab.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/AttachmentTab.jsp Sat Dec 20 06:04:09 2008
@@ -115,9 +115,9 @@
       </wiki:Permission>
       <td class="changenote">
       <%
-         String changeNote = TextUtil.replaceEntities((String)att.getAttribute(WikiPage.CHANGENOTE));
-         if( changeNote != null ) {
-         %><%=changeNote%><%
+          String changeNote = TextUtil.replaceEntities((String)att.getAttribute(JCRWikiPage.CHANGENOTE));
+               if( changeNote != null ) {
+      %><%=changeNote%><%
          }
       %>
       </td>

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/InfoContent.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/InfoContent.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/InfoContent.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/InfoContent.jsp Sat Dec 20 06:04:09 2008
@@ -12,8 +12,8 @@
 <%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
 <%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
 <%
-  WikiContext c = WikiContextFactory.findContext( pageContext );
-  WikiPage wikiPage = c.getPage();
+    WikiContext c = WikiContextFactory.findContext( pageContext );
+  JCRWikiPage wikiPage = c.getPage();
   int attCount = c.getEngine().getAttachmentManager().listAttachments( c.getPage() ).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, "attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";
@@ -24,7 +24,7 @@
   String creationAuthor ="";
 
   //FIXME -- seems not to work correctly for attachments !!
-  WikiPage firstPage = c.getEngine().getPage( wikiPage.getName(), 1 );
+  JCRWikiPage firstPage = c.getEngine().getPage( wikiPage.getName(), 1 );
   if( firstPage != null )
   {
     creationAuthor = firstPage.getAuthor();
@@ -99,7 +99,7 @@
           <fmt:formatDate value="<%= firstPage.getLastModified() %>" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}" />
         </wiki:Link>
       </fmt:param>
-      <fmt:param><%= creationAuthor %></fmt:param>
+      <fmt:param><%=creationAuthor%></fmt:param>
     </fmt:message>
     </p>
   </wiki:CheckVersion>
@@ -182,11 +182,12 @@
       </tr>
 
       <wiki:HistoryIterator id="currentPage">
-      <% if( ( startitem == -1 ) ||
-             (  ( currentPage.getVersion() > startitem )
-             && ( currentPage.getVersion() <= startitem + pagesize ) ) )
-         {
-       %>
+      <%
+          if( ( startitem == -1 ) ||
+           (  ( currentPage.getVersion() > startitem )
+           && ( currentPage.getVersion() <= startitem + pagesize ) ) )
+               {
+      %>
       <tr>
         <td>
           <wiki:LinkTo version="<%=Integer.toString(currentPage.getVersion())%>">
@@ -214,14 +215,16 @@
 
          <td class="changenote">
            <%
-              String changeNote = (String)currentPage.getAttribute( WikiPage.CHANGENOTE );
-              changeNote = (changeNote != null) ? TextUtil.replaceEntities( changeNote ) : "" ;
+               String changeNote = (String)currentPage.getAttribute( JCRWikiPage.CHANGENOTE );
+                 changeNote = (changeNote != null) ? TextUtil.replaceEntities( changeNote ) : "" ;
            %>
-           <%= changeNote %>
+           <%=changeNote%>
          </td>
 
       </tr>
-      <% } %>
+      <%
+          }
+      %>
       </wiki:HistoryIterator>
 
     </table>
@@ -239,7 +242,7 @@
 <%-- part 2 : attachments --%>
 <wiki:PageType type="attachment">
 <%
-  int MAXATTACHNAMELENGTH = 30;
+    int MAXATTACHNAMELENGTH = 30;
   String progressId = c.getEngine().getProgressManager().getNewProgressIdentifier();
 %>
 
@@ -329,16 +332,16 @@
 
     <wiki:HistoryIterator id="att"><%-- <wiki:AttachmentsIterator id="att"> --%>
     <%
-      String name = att.getName(); //att.getFileName();
-      int dot = name.lastIndexOf(".");
-      String attachtype = ( dot != -1 ) ? name.substring(dot+1) : "&nbsp;";
+        String name = att.getName(); //att.getFileName();
+          int dot = name.lastIndexOf(".");
+          String attachtype = ( dot != -1 ) ? name.substring(dot+1) : "&nbsp;";
 
-      String sname = name;
-      if( sname.length() > MAXATTACHNAMELENGTH ) sname = sname.substring(0,MAXATTACHNAMELENGTH) + "...";
+          String sname = name;
+          if( sname.length() > MAXATTACHNAMELENGTH ) sname = sname.substring(0,MAXATTACHNAMELENGTH) + "...";
     %>
 
     <tr>
-      <td><div id="attach-<%= attachtype %>" class="attachtype"><%= attachtype %></div></td>
+      <td><div id="attach-<%= attachtype %>" class="attachtype"><%=attachtype%></div></td>
       <%--<td><wiki:LinkTo title="<%= name %>" ><%= sname %></wiki:LinkTo></td>--%>
       <%--FIXME classs parameter throws java exception
       <td><wiki:Link version='<%=Integer.toString(att.getVersion())%>'
@@ -365,10 +368,10 @@
       --%>
       <td class='changenote'>
       <%
-         String changeNote = (String)att.getAttribute(WikiPage.CHANGENOTE);
-         if( changeNote != null ) {
-             changeNote = TextUtil.replaceEntities(changeNote);
-         %><%=changeNote%><%
+          String changeNote = (String)att.getAttribute(JCRWikiPage.CHANGENOTE);
+               if( changeNote != null ) {
+           changeNote = TextUtil.replaceEntities(changeNote);
+      %><%=changeNote%><%
          }
       %>
       </td>

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageActionsBottom.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageActionsBottom.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageActionsBottom.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageActionsBottom.jsp Sat Dec 20 06:04:09 2008
@@ -4,8 +4,8 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 <%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
 <%
-  WikiContext c = WikiContextFactory.findContext( pageContext );
-  WikiPage wikipage = c.getPage();
+    WikiContext c = WikiContextFactory.findContext( pageContext );
+  JCRWikiPage wikipage = c.getPage();
 %>
 <wiki:CheckRequestContext context='view|diff|edit|upload|info'>
 <div id='actionsBottom' class="pageactions"> 

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageTab.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageTab.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/PageTab.jsp Sat Dec 20 06:04:09 2008
@@ -7,8 +7,8 @@
 <%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
 <%--CHECK why is this needed --%>
 <%
-	WikiContext c = WikiContextFactory.findContext( pageContext );
-   	WikiPage p = c.getPage();
+    WikiContext c = WikiContextFactory.findContext( pageContext );
+   	JCRWikiPage p = c.getPage();
 	String pagename = p.getName();
 
 	/* check possible permalink (blogentry) pages */

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/FCK.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/FCK.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/FCK.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/FCK.jsp Sat Dec 20 06:04:09 2008
@@ -17,25 +17,26 @@
 <%--
     This provides the FCK editor for JSPWiki.
 --%>
-<%  WikiContext context = WikiContextFactory.findContext( pageContext );
+<%
+    WikiContext context = WikiContextFactory.findContext( pageContext );
     WikiEngine engine = context.getEngine();
     context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.TRUE );
     context.setVariable( WikiEngine.PROP_RUNFILTERS,  "false" );
 
-    WikiPage wikiPage = context.getPage();
+    JCRWikiPage wikiPage = context.getPage();
     String originalCCLOption = (String)wikiPage.getAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS );
     wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, "false" );
     
     String usertext = EditorManager.getEditedText(pageContext);
     TemplateManager.addResourceRequest( context, "script", "scripts/fckeditor/fckeditor.js" );
- %>   
+%>   
 <wiki:CheckRequestContext context="edit">
 <wiki:NoSuchPage> <%-- this is a new page, check if we're cloning --%>
 <%
-  String clone = request.getParameter( "clone" ); 
+    String clone = request.getParameter( "clone" ); 
   if( clone != null )
   {
-    WikiPage p = engine.getPage( clone );
+    JCRWikiPage p = engine.getPage( clone );
     if( p != null )
     {
         AuthorizationManager mgr = engine.getAuthorizationManager();
@@ -45,7 +46,7 @@
         {            
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPureText( p );
+    usertext = engine.getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e );*/ }

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/plain.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/plain.jsp?rev=728285&r1=728284&r2=728285&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/plain.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/webdocs/templates/default/editors/plain.jsp Sat Dec 20 06:04:09 2008
@@ -29,10 +29,10 @@
 <wiki:CheckRequestContext context="edit">
 <wiki:NoSuchPage> <%-- this is a new page, check if we're cloning --%>
 <%
-  String clone = request.getParameter( "clone" ); 
+    String clone = request.getParameter( "clone" ); 
   if( clone != null )
   {
-    WikiPage p = engine.getPage( clone );
+    JCRWikiPage p = engine.getPage( clone );
     if( p != null )
     {
         AuthorizationManager mgr = engine.getAuthorizationManager();
@@ -42,7 +42,7 @@
         {            
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPureText( p );
+    usertext = engine.getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e );*/ }



Mime
View raw message