You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/12/02 05:21:05 UTC

svn commit: r722372 [3/3] - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH: src/webdocs/ src/webdocs/admin/ src/webdocs/templates/default/ src/webdocs/templates/default/admin/ src/webdocs/templates/default/editors/ src/webdocs/templates/raw/...

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/AdminTemplate.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/AdminTemplate.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/AdminTemplate.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/AdminTemplate.jsp Mon Dec  1 20:21:03 2008
@@ -4,23 +4,24 @@
 <%@ page import="com.ecyrd.jspwiki.ui.admin.*" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
 <html>
 <head>
 <title>JSPWiki administration</title>
-  <wiki:Include page="commonheader.jsp"/>
-  <link rel="stylesheet" media="screen, projection, print" type="text/css" 
-        href="<wiki:Link format='url' templatefile='admin/admin.css'/>"/>
+  <wiki:Include page="commonheader.jsp" />
+  <link rel="stylesheet" media="screen, projection, print" type="text/css" href="<wiki:Link format='url' templatefile='admin/admin.css' />" />
 </head>
 <body class="view">
 <div id="wikibody">
-<div id="page" >
+<div id="page">
 <h1>JSPWiki Administration</h1>
 <div class="information">Not all things can be configured here.  Some things need to be configured
 in your <tt>jspwiki.properties</tt> file.</div>
 
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
-    WikiContext ctx = WikiContext.findContext(pageContext);
+    WikiContext ctx = WikiContextFactory.findContext( pageContext );
     AdminBeanManager mgr = wiki.getAdminBeanManager();
  %>
 
@@ -35,7 +36,7 @@
       
       <div class="formcontainer">
       <form action="Admin.jsp" method="post" accept-charset="UTF-8">
-        <input type="hidden" name="tab-admin" value="core"/>
+        <input type="hidden" name="tab-admin" value="core" />
         <input type="hidden" name="tab-core" value="${ab.title}" />
         <input type="hidden" name="bean" value="${ab.id}" />
         <%
@@ -49,7 +50,7 @@
 </wiki:Tab>
 
 <wiki:Tab id="users" title="Users">
-   <wiki:Include page="admin/UserManagement.jsp"/>
+   <wiki:Include page="admin/UserManagement.jsp" />
 </wiki:Tab>
 
 <wiki:Tab id="groups" title="Groups">
@@ -57,7 +58,7 @@
    <p>This is a list of all groups in this wiki.  If you click on the group name,
    you will be taken to the administration page of that particular group.</p>
    <p>
-   <wiki:Plugin plugin="Groups"/>
+   <wiki:Plugin plugin="Groups" />
    </p>
    </div>
 </wiki:Tab>
@@ -70,7 +71,7 @@
       
       <div class="formcontainer"> 
       <form action="Admin.jsp" method="post" accept-charset="UTF-8">
-         <input type="hidden" name="tab-admin" value="editors"/>
+         <input type="hidden" name="tab-admin" value="editors" />
          <input type="hidden" name="tab-editors" value="${ab.title}" />
          <%
          out.write( ab.doGet(ctx) );

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/UserManagement.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/UserManagement.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/UserManagement.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/admin/UserManagement.jsp Mon Dec  1 20:21:03 2008
@@ -6,8 +6,9 @@
 <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
 <%@ 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}" />
-<fmt:setBundle basename="templates.default"/>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+
+
 <script>
 function constructdate(date)
 {
@@ -55,7 +56,7 @@
    <div id="userlist">
       <select name="userid" id="userid" size="16" onchange="javascript:refreshUserInfo()">
          <c:forEach var="user" items="${engine.userManager.userDatabase.wikiNames}">
-            <option><c:out value="${user.name}" escapeXml="true"/></option>
+            <option><c:out value="${user.name}" escapeXml="true" /></option>
          </c:forEach>
       </select>
    </div>
@@ -72,8 +73,7 @@
      <tr>
        <td><label for="loginname">Login name</label></td>
        <td>
-           <input type="text" name="loginname" id="loginname"
-                  size="20" value="" />
+           <input type="text" name="loginname" id="loginname" size="20" value="" />
        </td>
      </tr>
      <tr>
@@ -91,15 +91,13 @@
      <tr>
        <td><label for="fullname">Full name</label></td>
        <td>
-         <input type="text" name="fullname" id="fullname"
-                size="20" value="" />
+         <input type="text" name="fullname" id="fullname" size="20" value="" />
        </td>
      </tr>
      <tr>
        <td><label for="email">Email</label></td>
        <td>
-         <input type="text" name="email" id="email"
-                size="20" value="" />
+         <input type="text" name="email" id="email" size="20" value="" />
        </td>
      </tr>
 
@@ -115,12 +113,12 @@
      </tr>
 
      <tr>
-        <td><input type="submit" name="action" value="Save"/></td>
+        <td><input type="submit" name="action" value="Save" /></td>
      </tr>
 
      </table>
    <div id="useractions">
-     <input type="submit" name="action" value="Remove" onclick="return( confirm('Are you sure you wish to remove this user?') && Wiki.submitOnce(this) );"/>      <input type="button" value="Add" onclick="javascript:addNew()"/>
+     <input type="submit" name="action" value="Remove" onclick="return( confirm('Are you sure you wish to remove this user?') && Wiki.submitOnce(this) );" />      <input type="button" value="Add" onclick="javascript:addNew()" />
    </div>
    </form>
    </div>

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/commonheader.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/commonheader.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/commonheader.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/commonheader.jsp Mon Dec  1 20:21:03 2008
@@ -6,8 +6,9 @@
 <%@ page import="java.util.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<fmt:setLocale value="${prefs.Language}" />
-<fmt:setBundle basename="templates.default"/>
+<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
+
+
 <%--
    This file provides a common header which includes the important JSPWiki scripts and other files.
    You need to include this in your template, within <head> and </head>.  It is recommended that
@@ -19,12 +20,10 @@
    can be included).
 --%>
 <%-- CSS stylesheet --%>
-<link rel="stylesheet" media="screen, projection, print" type="text/css"
-     href="<wiki:Link format='url' templatefile='jspwiki.css'/>"/>
+<link rel="stylesheet" media="screen, projection, print" type="text/css" href="<wiki:Link format='url' templatefile='jspwiki.css' />" />
 <%-- put this at the top, to avoid double load when not yet cached --%>
-<link rel="stylesheet" type="text/css" media="print" 
-     href="<wiki:Link format='url' templatefile='jspwiki_print.css'/>" />
-<wiki:IncludeResources type="stylesheet"/>
+<link rel="stylesheet" type="text/css" media="print" href="<wiki:Link format='url' templatefile='jspwiki_print.css' />" />
+<wiki:IncludeResources type="stylesheet" />
 <wiki:IncludeResources type="inlinecss" />
 
 <%-- display the more-menu inside the leftmenu, when javascript is not avail --%>
@@ -35,11 +34,11 @@
 </noscript>
 
 <%-- JAVASCRIPT --%>
-<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/mootools.js'/>"></script>
-<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/prettify.js'/>"></script>
-<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-common.js'/>"></script>
-<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-commonstyles.js'/>"></script>
-<wiki:IncludeResources type="script"/>
+<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/mootools.js' />"></script>
+<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/prettify.js' />"></script>
+<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-common.js' />"></script>
+<script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-commonstyles.js' />"></script>
+<wiki:IncludeResources type="script" />
 
 <%-- COOKIE read client preferences --%>
 <%
@@ -47,12 +46,12 @@
  %>
 
 <meta name="wikiContext" content='<wiki:Variable var="requestcontext" />' />
-<meta name="wikiBaseUrl" content='<wiki:BaseURL />' />
-<meta name="wikiPageUrl" content='<wiki:Link format="url"  page="#$%"/>' />
+<meta name="wikiBaseUrl" content='<wiki:BaseURL/>' />
+<meta name="wikiPageUrl" content='<wiki:Link format="url" page="#$%" />' />
 <meta name="wikiEditUrl" content='<wiki:EditLink format="url" />' />
-<meta name="wikiJsonUrl" content='<%=  WikiContext.findContext(pageContext).getURL( WikiContext.NONE, "JSON-RPC" ) %>' /><%--unusual pagename--%>
+<meta name="wikiJsonUrl" content='<%=  WikiContextFactory.findContext(pageContext).getURL( WikiContext.NONE, "JSON-RPC" ) %>' /><%--unusual pagename--%>
 <meta name="wikiPageName" content='<wiki:Variable var="pagename" />' /><%--pagename without blanks--%>
-<meta name="wikiUserName" content='<wiki:UserName />' />
+<meta name="wikiUserName" content='<wiki:UserName/>' />
 <meta name="wikiTemplateUrl" content='<wiki:Link format="url" templatefile="" />' />
 <meta name="wikiApplicationName" content='<wiki:Variable var="ApplicationName" />' />
 
@@ -62,48 +61,39 @@
 <wiki:IncludeResources type="jsfunction"/>
 //]]></script>
 
-<meta http-equiv="Content-Type" content="text/html; charset=<wiki:ContentEncoding />" />
-<link rel="search" href="<wiki:LinkTo format='url' page='FindPage'/>"
-    title='Search <wiki:Variable var="ApplicationName" />' />
-<link rel="help"   href="<wiki:LinkTo format='url' page='TextFormattingRules'/>"
-    title="Help" />
+<meta http-equiv="Content-Type" content="text/html; charset=<wiki:ContentEncoding/>" />
+<link rel="search" href="<wiki:LinkTo format='url' page='FindPage' />" title='Search <wiki:Variable var="ApplicationName" />' />
+<link rel="help" href="<wiki:LinkTo format='url' page='TextFormattingRules' />" title="Help" />
 <%
-  WikiContext c = WikiContext.findContext( pageContext );
+  WikiContext c = WikiContextFactory.findContext( pageContext );
   String frontpage = c.getEngine().getFrontPage();
  %>
- <link rel="start"  href="<wiki:LinkTo format='url' page='<%=frontpage%>' />"
-    title="Front page" />
-<link rel="alternate stylesheet" type="text/css" href="<wiki:Link format='url' templatefile='jspwiki_print.css'/>"
-    title="Print friendly" />
-<link rel="alternate stylesheet" type="text/css" href="<wiki:Link format='url' templatefile='jspwiki.css'/>"
-    title="Standard" />
-<link rel="shortcut icon" type="image/x-icon" href="<wiki:Link format='url' jsp='images/favicon.ico'/>" />
+ <link rel="start" href="<wiki:LinkTo format='url' page='<%=frontpage%>' />" title="Front page" />
+<link rel="alternate stylesheet" type="text/css" href="<wiki:Link format='url' templatefile='jspwiki_print.css' />" title="Print friendly" />
+<link rel="alternate stylesheet" type="text/css" href="<wiki:Link format='url' templatefile='jspwiki.css' />" title="Standard" />
+<link rel="shortcut icon" type="image/x-icon" href="<wiki:Link format='url' jsp='images/favicon.ico' />" />
 <%-- ie6 needs next line --%>
-<link rel="icon" type="image/x-icon" href="<wiki:Link format='url' jsp='images/favicon.ico'/>" />
+<link rel="icon" type="image/x-icon" href="<wiki:Link format='url' jsp='images/favicon.ico' />" />
 
 <%-- Support for the universal edit button (www.universaleditbutton.org) --%>
 <wiki:CheckRequestContext context='view|info|diff|upload'>
   <wiki:Permission permission="edit">
     <wiki:PageType type="page">
-    <link rel="alternate" type="application/x-wiki" 
-          href="<wiki:EditLink format='url' />"
-          title="<fmt:message key='actions.edit.title'/>" />
+    <link rel="alternate" type="application/x-wiki" href="<wiki:EditLink format='url' />" title="<fmt:message key='actions.edit.title' />" />
     </wiki:PageType>
   </wiki:Permission>
 </wiki:CheckRequestContext>
 
-<wiki:FeedDiscovery />
+<wiki:FeedDiscovery/>
 
 <%-- SKINS : extra stylesheets, extra javascript --%>
 <c:if test='${(!empty prefs.SkinName) && (prefs.SkinName!="PlainVanilla") }'>
-<link rel="stylesheet" type="text/css" media="screen, projection, print"
-     href="<wiki:Link format='url' templatefile='skins/' /><c:out value='${prefs.SkinName}/skin.css' />" />
+<link rel="stylesheet" type="text/css" media="screen, projection, print" href="<wiki:Link format='url' templatefile='skins/' /><c:out value='${prefs.SkinName}/skin.css' />" />
 <%--
 <link rel="stylesheet" type="text/css" media="print"
      href="<wiki:Link format='url' templatefile='skins/' /><c:out value='${prefs.SkinName}/print_skin.css' />" />
 --%>
-<script type="text/javascript"
-         src="<wiki:Link format='url' templatefile='skins/' /><c:out value='${prefs.SkinName}/skin.js' />" ></script>
+<script type="text/javascript" src="<wiki:Link format='url' templatefile='skins/' /><c:out value='${prefs.SkinName}/skin.js' />"></script>
 </c:if>
 
-<wiki:Include page="localheader.jsp"/>
\ No newline at end of file
+<wiki:Include page="localheader.jsp" />
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/FCK.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/FCK.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/FCK.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/FCK.jsp Mon Dec  1 20:21:03 2008
@@ -1,6 +1,6 @@
-<%@ page language="java" pageEncoding="UTF-8"%>
-<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki"%>
-<%@ page import="java.util.Properties"%>
+<%@ page language="java" pageEncoding="UTF-8" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<%@ page import="java.util.Properties" %>
 <%@ page import="com.ecyrd.jspwiki.*" %>
 <%@ page import="com.ecyrd.jspwiki.auth.*" %>
 <%@ page import="com.ecyrd.jspwiki.auth.permissions.*" %>
@@ -11,12 +11,14 @@
 <%@ page import="org.apache.commons.lang.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<fmt:setLocale value="${prefs.Language}" />
-<fmt:setBundle basename="templates.default"/>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
+
+
 <%--
     This provides the FCK editor for JSPWiki.
 --%>
-<%  WikiContext context = WikiContext.findContext( pageContext );
+<%  WikiContext context = WikiContextFactory.findContext( pageContext );
     WikiEngine engine = context.getEngine();
     context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.TRUE );
     context.setVariable( WikiEngine.PROP_RUNFILTERS,  "false" );
@@ -91,7 +93,7 @@
       enctype="application/x-www-form-urlencoded">
     <p>
         <%-- Edit.jsp relies on these being found.  So be careful, if you make changes. --%>
-        <input name="page" type="hidden" value="<wiki:Variable var="pagename"/>" />
+        <input name="page" type="hidden" value="<wiki:Variable var="pagename" />" />
         <input name="action" type="hidden" value="save" />
         <input name="<%=SpamFilter.getHashFieldName(request)%>" type="hidden" value="<c:out value='${lastchange}' />" />
     </p>
@@ -120,30 +122,30 @@
 </noscript>
 
    <p>
-     <label for="changenote"><fmt:message key='editor.plain.changenote'/></label>
-     <input type="text" id="changenote" name="changenote" size="80" maxlength="80" value="<c:out value='${changenote}'/>"/>
+     <label for="changenote"><fmt:message key='editor.plain.changenote' /></label>
+     <input type="text" id="changenote" name="changenote" size="80" maxlength="80" value="<c:out value='${changenote}' />" />
    </p>
    <wiki:CheckRequestContext context="comment">
     <fieldset>
-	<legend><fmt:message key="editor.commentsignature"/></legend>
+	<legend><fmt:message key="editor.commentsignature" /></legend>
     <p>
-    <label for="authorname" accesskey="n"><fmt:message key="editor.plain.name"/></label>
+    <label for="authorname" accesskey="n"><fmt:message key="editor.plain.name" /></label>
     <input type="text" name="author" id="authorname" value="<c:out value='${sessionScope.author}' />" />
     <input type="checkbox" name="remember" id="rememberme" <%=TextUtil.isPositive((String)session.getAttribute("remember")) ? "checked='checked'" : ""%> />
-    <label for="rememberme"><fmt:message key="editor.plain.remember"/></label>
+    <label for="rememberme"><fmt:message key="editor.plain.remember" /></label>
     </p>
 	<%--FIXME: seems not to read the email of the user, but some odd previously cached value --%>
     <p>
-    <label for="link" accesskey="m"><fmt:message key="editor.plain.email"/></label>
+    <label for="link" accesskey="m"><fmt:message key="editor.plain.email" /></label>
     <input type="text" name="link" id="link" size="24" value="<c:out value='${sessionScope.link}' />" />
     </p>
     </fieldset>
   </wiki:CheckRequestContext>
 
   <p>
-    <input name='ok' type='submit' value='<fmt:message key="editor.plain.save.submit"/>' />
-    <input name='preview' type='submit' value='<fmt:message key="editor.plain.preview.submit"/>' />
-    <input name='cancel' type='submit' value='<fmt:message key="editor.plain.cancel.submit"/>' />
+    <input name='ok' type='submit' value='<fmt:message key="editor.plain.save.submit" />' />
+    <input name='preview' type='submit' value='<fmt:message key="editor.plain.preview.submit" />' />
+    <input name='cancel' type='submit' value='<fmt:message key="editor.plain.cancel.submit" />' />
   </p>
 </div>
 </form>

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/plain.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/plain.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/plain.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/plain.jsp Mon Dec  1 20:21:03 2008
@@ -1,5 +1,5 @@
-<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
-<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki"%>
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
 <%@ page import="com.ecyrd.jspwiki.*" %>
 <%@ page import="com.ecyrd.jspwiki.auth.*" %>
 <%@ page import="com.ecyrd.jspwiki.auth.permissions.*" %>
@@ -10,13 +10,15 @@
 <%@ page import="com.ecyrd.jspwiki.rpc.json.*" %>
 <%@ 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}" />
-<fmt:setBundle basename="templates.default"/>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
+
+
 <%--
         This is a plain editor for JSPWiki.
 --%>
 <% 
-   WikiContext context = WikiContext.findContext( pageContext ); 
+   WikiContext context = WikiContextFactory.findContext( pageContext ); 
    WikiEngine engine = context.getEngine();
    
    String contextPath = request.getContextPath();
@@ -103,84 +105,84 @@
     </wiki:Permission>
 --%>  
     <tr>
-    <td><label for="changenote"><fmt:message key='editor.plain.changenote'/></label></td>
-    <td><input type="text" name="changenote" id="changenote" size="80" maxlength="80" value="<c:out value='${changenote}'/>"/></td>
+    <td><label for="changenote"><fmt:message key='editor.plain.changenote' /></label></td>
+    <td><input type="text" name="changenote" id="changenote" size="80" maxlength="80" value="<c:out value='${changenote}' />" /></td>
     </tr>
   </table>
   
   <div id="tools">
-      <h4><fmt:message key='editor.plain.toolbar'/></h4>
+      <h4><fmt:message key='editor.plain.toolbar' /></h4>
       <div id="toolbuttons">
       <span>
-	  <a href="#" class="tool" rel="" id="tbLink" title="<fmt:message key='editor.plain.tbLink.title'/>">link</a>
-	  <a href="#" class="tool" rel="break" id="tbH1" title="<fmt:message key='editor.plain.tbH1.title'/>">h1</a>
-	  <a href="#" class="tool" rel="break" id="tbH2" title="<fmt:message key='editor.plain.tbH2.title'/>">h2</a>
-	  <a href="#" class="tool" rel="break" id="tbH3" title="<fmt:message key='editor.plain.tbH3.title'/>">h3</a>
+	  <a href="#" class="tool" rel="" id="tbLink" title="<fmt:message key='editor.plain.tbLink.title' />">link</a>
+	  <a href="#" class="tool" rel="break" id="tbH1" title="<fmt:message key='editor.plain.tbH1.title' />">h1</a>
+	  <a href="#" class="tool" rel="break" id="tbH2" title="<fmt:message key='editor.plain.tbH2.title' />">h2</a>
+	  <a href="#" class="tool" rel="break" id="tbH3" title="<fmt:message key='editor.plain.tbH3.title' />">h3</a>
       </span>
       <span>
-	  <a href="#" class="tool" rel="" id="tbB" title="<fmt:message key='editor.plain.tbB.title'/>">bold</a>
-	  <a href="#" class="tool" rel="" id="tbI" title="<fmt:message key='editor.plain.tbI.title'/>">italic</a>
-	  <a href="#" class="tool" rel="" id="tbMONO" title="<fmt:message key='editor.plain.tbMONO.title'/>">mono</a>
-	  <a href="#" class="tool" rel="" id="tbSUP" title="<fmt:message key='editor.plain.tbSUP.title'/>">sup</a>
-	  <a href="#" class="tool" rel="" id="tbSUB" title="<fmt:message key='editor.plain.tbSUB.title'/>">sub</a>
-	  <a href="#" class="tool" rel="" id="tbSTRIKE" title="<fmt:message key='editor.plain.tbSTRIKE.title'/>">strike</a>
+	  <a href="#" class="tool" rel="" id="tbB" title="<fmt:message key='editor.plain.tbB.title' />">bold</a>
+	  <a href="#" class="tool" rel="" id="tbI" title="<fmt:message key='editor.plain.tbI.title' />">italic</a>
+	  <a href="#" class="tool" rel="" id="tbMONO" title="<fmt:message key='editor.plain.tbMONO.title' />">mono</a>
+	  <a href="#" class="tool" rel="" id="tbSUP" title="<fmt:message key='editor.plain.tbSUP.title' />">sup</a>
+	  <a href="#" class="tool" rel="" id="tbSUB" title="<fmt:message key='editor.plain.tbSUB.title' />">sub</a>
+	  <a href="#" class="tool" rel="" id="tbSTRIKE" title="<fmt:message key='editor.plain.tbSTRIKE.title' />">strike</a>
       </span>
       <span>
-	  <a href="#" class="tool" rel="" id="tbBR" title="<fmt:message key='editor.plain.tbBR.title'/>">br</a>
-	  <a href="#" class="tool" rel="break" id="tbHR" title="<fmt:message key='editor.plain.tbHR.title'/>">hr</a>
-	  <a href="#" class="tool" rel="break" id="tbPRE" title="<fmt:message key='editor.plain.tbPRE.title'/>">pre</a>
-	  <a href="#" class="tool" rel="break" id="tbCODE" title="<fmt:message key='editor.plain.tbCODE.title'/>">code</a>
-	  <a href="#" class="tool" rel="break" id="tbDL" title="<fmt:message key='editor.plain.tbDL.title'/>">dl</a>
+	  <a href="#" class="tool" rel="" id="tbBR" title="<fmt:message key='editor.plain.tbBR.title' />">br</a>
+	  <a href="#" class="tool" rel="break" id="tbHR" title="<fmt:message key='editor.plain.tbHR.title' />">hr</a>
+	  <a href="#" class="tool" rel="break" id="tbPRE" title="<fmt:message key='editor.plain.tbPRE.title' />">pre</a>
+	  <a href="#" class="tool" rel="break" id="tbCODE" title="<fmt:message key='editor.plain.tbCODE.title' />">code</a>
+	  <a href="#" class="tool" rel="break" id="tbDL" title="<fmt:message key='editor.plain.tbDL.title' />">dl</a>
       </span>
       <span>
-	  <a href="#" class="tool" rel="break" id="tbTOC" title="<fmt:message key='editor.plain.tbTOC.title'/>">toc</a>
-	  <a href="#" class="tool" rel="break" id="tbTAB" title="<fmt:message key='editor.plain.tbTAB.title'/>">tab</a>
-	  <a href="#" class="tool" rel="break" id="tbTABLE" title="<fmt:message key='editor.plain.tbTABLE.title'/>">table</a>
-	  <a href="#" class="tool" rel="" id="tbIMG" title="<fmt:message key='editor.plain.tbIMG.title'/>">img</a>
-	  <a href="#" class="tool" rel="break" id="tbQUOTE" title="<fmt:message key='editor.plain.tbQUOTE.title'/>">quote</a>
-	  <a href="#" class="tool" rel="break" id="tbSIGN" title="<fmt:message key='editor.plain.tbSIGN.title'/>">sign</a>
+	  <a href="#" class="tool" rel="break" id="tbTOC" title="<fmt:message key='editor.plain.tbTOC.title' />">toc</a>
+	  <a href="#" class="tool" rel="break" id="tbTAB" title="<fmt:message key='editor.plain.tbTAB.title' />">tab</a>
+	  <a href="#" class="tool" rel="break" id="tbTABLE" title="<fmt:message key='editor.plain.tbTABLE.title' />">table</a>
+	  <a href="#" class="tool" rel="" id="tbIMG" title="<fmt:message key='editor.plain.tbIMG.title' />">img</a>
+	  <a href="#" class="tool" rel="break" id="tbQUOTE" title="<fmt:message key='editor.plain.tbQUOTE.title' />">quote</a>
+	  <a href="#" class="tool" rel="break" id="tbSIGN" title="<fmt:message key='editor.plain.tbSIGN.title' />">sign</a>
       </span>
       <span>
-      <a href="#" class="tool" rel="break" id="tbUNDO" title="<fmt:message key='editor.plain.undo.title'/>"><fmt:message key='editor.plain.undo.submit'/></a>
+      <a href="#" class="tool" rel="break" id="tbUNDO" title="<fmt:message key='editor.plain.undo.title' />"><fmt:message key='editor.plain.undo.submit' /></a>
       </span>
       <span>
-	  <a href="#" class="tool" rel="break" id="tbREDO" title="<fmt:message key='editor.plain.redo.title'/>"><fmt:message key='editor.plain.redo.submit'/></a>
+	  <a href="#" class="tool" rel="break" id="tbREDO" title="<fmt:message key='editor.plain.redo.title' />"><fmt:message key='editor.plain.redo.submit' /></a>
       </span>
 	  </div>
 
 	  <div id="toolextra" class="clearbox" style="display:none;">
       <span>
-      <input type="checkbox" name="tabcompletion" id="tabcompletion" <%=TextUtil.isPositive((String)session.getAttribute("tabcompletion")) ? "checked='checked'" : ""%>/>
-      <label for="tabcompletion" title="<fmt:message key='editor.plain.tabcompletion.title'/>"><fmt:message key="editor.plain.tabcompletion"/></label>
+      <input type="checkbox" name="tabcompletion" id="tabcompletion" <%=TextUtil.isPositive((String)session.getAttribute("tabcompletion")) ? "checked='checked'" : ""%> />
+      <label for="tabcompletion" title="<fmt:message key='editor.plain.tabcompletion.title' />"><fmt:message key="editor.plain.tabcompletion" /></label>
       </span>
       <span>
-      <input type="checkbox" name="smartpairs" id="smartpairs" <%=TextUtil.isPositive((String)session.getAttribute("smartpairs")) ? "checked='checked'" : ""%>/>
-      <label for="smartpairs" title="<fmt:message key='editor.plain.smartpairs.title'/>"><fmt:message key="editor.plain.smartpairs"/></label>	  
+      <input type="checkbox" name="smartpairs" id="smartpairs" <%=TextUtil.isPositive((String)session.getAttribute("smartpairs")) ? "checked='checked'" : ""%> />
+      <label for="smartpairs" title="<fmt:message key='editor.plain.smartpairs.title' />"><fmt:message key="editor.plain.smartpairs" /></label>	  
       </span>
 	  </div>
 
 	  <div id="searchbar">
   		<span>
-        <label for="tbFIND" ><fmt:message key="editor.plain.find"/></label>
-  		<input type="text"   name="tbFIND" id="tbFIND" size="16" />
-		<label for="tbREPLACE" ><fmt:message key="editor.plain.replace"/></label>
-		<input type="text"   name="tbREPLACE" id="tbREPLACE" size="16" />
+        <label for="tbFIND"><fmt:message key="editor.plain.find" /></label>
+  		<input type="text" name="tbFIND" id="tbFIND" size="16" />
+		<label for="tbREPLACE"><fmt:message key="editor.plain.replace" /></label>
+		<input type="text" name="tbREPLACE" id="tbREPLACE" size="16" />
         <input type="button" name="doreplace" id="doreplace" value="<fmt:message key='editor.plain.find.submit' />" />
         </span>
   		<span>
   		<input type="checkbox" name="tbMatchCASE" id="tbMatchCASE" />
-  		<label for="tbMatchCASE"><fmt:message key="editor.plain.matchcase"/></label>
+  		<label for="tbMatchCASE"><fmt:message key="editor.plain.matchcase" /></label>
   		</span>
   		<span>
   		<input type="checkbox" name="tbREGEXP" id="tbREGEXP" />
-  		<label for="tbREGEXP" ><fmt:message key="editor.plain.regexp"/></label>
+  		<label for="tbREGEXP"><fmt:message key="editor.plain.regexp" /></label>
   		</span>
   		<span>
   		<input type="checkbox" name="tbGLOBAL" id="tbGLOBAL" checked="checked" />
-  		<label for="tbGLOBAL"><fmt:message key="editor.plain.global"/></label>
+  		<label for="tbGLOBAL"><fmt:message key="editor.plain.global" /></label>
   		</span>
 	  </div>
-	  <div class="clearbox" ></div>
+	  <div class="clearbox"></div>
   </div>
 
   <div>
@@ -192,15 +194,15 @@
 
   <wiki:CheckRequestContext context="comment">
     <fieldset>
-	<legend><fmt:message key="editor.commentsignature"/></legend>
+	<legend><fmt:message key="editor.commentsignature" /></legend>
     <p>
-    <label for="authorname" accesskey="n"><fmt:message key="editor.plain.name"/></label>
+    <label for="authorname" accesskey="n"><fmt:message key="editor.plain.name" /></label>
     <input type="text" name="author" id="authorname" value="<c:out value='${sessionScope.author}' />" />
     <input type="checkbox" name="remember" id="rememberme" <%=TextUtil.isPositive((String)session.getAttribute("remember")) ? "checked='checked'" : ""%> />
-    <label for="rememberme"><fmt:message key="editor.plain.remember"/></label>
+    <label for="rememberme"><fmt:message key="editor.plain.remember" /></label>
     </p>
     <p>
-    <label for="link" accesskey="m"><fmt:message key="editor.plain.email"/></label>
+    <label for="link" accesskey="m"><fmt:message key="editor.plain.email" /></label>
     <input type="text" name="link" id="link" size="24" value="<c:out value='${sessionScope.link}' />" />
     </p>
     </fieldset>
@@ -210,9 +212,9 @@
 
 <div id="sneakpreviewheader">
   <input type="checkbox" name="autopreview" id="autopreview" <%=TextUtil.isPositive((String)session.getAttribute("autopreview")) ? "checked='checked'" : ""%> />
-  <label for="autopreview" title="<fmt:message key='editor.plain.sneakpreview.title'/>"><fmt:message key="editor.plain.sneakpreview"/></label>	  
+  <label for="autopreview" title="<fmt:message key='editor.plain.sneakpreview.title' />"><fmt:message key="editor.plain.sneakpreview" /></label>	  
   <span id="previewSpin" class="spin" style="position:absolute;display:none;"></span>
 </div>
-<div id="sneakpreview" ></div>
+<div id="sneakpreview"></div>
 
 </div>
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/preview.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/preview.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/preview.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/default/editors/preview.jsp Mon Dec  1 20:21:03 2008
@@ -1,23 +1,25 @@
-<%@ page language="java" pageEncoding="UTF-8"%>
-<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki"%>
+<%@ page language="java" pageEncoding="UTF-8" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
 <%@ page import="com.ecyrd.jspwiki.*" %>
 <%@ page import="com.ecyrd.jspwiki.ui.*" %>
 <%@ page import="com.ecyrd.jspwiki.filters.*" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<fmt:setLocale value="${prefs.Language}" />
-<fmt:setBundle basename="templates.default"/>
+<%@ taglib uri="/WEB-INF/stripes.tld" prefix="stripes" %>
+<%@ page import="com.ecyrd.jspwiki.action.WikiContextFactory" %>
+
+
 <%--
         This is a special editor component for JSPWiki preview storage.
 --%>
 <% 
-   WikiContext context = WikiContext.findContext( pageContext ); 
+   WikiContext context = WikiContextFactory.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(WikiContext.COMMENT,context.getPage().getName()) : 
+                   context.getURL(WikiContext.EDIT,context.getPage().getName());
  %>
 <form action="<%=action%>"
       method="post" accept-charset="<wiki:ContentEncoding/>" 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/raw/ViewTemplate.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/raw/ViewTemplate.jsp?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/raw/ViewTemplate.jsp (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs/templates/raw/ViewTemplate.jsp Mon Dec  1 20:21:03 2008
@@ -1,5 +1,5 @@
 <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
 <% response.setContentType("text/plain; charset=UTF-8"); %>
 <pre>
-<wiki:InsertPage mode="plain"/>
+<wiki:InsertPage mode="plain" />
 </pre>
\ No newline at end of file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformer.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformer.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformer.java Mon Dec  1 20:21:03 2008
@@ -10,20 +10,29 @@
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.action.HandlerInfo;
 import com.ecyrd.jspwiki.action.WikiActionBean;
+import com.ecyrd.jspwiki.action.WikiContextFactory;
 
 /**
  * Transforms a JspDocument from standard JSP markup to Stripes markup.
+ * Known limitations: will not modify Java code inside of tag attributes.
  */
 public class JSPWikiJspTransformer extends AbstractJspTransformer
 {
     private static final Pattern CONTEXT_PATTERN = Pattern.compile( "\\.createContext\\(.*?WikiContext.([A-Z]*?)\\s*\\);" );
 
-    private Map<String,HandlerInfo> m_contextMap = new HashMap<String,HandlerInfo>();
+    private static final Pattern HASACCESS_PATTERN = Pattern
+        .compile( "if\\s*\\(\\s*\\!(wikiContext|context|ctx)\\.hasAccess\\(.*?\\)\\s*\\)\\s*return;" );
+
+    private static final Pattern PAGE_GETNAME_PATTERN = Pattern.compile( "(wikiContext|context|ctx)\\.getName\\(\\)" );
+
+    private static final Pattern FINDCONTEXT_PATTERN = Pattern.compile( "WikiContext\\.findContext\\((.*?)\\)" );
+
+    private Map<String, HandlerInfo> m_contextMap = new HashMap<String, HandlerInfo>();
 
     /**
      * {@inheritDoc}
      */
-    public void initialize( Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState )
+    public void initialize( JspMigrator migrator, Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState )
     {
         m_contextMap = cacheRequestContexts( beanClasses );
         System.out.println( "Initialized JSPWikiJspTransformer." );
@@ -53,9 +62,10 @@
                     removeSetBundle( tag );
                 }
 
-                // Advise user about <input type="hidden"> or <stripes:hidden> tags
+                // Advise user about <input type="hidden"> or <stripes:hidden>
+                // tags
                 boolean isTypeHidden = false;
-                if ( tag.getType() != NodeType.END_TAG )
+                if( tag.getType() != NodeType.END_TAG )
                 {
                     isTypeHidden = "stripes:hidden".equals( tag.getName() );
                     if( "input".equals( tag.getName() ) )
@@ -67,10 +77,10 @@
                     {
                         String paramName = tag.hasAttribute( "name" ) ? tag.getAttribute( "name" ).getValue() : null;
                         String paramValue = tag.hasAttribute( "value" ) ? tag.getAttribute( "value" ).getValue() : null;
-                        if ( paramName != null && paramValue != null )
+                        if( paramName != null && paramValue != null )
                         {
-                            message( tag, "NOTE: hidden form input sets parameter " + paramName
-                                     + "=\"" + paramValue + "\". This should probably correspond to a Stripes ActionBean getter/settter. Refactor?" );
+                            message( tag, "NOTE: hidden form input sets parameter " + paramName + "=\"" + paramValue
+                                          + "\". This should probably correspond to a Stripes ActionBean getter/settter. Refactor?" );
                         }
                     }
                 }
@@ -83,51 +93,108 @@
                 }
             }
 
-            // Look for WikiEngine.createContext() statements, and add matching <stripes:useActionBean> tag
-            else if ( node.getType() == NodeType.JSP_DECLARATION || node.getType() == NodeType.SCRIPTLET )
+            // Look for WikiEngine.createContext() statements, and add matching
+            // <stripes:useActionBean> tag
+            else if( node.getType() == NodeType.JSP_DECLARATION || 
+                         node.getType() == NodeType.SCRIPTLET || 
+                         node.getType() == NodeType.JSP_EXPRESSION ||
+                         node.getType() == NodeType.CDATA )
             {
                 String scriptlet = node.getValue();
                 Matcher m = CONTEXT_PATTERN.matcher( scriptlet );
-                if (m.find()) {
-                    String context = m.group(1).trim();     // EDIT, COMMENT etc.
+                if( m.find() )
+                {
+                    String context = m.group( 1 ).trim(); // EDIT, COMMENT
+                                                            // etc.
                     HandlerInfo handler = m_contextMap.get( context );
-                    if ( handler != null )
+                    if( handler != null )
                     {
                         // Add the <stripes:useActionBean> tag
                         addUseActionBeanTag( doc, handler.getActionBeanClass(), handler.getEventName() );
-                        
+
                         // Now add the Stripes taglib declaration
-                        if ( StripesJspTransformer.addStripesTaglib( doc ) )
+                        if( StripesJspTransformer.addStripesTaglib( doc ) )
                         {
                             message( doc.getRoot(), "Added Stripes taglib directive." );
                         }
                     }
                 }
-                
+
+                // Remove any WikiContext.hasAccess() statements
+                m = HASACCESS_PATTERN.matcher( scriptlet );
+                if( m.find() )
+                {
+                    String hasAccess = m.group( 0 );
+                    scriptlet = scriptlet.replace( hasAccess, "" );
+                    node.setValue( scriptlet );
+                    message( node, "Removed WikiContext.hasAccess() statement." );
+                }
+
+                // Change WikiContext.getName() to
+                // WikiContext.getPage().getName();
+                m = PAGE_GETNAME_PATTERN.matcher( scriptlet );
+                if( m.find() )
+                {
+                    String getName = m.group( 0 );
+                    String ctx = m.group( 1 ).trim();
+                    scriptlet = scriptlet.replace( getName, ctx + ".getPage().getName()" );
+                    node.setValue( scriptlet );
+                    message( node, "Changed WikiContext.getName() statement to WikiContext.getPage().getName()." );
+                }
+
+                // Change WikiContext.findContext() to
+                // WikiContextFactory.findContext()
+                m = FINDCONTEXT_PATTERN.matcher( scriptlet );
+                if( m.find() )
+                {
+                    String findContext = m.group( 0 );
+                    String ctx = m.group( 1 ).trim();
+                    scriptlet = scriptlet.replace( findContext, "WikiContextFactory.findContext( " + ctx + " )" );
+                    node.setValue( scriptlet );
+                    message( node, "Changed WikiContext.findContext() statement to WikiContextFactory.findContext()." );
+
+                    // Make sure we have a page import statement!
+                    List<Tag> imports = doc.getPageImport( WikiContextFactory.class.getName() );
+                    if( imports.size() == 0 )
+                    {
+                        doc.addPageImportDirective( WikiContextFactory.class.getName() );
+                        message( node, "Added page import for WikiContextFactory." );
+                    }
+                }
             }
         }
     }
 
     private void addUseActionBeanTag( JspDocument doc, Class<? extends ActionBean> beanClass, String event )
     {
+        // If UseActionBean tag already added, bail
+        List<Node> nodes = doc.getNodes();
+        for( Node node : nodes )
+        {
+            if( "stripes:useActionBean".equals( node.getName() ) )
+            {
+                return;
+            }
+        }
+
         // Create Tag
         Tag tag = new Tag( doc, NodeType.EMPTY_ELEMENT_TAG );
         tag.setName( "stripes:useActionBean" );
-        tag.addAttribute( new Attribute( doc, "beanClass", beanClass.getName() ) );
-        if ( event != null )
+        tag.addAttribute( new Attribute( doc, "beanclass", beanClass.getName() ) );
+        if( event != null )
         {
             tag.addAttribute( new Attribute( doc, "event", event ) );
         }
-        
+
         // Create linebreak
         Text linebreak = new Text( doc );
         linebreak.setValue( System.getProperty( "line.separator" ) );
         Node root = doc.getRoot();
         linebreak.setParent( root );
-        
+
         // Figure out where to put it
         List<Node> directives = doc.getNodes( NodeType.JSP_DIRECTIVE );
-        if ( directives.size() == 0 )
+        if( directives.size() == 0 )
         {
             root.addChild( linebreak, 0 );
             root.addChild( tag, 0 );
@@ -138,7 +205,7 @@
             lastDirective.addSibling( tag );
             lastDirective.addSibling( linebreak );
         }
-        message( doc.getRoot(), "Added <stripes:useActionBean beanClass=\"" + beanClass.getName() + "\" event=\"" + event + "\" />" );
+        message( doc.getRoot(), "Added <stripes:useActionBean beanclass=\"" + beanClass.getName() + "\" event=\"" + event + "\" />" );
     }
 
     /**
@@ -185,23 +252,25 @@
     }
 
     /**
-     * Using introspection, creates a cached Map of with request context field names as keys, and ActionBean classes as values.
+     * Using introspection, creates a cached Map of with request context field
+     * names as keys, and ActionBean classes as values.
      */
-    @SuppressWarnings("unchecked")
-    private Map<String,HandlerInfo> cacheRequestContexts( Set<Class<? extends ActionBean>> beanClasses )
+    @SuppressWarnings( "unchecked" )
+    private Map<String, HandlerInfo> cacheRequestContexts( Set<Class<? extends ActionBean>> beanClasses )
     {
-        // Create a map with of all String constant; key: constant value, value: constant name
+        // Create a map with of all String constant; key: constant value, value:
+        // constant name
         // e.g., "login", "LOGIN"
-        Map<String,String> fields = new HashMap<String,String>(); 
-        for ( Field field : WikiContext.class.getDeclaredFields() )
+        Map<String, String> fields = new HashMap<String, String>();
+        for( Field field : WikiContext.class.getDeclaredFields() )
         {
-            if ( String.class.equals( field.getType() ) )
+            if( String.class.equals( field.getType() ) )
             {
                 String fieldName = field.getName();
                 String fieldValue = null;
                 try
                 {
-                    fieldValue = (String)field.get( null );
+                    fieldValue = (String) field.get( null );
                     fields.put( fieldValue, fieldName );
                 }
                 catch( Exception e )
@@ -210,18 +279,19 @@
                 }
             }
         }
-        
+
         // Match WikiRequestContext annotations with WikiContext field values
-        Map<String,HandlerInfo> contextMap = new HashMap<String,HandlerInfo>();
-        for ( Class<? extends ActionBean> beanClass : beanClasses )
+        Map<String, HandlerInfo> contextMap = new HashMap<String, HandlerInfo>();
+        for( Class<? extends ActionBean> beanClass : beanClasses )
         {
-            Collection<HandlerInfo> handlers = HandlerInfo.getHandlerInfoCollection( (Class<? extends WikiActionBean>)beanClass ).values();
-            
-            for ( HandlerInfo handler : handlers )
+            Collection<HandlerInfo> handlers = HandlerInfo.getHandlerInfoCollection( (Class<? extends WikiActionBean>) beanClass )
+                .values();
+
+            for( HandlerInfo handler : handlers )
             {
                 String eventName = handler.getRequestContext();
                 String fieldName = fields.get( eventName );
-                if ( fieldName != null )
+                if( fieldName != null )
                 {
                     contextMap.put( fieldName, handler );
                 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformerTest.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformerTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JSPWikiJspTransformerTest.java Mon Dec  1 20:21:03 2008
@@ -1,10 +1,9 @@
 package com.ecyrd.jspwiki.ui.stripes;
 
-import java.security.ProtectionDomain;
+import java.io.File;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -19,7 +18,7 @@
     
     public void setUp()
     {
-        m_transformer.initialize( JspMigrator.findBeanClasses(), m_sharedState );
+        m_transformer.initialize( new JspMigrator(), JspMigrator.findBeanClasses(), m_sharedState );
     }
 
     public JSPWikiJspTransformerTest( String s )
@@ -59,6 +58,154 @@
         assertEquals( "POST", attribute.getValue() );
     }
     
+    public void testChangeFindContext1() throws Exception
+    {
+        String s = "<% WikiContext ctx = WikiContext.findContext(pageContext); %>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        List<Node> nodes = doc.getNodes();
+        assertEquals( 1, nodes.size() );
+        Node node = nodes.get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 3 nodes: page import, plus CR, plus WikiContext.findContext() changed to WikiContextFactory.findContext();
+        nodes = doc.getNodes();
+        assertEquals( 3, nodes.size() );
+        node = nodes.get( 0 );
+        assertEquals( NodeType.JSP_DIRECTIVE, node.getType() );
+        assertEquals( "page", node.getName() );
+        assertEquals( "com.ecyrd.jspwiki.action.WikiContextFactory", ( (Tag)node).getAttribute( "import" ).getValue() );
+        node = nodes.get( 1 );
+        assertEquals( NodeType.TEXT, node.getType() );
+        node = nodes.get( 2 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+        assertEquals( " WikiContext ctx = WikiContextFactory.findContext( pageContext ); ", node.getValue() );
+    }
+    
+    public void testChangeFindContext2() throws Exception
+    {
+        String s = "<%@ page import=\"com.ecyrd.jspwiki.action.*\" %><% WikiContext ctx = WikiContext.findContext(pageContext); %>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 2 nodes: directive (with wildcard) plus scriptlet
+        List<Node> nodes = doc.getNodes();
+        assertEquals( 2, nodes.size() );
+        Node node = nodes.get( 0 );
+        assertEquals( NodeType.JSP_DIRECTIVE, node.getType() );
+        assertEquals( "page", node.getName() );
+        assertEquals( "com.ecyrd.jspwiki.action.*", ( (Tag)node).getAttribute( "import" ).getValue() );
+        node = nodes.get( 1 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 3 nodes: page import, plus CR, plus WikiContext.findContext() changed to WikiContextFactory.findContext();
+        nodes = doc.getNodes();
+        assertEquals( 2, nodes.size() );
+        node = nodes.get( 0 );
+        assertEquals( NodeType.JSP_DIRECTIVE, node.getType() );
+        assertEquals( "page", node.getName() );
+        assertEquals( "com.ecyrd.jspwiki.action.*", ( (Tag)node).getAttribute( "import" ).getValue() );
+        node = nodes.get( 1 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+        assertEquals( " WikiContext ctx = WikiContextFactory.findContext( pageContext ); ", node.getValue() );
+    }
+    
+    public void testRemoveGetName1() throws Exception
+    {
+        String s = "<% String pagereq = wikiContext.getName();%>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        assertEquals( 1, doc.getNodes().size() );
+        Node node = doc.getNodes().get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 1 node with getName() changed to getPage().getName();
+        assertEquals( 1, doc.getNodes().size() );
+        assertEquals( " String pagereq = wikiContext.getPage().getName();", node.getValue() );
+    }
+
+    public void testRemoveGetName2() throws Exception
+    {
+        String s = "<% String pagereq = context.getName();%>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        assertEquals( 1, doc.getNodes().size() );
+        Node node = doc.getNodes().get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 1 node with getName() changed to getPage().getName();
+        assertEquals( 1, doc.getNodes().size() );
+        assertEquals( " String pagereq = context.getPage().getName();", node.getValue() );
+    }
+
+    public void testRemoveHasAccess1() throws Exception
+    {
+        String s = "<% WikiContext context;   if(!wikiContext.hasAccess( response )) return;  %>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        assertEquals( 1, doc.getNodes().size() );
+        Node node = doc.getNodes().get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 1 node with hasAccess() removed
+        assertEquals( 1, doc.getNodes().size() );
+        assertEquals( " WikiContext context;     ", node.getValue() );
+    }
+    
+    public void testRemoveHasAccess2() throws Exception
+    {
+        String s = "<% WikiContext context;   if( !context.hasAccess( r ) ) return;  %>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        assertEquals( 1, doc.getNodes().size() );
+        Node node = doc.getNodes().get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 1 node with hasAccess() removed
+        assertEquals( 1, doc.getNodes().size() );
+        assertEquals( " WikiContext context;     ", node.getValue() );
+    }
+    
+    public void testRemoveHasAccess3() throws Exception
+    {
+        String s = "<% if(!wikiContext.hasAccess( response )) return; %>";
+        JspDocument doc = new JspParser().parse( s );
+
+        // Should be 1 node: scriptlet
+        assertEquals( 1, doc.getNodes().size() );
+        Node node = doc.getNodes().get( 0 );
+        assertEquals( NodeType.SCRIPTLET, node.getType() );
+
+        // Run the transformer
+        m_transformer.transform( m_sharedState, doc );
+
+        // Should be 1 node with hasAccess() removed
+        assertEquals( 1, doc.getNodes().size() );
+        assertEquals( "  ", node.getValue() );
+    }
+    
     public void testSetBundle() throws Exception
     {
         String s = "<fmt:setBundle basename=\"templates.default\"/>\n<form method=\"POST\" onsubmit=\"return Wiki.submitOnce(this);\" />";
@@ -97,7 +244,7 @@
         assertEquals( 5, doc.getNodes().size() );
         Tag tag = (Tag)doc.getNodes().get( 2 );
         assertEquals( "stripes:useActionBean", tag.getName() );
-        assertEquals( "beanClass", tag.getAttributes().get( 0 ).getName() );
+        assertEquals( "beanclass", tag.getAttributes().get( 0 ).getName() );
         assertEquals( "com.ecyrd.jspwiki.action.EditActionBean", tag.getAttributes().get( 0 ).getValue() );
         assertEquals( "event", tag.getAttributes().get( 1 ).getName() );
         assertEquals( "edit", tag.getAttributes().get( 1 ).getValue() );

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspDocument.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspDocument.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspDocument.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspDocument.java Mon Dec  1 20:21:03 2008
@@ -53,6 +53,43 @@
         return typeNodes;
     }
     
+    /**
+    * Convenience method that inserts a page-import  directive after the last directive in the document.
+    * @param type the type to add, <em>e.g.,</em> <code>org.foo.Bar</code> or <code>org.foo.*</code>
+     */
+    public void addPageImportDirective( String type )
+    {
+        // Create new directive
+        Tag directive = new Tag( this, NodeType.JSP_DIRECTIVE );
+        directive.setName( "page" );
+        directive.addAttribute( new Attribute( this, "import", type ) );
+        
+        // Create linebreak
+        Text linebreak = new Text( this );
+        linebreak.setValue( System.getProperty( "line.separator" ) );
+        linebreak.setParent( root );
+        
+        // Figure out where to put it
+        List<Node> directives = getNodes( NodeType.JSP_DIRECTIVE );
+        if ( directives.size() == 0 )
+        {
+            root.addChild( linebreak, 0 );
+            root.addChild( directive, 0 );
+        }
+        else
+        {
+            Node lastDirective = directives.get( directives.size() - 1 );
+            lastDirective.addSibling( directive );
+            lastDirective.addSibling( linebreak );
+        }
+        
+    }
+
+    /**
+     * Convenience method that inserts a taglib directive after the last directive in the document.
+     * @param uri the URI of the taglib to add, <em>e.g.,</em><code>/WEB-INF/stripes.tld</code>
+     * @param prefix the prefix for the tablib, <em>e.g.,</em><code>stripes</code>
+     */
     public void addTaglibDirective( String uri, String prefix )
     {
         // Create new directive
@@ -79,7 +116,44 @@
             lastDirective.addSibling( directive );
             lastDirective.addSibling( linebreak );
         }
-        
+    }
+    
+    /**
+     * <p>Returns a list of JSP page-import directive Tags that match a supplied type name.
+     * To be considered a match, the type named in the import must match
+     * the supplied type exactly, or match be the wildcard import for the package
+     * containing it. For example, if the type being searched for was <code>org.bar.Foo</code>,
+     * these page imports would match:</p>
+     * <ul>
+     * <li>&lt;%@ page import="org.bar.Foo" %&gt;</li>
+     * <li>&lt;%@ page import="org.bar.*" %&gt;</li>
+     * </ul>
+     * @param type the class, interface or other type to match
+     * @return a list of all matching tags, which may be a zero-length list
+     */
+    public List<Tag> getPageImport( String type )
+    {
+        if( type == null )
+        {
+            throw new IllegalArgumentException( "Type cannot be null." );
+        }
+        int periodPosition = type.lastIndexOf( '.' );
+        String wildcardType = periodPosition == -1 ? "*" : type.substring( 0, periodPosition ) + ".*";
+        List<Node> directives = getNodes( NodeType.JSP_DIRECTIVE );
+        List<Tag> matchingDirectives = new ArrayList<Tag>();
+        for( Node node : directives )
+        {
+            Tag directive = (Tag)node;
+            Attribute imported = directive.getAttribute( "import" );
+            if ( "page".equals( directive.getName() ) && imported != null )
+            {
+                if ( type.equals( imported.getValue() ) || wildcardType.equals( imported.getValue() ) )
+                {
+                    matchingDirectives.add( directive );
+                }
+            }
+        }
+        return matchingDirectives;
     }
 
     /**

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspMigrator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspMigrator.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspMigrator.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspMigrator.java Mon Dec  1 20:21:03 2008
@@ -13,11 +13,10 @@
 
 public class JspMigrator
 {
-
     /**
      * Key for a list of File objects stored in the shared-state array.
      */
-    public static final String ALL_JSPS = "allJSPs";
+    protected static final String ALL_JSPS = "allJSPs";
 
     /**
      * Returns a list of files that match a specified extension, starting in a
@@ -107,7 +106,7 @@
         JspMigrator migrator = new JspMigrator();
         migrator.addTransformer( new StripesJspTransformer() );
         migrator.addTransformer( new JSPWikiJspTransformer() );
-        migrator.initialize( new HashMap<String,Object>() );
+        migrator.initialize( new HashMap<String, Object>() );
         try
         {
             migrator.migrate( src, dest );
@@ -118,6 +117,24 @@
         }
     }
 
+    /**
+     * Returns the ActionBean implementations found on the classpath.
+     * 
+     * @return
+     */
+    protected static Set<Class<? extends ActionBean>> findBeanClasses()
+    {
+        // Find all ActionBean implementations on the classpath
+        String beanPackagesProp = System.getProperty( WikiContextFactory.PROPS_ACTIONBEAN_PACKAGES,
+                                                      WikiContextFactory.DEFAULT_ACTIONBEAN_PACKAGES ).trim();
+        String[] beanPackages = beanPackagesProp.split( "," );
+        ResolverUtil<ActionBean> resolver = new ResolverUtil<ActionBean>();
+        resolver.findImplementations( ActionBean.class, beanPackages );
+        Set<Class<? extends ActionBean>> beanClasses = resolver.getClasses();
+
+        return beanClasses;
+    }
+
     protected static String readSource( File src ) throws IOException
     {
         // Read in the file
@@ -132,6 +149,14 @@
         return s.toString();
     }
 
+    /**
+     * Whether the JspMigrator should migrate HTML form elements to the Stripes
+     * format. Defaults to <code>true</code>.
+     */
+    public static final String MIGRATE_FORMS = "stripes.migrator.migrateForms";
+
+    private Map<String, Boolean> m_features = new HashMap<String, Boolean>();
+
     private List<JspTransformer> m_transformers = new ArrayList<JspTransformer>();
 
     private Map<String, Object> m_sharedState = new HashMap<String, Object>();
@@ -148,39 +173,47 @@
     }
 
     /**
-     * Initializes the JspMigrator with a shared-state Map containing key/value pairs. Each
-     * {@link JspTransformer} added to the transformer via {@link #addTransformer(JspTransformer)}
-     * is initialized in sequence by calling its respective {@link JspTransformer#initialize(Map)}
-     * method. Each JspTransformer is passed a Set of discovered {@link net.sourceforge.stripes.action.ActionBean}
-     * classes, plus the shared-state Map.
-     * @param sharedState the shared-state Map passed to all JspTransformers at time of initialization
+     * Returns <code>true</code> if a feature for the JspMigrator has been
+     * set.
+     * 
+     * @param feature the feature to check; for example, {@link #MIGRATE_FORMS}
+     * @return the result
      */
-    public void initialize( Map<String, Object> sharedState )
+    public boolean getFeature( String feature )
     {
-        m_sharedState = sharedState;
-        
-        // Initialize the transformers
-        for ( JspTransformer transformer: m_transformers )
+        if( feature == null )
         {
-            transformer.initialize( findBeanClasses(), m_sharedState );
+            throw new IllegalArgumentException( "Feature cannot be null." );
         }
+        Boolean featureValue = m_features.get( feature );
+        return featureValue == null ? false : featureValue.booleanValue();
     }
 
     /**
-     * Returns the ActionBean implementations found on the classpath.
-     * @return
+     * Initializes the JspMigrator with a shared-state Map containing key/value
+     * pairs. Each {@link JspTransformer} added to the transformer via
+     * {@link #addTransformer(JspTransformer)} is initialized in sequence by
+     * calling its respective {@link JspTransformer#initialize(Map)} method.
+     * Each JspTransformer is passed a Set of discovered
+     * {@link net.sourceforge.stripes.action.ActionBean} classes, plus the
+     * shared-state Map.
+     * 
+     * @param sharedState the shared-state Map passed to all JspTransformers at
+     *            time of initialization
      */
-    protected static Set<Class<? extends ActionBean>> findBeanClasses()
+    public void initialize( Map<String, Object> sharedState )
     {
-        // Find all ActionBean implementations on the classpath
-        String beanPackagesProp = System.getProperty( WikiContextFactory.PROPS_ACTIONBEAN_PACKAGES,
-                                                      WikiContextFactory.DEFAULT_ACTIONBEAN_PACKAGES ).trim();
-        String[] beanPackages = beanPackagesProp.split( "," );
-        ResolverUtil<ActionBean> resolver = new ResolverUtil<ActionBean>();
-        resolver.findImplementations( ActionBean.class, beanPackages );
-        Set<Class<? extends ActionBean>> beanClasses = resolver.getClasses();
-        
-        return beanClasses;
+        // Figure out the properties to use.
+        boolean migrateForms = Boolean.getBoolean( System.getProperty( MIGRATE_FORMS, "true" ) );
+        setFeature( MIGRATE_FORMS, migrateForms );
+
+        m_sharedState = sharedState;
+
+        // Initialize the transformers
+        for( JspTransformer transformer : m_transformers )
+        {
+            transformer.initialize( this, findBeanClasses(), m_sharedState );
+        }
     }
 
     /**
@@ -211,6 +244,22 @@
     }
 
     /**
+     * Sets a feature for the JspMigrator.
+     * 
+     * @param feature the feature to set; for example, {@link #MIGRATE_FORMS}
+     * @param whether the feature should be activated (<code>true</code>) or
+     *            not (<code>false</code>).
+     */
+    public void setFeature( String feature, boolean value )
+    {
+        if( feature == null )
+        {
+            throw new IllegalArgumentException( "Feature cannot be null." );
+        }
+        m_features.put( feature, value );
+    }
+
+    /**
      * Writes a String to a file.
      * 
      * @param dest the destination file

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspTransformer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspTransformer.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspTransformer.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/JspTransformer.java Mon Dec  1 20:21:03 2008
@@ -13,12 +13,13 @@
     /**
      * Initializes the transformer. This method should be called only once, when
      * the transformer is initialized.
+     * @param migrator the JspMigrator initializing the transformer
      * @param beanClasses the Set of ActionBean classes discovered by
      * @param sharedState a Map containing key/value pairs that represent any
      *            shared-state information that this method might need during
      *            transformation.
      */
-    public void initialize( Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState );
+    public void initialize( JspMigrator migrator, Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState );
 
     /**
      * Executes the transformation on the JSP and returns the result. This

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/StripesJspTransformer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/StripesJspTransformer.java?rev=722372&r1=722371&r2=722372&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/StripesJspTransformer.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/stripes/StripesJspTransformer.java Mon Dec  1 20:21:03 2008
@@ -17,12 +17,17 @@
     private Map<Class<? extends ActionBean>, Set<String>> beanProperties = new HashMap<Class<? extends ActionBean>, Set<String>>();
 
     private Map<String, Class<? extends ActionBean>> beanBindings = new HashMap<String, Class<? extends ActionBean>>();
-
+    
+    private boolean migrateForms = false;
+    
     /**
      * {@inheritDoc}
      */
-    public void initialize( Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState )
+    public void initialize( JspMigrator migrator, Set<Class<? extends ActionBean>> beanClasses, Map<String, Object> sharedState )
     {
+        // What features should we use?
+        migrateForms = migrator.getFeature( JspMigrator.MIGRATE_FORMS );
+        
         // Fetch the URL bindings
         initUrlBindingCache( beanClasses );
 
@@ -110,24 +115,24 @@
                 Tag tag = (Tag) node;
 
                 // Change <form> to <stripes:form>
-                if( "form".equals( tag.getName() ) )
+                if( migrateForms && "form".equals( tag.getName() ) )
                 {
                     migrated = migrateFormTag( tag ) || migrated;
                 }
 
                 // Change <input type="*"> tags to <stripes:*>
-                else if( "input".equals( tag.getName() ) )
+                else if( migrateForms && "input".equals( tag.getName() ) )
                 {
                     migrated = migrateInputTag( tag ) || migrated;
                 }
 
                 // Change <textarea> to <stripes:textarea>
-                else if( "textarea".equals( tag.getName() ) )
+                else if( migrateForms && "textarea".equals( tag.getName() ) )
                 {
                     migrated = migrateTextArea( tag ) || migrated;
                 }
 
-                else if( "label".equals( tag.getName() ) )
+                else if( migrateForms && "label".equals( tag.getName() ) )
                 {
                     migrated = migrateLabel( tag ) || migrated;
                 }