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 1433993221e37dc38d7846dfcb78671f524ea0bd Author: juanpablo <[email protected]> AuthorDate: Mon Feb 24 17:12:32 2020 +0100 JSPWIKI-120: propagate WikiContext#getEngine() now returns Engine instead of WikiEngine (5) --- .../main/webapp/templates/default/AttachmentTab.jsp | 2 +- .../src/main/webapp/templates/default/DiffTab.jsp | 12 +++++++----- .../src/main/webapp/templates/default/GroupTab.jsp | 5 +++-- .../main/webapp/templates/default/InfoContent.jsp | 8 +++++--- .../main/webapp/templates/default/LoginContent.jsp | 9 +++------ .../src/main/webapp/templates/default/Nav.jsp | 11 ++++++----- .../src/main/webapp/templates/default/PageTab.jsp | 6 +++--- .../main/webapp/templates/default/PreferencesTab.jsp | 11 +++++------ .../src/main/webapp/templates/default/ProfileTab.jsp | 2 +- .../webapp/templates/default/editors/CKeditor.jsp | 20 +++++++++++--------- .../webapp/templates/default/editors/TinyMCE.jsp | 20 +++++++++++--------- .../main/webapp/templates/default/editors/plain.jsp | 16 +++++++++------- .../webapp/templates/default/editors/wysiwyg.jsp | 20 +++++++++++--------- 13 files changed, 76 insertions(+), 66 deletions(-) diff --git a/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp b/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp index 634df52..84bd19f 100644 --- a/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp @@ -32,7 +32,7 @@ int MAXATTACHNAMELENGTH = 30; WikiContext c = WikiContext.findContext(pageContext); %> -<c:set var="progressId" value="<%= c.getEngine().getProgressManager().getNewProgressIdentifier() %>" /> +<c:set var="progressId" value="<%= c.getEngine().getManager( ProgressManager.class ).getNewProgressIdentifier() %>" /> <div class="page-content"> <wiki:Permission permission="upload"> diff --git a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp index d88f3ef..46e3741 100644 --- a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp @@ -17,20 +17,22 @@ 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/core" prefix="c" %> <%@ 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 ); %> -<c:set var="history" value="<%= c.getEngine().getPageManager().getVersionHistory(c.getPage().getName()) %>" /> -<c:set var="diffprovider" value='<%= c.getEngine().getVariableManager().getVariable(c,"jspwiki.diffProvider") %>' /> +<c:set var="history" value="<%= c.getEngine().getManager( PageManager.class ).getVersionHistory(c.getPage().getName()) %>" /> +<c:set var="diffprovider" value='<%= c.getEngine().getManager( VariableManager.class ).getVariable(c,"jspwiki.diffProvider") %>' /> <wiki:PageExists> <form action="<wiki:Link jsp='Diff.jsp' format='url' />" class="diffbody form-inline" diff --git a/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp b/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp index 98bf0fb..a497f48 100644 --- a/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp @@ -25,6 +25,7 @@ <%@ page import="org.apache.wiki.auth.AuthorizationManager" %> <%@ page import="org.apache.wiki.auth.PrincipalComparator" %> <%@ page import="org.apache.wiki.auth.authorize.Group" %> +<%@ page import="org.apache.wiki.auth.authorize.GroupManager" %> <%@ page import="org.apache.wiki.auth.permissions.GroupPermission" %> <%@ page import="org.apache.wiki.auth.authorize.GroupManager" %> <%@ page import="org.apache.wiki.preferences.Preferences" %> @@ -43,8 +44,8 @@ //String name = request.getParameter( "group" ); //Group group = (Group)pageContext.getAttribute( "Group",PageContext.REQUEST_SCOPE ); - AuthorizationManager authMgr = c.getEngine().getAuthorizationManager(); - GroupManager groupMgr = c.getEngine().getGroupManager(); + AuthorizationManager authMgr = c.getEngine().getManager( AuthorizationManager.class ); + GroupManager groupMgr = c.getEngine().getManager( GroupManager.class ); Principal[] groups = groupMgr.getRoles(); Arrays.sort( groups, new PrincipalComparator() ); diff --git a/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp b/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp index 3575a83..d9a5bef 100644 --- a/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp @@ -22,7 +22,9 @@ <%@ 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" %> <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %> @@ -35,14 +37,14 @@ <% 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 + ")"; 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(); @@ -249,7 +251,7 @@ <% int MAXATTACHNAMELENGTH = 30; %> -<c:set var="progressId" value="<%= c.getEngine().getProgressManager().getNewProgressIdentifier() %>" /> +<c:set var="progressId" value="<%= c.getEngine().getManager( ProgressManager.class ).getNewProgressIdentifier() %>" /> <wiki:Permission permission="upload"> <form action="<wiki:Link jsp='attach' format='url'><wiki:Param name='progressid' value='${progressId}'/></wiki:Link>" diff --git a/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp b/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp index 5c2f50e..f0d0db9 100644 --- a/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp @@ -29,15 +29,12 @@ <fmt:setBundle basename="templates.default"/> <% WikiContext ctx = WikiContext.findContext( pageContext ); - AuthenticationManager mgr = ctx.getEngine().getAuthenticationManager(); + AuthenticationManager mgr = ctx.getEngine().getManager( AuthenticationManager.class ); String loginURL = ""; - if( mgr.isContainerAuthenticated() ) - { + if( mgr.isContainerAuthenticated() ) { loginURL = "j_security_check"; - } - else - { + } else { String redir = (String)ctx.getVariable("redirect"); if( redir == null ) redir = ctx.getEngine().getFrontPage(); loginURL = ctx.getURL( WikiContext.LOGIN, redir ); diff --git a/jspwiki-war/src/main/webapp/templates/default/Nav.jsp b/jspwiki-war/src/main/webapp/templates/default/Nav.jsp index a064b13..35e43b1 100644 --- a/jspwiki-war/src/main/webapp/templates/default/Nav.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/Nav.jsp @@ -17,26 +17,27 @@ under the License. --%> -<%@ page import="org.apache.wiki.*" %> <%@ page import="java.util.StringTokenizer" %> - +<%@ page import="javax.servlet.jsp.jstl.fmt.*" %> +<%@ page import="org.apache.wiki.*" %> <%@ page import="org.apache.wiki.attachment.*" %> +<%@ page import="org.apache.wiki.pages.PageManager" %> + <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ page import="javax.servlet.jsp.jstl.fmt.*" %> <fmt:setLocale value="${prefs.Language}" /> <fmt:setBundle basename="templates.default"/> <% WikiContext c = WikiContext.findContext( pageContext ); - String text = c.getEngine().getPageManager().getText( c.getPage() ); + String text = c.getEngine().getManager( PageManager.class ).getText( c.getPage() ); StringTokenizer tokens = new StringTokenizer( text ); //avg reading speeds: https://iovs.arvojournals.org/article.aspx?articleid=2166061 %> -<c:set var="attachments" value="<%= c.getEngine().getAttachmentManager().listAttachments( c.getPage() ).size() %>" /> +<c:set var="attachments" value="<%= c.getEngine().getManager( AttachmentManager.class ).listAttachments( c.getPage() ).size() %>" /> <c:set var="wordCount" value="<%= tokens.countTokens() %>" /> <c:set var="readingTime" value="${wordCount / 228}" /> diff --git a/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp b/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp index 1a17317..6917a73 100644 --- a/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp @@ -18,6 +18,7 @@ --%> <%@ page import="org.apache.wiki.*" %> +<%@ page import="org.apache.wiki.pages.PageManager" %> <%@ page import="org.apache.wiki.util.TextUtil" %> <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> @@ -34,14 +35,13 @@ </c:when> <c:otherwise> -<%-- If the page is an older version, then offer a note and a possibility - to restore this version as the latest one. --%> +<%-- If the page is an older version, then offer a note and a possibility to restore this version as the latest one. --%> <wiki:CheckVersion mode="notlatest"> <% WikiContext c = WikiContext.findContext( pageContext ); %> <c:set var="thisVersion" value="<%= c.getPage().getVersion() %>" /> - <c:set var="latestVersion" value="<%= c.getEngine().getPageManager().getPage( c.getPage().getName(), WikiProvider.LATEST_VERSION ).getVersion() %>" /> + <c:set var="latestVersion" value="<%= c.getEngine().getManager( PageManager.class ).getPage( c.getPage().getName(), WikiProvider.LATEST_VERSION ).getVersion() %>" /> <form action="<wiki:Link format='url' jsp='Wiki.jsp'/>" method="get" accept-charset='UTF-8'> diff --git a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp index 0612f5b..5dd87b1 100644 --- a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp @@ -18,29 +18,28 @@ --%> <%@ page errorPage="/Error.jsp" %> -<%@ page import="java.util.*" %> -<%@ page import="java.lang.*" %> -<%@ page import="org.apache.wiki.*" %> <%@ page import="java.io.*" %> +<%@ page import="java.util.*" %> <%@ page import="java.util.jar.*" %> +<%@ page import="javax.servlet.jsp.jstl.fmt.*" %> +<%@ page import="org.apache.wiki.*" %> <%@ page import="org.apache.wiki.ui.*" %> <%@ page import="org.apache.wiki.preferences.*" %> <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ page import="javax.servlet.jsp.jstl.fmt.*" %> <fmt:setLocale value="${prefs.Language}" /> <fmt:setBundle basename="templates.default"/> <% WikiContext c = WikiContext.findContext( pageContext ); - TemplateManager t = c.getEngine().getTemplateManager(); + TemplateManager t = c.getEngine().getManager( TemplateManager.class ); %> <c:set var="skins" value="<%= t.listSkins(pageContext, c.getTemplate() ) %>" /> <c:set var="languages" value="<%= t.listLanguages(pageContext) %>" /> <c:set var="timezones" value="<%= t.listTimeZones(pageContext) %>" /> <c:set var="timeformats" value="<%= t.listTimeFormats(pageContext) %>" /> -<c:set var="editors" value="<%= c.getEngine().getEditorManager().getEditorList() %>" /> +<c:set var="editors" value="<%= c.getEngine().getManager( EditorManager.class ).getEditorList() %>" /> <c:set var="redirect"><wiki:Variable var='redirect' default='<%=c.getEngine().getFrontPage() %>' /></c:set> <form action="<wiki:Link jsp='UserPreferences.jsp' format='url'><wiki:Param name='tab' value='prefs'/></wiki:Link>" diff --git a/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp b/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp index 927ed10..ff11b62 100644 --- a/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/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 method="post" accept-charset="UTF-8" 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 c292043..bc229c6 100644 --- a/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp @@ -20,11 +20,13 @@ <%@ page import="java.util.Properties"%> <%@ page import="org.apache.commons.lang3.*" %> <%@ 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, @@ -67,17 +69,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 );*/ } @@ -88,7 +90,7 @@ <% if( usertext == null ) { - usertext = engine.getPageManager().getPureText( context.getPage() ); + usertext = engine.getManager( PageManager.class ).getPureText( context.getPage() ); } %> </wiki:CheckRequestContext> @@ -98,7 +100,7 @@ String pageAsHtml; try { - pageAsHtml = engine.getRenderingManager().getHTML( context, usertext ); + pageAsHtml = engine.getManager( RenderingManager.class ).getHTML( context, usertext ); } catch( Exception e ) { @@ -118,7 +120,7 @@ wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption ); /*FFS not used - String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR ); + String templateDir = (String)copyOfWikiProperties.get( Engine.PROP_TEMPLATEDIR ); String protocol = "http://"; if( request.isSecure() ) @@ -209,7 +211,7 @@ </ul> </div> - <c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>" /> + <c:set var="editors" value="<%= engine.getManager( EditorManager.class ).getEditorList() %>" /> <c:if test='${fn:length(editors)>1}'> <div class="btn-group config"> <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%> 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 106f3d9..515fba0 100644 --- a/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp @@ -21,11 +21,13 @@ <%@ page import="java.util.Properties"%> <%@ page import="org.apache.commons.lang3.*" %> <%@ 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" %> @@ -45,7 +47,7 @@ --%> <% 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" ); @@ -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> @@ -96,7 +98,7 @@ String pageAsHtml; try { - pageAsHtml = engine.getRenderingManager().getHTML( context, usertext ); + pageAsHtml = engine.getManager( RenderingManager.class ).getHTML( context, usertext ); } catch( Exception e ) @@ -119,7 +121,7 @@ wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption ); /*FSS 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() ) { @@ -209,7 +211,7 @@ </ul> </div> - <c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>" /> + <c:set var="editors" value="<%= engine.getManager( EditorManager.class ).getEditorList() %>" /> <c:if test='${fn:length(editors)>1}'> <div class="btn-group config"> <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%> diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp index d91cedb..88d54fb 100644 --- a/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp @@ -19,10 +19,12 @@ <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ 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://jspwiki.apache.org/tags" prefix="wiki" %> @@ -36,7 +38,7 @@ --%> <% WikiContext context = WikiContext.findContext( pageContext ); - WikiEngine engine = context.getEngine(); + Engine engine = context.getEngine(); String usertext = EditorManager.getEditedText( pageContext ); %> @@ -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> @@ -226,7 +228,7 @@ </ul> </div> - <c:set var="editors" value="<%= context.getEngine().getEditorManager().getEditorList() %>" /> + <c:set var="editors" value="<%= context.getEngine().getManager( EditorManager.class ).getEditorList() %>" /> <c:if test='${fn:length(editors) > 1}'> <div class="btn-group config"> <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%> diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp index 2849bf3..2a556ce 100644 --- a/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp +++ b/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp @@ -21,11 +21,13 @@ <%@ page import="java.util.Properties"%> <%@ page import="org.apache.commons.lang3.*" %> <%@ 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" %> @@ -41,7 +43,7 @@ --%> <% 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" ); @@ -59,17 +61,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 );*/ } @@ -80,7 +82,7 @@ <% if( usertext == null ) { - usertext = engine.getPageManager().getPureText( context.getPage() ); + usertext = engine.getManager( PageManager.class ).getPureText( context.getPage() ); } %> </wiki:CheckRequestContext> @@ -90,7 +92,7 @@ String pageAsHtml; try { - pageAsHtml = engine.getRenderingManager().getHTML( context, usertext ); + pageAsHtml = engine.getManager( RenderingManager.class ).getHTML( context, usertext ); } catch( Exception e ) { @@ -110,7 +112,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() ) { @@ -202,7 +204,7 @@ </ul> </div> - <c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>" /> + <c:set var="editors" value="<%= engine.getManager( EditorManager.class ).getEditorList() %>" /> <c:if test='${fn:length(editors)>1}'> <div class="btn-group config"> <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
