jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject svn commit: r1431141 - in /incubator/jspwiki/trunk: ./ doc/ src/org/apache/wiki/ src/org/apache/wiki/api/engine/ src/org/apache/wiki/parser/ src/org/apache/wiki/plugin/
Date Wed, 09 Jan 2013 23:10:36 GMT
Author: juanpablo
Date: Wed Jan  9 23:10:35 2013
New Revision: 1431141

URL: http://svn.apache.org/viewvc?rev=1431141&view=rev
Log:
 * 2.9.1-svn-16

 * some additional changes regarding org.apache.wiki.api.engine.PluginManager (cfr. $SVN/trunk/doc/2.10-API.txt):
 
   -> @Deprecated public void executeParse(PluginContent content, WikiContext context)
        + consider using PluginContent.executeParse(WikiContext) instead
   -> WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) is now public and
part 
      of the org.apache.wiki.api.engine.PluginManager API

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/doc/2.10-API.txt
    incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/org/apache/wiki/api/engine/PluginManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/parser/PluginContent.java
    incubator/jspwiki/trunk/src/org/apache/wiki/plugin/DefaultPluginManager.java
    incubator/jspwiki/trunk/src/org/apache/wiki/plugin/PluginManager.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Wed Jan  9 23:10:35 2013
@@ -1,4 +1,14 @@
-2013-01-XX  Juan Pablo Santos (juanpablo AT apache DOT org)
+2013-01-10  Juan Pablo Santos (juanpablo AT apache DOT org)
+
+       * 2.9.1-svn-16
+         
+       * some additional changes regarding org.apache.wiki.api.engine.PluginManager (cfr.
$SVN/trunk/doc/2.10-API.txt):  
+         -> @Deprecated public void executeParse(PluginContent content, WikiContext context)
+              + consider using PluginContent.executeParse(WikiContext) instead
+         -> WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) is now public
and part 
+            of the org.apache.wiki.api.engine.PluginManager API
+       
+2013-01-09  Juan Pablo Santos (juanpablo AT apache DOT org)
 
        * 2.9.1-svn-15
        

Modified: incubator/jspwiki/trunk/doc/2.10-API.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/doc/2.10-API.txt?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/doc/2.10-API.txt (original)
+++ incubator/jspwiki/trunk/doc/2.10-API.txt Wed Jan  9 23:10:35 2013
@@ -67,6 +67,10 @@ org.apache.wiki.plugin.PluginManager
  -> moved to org.apache.wiki.plugin.DefaultPluginManager
  -> @Deprecated public static boolean isPluginLink( String link )
       * equivalent method on org.apache.wiki.parser.JSPWikiMarkupParser
+ -> @Deprecated public void executeParse(PluginContent content, WikiContext context)
+      * consider using PluginContent.executeParse(WikiContext) instead
+ -> WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) is now public 
+    and part of the org.apache.wiki.api.engine.PluginManager API
  -> WikiEngine.getPluginManager returns org.apache.wiki.api.engine.PluginManager
 
 org.apache.wiki.plugin.InitializablePlugin

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/Release.java?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/Release.java Wed Jan  9 23:10:35 2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "15";
+    public static final String     BUILD         = "16";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/api/engine/PluginManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/api/engine/PluginManager.java?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/api/engine/PluginManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/api/engine/PluginManager.java Wed Jan  9 23:10:35
2013
@@ -3,9 +3,11 @@ package org.apache.wiki.api.engine;
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Map;
+import java.util.ResourceBundle;
 
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.api.plugin.WikiPlugin;
 import org.apache.wiki.parser.PluginContent;
 
 public interface PluginManager
@@ -133,15 +135,16 @@ public interface PluginManager
      * @return A Collection of WikiModuleInfo instances.
      */
     Collection modules();
-
+    
     /**
-     *  Executes parse stage, unless plugins are disabled.
-     *  
-     *  @param content The content item.
-     *  @param context A WikiContext
-     *  @throws PluginException If something goes wrong.
+     * Creates a {@link WikiPlugin}.
+     * 
+     * @param pluginName plugin's classname
+     * @param rb {@link ResourceBundle} with i18ned text for exceptions.
+     * @return a {@link WikiPlugin}.
+     * @throws PluginException if there is a problem building the {@link WikiPlugin}.
      */
-    void executeParse(PluginContent content, WikiContext context)
+    WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) 
         throws PluginException;
     
 }

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/parser/PluginContent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/parser/PluginContent.java?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/parser/PluginContent.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/parser/PluginContent.java Wed Jan  9 23:10:35
2013
@@ -27,6 +27,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.api.plugin.ParserStagePlugin;
 import org.apache.wiki.api.plugin.WikiPlugin;
 import org.apache.wiki.render.RenderingManager;
 import org.jdom.Text;
@@ -214,11 +215,26 @@ public class PluginContent extends Text
      *  @param context The WikiContext
      *  @throws PluginException If something goes wrong.
      */
-    public void executeParse(WikiContext context)
+    public void executeParse( WikiContext context )
         throws PluginException
     {
         PluginManager pm = context.getEngine().getPluginManager();
-        pm.executeParse( this, context );
+        if( pm.pluginsEnabled() ) {
+            ResourceBundle rb = context.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
+            Map<String, String> params = getParameters();
+            WikiPlugin plugin = pm.newWikiPlugin( getPluginName(), rb );
+            try
+            {
+                if( plugin != null && plugin instanceof ParserStagePlugin )
+                {
+                    ( ( ParserStagePlugin )plugin ).executeParser( this, context, params
);
+                }
+            }
+            catch( ClassCastException e )
+            {
+                throw new PluginException( MessageFormat.format( rb.getString( "plugin.error.notawikiplugin"
), getPluginName() ), e );
+            }
+        }
     }
 
 }

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/plugin/DefaultPluginManager.java?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/plugin/DefaultPluginManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/plugin/DefaultPluginManager.java Wed Jan 
9 23:10:35 2013
@@ -943,35 +943,6 @@ public class DefaultPluginManager extend
     }
 
     /**
-     *  Executes parse stage, unless plugins are disabled.
-     *  
-     *  @param content The content item.
-     *  @param context A WikiContext
-     *  @throws PluginException If something goes wrong.
-     */
-    public void executeParse(PluginContent content, WikiContext context)
-        throws PluginException
-    {
-        if( !m_pluginsEnabled )
-            return;
-
-        ResourceBundle rb = context.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
-        Map<String, String> params = content.getParameters();
-        WikiPlugin plugin = newWikiPlugin( content.getPluginName(), rb );
-        try
-        {
-            if( plugin != null && plugin instanceof ParserStagePlugin )
-            {
-                ( ( ParserStagePlugin )plugin ).executeParser( content, context, params );
-            }
-        }
-        catch( ClassCastException e )
-        {
-            throw new PluginException( MessageFormat.format( rb.getString( "plugin.error.notawikiplugin"
), content.getPluginName() ), e );
-        }
-    }
-    
-    /**
      * Creates a {@link WikiPlugin}.
      * 
      * @param pluginName plugin's classname
@@ -979,7 +950,7 @@ public class DefaultPluginManager extend
      * @return a {@link WikiPlugin}.
      * @throws PluginException if there is a problem building the {@link WikiPlugin}.
      */
-    WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) 
+    public WikiPlugin newWikiPlugin( String pluginName, ResourceBundle rb ) 
         throws PluginException 
     {
         WikiPlugin plugin = null;

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/plugin/PluginManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/plugin/PluginManager.java?rev=1431141&r1=1431140&r2=1431141&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/plugin/PluginManager.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/plugin/PluginManager.java Wed Jan  9 23:10:35
2013
@@ -19,14 +19,18 @@
 package org.apache.wiki.plugin;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.Map;
 import java.util.Properties;
+import java.util.ResourceBundle;
 
 import org.apache.commons.lang.ClassUtils;
 import org.apache.log4j.Logger;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.api.plugin.ParserStagePlugin;
+import org.apache.wiki.api.plugin.WikiPlugin;
 import org.apache.wiki.modules.WikiModuleInfo;
 import org.apache.wiki.parser.PluginContent;
 import org.jdom.Element;
@@ -185,16 +189,39 @@ public class PluginManager extends Defau
     public PluginContent parsePluginLine( WikiContext context, String commandline, int pos
)
         throws PluginException
     {
-       PluginContent pc = null;
-       try
-       {
-           pc = super.parsePluginLine(context, commandline, pos );
-       }
-       catch (org.apache.wiki.api.exceptions.PluginException e)
-       {
-           throw new PluginException( e.getMessage(), e );
-       }
-       return pc;
+       return super.parsePluginLine(context, commandline, pos );
+    }
+    
+    /**
+     *  Executes parse stage, unless plugins are disabled.
+     *  
+     *  @param content The content item.
+     *  @param context A WikiContext
+     *  @throws PluginException If something goes wrong.
+     *  @deprecated Remains because of old API compatobility; will be removed in 2.10 scope.

+     *  Consider using {@link PluginContent#executeParse(WikiContext)} instead
+     */
+    @Deprecated
+    public void executeParse(PluginContent content, WikiContext context)
+        throws PluginException
+    {
+        if( !pluginsEnabled() )
+            return;
+
+        ResourceBundle rb = context.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
+        Map<String, String> params = content.getParameters();
+        WikiPlugin plugin = newWikiPlugin( content.getPluginName(), rb );
+        try
+        {
+            if( plugin != null && plugin instanceof ParserStagePlugin )
+            {
+                ( ( ParserStagePlugin )plugin ).executeParser( content, context, params );
+            }
+        }
+        catch( ClassCastException e )
+        {
+            throw new PluginException( MessageFormat.format( rb.getString( "plugin.error.notawikiplugin"
), content.getPluginName() ), e );
+        }
     }
     
     /**



Mime
View raw message