jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject [09/10] jspwiki git commit: no more instantiation of WysiwygEditingRenderer, the appropiate renderer is retrieved through the rendering manager
Date Tue, 22 Aug 2017 18:13:05 GMT
no more instantiation of WysiwygEditingRenderer, the appropiate renderer is retrieved through
the rendering manager


Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo
Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/76017e18
Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/76017e18
Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/76017e18

Branch: refs/heads/master
Commit: 76017e18a79409e76fe5caad651ce1a3f6de8aa0
Parents: d813d92
Author: juanpablo <juanpablo@apache.org>
Authored: Tue Aug 22 20:11:32 2017 +0200
Committer: juanpablo <juanpablo@apache.org>
Committed: Tue Aug 22 20:11:32 2017 +0200

----------------------------------------------------------------------
 .../src/main/webapp/XHRMarkup2Wysiwyg.jsp       | 11 +------
 .../templates/default/editors/CKeditor.jsp      | 30 +++++++-----------
 .../webapp/templates/default/editors/FCK.jsp    | 12 ++------
 .../templates/default/editors/TinyMCE.jsp       | 32 ++++++++------------
 .../templates/haddock/editors/CKeditor.jsp      | 10 +-----
 .../templates/haddock/editors/TinyMCE.jsp       | 14 ++-------
 .../templates/haddock/editors/wysiwyg.jsp       | 15 ++-------
 7 files changed, 33 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/XHRMarkup2Wysiwyg.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/XHRMarkup2Wysiwyg.jsp b/jspwiki-war/src/main/webapp/XHRMarkup2Wysiwyg.jsp
index 293bb45..c205e38 100644
--- a/jspwiki-war/src/main/webapp/XHRMarkup2Wysiwyg.jsp
+++ b/jspwiki-war/src/main/webapp/XHRMarkup2Wysiwyg.jsp
@@ -48,19 +48,10 @@
   if( usertext != null )
   {
 
-    RenderingManager renderingManager = new RenderingManager();
-
-    // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-    Properties copyOfWikiProperties = new Properties();
-    copyOfWikiProperties.putAll( wiki.getWikiProperties() );
-    copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-    renderingManager.initialize( wiki, copyOfWikiProperties );
-
     String pageAsHtml;
     try
     {
-        pageAsHtml = renderingManager.getHTML( wikiContext, usertext );
-
+        pageAsHtml = wiki.getRenderingManager().getHTML( wikiContext, usertext );
     }
         catch( Exception e )
     {

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
index 339c938..e9f3e2b 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
@@ -94,25 +94,17 @@
 <%
    if( usertext == null ) usertext = "";
 
-   RenderingManager renderingManager = engine.getRenderingManager();
-
-   // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-   Properties copyOfWikiProperties = new Properties();
-   copyOfWikiProperties.putAll( engine.getWikiProperties() );
-   copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-   renderingManager.initialize( engine, copyOfWikiProperties );
-
-    String pageAsHtml;
-    try
-    {
-        //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
-        pageAsHtml = renderingManager.getHTML( context, usertext );
-    }
-        catch( Exception e )
-    {
-        pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
-        //pageAsHtml = e.toString() + "\n" + usertext; //error
-    }
+   String pageAsHtml;
+   try
+   {
+       //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
+       pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
+   }
+       catch( Exception e )
+   {
+       pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
+       //pageAsHtml = e.toString() + "\n" + usertext; //error
+   }
 
    // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
    // after the XHTML for CKeditor has been rendered.

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/default/editors/FCK.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/FCK.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/FCK.jsp
index e563569..ec95bca 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/FCK.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/FCK.jsp
@@ -81,15 +81,7 @@
 </wiki:CheckRequestContext>
 <% if( usertext == null ) usertext = "";
 
-   RenderingManager renderingManager = engine.getRenderingManager();
-
-   // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-   Properties copyOfWikiProperties = new Properties();
-   copyOfWikiProperties.putAll( engine.getWikiProperties() );
-   copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-   renderingManager.initialize( engine, copyOfWikiProperties );
-
-   String pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
+   String pageAsHtml = StringEscapeUtils.escapeJavaScript( engine.getRenderingManager().getHTML(
context, usertext ) );
 
    // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
    // after the XHTML for FCK has been rendered.
@@ -97,7 +89,7 @@
    context.setVariable( WikiEngine.PROP_RUNFILTERS,  null );
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
 
-   String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( WikiEngine.PROP_TEMPLATEDIR
);
 
    String protocol = "http://";
    if( request.isSecure() )

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
index 72c95ce..207c1a9 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
@@ -94,25 +94,17 @@
 <%
    if( usertext == null ) usertext = "";
 
-   RenderingManager renderingManager = engine.getRenderingManager();
-
-   // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-   Properties copyOfWikiProperties = new Properties();
-   copyOfWikiProperties.putAll( engine.getWikiProperties() );
-   copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-   renderingManager.initialize( engine, copyOfWikiProperties );
-
-    String pageAsHtml;
-    try
-    {
-        //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
-        pageAsHtml = renderingManager.getHTML( context, usertext );
-    }
-        catch( Exception e )
-    {
-        pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
-        //pageAsHtml = e.toString() + "\n" + usertext; //error
-    }
+   String pageAsHtml;
+   try
+   {
+       //pageAsHtml = StringEscapeUtils.escapeJavaScript( engine.getRenderingManager().getHTML(
context, usertext ) );
+       pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
+   }
+       catch( Exception e )
+   {
+       pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
+       //pageAsHtml = e.toString() + "\n" + usertext; //error
+   }
 
    // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
    // after the XHTML for TinyMCE has been rendered.
@@ -122,7 +114,7 @@
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
 
    /*not used
-   String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( WikiEngine.PROP_TEMPLATEDIR
);
 
    String protocol = "http://";
    if( request.isSecure() )

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/haddock/editors/CKeditor.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/haddock/editors/CKeditor.jsp b/jspwiki-war/src/main/webapp/templates/haddock/editors/CKeditor.jsp
index 7a79de8..026e5ff 100644
--- a/jspwiki-war/src/main/webapp/templates/haddock/editors/CKeditor.jsp
+++ b/jspwiki-war/src/main/webapp/templates/haddock/editors/CKeditor.jsp
@@ -96,19 +96,11 @@
 <%
     if( usertext == null ) usertext = "";
 
-    RenderingManager renderingManager = new RenderingManager();
-
-    // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-    Properties copyOfWikiProperties = new Properties();
-    copyOfWikiProperties.putAll( engine.getWikiProperties() );
-    copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-    renderingManager.initialize( engine, copyOfWikiProperties );
-
     String pageAsHtml;
     try
     {
         //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
-        pageAsHtml = renderingManager.getHTML( context, usertext );
+        pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
     }
         catch( Exception e )
     {

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp b/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
index e3af0a1..2bad241 100644
--- a/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
+++ b/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
@@ -97,19 +97,11 @@
 <%
     if( usertext == null ) usertext = "";
 
-    RenderingManager renderingManager = new RenderingManager();
-
-    // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-    Properties copyOfWikiProperties = new Properties();
-    copyOfWikiProperties.putAll( engine.getWikiProperties() );
-    copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-    renderingManager.initialize( engine, copyOfWikiProperties );
-
     String pageAsHtml;
     try
     {
-        //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
-        pageAsHtml = renderingManager.getHTML( context, usertext );
+        //pageAsHtml = StringEscapeUtils.escapeJavaScript( engine.getRenderingManager().getHTML(
context, usertext ) );
+        pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
 
     }
         catch( Exception e )
@@ -134,7 +126,7 @@
 
 
    /*FSS not used
-   String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( WikiEngine.PROP_TEMPLATEDIR
);
 
    String protocol = "http://";
    if( request.isSecure() )

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/76017e18/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp b/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp
index 2aea0e9..4ddad49 100644
--- a/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp
+++ b/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp
@@ -89,20 +89,11 @@
 <%
     if( usertext == null ) usertext = "";
 
-    RenderingManager renderingManager = new RenderingManager();
-    //RenderingManager renderingManager = engine.getRenderingManager();
-
-    // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
-    Properties copyOfWikiProperties = new Properties();
-    copyOfWikiProperties.putAll( engine.getWikiProperties() );
-    copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName()
);
-    renderingManager.initialize( engine, copyOfWikiProperties );
-
     String pageAsHtml;
     try
     {
-        //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context,
usertext ) );
-        pageAsHtml = renderingManager.getHTML( context, usertext );
+        //pageAsHtml = StringEscapeUtils.escapeJavaScript( engine.getRenderingManager().getHTML(
context, usertext ) );
+        pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
     }
         catch( Exception e )
     {
@@ -123,7 +114,7 @@
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
 
    /*not used
-   String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( WikiEngine.PROP_TEMPLATEDIR
);
 
    String protocol = "http://";
    if( request.isSecure() )


Mime
View raw message