This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit ab518d9ed666bdc6971280be4e5bef77c3561e45
Author: juanpablo <[email protected]>
AuthorDate: Mon Feb 24 17:12:23 2020 +0100

    JSPWIKI-120: propagate WikiContext#getEngine() now returns Engine instead 
of WikiEngine (4)
---
 .../src/main/webapp/templates/210/AttachmentTab.jsp  |  2 +-
 .../src/main/webapp/templates/210/CommentContent.jsp |  5 +++--
 .../src/main/webapp/templates/210/DiffTab.jsp        | 12 +++++++-----
 .../src/main/webapp/templates/210/EditContent.jsp    |  5 +++--
 .../src/main/webapp/templates/210/GroupTab.jsp       |  4 ++--
 .../src/main/webapp/templates/210/InfoContent.jsp    | 12 +++++++-----
 .../src/main/webapp/templates/210/LoginContent.jsp   |  2 +-
 .../src/main/webapp/templates/210/PageContent.jsp    |  4 ++--
 .../src/main/webapp/templates/210/PageTab.jsp        |  3 ++-
 .../src/main/webapp/templates/210/PreferencesTab.jsp |  2 +-
 .../src/main/webapp/templates/210/ProfileTab.jsp     |  2 +-
 .../src/main/webapp/templates/210/UploadTemplate.jsp |  5 +++--
 .../main/webapp/templates/210/editors/CKeditor.jsp   | 18 ++++++++++--------
 .../src/main/webapp/templates/210/editors/FCK.jsp    | 18 ++++++++++--------
 .../main/webapp/templates/210/editors/TinyMCE.jsp    | 20 +++++++++++---------
 .../src/main/webapp/templates/210/editors/plain.jsp  | 14 ++++++++------
 .../main/webapp/templates/210/editors/wysiwyg.jsp    | 14 ++++++++------
 17 files changed, 80 insertions(+), 62 deletions(-)

diff --git a/jspwiki-war/src/main/webapp/templates/210/AttachmentTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/AttachmentTab.jsp
index bc88026..aeb551c 100644
--- a/jspwiki-war/src/main/webapp/templates/210/AttachmentTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/AttachmentTab.jsp
@@ -29,7 +29,7 @@
 <%
   int MAXATTACHNAMELENGTH = 30;
   WikiContext c = WikiContext.findContext(pageContext);
-  String progressId = 
c.getEngine().getProgressManager().getNewProgressIdentifier();
+  String progressId = c.getEngine().getManager( ProgressManager.class 
).getNewProgressIdentifier();
 %>
 
 <div id="addattachment">
diff --git a/jspwiki-war/src/main/webapp/templates/210/CommentContent.jsp 
b/jspwiki-war/src/main/webapp/templates/210/CommentContent.jsp
index 5ea2821..664e21a 100644
--- a/jspwiki-war/src/main/webapp/templates/210/CommentContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/CommentContent.jsp
@@ -18,14 +18,15 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
-<%@ page import="org.apache.wiki.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.attachment.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  int attCount = 
c.getEngine().getAttachmentManager().listAttachments(c.getPage()).size();
+  int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments(c.getPage()).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";  
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
index 35c0005..e533567 100644
--- a/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/DiffTab.jsp
@@ -17,21 +17,23 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.tags.InsertDiffTag" %>
-<%@ page import="org.apache.wiki.*" %>
 <%@ page import="java.util.*" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
+<%@ page import="org.apache.wiki.tags.InsertDiffTag" %>
+<%@ page import="org.apache.wiki.variables.VariableManager" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  List history = 
c.getEngine().getPageManager().getVersionHistory(c.getPage().getName());
+  List history = c.getEngine().getManager( PageManager.class 
).getVersionHistory(c.getPage().getName());
   pageContext.setAttribute( "history", history );
-  pageContext.setAttribute( "diffprovider", 
c.getEngine().getVariableManager().getVariable(c,"jspwiki.diffProvider"));
+  pageContext.setAttribute( "diffprovider", c.getEngine().getManager( 
VariableManager.class ).getVariable(c,"jspwiki.diffProvider"));
  %>
 
 <wiki:PageExists>
diff --git a/jspwiki-war/src/main/webapp/templates/210/EditContent.jsp 
b/jspwiki-war/src/main/webapp/templates/210/EditContent.jsp
index b6b7649..f10741d 100644
--- a/jspwiki-war/src/main/webapp/templates/210/EditContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/EditContent.jsp
@@ -18,15 +18,16 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.attachment.AttachmentManager" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  int attCount = 
c.getEngine().getAttachmentManager().listAttachments(c.getPage()).size();
+  int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments(c.getPage()).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/210/GroupTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/GroupTab.jsp
index d6fc9a4..914cfbb 100644
--- a/jspwiki-war/src/main/webapp/templates/210/GroupTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/GroupTab.jsp
@@ -21,6 +21,7 @@
 <%@ page import="java.security.Principal" %>
 <%@ page import="java.text.MessageFormat" %>
 <%@ page import="java.util.*" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ page import="org.apache.wiki.WikiContext" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.PrincipalComparator" %>
@@ -29,7 +30,6 @@
 <%@ page import="org.apache.wiki.preferences.Preferences" %>
 <%@ page import="org.apache.log4j.*" %>
 <%@ page errorPage="/Error.jsp" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
@@ -166,7 +166,7 @@
     if ( roles[i] instanceof GroupPrincipal ) /* bugfix */
     {
       String name = roles[i].getName();
-      Group group = c.getEngine().getGroupManager().getGroup( name );
+      Group group = c.getEngine().getManager( GroupManager.class ).getGroup( 
name );
 
       %><%= printWikiGroupPutGroup( group, name, name.equals( groupname ), 
pageContext )  %><%
     }
diff --git a/jspwiki-war/src/main/webapp/templates/210/InfoContent.jsp 
b/jspwiki-war/src/main/webapp/templates/210/InfoContent.jsp
index 57baec4..c59d32b 100644
--- a/jspwiki-war/src/main/webapp/templates/210/InfoContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/InfoContent.jsp
@@ -18,15 +18,17 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
+<%@ page import="java.security.Permission" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ page import="org.apache.wiki.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
 <%@ page import="org.apache.wiki.attachment.*" %>
 <%@ page import="org.apache.wiki.i18n.InternationalizationManager" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.preferences.Preferences" %>
+<%@ page import="org.apache.wiki.ui.progress.ProgressManager" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
-<%@ page import="java.security.Permission" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
 <fmt:setLocale value="${prefs.Language}" />
@@ -34,7 +36,7 @@
 <%
   WikiContext c = WikiContext.findContext(pageContext);
   WikiPage wikiPage = c.getPage();
-  int attCount = c.getEngine().getAttachmentManager().listAttachments( 
c.getPage() ).size();
+  int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments( c.getPage() ).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";
 
@@ -44,7 +46,7 @@
   String creationAuthor ="";
 
   //FIXME -- seems not to work correctly for attachments !!
-  WikiPage firstPage = c.getEngine().getPageManager().getPage( 
wikiPage.getName(), 1 );
+  WikiPage firstPage = c.getEngine().getManager( PageManager.class ).getPage( 
wikiPage.getName(), 1 );
   if( firstPage != null )
   {
     creationAuthor = firstPage.getAuthor();
@@ -265,7 +267,7 @@
 <wiki:PageType type="attachment">
 <%
   int MAXATTACHNAMELENGTH = 30;
-  String progressId = 
c.getEngine().getProgressManager().getNewProgressIdentifier();
+  String progressId = c.getEngine().getManager( ProgressManager.class 
).getNewProgressIdentifier();
 %>
 
   <wiki:TabbedSection defaultTab="<%=tabParam%>">
diff --git a/jspwiki-war/src/main/webapp/templates/210/LoginContent.jsp 
b/jspwiki-war/src/main/webapp/templates/210/LoginContent.jsp
index b4266f0..542631e 100644
--- a/jspwiki-war/src/main/webapp/templates/210/LoginContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/LoginContent.jsp
@@ -30,7 +30,7 @@
 <%
     String postURL = "";
     WikiContext ctx = WikiContext.findContext( pageContext );
-    AuthenticationManager mgr = ctx.getEngine().getAuthenticationManager();
+    AuthenticationManager mgr = ctx.getEngine().getManager( 
AuthenticationManager.class );
 
     if( mgr.isContainerAuthenticated() )
     {
diff --git a/jspwiki-war/src/main/webapp/templates/210/PageContent.jsp 
b/jspwiki-war/src/main/webapp/templates/210/PageContent.jsp
index dfb4505..48ee36e 100644
--- a/jspwiki-war/src/main/webapp/templates/210/PageContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/PageContent.jsp
@@ -18,15 +18,15 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ page import="org.apache.wiki.*" %>
 <%@ page import="org.apache.wiki.attachment.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  int attCount = 
c.getEngine().getAttachmentManager().listAttachments(c.getPage()).size();
+  int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments( c.getPage() ).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/210/PageTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/PageTab.jsp
index 5b892a4..40393af 100644
--- a/jspwiki-war/src/main/webapp/templates/210/PageTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/PageTab.jsp
@@ -19,6 +19,7 @@
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %><%--CHECK why is this needed 
--%>
@@ -52,7 +53,7 @@
           <%--<wiki:PageVersion/>--%>
           <select id="version" name="version" onchange="this.form.submit();" >
 <% 
-   int latestVersion = c.getEngine().getPageManager().getPage( pagename, 
WikiProvider.LATEST_VERSION ).getVersion();
+   int latestVersion = c.getEngine().getManager( PageManager.class ).getPage( 
pagename, WikiProvider.LATEST_VERSION ).getVersion();
    int thisVersion = p.getVersion();
 
    if( thisVersion == WikiProvider.LATEST_VERSION ) thisVersion = 
latestVersion; //should not happen
diff --git a/jspwiki-war/src/main/webapp/templates/210/PreferencesTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/PreferencesTab.jsp
index 36e6f54..7ba04fe 100644
--- a/jspwiki-war/src/main/webapp/templates/210/PreferencesTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/PreferencesTab.jsp
@@ -37,7 +37,7 @@
 <%
   //FIXME: this should better move to UserPreferences.jsp but that doesn't 
seem to work. Ugh ?
   WikiContext c = WikiContext.findContext( pageContext );
-  TemplateManager t = c.getEngine().getTemplateManager();
+  TemplateManager t = c.getEngine().getManager( TemplateManager.class );
   pageContext.setAttribute( "skins", t.listSkins(pageContext, c.getTemplate() 
) );
   pageContext.setAttribute( "languages", t.listLanguages(pageContext) );
   pageContext.setAttribute( "timeformats", t.listTimeFormats(pageContext) );
diff --git a/jspwiki-war/src/main/webapp/templates/210/ProfileTab.jsp 
b/jspwiki-war/src/main/webapp/templates/210/ProfileTab.jsp
index 6c6378f..173dc2a 100644
--- a/jspwiki-war/src/main/webapp/templates/210/ProfileTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/ProfileTab.jsp
@@ -30,7 +30,7 @@
 <%
   /* dateformatting not yet supported by wiki:UserProfile tag - diy */
   WikiContext wikiContext = WikiContext.findContext(pageContext);
-  UserManager manager = wikiContext.getEngine().getUserManager();
+  UserManager manager = wikiContext.getEngine().getManager( UserManager.class 
);
   UserProfile profile = manager.getUserProfile( wikiContext.getWikiSession() );
 %>
 <form action="<wiki:CheckRequestContext 
diff --git a/jspwiki-war/src/main/webapp/templates/210/UploadTemplate.jsp 
b/jspwiki-war/src/main/webapp/templates/210/UploadTemplate.jsp
index 7df18fb..32265f2 100644
--- a/jspwiki-war/src/main/webapp/templates/210/UploadTemplate.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/UploadTemplate.jsp
@@ -18,14 +18,15 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.attachment.AttachmentManager" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
-<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  int attCount = 
c.getEngine().getAttachmentManager().listAttachments(c.getPage()).size();
+  int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments(c.getPage()).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
   if( attCount != 0 ) attTitle += " (" + attCount + ")";
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/210/editors/CKeditor.jsp 
b/jspwiki-war/src/main/webapp/templates/210/editors/CKeditor.jsp
index 08c287e..cf85ee8 100644
--- a/jspwiki-war/src/main/webapp/templates/210/editors/CKeditor.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/editors/CKeditor.jsp
@@ -21,11 +21,13 @@
 <%@ page import="java.util.Properties"%>
 <%@ page import="org.apache.commons.text.*" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
 <%@ page import="org.apache.wiki.filters.*" %>
-<%@ page import="org.apache.wiki.render.*" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.parser.JSPWikiMarkupParser" %>
+<%@ page import="org.apache.wiki.render.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ page import="org.apache.wiki.variables.VariableManager" %>
@@ -39,7 +41,7 @@
 --%>
 <%
     WikiContext context = WikiContext.findContext( pageContext );
-    WikiEngine engine = context.getEngine();
+    Engine engine = context.getEngine();
 
     /* local download of CKeditor */
     TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
@@ -66,17 +68,17 @@
   String clone = request.getParameter( "clone" );
   if( clone != null )
   {
-    WikiPage p = engine.getPageManager().getPage( clone );
+    WikiPage p = engine.getManager( PageManager.class ).getPage( clone );
     if( p != null )
     {
-        AuthorizationManager mgr = engine.getAuthorizationManager();
+        AuthorizationManager mgr = engine.getManager( 
AuthorizationManager.class );
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION 
);
 
         try
         {
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPageManager().getPureText( p );
+            usertext = engine.getManager( PageManager.class ).getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e 
);*/ }
@@ -87,7 +89,7 @@
 <%
   if( usertext == null )
   {
-    usertext = engine.getPageManager().getPureText( context.getPage() );
+    usertext = engine.getManager( PageManager.class ).getPureText( 
context.getPage() );
   }
 %>
 </wiki:CheckRequestContext>
@@ -98,7 +100,7 @@
    try
    {
        //pageAsHtml = StringEscapeUtils.escapeEcmaScript( 
renderingManager.getHTML( context, usertext ) );
-       pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
+       pageAsHtml = engine.getManager( RenderingManager.class ).getHTML( 
context, usertext );
    }
        catch( Exception e )
    {
@@ -114,7 +116,7 @@
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, 
originalCCLOption );
 
    /*not used
-   String templateDir = (String)copyOfWikiProperties.get( 
WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)copyOfWikiProperties.get( 
Engine.PROP_TEMPLATEDIR );
 
    String protocol = "http://";;
    if( request.isSecure() )
diff --git a/jspwiki-war/src/main/webapp/templates/210/editors/FCK.jsp 
b/jspwiki-war/src/main/webapp/templates/210/editors/FCK.jsp
index 4db5005..c6662b2 100644
--- a/jspwiki-war/src/main/webapp/templates/210/editors/FCK.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/editors/FCK.jsp
@@ -22,11 +22,13 @@
 <%@ page import="java.util.Properties"%>
 <%@ page import="org.apache.commons.text.*" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
 <%@ page import="org.apache.wiki.filters.*" %>
-<%@ page import="org.apache.wiki.render.*" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.parser.JSPWikiMarkupParser" %>
+<%@ page import="org.apache.wiki.render.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ page import="org.apache.wiki.variables.VariableManager" %>
@@ -38,7 +40,7 @@
     This provides the FCK editor for JSPWiki.
 --%>
 <%  WikiContext context = WikiContext.findContext( pageContext );
-    WikiEngine engine = context.getEngine();
+    Engine engine = context.getEngine();
     context.setVariable( WikiContext.VAR_WYSIWYG_EDITOR_MODE, Boolean.TRUE );
     context.setVariable( VariableManager.VAR_RUNFILTERS,  "false" );
 
@@ -56,17 +58,17 @@
   String clone = request.getParameter( "clone" );
   if( clone != null )
   {
-    WikiPage p = engine.getPageManager().getPage( clone );
+    WikiPage p = engine.getManager( PageManager.class ).getPage( clone );
     if( p != null )
     {
-        AuthorizationManager mgr = engine.getAuthorizationManager();
+        AuthorizationManager mgr = engine.getManager( 
AuthorizationManager.class );
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION 
);
 
         try
         {
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPageManager().getPureText( p );
+            usertext = engine.getManager( PageManager.class ).getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e 
);*/ }
@@ -77,12 +79,12 @@
 <%
     if( usertext == null )
     {
-        usertext = engine.getPageManager().getPureText( context.getPage() );
+        usertext = engine.getManager( PageManager.class ).getPureText( 
context.getPage() );
     }%>
 </wiki:CheckRequestContext>
 <% if( usertext == null ) usertext = "";
 
-   String pageAsHtml = StringEscapeUtils.escapeEcmaScript( 
engine.getRenderingManager().getHTML( context, usertext ) );
+   String pageAsHtml = StringEscapeUtils.escapeEcmaScript( engine.getManager( 
RenderingManager.class ).getHTML( context, usertext ) );
 
    // Disable the WYSIWYG_EDITOR_MODE and reset the other properties 
immediately
    // after the XHTML for FCK has been rendered.
@@ -90,7 +92,7 @@
    context.setVariable( VariableManager.VAR_RUNFILTERS,  null );
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, 
originalCCLOption );
 
-   String templateDir = (String)engine.getWikiProperties().get( 
WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( 
Engine.PROP_TEMPLATEDIR );
 
    String protocol = "http://";;
    if( request.isSecure() )
diff --git a/jspwiki-war/src/main/webapp/templates/210/editors/TinyMCE.jsp 
b/jspwiki-war/src/main/webapp/templates/210/editors/TinyMCE.jsp
index 0372792..52047d2 100644
--- a/jspwiki-war/src/main/webapp/templates/210/editors/TinyMCE.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/editors/TinyMCE.jsp
@@ -21,11 +21,13 @@
 <%@ page import="java.util.Properties"%>
 <%@ page import="org.apache.commons.text.*" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
 <%@ page import="org.apache.wiki.filters.*" %>
-<%@ page import="org.apache.wiki.render.*" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.parser.JSPWikiMarkupParser" %>
+<%@ page import="org.apache.wiki.render.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ page import="org.apache.wiki.variables.VariableManager" %>
@@ -38,7 +40,7 @@
 --%>
 <%
     WikiContext context = WikiContext.findContext( pageContext );
-    WikiEngine engine = context.getEngine();
+    Engine engine = context.getEngine();
 
     /* local download of TinyMCE */
     TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
@@ -65,17 +67,17 @@
   String clone = request.getParameter( "clone" );
   if( clone != null )
   {
-    WikiPage p = engine.getPageManager().getPage( clone );
+    WikiPage p = engine.getManager( PageManager.class ).getPage( clone );
     if( p != null )
     {
-        AuthorizationManager mgr = engine.getAuthorizationManager();
+        AuthorizationManager mgr = engine.getManager( 
AuthorizationManager.class );
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION 
);
 
         try
         {
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPageManager().getPureText( p );
+            usertext = engine.getManager( PageManager.class ).getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e 
);*/ }
@@ -86,7 +88,7 @@
 <%
   if( usertext == null )
   {
-    usertext = engine.getPageManager().getPureText( context.getPage() );
+    usertext = engine.getManager( PageManager.class ).getPureText( 
context.getPage() );
   }
 %>
 </wiki:CheckRequestContext>
@@ -95,8 +97,8 @@
 
    String pageAsHtml;
    try {
-       //pageAsHtml = StringEscapeUtils.escapeJavaScript( 
engine.getRenderingManager().getHTML( context, usertext ) );
-       pageAsHtml = engine.getRenderingManager().getHTML( context, usertext );
+       //pageAsHtml = StringEscapeUtils.escapeJavaScript( engine.getManager( 
RenderingManager.class ).getHTML( context, usertext ) );
+       pageAsHtml = engine.getManager( RenderingManager.class ).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
@@ -109,7 +111,7 @@
    wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, 
originalCCLOption );
 
    /*not used
-   String templateDir = (String)engine.getWikiProperties().get( 
WikiEngine.PROP_TEMPLATEDIR );
+   String templateDir = (String)engine.getWikiProperties().get( 
Engine.PROP_TEMPLATEDIR );
 
    String protocol = "http://";;
    if( request.isSecure() )
diff --git a/jspwiki-war/src/main/webapp/templates/210/editors/plain.jsp 
b/jspwiki-war/src/main/webapp/templates/210/editors/plain.jsp
index 7b8b7cb..e4743f7 100644
--- a/jspwiki-war/src/main/webapp/templates/210/editors/plain.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/editors/plain.jsp
@@ -20,10 +20,12 @@
 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
-<%@ page import="org.apache.wiki.tags.*" %>
 <%@ page import="org.apache.wiki.filters.SpamFilter" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
+<%@ page import="org.apache.wiki.tags.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
@@ -35,7 +37,7 @@
 --%>
 <%
    WikiContext context = WikiContext.findContext( pageContext );
-   WikiEngine engine = context.getEngine();
+   Engine engine = context.getEngine();
 
    TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
                context.getURL( WikiContext.NONE, "scripts/jspwiki-edit.js" ) );
@@ -48,17 +50,17 @@
   String clone = request.getParameter( "clone" );
   if( clone != null )
   {
-    WikiPage p = engine.getPageManager().getPage( clone );
+    WikiPage p = engine.getManager( PageManager.class ).getPage( clone );
     if( p != null )
     {
-        AuthorizationManager mgr = engine.getAuthorizationManager();
+        AuthorizationManager mgr = engine.getManager( 
AuthorizationManager.class );
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION 
);
 
         try
         {
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPageManager().getPureText( p );
+            usertext = engine.getManager( PageManager.class ).getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e 
);*/ }
@@ -69,7 +71,7 @@
 <%
   if( usertext == null )
   {
-    usertext = engine.getPageManager().getPureText( context.getPage() );
+    usertext = engine.getManager( PageManager.class ).getPureText( 
context.getPage() );
   }
 %>
 </wiki:CheckRequestContext>
diff --git a/jspwiki-war/src/main/webapp/templates/210/editors/wysiwyg.jsp 
b/jspwiki-war/src/main/webapp/templates/210/editors/wysiwyg.jsp
index 3eeba15..31991ce 100644
--- a/jspwiki-war/src/main/webapp/templates/210/editors/wysiwyg.jsp
+++ b/jspwiki-war/src/main/webapp/templates/210/editors/wysiwyg.jsp
@@ -20,10 +20,12 @@
 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
-<%@ page import="org.apache.wiki.tags.*" %>
 <%@ page import="org.apache.wiki.filters.SpamFilter" %>
+<%@ page import="org.apache.wiki.pages.PageManager" %>
+<%@ page import="org.apache.wiki.tags.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
@@ -35,7 +37,7 @@
 --%>
 <%
    WikiContext context = WikiContext.findContext( pageContext );
-   WikiEngine engine = context.getEngine();
+   Engine engine = context.getEngine();
 
    TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
                context.getURL( WikiContext.NONE, "scripts/jspwiki-edit.js" ) );
@@ -48,17 +50,17 @@
   String clone = request.getParameter( "clone" );
   if( clone != null )
   {
-    WikiPage p = engine.getPageManager().getPage( clone );
+    WikiPage p = engine.getManager( PageManager.class ).getPage( clone );
     if( p != null )
     {
-        AuthorizationManager mgr = engine.getAuthorizationManager();
+        AuthorizationManager mgr = engine.getManager( 
AuthorizationManager.class );
         PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION 
);
 
         try
         {
           if( mgr.checkPermission( context.getWikiSession(), pp ) )
           {
-            usertext = engine.getPageManager().getPureText( p );
+            usertext = engine.getManager( PageManager.class ).getPureText( p );
           }
         }
         catch( Exception e ) {  /*log.error( "Accessing clone page "+clone, e 
);*/ }
@@ -69,7 +71,7 @@
 <%
   if( usertext == null )
   {
-    usertext = engine.getPageManager().getPureText( context.getPage() );
+    usertext = engine.getManager( PageManager.class ).getPureText( 
context.getPage() );
   }
 %>
 </wiki:CheckRequestContext>

Reply via email to