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 e8d84a688f9b9d86ea58b7d31c93a2856e8f82d7
Author: juanpablo <[email protected]>
AuthorDate: Sat Mar 28 14:30:54 2020 +0100

    use public api on default template
---
 .../src/main/webapp/templates/default/AJAXCategories.jsp     | 12 +++++++-----
 .../src/main/webapp/templates/default/AJAXPreview.jsp        | 11 ++++++-----
 jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp |  8 ++++----
 .../src/main/webapp/templates/default/AttachmentTab.jsp      |  6 +++---
 jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp    |  4 ++--
 .../src/main/webapp/templates/default/EditContent.jsp        |  4 ++--
 .../src/main/webapp/templates/default/EditGroupContent.jsp   |  6 +++---
 .../src/main/webapp/templates/default/FindContent.jsp        |  2 +-
 jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp   |  4 ++--
 jspwiki-war/src/main/webapp/templates/default/Header.jsp     |  2 +-
 .../src/main/webapp/templates/default/InfoContent.jsp        | 11 +++++------
 .../src/main/webapp/templates/default/LoginContent.jsp       |  7 +++----
 jspwiki-war/src/main/webapp/templates/default/Nav.jsp        |  4 ++--
 .../src/main/webapp/templates/default/PageContent.jsp        |  6 +++---
 jspwiki-war/src/main/webapp/templates/default/PageTab.jsp    |  7 ++++---
 .../src/main/webapp/templates/default/PreferencesContent.jsp |  2 +-
 .../src/main/webapp/templates/default/PreferencesTab.jsp     |  4 ++--
 jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp |  4 ++--
 jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp    |  4 ++--
 .../src/main/webapp/templates/default/UploadTemplate.jsp     |  2 +-
 jspwiki-war/src/main/webapp/templates/default/UserBox.jsp    |  4 ++--
 .../src/main/webapp/templates/default/WorkflowContent.jsp    |  2 +-
 .../main/webapp/templates/default/admin/AdminTemplate.jsp    |  7 ++++---
 .../main/webapp/templates/default/admin/UserManagement.jsp   |  2 +-
 .../src/main/webapp/templates/default/commonheader.jsp       |  4 ++--
 .../src/main/webapp/templates/default/editors/CKeditor.jsp   |  8 +++-----
 .../src/main/webapp/templates/default/editors/TinyMCE.jsp    |  3 +--
 .../src/main/webapp/templates/default/editors/plain.jsp      |  3 +--
 .../src/main/webapp/templates/default/editors/preview.jsp    |  7 +++----
 .../src/main/webapp/templates/default/editors/wysiwyg.jsp    |  3 +--
 30 files changed, 75 insertions(+), 78 deletions(-)

diff --git a/jspwiki-war/src/main/webapp/templates/default/AJAXCategories.jsp 
b/jspwiki-war/src/main/webapp/templates/default/AJAXCategories.jsp
index 9b7c9cb..603e032 100644
--- a/jspwiki-war/src/main/webapp/templates/default/AJAXCategories.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/AJAXCategories.jsp
@@ -17,20 +17,22 @@
     under the License.  
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
+<%@ page import="org.apache.wiki.api.spi.Wiki" %>
+<%@ page import="org.apache.wiki.auth.AuthorizationManager" %>
 <%@ page import="org.apache.wiki.preferences.Preferences" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%! 
   public void jspInit()
   {
-    wiki = WikiEngine.getInstance( getServletConfig() );
+    wiki = Wiki.engine().find( getServletConfig() );
   }
-  WikiEngine wiki;
+  Engine wiki;
 %>
 <%
   // Copied from a top-level jsp -- which would be a better place to put this 
-  WikiContext wikiContext = new WikiContext( wiki, request, WikiContext.VIEW );
-  if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) 
return;
+  Context wikiContext = Wiki.context().find( wiki, request, 
ContextEnum.PAGE_VIEW.getRequestContext() );
+  if( !wiki.getManager( AuthorizationManager.class ).hasAccess( wikiContext, 
response ) ) return;
   String pagereq = wikiContext.getPage().getName();
 
   response.setContentType("text/html; charset="+wiki.getContentEncoding() );
diff --git a/jspwiki-war/src/main/webapp/templates/default/AJAXPreview.jsp 
b/jspwiki-war/src/main/webapp/templates/default/AJAXPreview.jsp
index 996ef27..abaf5c2 100644
--- a/jspwiki-war/src/main/webapp/templates/default/AJAXPreview.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/AJAXPreview.jsp
@@ -19,7 +19,8 @@
 
 <%@ page language="java" pageEncoding="UTF-8"%>
 <%@ page import="org.apache.log4j.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
+<%@ page import="org.apache.wiki.api.spi.Wiki" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
 <%@ page import="org.apache.wiki.preferences.Preferences" %>
@@ -28,15 +29,15 @@
 <%! 
   public void jspInit()
   {
-    wiki = WikiEngine.getInstance( getServletConfig() );
+    wiki = Wiki.engine().find( getServletConfig() );
   }
   Logger log = Logger.getLogger("JSPWikiSearch");
-  WikiEngine wiki;
+  Engine wiki;
 %>
 <%
   // Copied from a top-level jsp -- which would be a better place to put this 
-  WikiContext wikiContext = new WikiContext( wiki, request, WikiContext.VIEW );
-  if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) 
return;
+  Context wikiContext = Wiki.context().find( wiki, request, 
ContextEnum.PAGE_VIEW.getRequestContext() );
+  if( !wiki.getManager( AuthorizationManager.class ).hasAccess( wikiContext, 
response ) ) return;
 
   response.setContentType("text/html; charset="+wiki.getContentEncoding() );
   
diff --git a/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp 
b/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp
index f750bf6..057874f 100644
--- a/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp
@@ -24,8 +24,8 @@
 <%@ page import="java.net.URLEncoder" %>
 <%@ page import="org.apache.commons.lang3.*" %>
 <%@ page import="org.apache.log4j.*" %>
-<%@ page import="org.apache.wiki.*" %>
 <%@ page import="org.apache.wiki.api.core.*" %>
+<%@ page import="org.apache.wiki.api.spi.Wiki" %>
 <%@ page import="org.apache.wiki.api.search.SearchResult" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
@@ -40,7 +40,7 @@
 <%!
   public void jspInit()
   {
-    wiki = WikiEngine.getInstance( getServletConfig() );
+    wiki = Wiki.engine().find( getServletConfig() );
   }
   Logger log = Logger.getLogger("JSPWikiSearch");
   Engine wiki;
@@ -48,8 +48,8 @@
 <%
   /* ********************* 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 = new WikiContext( wiki, request, WikiContext.FIND );
+
+  Context wikiContext = Wiki.context().find( wiki, request, 
ContextEnum.WIKI_FIND.getRequestContext() );
   if(!wiki.getManager( AuthorizationManager.class ).hasAccess( wikiContext, 
response ) ) return;
 
   String query = request.getParameter( "query");
diff --git a/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp
index 84bd19f..2288970 100644
--- a/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/AttachmentTab.jsp
@@ -17,7 +17,7 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.ui.progress.*" %>
 <%@ page import="org.apache.wiki.auth.permissions.*" %>
@@ -30,7 +30,7 @@
 <fmt:setBundle basename="templates.default"/>
 <%
   int MAXATTACHNAMELENGTH = 30;
-  WikiContext c = WikiContext.findContext(pageContext);
+  Context c = Context.findContext(pageContext);
 %>
 <c:set var="progressId" value="<%= c.getEngine().getManager( 
ProgressManager.class ).getNewProgressIdentifier() %>" />
 <div class="page-content">
@@ -148,7 +148,7 @@
           <input type="button"
                 class="btn btn-danger btn-xs"
                 value="<fmt:message key='attach.delete'/>"
-                  src="<wiki:Link format='url' 
context='<%=WikiContext.DELETE%>' ><wiki:Param name='tab' value='attach' 
/></wiki:Link>"
+                  src="<wiki:Link format='url' 
context='<%=ContextEnum.PAGE_DELETE.getRequestContext()%>' ><wiki:Param 
name='tab' value='attach' /></wiki:Link>"
               onclick="document.deleteForm.action=this.src; 
document.deleteForm['delete-all'].click();" />
         </wiki:Permission>
       </td>
diff --git a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
index 46e3741..0c6e60e 100644
--- a/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/DiffTab.jsp
@@ -19,7 +19,7 @@
 
 <%@ page import="java.util.*" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.tags.InsertDiffTag" %>
 <%@ page import="org.apache.wiki.variables.VariableManager" %>
@@ -29,7 +29,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
 %>
 <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") %>' />
diff --git a/jspwiki-war/src/main/webapp/templates/default/EditContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/EditContent.jsp
index fd63247..4700f24 100644
--- a/jspwiki-war/src/main/webapp/templates/default/EditContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/EditContent.jsp
@@ -18,7 +18,7 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki"  %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ 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.*" %>
@@ -26,7 +26,7 @@
 <fmt:setBundle basename="templates.default"/>
 
 <%--
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
 --%>
 
 <%-- Main Content Section --%>
diff --git a/jspwiki-war/src/main/webapp/templates/default/EditGroupContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/EditGroupContent.jsp
index 86b93e2..8f7c6ca 100644
--- a/jspwiki-war/src/main/webapp/templates/default/EditGroupContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/EditGroupContent.jsp
@@ -20,7 +20,7 @@
 <%@ page import="java.security.Principal" %>
 <%@ page import="java.util.Arrays" %>
 <%@ page import="org.apache.log4j.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.authorize.Group" %>
 <%@ page import="org.apache.wiki.util.comparators.PrincipalComparator" %>
 <%@ page errorPage="/Error.jsp" %>
@@ -32,11 +32,11 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
 
   // Extract the group name and members
   String name = request.getParameter( "group" );
-  Group group = (Group)pageContext.getAttribute( 
"Group",PageContext.REQUEST_SCOPE );
+  Group group = (Group)pageContext.getAttribute( "Group", 
PageContext.REQUEST_SCOPE );
   Principal[] members = null;
 
   if ( group != null )
diff --git a/jspwiki-war/src/main/webapp/templates/default/FindContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/FindContent.jsp
index c6fd521..b2eefd6 100644
--- a/jspwiki-war/src/main/webapp/templates/default/FindContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/FindContent.jsp
@@ -17,7 +17,7 @@
     under the License.
 --%>
 <%@ 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.ui.*" %>
 <%@ page import="java.util.*" %>
 <%@ page import="org.apache.commons.lang3.*" %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp
index d3feffc..752e9f2 100644
--- a/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/GroupTab.jsp
@@ -21,7 +21,7 @@
 <%@ page import="java.text.MessageFormat" %>
 <%@ page import="java.util.*" %>
 <%@ page import="org.apache.log4j.*" %>
-<%@ page import="org.apache.wiki.WikiContext" %>
+<%@ page import="org.apache.wiki.api.core.Context" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.authorize.Group" %>
 <%@ page import="org.apache.wiki.auth.authorize.GroupManager" %>
@@ -37,7 +37,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
 
   // Extract the group name and members
   //String name = request.getParameter( "group" );
diff --git a/jspwiki-war/src/main/webapp/templates/default/Header.jsp 
b/jspwiki-war/src/main/webapp/templates/default/Header.jsp
index ed80787..e261e00 100644
--- a/jspwiki-war/src/main/webapp/templates/default/Header.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/Header.jsp
@@ -21,7 +21,7 @@
 <%@ 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="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <c:set var="frontpage"><wiki:Variable var="jspwiki.frontPage" /></c:set>
diff --git a/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp
index 94b54d5..744bf0c 100644
--- a/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/InfoContent.jsp
@@ -17,7 +17,6 @@
     under the License.
 --%>
 
-<%@ 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.*" %>
@@ -36,7 +35,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  Context c = WikiContext.findContext(pageContext);
+  Context c = Context.findContext(pageContext);
   Page wikiPage = c.getPage();
   int attCount = c.getEngine().getManager( AttachmentManager.class 
).listAttachments( c.getPage() ).size();
   String attTitle = LocaleSupport.getLocalizedMessage(pageContext, 
"attach.tab");
@@ -136,7 +135,7 @@
   </wiki:Permission>
 
   <wiki:Permission permission="delete">
-    <form action="<wiki:Link format='url' context='<%=WikiContext.DELETE%>' />"
+    <form action="<wiki:Link format='url' 
context='<%=ContextEnum.PAGE_DELETE.getRequestContext()%>' />"
            class="form-group"
               id="deleteForm"
           method="post" accept-charset="<wiki:ContentEncoding />" >
@@ -158,7 +157,7 @@
 
     <wiki:SetPagination start="<%=startitem%>" total="<%=itemcount%>" 
pagesize="<%=pagesize%>" maxlinks="9"
                        fmtkey="info.pagination"
-                         href='<%=c.getURL(WikiContext.INFO, 
wikiPage.getName(), "start=%s")%>' />
+                         
href='<%=c.getURL(ContextEnum.PAGE_INFO.getRequestContext(), 
wikiPage.getName(), "start=%s")%>' />
 
     <c:set var="first" value="<%= startitem %>"/>
     <c:set var="last" value="<%= startitem + pagesize %>"/>
@@ -298,7 +297,7 @@
 </wiki:Permission>
 
 
-<form action="<wiki:Link format='url' context='<%=WikiContext.DELETE%>' 
><wiki:Param name='tab' value='attach' /></wiki:Link>"
+<form action="<wiki:Link format='url' 
context='<%=ContextEnum.PAGE_DELETE.getRequestContext()%>' ><wiki:Param 
name='tab' value='attach' /></wiki:Link>"
            class="form-group"
               id="deleteForm"
           method="post" accept-charset="<wiki:ContentEncoding />" >
@@ -366,7 +365,7 @@
          <td>
             <input type="button"
                    value="Restore"
-                   url="<wiki:Link format='url' 
context='<%=WikiContext.UPLOAD%>'/>"/>
+                   url="<wiki:Link format='url' 
context='<%=ContextEnum.PAGE_UPLOAD.getRequestContext()%>'/>"/>
          </td>
       </wiki:Permission>
       --%>
diff --git a/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp
index f0d0db9..ae321eb 100644
--- a/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/LoginContent.jsp
@@ -17,8 +17,7 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
@@ -28,7 +27,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-    WikiContext ctx = WikiContext.findContext( pageContext );
+    Context ctx = Context.findContext( pageContext );
     AuthenticationManager mgr = ctx.getEngine().getManager( 
AuthenticationManager.class );
     String loginURL = "";
 
@@ -37,7 +36,7 @@
     } else {
         String redir = (String)ctx.getVariable("redirect");
         if( redir == null ) redir = ctx.getEngine().getFrontPage();
-        loginURL = ctx.getURL( WikiContext.LOGIN, redir );
+        loginURL = ctx.getURL( ContextEnum.WIKI_LOGIN.getRequestContext(), 
redir );
     }
 
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/Nav.jsp 
b/jspwiki-war/src/main/webapp/templates/default/Nav.jsp
index 35e43b1..8fbe549 100644
--- a/jspwiki-war/src/main/webapp/templates/default/Nav.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/Nav.jsp
@@ -19,7 +19,7 @@
 
 <%@ page import="java.util.StringTokenizer" %>
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.attachment.*" %>
 <%@ page import="org.apache.wiki.pages.PageManager" %>
 
@@ -30,7 +30,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
 
   String text = c.getEngine().getManager( PageManager.class ).getText( 
c.getPage() );
   StringTokenizer tokens = new StringTokenizer( text );
diff --git a/jspwiki-war/src/main/webapp/templates/default/PageContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/PageContent.jsp
index 60380e9..0cd0da3 100644
--- a/jspwiki-war/src/main/webapp/templates/default/PageContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/PageContent.jsp
@@ -18,14 +18,14 @@
 --%>
 
 <%@ 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.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 );
+  Context c = Context.findContext( pageContext );
 %>
 <%-- Main Content Section --%>
 <%-- This has been source ordered to come first in the markup (and on small 
devices)
@@ -36,7 +36,7 @@
 
   <wiki:PageType type="attachment">
     <div><%-- insert the actual attachement, image, etc... --%>
-      <wiki:Translate>[<%= WikiContext.findContext( pageContext 
).getPage().getName() %>]</wiki:Translate>
+      <wiki:Translate>[<%= Context.findContext( pageContext 
).getPage().getName() %>]</wiki:Translate>
     </div>
   </wiki:PageType>
 
diff --git a/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp
index 6917a73..b889a1d 100644
--- a/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/PageTab.jsp
@@ -17,7 +17,8 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
+<%@ page import="org.apache.wiki.api.providers.WikiProvider" %>
 <%@ page import="org.apache.wiki.pages.PageManager" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
@@ -38,7 +39,7 @@
 <%-- 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 );
+    Context c = Context.findContext( pageContext );
   %>
   <c:set var="thisVersion" value="<%= c.getPage().getVersion() %>" />
   <c:set var="latestVersion" value="<%= c.getEngine().getManager( 
PageManager.class ).getPage( c.getPage().getName(), WikiProvider.LATEST_VERSION 
).getVersion() %>" />
@@ -74,7 +75,7 @@
 
 
 <%--
-ISWEBLOG= <%= WikiContext.findContext( pageContext ).getPage().getAttribute( 
/*ATTR_ISWEBLOG*/ "weblogplugin.isweblog" ) %>
+ISWEBLOG= <%= Context.findContext( pageContext ).getPage().getAttribute( 
/*ATTR_ISWEBLOG*/ "weblogplugin.isweblog" ) %>
 --%>
 <%--  IF BLOCOMMENT PAGE:  insert back buttons to mainblog and blogentry 
permalink --%>
 <c:set var="mainblogpage" 
value="${fn:substringBefore(param.page,'_comments_')}" />
diff --git 
a/jspwiki-war/src/main/webapp/templates/default/PreferencesContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/PreferencesContent.jsp
index aaf8fd6..23fe6b1 100644
--- a/jspwiki-war/src/main/webapp/templates/default/PreferencesContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/PreferencesContent.jsp
@@ -17,7 +17,7 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
index 5dd87b1..d1b1a4f 100644
--- a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
@@ -22,7 +22,7 @@
 <%@ 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.api.core.*" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.preferences.*" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
@@ -32,7 +32,7 @@
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  Context c = Context.findContext( pageContext );
   TemplateManager t = c.getEngine().getManager( TemplateManager.class );
 %>
 <c:set var="skins"       value="<%= t.listSkins(pageContext, c.getTemplate() ) 
%>" />
diff --git a/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp 
b/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp
index ff11b62..d37b275 100644
--- a/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/ProfileTab.jsp
@@ -17,7 +17,7 @@
     under the License.
 --%>
 
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.auth.*" %>
 <%@ page import="org.apache.wiki.auth.user.*" %>
 <%@ page errorPage="/Error.jsp" %>
@@ -29,7 +29,7 @@
 <fmt:setBundle basename="templates.default"/>
 <%
   /* dateformatting not yet supported by wiki:UserProfile tag - diy */
-  WikiContext wikiContext = WikiContext.findContext(pageContext);
+  Context wikiContext = Context.findContext(pageContext);
   UserManager manager = wikiContext.getEngine().getManager( UserManager.class 
);
   UserProfile profile = manager.getUserProfile( wikiContext.getWikiSession() );
 %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp 
b/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
index 12bcb73..b465eec 100644
--- a/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/Sidebar.jsp
@@ -23,11 +23,11 @@
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 
 <div class="sidebar">
 
-  <c:set var="isweblog"><%= ( String )WikiContext.findContext( pageContext 
).getPage().getAttribute( /*ATTR_ISWEBLOG*/ "weblogplugin.isweblog" ) %></c:set>
+  <c:set var="isweblog"><%= ( String )Context.findContext( pageContext 
).getPage().getAttribute( /*ATTR_ISWEBLOG*/ "weblogplugin.isweblog" ) %></c:set>
   <c:if test="${isweblog}">
   <wiki:Calendar pageformat="'${param.page}_blogentry_'ddMMyy'_1'"
                  
urlformat="'Wiki.jsp?page=${param.page}&weblog.startDate='ddMMyy'&weblog.days=1'"/>
diff --git a/jspwiki-war/src/main/webapp/templates/default/UploadTemplate.jsp 
b/jspwiki-war/src/main/webapp/templates/default/UploadTemplate.jsp
index 4129fa8..5f1a7d2 100644
--- a/jspwiki-war/src/main/webapp/templates/default/UploadTemplate.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/UploadTemplate.jsp
@@ -18,7 +18,7 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ 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.*" %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/UserBox.jsp 
b/jspwiki-war/src/main/webapp/templates/default/UserBox.jsp
index 5ffc790..5b74471 100644
--- a/jspwiki-war/src/main/webapp/templates/default/UserBox.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/UserBox.jsp
@@ -21,11 +21,11 @@
 <%@ 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.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
-  WikiContext c = WikiContext.findContext(pageContext);
+  Context c = Context.findContext(pageContext);
 %>
 <c:set var="redirect"><%= c.getEngine().encodeName(c.getName()) %></c:set>
 <c:set var="username"><wiki:UserName /></c:set>
diff --git a/jspwiki-war/src/main/webapp/templates/default/WorkflowContent.jsp 
b/jspwiki-war/src/main/webapp/templates/default/WorkflowContent.jsp
index f2dbcf9..0df42f7 100644
--- a/jspwiki-war/src/main/webapp/templates/default/WorkflowContent.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/WorkflowContent.jsp
@@ -18,7 +18,7 @@
 --%>
 
 <%@ page errorPage="/Error.jsp" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ 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" %>
diff --git 
a/jspwiki-war/src/main/webapp/templates/default/admin/AdminTemplate.jsp 
b/jspwiki-war/src/main/webapp/templates/default/admin/AdminTemplate.jsp
index 777273d..c3b4f82 100644
--- a/jspwiki-war/src/main/webapp/templates/default/admin/AdminTemplate.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/admin/AdminTemplate.jsp
@@ -18,7 +18,8 @@
 --%>
 
 <%@ page import="java.util.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
+<%@ page import="org.apache.wiki.api.spi.Wiki" %>
 <%@ page import="org.apache.wiki.ui.*" %>
 <%@ page import="org.apache.wiki.ui.admin.*" %>
 <%@ page errorPage="/Error.jsp" %>
@@ -39,8 +40,8 @@
 in your <code>jspwiki.properties</code> file.</div>
 
 <%
-    WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
-    WikiContext ctx = WikiContext.findContext(pageContext);
+    Engine wiki = Wiki.engine().find( getServletConfig() );
+    Context ctx = Context.findContext(pageContext);
     AdminBeanManager mgr = wiki.getManager( AdminBeanManager.class );
  %>
 
diff --git 
a/jspwiki-war/src/main/webapp/templates/default/admin/UserManagement.jsp 
b/jspwiki-war/src/main/webapp/templates/default/admin/UserManagement.jsp
index 02731b8..d3a226f 100644
--- a/jspwiki-war/src/main/webapp/templates/default/admin/UserManagement.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/admin/UserManagement.jsp
@@ -18,7 +18,7 @@
 --%>
 
 <%@ page import="java.util.*" %>
-<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.api.core.*" %>
 <%@ page import="org.apache.wiki.ui.admin.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
diff --git a/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp 
b/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
index a247811..3432f10 100644
--- a/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
@@ -18,7 +18,7 @@
 --%>
 
 <%@ 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.ui.*" %>
 <%@ page import="org.apache.wiki.util.*" %>
 <%@ page import="org.apache.wiki.preferences.Preferences" %>
@@ -95,7 +95,7 @@ String.I18N.PREFIX = "javascript.";
 <meta name="wikiPageUrl" content='<wiki:Link format="url"  page="#$%"/>' />
 <meta name="wikiEditUrl" content='<wiki:EditLink format="url" page="#$%"/>' />
 <meta name="wikiCloneUrl" content='<wiki:EditLink format="url" 
page="#$%"/>&clone=<wiki:Variable var="pagename" />' />
-<meta name="wikiJsonUrl" content='<%= 
WikiContext.findContext(pageContext).getURL( WikiContext.NONE, "ajax" ) %>' 
/><%--unusual pagename--%>
+<meta name="wikiJsonUrl" content='<%= Context.findContext(pageContext).getURL( 
ContextEnum.PAGE_NONE.getRequestContext(), "ajax" ) %>' /><%--unusual 
pagename--%>
 <meta name="wikiPageName" content='<wiki:Variable var="pagename" />' 
/><%--pagename without blanks--%>
 <meta name="wikiUserName" content='<wiki:UserName />' />
 <meta name="wikiTemplateUrl" content='<wiki:Link format="url" templatefile="" 
/>' />
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 60ba62b..fb70ec0 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/CKeditor.jsp
@@ -19,7 +19,6 @@
 <%@ page language="java" pageEncoding="UTF-8"%>
 <%@ 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.*" %>
@@ -40,16 +39,15 @@
     This provides the WYSIWYG CKeditor for JSPWiki.
 --%>
 <%
-    Context context = WikiContext.findContext( pageContext );
+    Context context = Context.findContext( pageContext );
     Engine engine = context.getEngine();
 
     /* local download of CKeditor */
     TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
-           context.getURL( WikiContext.NONE, "scripts/ckeditor/ckeditor.js" ) 
);
+           context.getURL( ContextEnum.PAGE_NONE.getRequestContext(), 
"scripts/ckeditor/ckeditor.js" ) );
 
     /*  Use CKEditor from a CDN
-    TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT,
-           "//cdn.ckeditor.com/4.5.1/standard/ckeditor.js" );
+    TemplateManager.addResourceRequest( context, 
TemplateManager.RESOURCE_SCRIPT, 
"//cdn.ckeditor.com/4.5.1/standard/ckeditor.js" );
     */
 
     context.setVariable( Context.VAR_WYSIWYG_EDITOR_MODE, Boolean.TRUE );
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 ef036a4..2e90595 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/TinyMCE.jsp
@@ -20,7 +20,6 @@
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ 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.*" %>
@@ -46,7 +45,7 @@
     This provides the WYSIWYG TinyMCE for JSPWiki.
 --%>
 <%
-    Context context = WikiContext.findContext( pageContext );
+    Context context = Context.findContext( pageContext );
     Engine engine = context.getEngine();
 
     context.setVariable( Context.VAR_WYSIWYG_EDITOR_MODE, Boolean.TRUE );
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 8ec27a1..6224e62 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp
@@ -18,7 +18,6 @@
 --%>
 
 <%@ 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.*" %>
@@ -37,7 +36,7 @@
         This is a plain editor for JSPWiki.
 --%>
 <%
-   Context context = WikiContext.findContext( pageContext );
+   Context context = Context.findContext( pageContext );
    Engine engine = context.getEngine();
 
    String usertext = EditorManager.getEditedText( pageContext );
diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/preview.jsp 
b/jspwiki-war/src/main/webapp/templates/default/editors/preview.jsp
index 01838f5..6a90dbe 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/preview.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/preview.jsp
@@ -19,7 +19,6 @@
 
 <%@ page language="java" 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.ui.*" %>
 <%@ page import="org.apache.wiki.util.TextUtil" %>
@@ -32,13 +31,13 @@
         This is a special editor component for JSPWiki preview storage.
 --%>
 <%
-   Context context = WikiContext.findContext( pageContext );
+   Context context = Context.findContext( pageContext );
    String usertext = (String)pageContext.getAttribute( 
EditorManager.ATTR_EDITEDTEXT, PageContext.REQUEST_SCOPE );
    if( usertext == null ) usertext = "";
 
    String action = "comment".equals(request.getParameter("action")) ?
-                   context.getURL(WikiContext.COMMENT,context.getName()) :
-                   context.getURL(WikiContext.EDIT,context.getName());
+                   context.getURL( 
ContextEnum.PAGE_COMMENT.getRequestContext(), context.getName() ) :
+                   context.getURL( ContextEnum.PAGE_EDIT.getRequestContext(), 
context.getName() );
  %>
 <form action="<%=action%>"
       method="post" accept-charset="<wiki:ContentEncoding/>"
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 e39b458..f769ce9 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
@@ -20,7 +20,6 @@
 <%@ taglib uri="http://jspwiki.apache.org/tags"; prefix="wiki" %>
 <%@ 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.*" %>
@@ -42,7 +41,7 @@
     This provides a wysiwy editor for JSPWiki. (based on mooeditable)
 --%>
 <%
-    Context context = WikiContext.findContext( pageContext );
+    Context context = Context.findContext( pageContext );
     Engine engine = context.getEngine();
 
     context.setVariable( Context.VAR_WYSIWYG_EDITOR_MODE, Boolean.TRUE );

Reply via email to