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 2010/02/03 06:27:02 UTC
svn commit: r905899 [1/2] - in /incubator/jspwiki/trunk/src: WebContent/
WebContent/templates/default/ WebContent/templates/default/editors/
WebContent/templates/default/tabs/ java/org/apache/wiki/action/
Author: ajaquith
Date: Wed Feb 3 05:27:01 2010
New Revision: 905899
URL: http://svn.apache.org/viewvc?rev=905899&view=rev
Log:
[JSPWIKI-578] Eliminated top-level JSPs for Edit.jsp, Preview.jsp, CreateProfile.jsp, Login.jsp, LoginForm.jsp, LostPassword.jsp, and UserPreferences.jsp and consolidated the markup into the template JSPs.
Added:
incubator/jspwiki/trunk/src/WebContent/templates/default/Comment.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfile.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/Login.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/Preferences.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/
incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/AttachmentsTab.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/PageInfoTab.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/ProfileTab.jsp
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LostPasswordActionBean.java
Removed:
incubator/jspwiki/trunk/src/WebContent/Comment.jsp
incubator/jspwiki/trunk/src/WebContent/CreateProfile.jsp
incubator/jspwiki/trunk/src/WebContent/Edit.jsp
incubator/jspwiki/trunk/src/WebContent/Login.jsp
incubator/jspwiki/trunk/src/WebContent/LoginForm.jsp
incubator/jspwiki/trunk/src/WebContent/LostPassword.jsp
incubator/jspwiki/trunk/src/WebContent/Preview.jsp
incubator/jspwiki/trunk/src/WebContent/UserPreferences.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/Attachments.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/CommentContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfileContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/EditContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/LoginContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/LostPasswordContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/PreferencesContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/PreferencesTab.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/PreviewContent.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/ProfileTab.jsp
Modified:
incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsTop.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfo.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/Wiki.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UserPreferencesActionBean.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UserProfileActionBean.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/Comment.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Comment.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Comment.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Comment.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,67 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<s:layout-render name="${templates['DefaultLayout.jsp']}">
+
+ <%-- Page title should say Comment: + pagename --%>
+ <s:layout-component name="headTitle">
+ <fmt:message key="comment.title.comment">
+ <fmt:param><wiki:Variable var="ApplicationName" /></fmt:param>
+ <fmt:param><wiki:PageName/></fmt:param>
+ </fmt:message>
+ </s:layout-component>
+
+ <!-- Add Javascript for editors -->
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-edit.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/dialog.js' />"></script>
+ <%--
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/posteditor.js' />"></script>
+ --%>
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <wiki:TabbedSection defaultTab="commentcontent">
+ <wiki:Tab id="pagecontent" titleKey="comment.tab.discussionpage">
+ <wiki:InsertPage/>
+ </wiki:Tab>
+
+ <wiki:Tab id="commentcontent" titleKey="comment.tab.addcomment">
+ <wiki:Editor/>
+ </wiki:Tab>
+
+ <%-- Edit help tab --%>
+ <wiki:Tab id="edithelp" titleKey="edit.tab.help" accesskey="h">
+ <wiki:InsertPage page="EditPageHelp" />
+ <wiki:NoSuchPage page="EditPageHelp">
+ <div class="error">
+ <fmt:message key="comment.edithelpmissing">
+ <fmt:param><wiki:EditLink page="EditPageHelp">EditPageHelp</wiki:EditLink></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:NoSuchPage>
+ </wiki:Tab>
+ </wiki:TabbedSection>
+ </s:layout-component>
+
+</s:layout-render>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfile.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfile.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfile.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/CreateProfile.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,63 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<s:layout-render name="${templates['DefaultLayout.jsp']}">
+ <s:layout-component name="content">
+ <wiki:TabbedSection defaultTab="${param.tab}">
+
+ <wiki:UserCheck status="notauthenticated">
+ <%-- Login tab --%>
+ <wiki:Tab id="login" titleKey="login.tab"
+ beanclass="org.apache.wiki.action.LoginActionBean"/>
+
+ <%-- Lost password tab --%>
+ <wiki:Tab id="reset" titleKey="login.lostpw.tab"
+ beanclass="org.apache.wiki.action.LostPasswordActionBean">
+ <wiki:Param name="tab" value="reset" />
+ </wiki:Tab>
+ </wiki:UserCheck>
+
+ <%-- New user tab --%>
+ <wiki:Permission permission="editProfile">
+ <wiki:Tab id="profile" titleKey="login.register.tab">
+ <jsp:include page="${templates['tabs/ProfileTab.jsp']}" />
+ </wiki:Tab>
+ </wiki:Permission>
+
+ <%-- Help tab --%>
+ <wiki:Tab id="help" titleKey="login.tab.help">
+ <wiki:InsertPage page="LoginHelp" />
+ <wiki:NoSuchPage page="LoginHelp">
+ <div class="error">
+ <fmt:message key="login.loginhelpmissing">
+ <fmt:param><wiki:EditLink page="LoginHelp">LoginHelp</wiki:EditLink></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:NoSuchPage>
+ </wiki:Tab>
+
+ </wiki:TabbedSection>
+ </s:layout-component>
+</s:layout-render>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,86 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<s:layout-render name="${templates['DefaultLayout.jsp']}">
+
+ <%-- Page title should say Edit: + pagename --%>
+ <s:layout-component name="headTitle">
+ <fmt:message key="edit.title.edit">
+ <fmt:param><wiki:Variable var="ApplicationName" /></fmt:param>
+ <fmt:param><wiki:PageName/></fmt:param>
+ </fmt:message>
+ </s:layout-component>
+
+ <!-- Add Javascript for editors -->
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-edit.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/dialog.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/stripes-support.js' />"></script>
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <wiki:TabbedSection defaultTab="edit">
+
+ <%-- View tab --%>
+ <wiki:Tab id="view" titleKey="view.tab" accesskey="v"
+ onclick="Stripes.executeEvent('editform', 'preview', 'previewContent');">
+ <div class="information">
+ <fmt:message key="preview.info" />
+ </div>
+ <div id="previewContent">
+ Page contents go here.
+ </div>
+ </wiki:Tab>
+
+ <%-- Editor tab --%>
+ <wiki:Tab id="edit" titleKey="edit.tab.edit" accesskey="e">
+ <wiki:Editor/>
+ </wiki:Tab>
+
+ <%-- Attachments tab --%>
+ <wiki:Tab id="attachments" accesskey="a"
+ title="${wiki:attachmentsTitle(request.Locale, wikiActionBean.attachments)}">
+ <jsp:include page="${templates['tabs/AttachmentsTab.jsp']}" />
+ </wiki:Tab>
+
+ <%-- Info tab --%>
+ <wiki:Tab id="info" titleKey="info.tab" accesskey="i">
+ <jsp:include page="${templates['tabs/PageInfoTab.jsp']}" />
+ </wiki:Tab>
+
+ <%-- Help tab --%>
+ <wiki:Tab id="help" titleKey="edit.tab.help" accesskey="h">
+ <wiki:InsertPage page="EditPageHelp" />
+ <wiki:NoSuchPage page="EditPageHelp">
+ <div class="error">
+ <fmt:message key="comment.edithelpmissing">
+ <fmt:param><wiki:EditLink page="EditPageHelp">EditPageHelp</wiki:EditLink></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:NoSuchPage>
+ </wiki:Tab>
+
+ </wiki:TabbedSection>
+ </s:layout-component>
+
+</s:layout-render>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/Login.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Login.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Login.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Login.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,168 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ 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://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.action.*" %>
+<%@ page import="org.apache.wiki.auth.*" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<%
+ String postURL = "";
+ WikiContext ctx = WikiContextFactory.findContext( pageContext );
+ AuthenticationManager mgr = ctx.getEngine().getAuthenticationManager();
+ if( mgr.isContainerAuthenticated() )
+ {
+ postURL = "j_security_check";
+ }
+ else
+ {
+ postURL = "/Login.jsp";
+ }
+%>
+<s:layout-render name="${templates['DefaultLayout.jsp']}">
+ <s:layout-component name="content">
+ <wiki:TabbedSection defaultTab="${param.tab}">
+
+ <wiki:UserCheck status="notauthenticated">
+ <%-- Login tab --%>
+ <wiki:Tab id="login" titleKey="login.tab">
+ <div class="formcontainer">
+ <s:form action="<%=postURL%>" id="login" class="wikiform" acceptcharset="UTF-8">
+ <s:param name="tab" value="login" />
+ <h3>
+ <fmt:message key="login.heading.login">
+ <fmt:param><wiki:Variable var="applicationname" /></fmt:param>
+ </fmt:message>
+ </h3>
+
+ <%-- Global form errors and messages --%>
+ <div class="formhelp"><fmt:message key="login.help"></fmt:message></div>
+ <div class="instructions"><s:messages key="login" /></div>
+ <div class="errors"><s:errors beanclass="org.apache.wiki.action.LoginActionBean" /></div>
+
+ <%-- Username --%>
+ <div>
+ <s:label for="j_username" name="loginName" />
+ <s:text size="24" name="j_username" id="j_username"><wiki:Variable var="uid" default="" /></s:text>
+ </div>
+
+ <%-- Password --%>
+ <div>
+ <s:label for="j_password" name="password" />
+ <s:password size="24" name="j_password" id="j_password" />
+ </div>
+ <c:if test="${wikiEngine.authenticationManager.cookieAuthenticated}">
+ <div>
+ <s:label for="remember" />
+ <s:checkbox name="remember" id="j_remember" />
+ </div>
+ </c:if>
+
+ <%-- Login submit button --%>
+ <div class="description"><s:submit name="login" /></div>
+
+ <%-- Help --%>
+ <div class="formhelp">
+ <fmt:message key="login.lostpw" />
+ <s:link beanclass="org.apache.wiki.action.LostPasswordActionBean">
+ <fmt:message key="login.lostpw.getnew" />
+ </s:link>
+ </div>
+ <div class="formhelp">
+ <fmt:message key="login.nopassword" />
+ <s:link beanclass="org.apache.wiki.action.UserProfileActionBean" event="create">
+ <fmt:message key="login.registernow">
+ <fmt:param><wiki:Variable var="applicationname" /></fmt:param>
+ </fmt:message>
+ </s:link>
+ </div>
+ </s:form>
+ </div>
+ </wiki:Tab>
+ </wiki:UserCheck>
+
+ <%-- Lost password tab --%>
+ <wiki:Tab id="reset" titleKey="login.lostpw.tab">
+ <div class="formcontainer">
+ <s:form beanclass="org.apache.wiki.action.LostPasswordActionBean" id="lostpw" class="wikiform" acceptcharset="UTF-8">
+ <s:param name="tab" value="reset" />
+ <h3><fmt:message key="login.lostpw.heading" /></h3>
+
+ <%-- Global form errors and messages --%>
+ <div class="formhelp"><fmt:message key="login.lostpw.help"></fmt:message></div>
+ <div class="instructions"><s:messages key="reset" /></div>
+ <div class="errors"><s:errors beanclass="org.apache.wiki.action.LostPasswordActionBean"/></div>
+
+ <%-- E-mail --%>
+ <div>
+ <s:label for="email" />
+ <s:text size="24" name="email" id="email" />
+ <s:errors field="email" />
+ </div>
+
+ <%-- Reset submit button --%>
+ <s:submit name="reset" />
+
+ <%-- Help --%>
+ <div class="formhelp">
+ <fmt:message key="login.invite" />
+ <s:link beanclass="org.apache.wiki.action.UserProfileActionBean" event="create">
+ <fmt:message key="login.heading.login">
+ <fmt:param><wiki:Variable var="applicationname" /></fmt:param>
+ </fmt:message>
+ </s:link>
+ </div>
+ <div class="formhelp">
+ <fmt:message key="login.nopassword" />
+ <s:link beanclass="org.apache.wiki.action.LostPasswordActionBean">
+ <s:param name="tab" value="reset" />
+ <fmt:message key="login.registernow">
+ <fmt:param><wiki:Variable var="applicationname" /></fmt:param>
+ </fmt:message>
+ </s:link>
+ </div>
+ </s:form>
+ </div>
+ </wiki:Tab>
+
+ <%-- New user tab --%>
+ <wiki:Permission permission="editProfile">
+ <wiki:Tab id="profile" titleKey="login.register.tab"
+ beanclass="org.apache.wiki.action.UserProfileActionBean" event="create" />
+ </wiki:Permission>
+
+ <%-- Help tab --%>
+ <wiki:Tab id="help" titleKey="login.tab.help">
+ <wiki:InsertPage page="LoginHelp" />
+ <wiki:NoSuchPage page="LoginHelp">
+ <div class="error">
+ <fmt:message key="login.loginhelpmissing">
+ <fmt:param><wiki:EditLink page="LoginHelp">LoginHelp</wiki:EditLink></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:NoSuchPage>
+ </wiki:Tab>
+
+ </wiki:TabbedSection>
+ </s:layout-component>
+</s:layout-render>
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsTop.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsTop.jsp?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsTop.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/PageActionsTop.jsp Wed Feb 3 05:27:01 2010
@@ -28,16 +28,6 @@
<wiki:CheckRequestContext context='view|info|diff|upload|rename'>
<wiki:Permission permission="edit">
<li>
- <wiki:PageType type="page">
- <c:set var="editTitle"><fmt:message key="actions.edit.title" /></c:set>
- <s:link
- beanclass="org.apache.wiki.action.EditActionBean" event="edit"
- accesskey="e" class="action edit"
- title="${editTitle}">
- <fmt:message key='actions.edit' />
- <s:param name="page" value="${wikiContext.page.name}" />
- </s:link>
- </wiki:PageType>
<wiki:PageType type="attachment">
<c:set var="editParentTitle"><fmt:message key="actions.editparent.title" /></c:set>
<s:link
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfo.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfo.jsp?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfo.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/PageInfo.jsp Wed Feb 3 05:27:01 2010
@@ -18,16 +18,14 @@
specific language governing permissions and limitations
under the License.
--%>
-<%@ 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" %>
<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
<s:layout-render name="${templates['DefaultLayout.jsp']}">
<s:layout-component name="content">
- <wiki:TabbedSection defaultTab="info">
+ <wiki:TabbedSection defaultTab="${param.tab}">
<wiki:NoSuchPage>
- <wiki:Tab id="info" titleKey="info.tab" accesskey="i">
+ <wiki:Tab id="${param.tab}" titleKey="info.tab" accesskey="i">
<fmt:message key="common.nopage">
<fmt:param><wiki:EditLink><fmt:message key="common.createit" /></wiki:EditLink></fmt:param>
</fmt:message>
@@ -36,21 +34,65 @@
<wiki:PageExists>
- <%-- Content tab --%>
- <wiki:Tab id="pagecontent" titleKey="view.tab" accesskey="v" beanclass="org.apache.wiki.action.ViewActionBean" event="view">
+ <%-- View tab --%>
+ <wiki:Tab id="view" titleKey="view.tab" accesskey="v"
+ beanclass="org.apache.wiki.action.ViewActionBean" event="view">
<wiki:Param name="page" value="${wikiActionBean.page.name}" />
</wiki:Tab>
-
+
+ <%-- Edit tab --%>
+ <wiki:Permission permission="edit">
+ <wiki:Tab id="edit" titleKey="edit.tab.edit" accesskey="e"
+ beanclass="org.apache.wiki.action.EditActionBean" event="edit">
+ <wiki:Param name="page" value="${wikiActionBean.page.name}" />
+ </wiki:Tab>
+ </wiki:Permission>
+
<%-- Attachments tab --%>
- <wiki:Tab id="attach" accesskey="a"
- title="${wiki:attachmentsTitle(request.Locale, wikiActionBean.attachments)}"
- beanclass="org.apache.wiki.action.ViewActionBean" event="attachments">
- <wiki:Param name="page" value="${wikiActionBean.page.name}" />
+ <wiki:Tab id="attachments" accesskey="a"
+ title="${wiki:attachmentsTitle(request.Locale, wikiActionBean.attachments)}">
+ <%-- Add attachments --%>
+ <div id="addattachment">
+ <h3><fmt:message key="attach.add" /></h3>
+ <wiki:Permission permission="upload">
+ <s:form beanclass="org.apache.wiki.action.AttachmentActionBean" class="wikiform" id="uploadform" acceptcharset="UTF-8">
+ <s:param name="progressid" value="${wikiEngine.progressManager.newProgressIdentifier}" />
+ <s:param name="page" value="${wikiActionBean.page.name}" />
+ <table>
+ <tr>
+ <td colspan="2"><div class="formhelp"><fmt:message key="attach.add.info" /></div></td>
+ </tr>
+ <tr>
+ <td colspan="2"><s:errors field="newAttachments" /></td>
+ </tr>
+ <tr>
+ <td><s:label for="attachfile0" name="attach.add.selectfile" /></td>
+ <td><s:file name="newAttachments[0]" id="attachfile0" /><br/>
+ <s:file name="newAttachments[1]" id="attachfile1" /><br/>
+ <s:file name="newAttachments[2]" id="attachfile2" /></td>
+ </tr>
+ <tr>
+ <td><s:label for="attachnote" name="attach.add.changenote" /></td>
+ <td><s:text name="changenote" id="attachnote" maxlength="80" size="60" /></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <s:submit name="upload" id="upload" />
+ <div id="progressbar"><div class="ajaxprogress"></div></div>
+ </td>
+ </tr>
+ </table>
+ </s:form>
+ </wiki:Permission>
+ </div>
+ <%-- Existing attachments --%>
+ <jsp:include page="${templates['tabs/AttachmentsTab.jsp']}" />
</wiki:Tab>
-
+
<%-- Info tab --%>
<wiki:Tab id="info" titleKey="info.tab" accesskey="i">
-
+
<%-- Rename page --%>
<wiki:Permission permission="rename">
<s:form beanclass="org.apache.wiki.action.RenameActionBean" class="wikiform" id="renameform" method="post" acceptcharset="UTF-8" >
@@ -64,7 +106,7 @@
</p>
</s:form>
</wiki:Permission>
-
+
<%-- Delete page --%>
<wiki:Permission permission="delete">
<s:form beanclass="org.apache.wiki.action.DeleteActionBean" class="wikiform" id="deleteForm" method="post" acceptcharset="UTF-8">
@@ -74,117 +116,12 @@
</p>
</s:form>
</wiki:Permission>
-
- <%-- Referring pages --%>
- <div class='line'>
- <div class="collapsebox-closed unit size1of2" id="incomingLinks">
- <h4><fmt:message key="info.tab.incoming" /></h4>
- <wiki:Plugin plugin="ReferringPagesPlugin" args="before='*' after='\n' " />
- </div>
- <div class="collapsebox-closed lastUnit size1of2 " id="outgoingLinks">
- <h4><fmt:message key="info.tab.outgoing" /></h4>
- <wiki:Plugin plugin="ReferredPagesPlugin" args="depth='1' type='local'" />
- </div>
- </div>
-
- <%-- Diff page versions --%>
- <wiki:CheckRequestContext context="diff">
- <s:form beanclass="org.apache.wiki.action.DiffActionBean" method="get" acceptcharset="UTF-8">
- <div class="collapsebox" id="diffcontent">
- <h4>
- <s:hidden name="page" />
- <fmt:message key="diff.difference">
- <fmt:param>
- <s:select id="r1" name="r1" value="${wikiActionBean.r1}" onchange="this.form.submit();">
- <s:options-collection collection="${wikiActionBean.history}" value="version" label="version" />
- </s:select>
- </fmt:param>
- <fmt:param>
- <s:select id="r2" name="r2" value="${wikiActionBean.r2}" onchange="this.form.submit();">
- <s:options-collection collection="${wikiActionBean.history}" value="version" label="version" />
- </s:select>
- </fmt:param>
- </fmt:message>
- </h4>
- <c:if test='${diffprovider eq "ContextualDiffProvider"}'>
- <div class="diffnote">
- <a href="#change-1" title="<fmt:message key='diff.gotofirst.title' />" class="diff-nextprev">
- <fmt:message key="diff.gotofirst" />
- </a>»»
- </div>
- </c:if>
- <div class="diffbody">
- <wiki:InsertDiff><i><fmt:message key="diff.nodiff" /></i></wiki:InsertDiff>
- </div>
- </div>
- </s:form>
- </wiki:CheckRequestContext>
-
- <%-- Previous versions --%>
- <wiki:CheckVersion mode="notfirst">
- <c:if test="${fn:length(wikiActionBean.history) > 1}">
- <div class="zebra-table sortable">
- <table class="wikitable">
- <tr>
- <th><fmt:message key="info.version" /></th>
- <th><fmt:message key="info.date" /></th>
- <th><fmt:message key="info.size" /></th>
- <th><fmt:message key="info.author" /></th>
- <th><fmt:message key="info.changes" /></th>
- <th class='changenote'><fmt:message key="info.changenote" /></th>
- </tr>
- <c:forEach var="page" items="${wikiActionBean.history}">
- <tr>
- <td>
- <s:link beanclass="org.apache.wiki.action.ViewActionBean" event="view">
- <s:param name="page" value="${page.name}" />
- <s:param name="version" value="${page.version}" />
- ${page.version}
- </s:link>
- </td>
-
- <td>
- <fmt:formatDate value="${page.lastModified}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
- </td>
-
- <td style="white-space:nowrap;text-align:right;">
- <c:set var="ff"><wiki:PageSize/></c:set>
- <fmt:formatNumber value='${ff/1000}' maxFractionDigits='3' minFractionDigits='1' /> <fmt:message key="info.kilobytes" />
- </td>
-
- <td>${page.author}</td>
-
- <td>
- <c:if test="${page.version > 1}">
- <s:link beanclass="org.apache.wiki.action.DiffActionBean" event="diff">
- <s:param name="page" value="${page.name}" />
- <s:param name="r1" value="${page.version}" />
- <s:param name="r2" value="${page.version - 1}" />
- <fmt:message key="info.difftoprev" />
- </s:link>
- </c:if>
- <c:if test="${page.version < wikiActionBean.page.version}">
- <s:link beanclass="org.apache.wiki.action.DiffActionBean" event="diff">
- <s:param name="page" value="${page.name}" />
- <s:param name="r1" value="${page.version}" />
- <s:param name="r2" value="${wikiActionBean.page.version}" />
- <fmt:message key="info.difftolast" />
- </s:link>
- </c:if>
- </td>
-
- <td class="changenote">${page.changeNote}</td>
- </tr>
- </c:forEach>
- </table>
- </div>
- </c:if>
- </wiki:CheckVersion>
- </wiki:Tab>
+ <%-- Referring pages, previous versions --%>
+ <jsp:include page="${'tabs/PageInfoTab.jsp'}" />
+ </wiki:Tab>
</wiki:PageExists>
-
</wiki:TabbedSection>
</s:layout-component>
</s:layout-render>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/Preferences.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Preferences.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Preferences.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Preferences.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,169 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ 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" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<%@ page errorPage="/Error.jsp" %>
+<s:layout-render name="${templates['DefaultLayout.jsp']}">
+
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url' jsp='scripts/jspwiki-prefs.js' />"></script>
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <wiki:TabbedSection defaultTab="${param.tab}">
+
+ <%-- Preferences tab --%>
+ <wiki:Tab id="prefs" titleKey="prefs.tab.prefs" accesskey="p">
+ <h3><fmt:message key="prefs.heading"><fmt:param><wiki:Variable var="applicationname" /></fmt:param></fmt:message></h3>
+ <!-- Any messages or errors? -->
+ <div class="instructions"><s:messages key="prefs" /></div>
+ <div class="errors"><s:errors beanclass="org.apache.wiki.action.UserPreferencesActionBean" globalErrorsOnly="true" /></div>
+
+ <div class="formcontainer">
+ <s:form beanclass="org.apache.wiki.action.UserPreferencesActionBean"
+ class="wikiform" id="setCookie" method="post" acceptcharset="UTF-8">
+ <s:param name="tab" value="prefs" />
+
+ <%-- Asserted name --%>
+ <wiki:UserCheck status="notauthenticated">
+ <div>
+ <s:label for="assertedName" />
+ <s:text id="assertedName" name="assertedName" size="20"><wiki:UserProfile property='wikiname' /></s:text>
+ <s:errors field="assertedName" />
+ <div class="description">
+ <fmt:message key="prefs.assertedname.description">
+ <fmt:param><wiki:Variable var="applicationname" /></fmt:param>
+ <fmt:param>
+ <a href="<wiki:Link jsp='Login.jsp' format='url'></wiki:Link>">
+ <fmt:message key="prefs.assertedname.create" />
+ </a>
+ </fmt:param>
+ </fmt:message>
+ </div>
+ </div>
+ </wiki:UserCheck>
+
+ <%-- Editor --%>
+ <div>
+ <s:label for="editor" />
+ <select id="editor" name="editor">
+ <wiki:EditorIterator id="edt">
+ <option <%=edt.isSelected()%> value="<%=edt.getName()%>"><%=edt.getName()%></option>
+ </wiki:EditorIterator>
+ </select>
+ <s:errors field="editor" />
+ </div>
+
+ <%-- Section editing --%>
+ <div>
+ <s:label for="sectionEditing" />
+ <s:checkbox id="sectionEditing" name="sectionEditing" /> <fmt:message key="prefs.user.sectionediting.text" />
+ <s:errors field="sectionEditing" />
+ </div>
+
+ <%-- Skin --%>
+ <div>
+ <s:label for="skin" />
+ <s:select id="skin" name="skin">
+ <s:options-collection collection="${skins}" />
+ </s:select>
+ <s:errors field="skin" />
+ </div>
+
+ <%-- Locale --%>
+ <c:if test='${not empty locales}'>
+ <div>
+ <s:label for="locale" />
+ <s:select name="locale">
+ <s:options-map map="${locales}" />
+ </s:select>
+ <s:errors field="locale" />
+ </div>
+ </c:if>
+
+ <%-- Orientation --%>
+ <div>
+ <s:label for="orientation" />
+ <s:select id="orientation" name="orientation">
+ <s:options-enumeration enum="org.apache.wiki.preferences.Preferences.Orientation" label="name" />
+ </s:select>
+ <s:errors field="orientation" />
+ </div>
+
+ <%-- Time format --%>
+ <div>
+ <s:label for="timeFormat" />
+ <s:select id="timeFormat" name="timeFormat">
+ <s:options-map map="${timeformats}" />
+ </s:select>
+ <s:errors field="timeFormat" />
+ </div>
+
+ <%-- Time zone --%>
+ <div>
+ <s:label for="timeZone" />
+ <s:select id="timeZone" name="timeZone">
+ <s:options-map map="${timezones}" />
+ </s:select>
+ <s:errors field="timeZone" />
+ </div>
+
+ <%-- Save user preferences --%>
+ <s:submit name="save" accesskey="s" />
+ <div class="formhelp">
+ <fmt:message key='prefs.cookies' />
+ </div>
+
+ </s:form>
+ </div>
+
+ <%-- Clearing the 'asserted name' and other prefs in the cookie --%>
+ <h3><fmt:message key='prefs.clear.heading' /></h3>
+ <div class="formcontainer">
+ <s:form beanclass="org.apache.wiki.action.UserPreferencesActionBean"
+ id="clearCookie"
+ method="post"
+ acceptcharset="UTF-8">
+ <div>
+ <s:submit name="clearAssertedName" />
+ </div>
+ <div class="formhelp"><fmt:message key="prefs.clear.description" /></div>
+ </s:form>
+ </div>
+ </wiki:Tab>
+
+ <%-- Profile tab --%>
+ <wiki:UserCheck status="authenticated">
+ <wiki:Tab id="profile" titleKey="prefs.tab.profile" accesskey="o">
+ <wiki:Permission permission="editProfile">
+ <jsp:include page="${templates['tabs/ProfileTab.jsp']}" />
+ </wiki:Permission>
+ </wiki:Tab>
+ </wiki:UserCheck>
+
+ </wiki:TabbedSection>
+ </s:layout-component>
+
+</s:layout-render>
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/Wiki.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Wiki.jsp?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Wiki.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Wiki.jsp Wed Feb 3 05:27:01 2010
@@ -53,10 +53,10 @@
</wiki:CheckVersion>
<s:layout-component name="content">
- <wiki:TabbedSection defaultTab="pagecontent">
+ <wiki:TabbedSection defaultTab="view">
<wiki:NoSuchPage>
- <wiki:Tab id="pagecontent" titleKey="view.tab" accesskey="v">
+ <wiki:Tab id="view" titleKey="view.tab" accesskey="v">
<fmt:message key="common.nopage">
<fmt:param><wiki:EditLink><fmt:message key="common.createit" /></wiki:EditLink></fmt:param>
</fmt:message>
@@ -65,8 +65,8 @@
<wiki:PageExists>
- <%-- Content tab --%>
- <wiki:Tab id="pagecontent" titleKey="view.tab" accesskey="v">
+ <%-- View tab --%>
+ <wiki:Tab id="view" titleKey="view.tab" accesskey="v">
<%-- 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">
@@ -131,15 +131,24 @@
</wiki:PageType>
</wiki:Tab>
+ <%-- Edit tab --%>
+ <wiki:Permission permission="edit">
+ <wiki:Tab id="edit" titleKey="edit.tab.edit" accesskey="e"
+ beanclass="org.apache.wiki.action.EditActionBean" event="edit">
+ <wiki:Param name="page" value="${wikiActionBean.page.name}" />
+ </wiki:Tab>
+ </wiki:Permission>
+
<%-- Attachments tab --%>
- <wiki:Tab id="attach" accesskey="a"
+ <wiki:Tab id="attachments" accesskey="a"
title="${wiki:attachmentsTitle(request.Locale, wikiActionBean.attachments)}"
beanclass="org.apache.wiki.action.ViewActionBean" event="attachments">
<wiki:Param name="page" value="${wikiActionBean.page.name}" />
</wiki:Tab>
<%-- Info tab --%>
- <wiki:Tab id="info" titleKey="info.tab" accesskey="i" beanclass="org.apache.wiki.action.ViewActionBean" event="info">
+ <wiki:Tab id="info" titleKey="info.tab" accesskey="i"
+ beanclass="org.apache.wiki.action.ViewActionBean" event="info">
<wiki:Param name="page" value="${wikiActionBean.page.name}" />
</wiki:Tab>
</wiki:PageExists>
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp Wed Feb 3 05:27:01 2010
@@ -18,11 +18,10 @@
specific language governing permissions and limitations
under the License.
--%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ 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://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
-<%@ page import="org.apache.wiki.util.TextUtil" %>
<%--
This is a plain editor for JSPWiki.
--%>
@@ -38,80 +37,71 @@
<%-- Toolbar --%>
<div id="toolbar" class="line">
- <div id="configDialog" style="display:none;">
- <s:checkbox name="options.tabCompletion" id="tabCompletion" /><fmt:message key="editor.plain.tabcompletion"/>
- <br />
- <s:checkbox name="options.smartPairs" id="smartPairs" /><fmt:message key="editor.plain.smartpairs"/>
- </div>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.action'/></legend>
- <a href="#" class="tool tUNDO" title="<fmt:message key='editor.plain.undo.title'/>">undo</a>
- <a href="#" class="tool tREDO" title="<fmt:message key='editor.plain.redo.title'/>">redo</a>
- <a href="#" class="tool tSEARCH" title="<fmt:message key='editor.plain.find.title'/>">find</a>
- <a href="#" class="tool tCONFIG" title="<fmt:message key='editor.plain.config.title'/>">config</a>
- </fieldset>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.insert'/></legend>
- <a href="#" class="tool tLink" title="<fmt:message key='editor.plain.tbLink.title'/>">link</a>
- <a href="#" class="tool tH1" title="<fmt:message key='editor.plain.tbH1.title'/>">h1</a>
- <a href="#" class="tool tH2" title="<fmt:message key='editor.plain.tbH2.title'/>">h2</a>
- <a href="#" class="tool tH3" title="<fmt:message key='editor.plain.tbH3.title'/>">h3</a>
- <a href="#" class="tool tPRE" title="<fmt:message key='editor.plain.tbPRE.title'/>">pre</a>
- <a href="#" class="tool tHR" title="<fmt:message key='editor.plain.tbHR.title'/>">hr</a>
- <a href="#" class="tool tBR" title="<fmt:message key='editor.plain.tbBR.title'/>">br</a>
- <a href="#" class="tool tCHAR" title="<fmt:message key='editor.plain.tbCHAR.title'/>">special</a>
- </fieldset>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.style'/></legend>
- <a href="#" class="tool tB" title="<fmt:message key='editor.plain.tbB.title'/>">bold</a>
- <a href="#" class="tool tI" title="<fmt:message key='editor.plain.tbI.title'/>">italic</a>
- <a href="#" class="tool tMONO" title="<fmt:message key='editor.plain.tbMONO.title'/>">mono</a>
- <a href="#" class="tool tCSS" title="<fmt:message key='editor.plain.tbCSS.title'/>">%%</a>
- <a href="#" class="tool tFONT" title="<fmt:message key='editor.plain.tbFONT.title'/>">font</a>
- <a href="#" class="tool tCOLOR" title="<fmt:message key='editor.plain.tbCOLOR.title'/>">color</a>
- <!--
- <a href="#" class="tool tSUP" title="<fmt:message key='editor.plain.tbSUP.title'/>">sup</a>
- <a href="#" class="tool tSUB" title="<fmt:message key='editor.plain.tbSUB.title'/>">sub</a>
- <a href="#" class="tool tSTRIKE" title="<fmt:message key='editor.plain.tbSTRIKE.title'/>">strike</a>
- -->
- </fieldset>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.extra'/></legend>
- <a href="#" class="tool tACL" title="<fmt:message key='editor.plain.tbACL.title'/>">acl</a>
- <a href="#" class="tool tIMG" title="<fmt:message key='editor.plain.tbIMG.title'/>">img</a>
- <a href="#" class="tool tTABLE" title="<fmt:message key='editor.plain.tbTABLE.title'/>">table</a>
- <a href="#" class="tool tPLUGIN" title="<fmt:message key='editor.plain.tbPLUGIN.title'/>">plugin</a>
- <%--
- <a href="#" class="tool tTOC" title="<fmt:message key='editor.plain.tbTOC.title'/>">toc</a>
- --%>
- <a href="#" class="tool tDL" title="<fmt:message key='editor.plain.tbDL.title'/>">dl</a>
- <a href="#" class="tool tCODE" title="<fmt:message key='editor.plain.tbCODE.title'/>">code</a>
- <a href="#" class="tool tTAB" title="<fmt:message key='editor.plain.tbTAB.title'/>">tab</a>
- <a href="#" class="tool tSIGN" title="<fmt:message key='editor.plain.tbSIGN.title'/>">sign</a>
- <%-- --%>
- </fieldset>
-
- <fieldset class="unit lastUnit">
- <legend><fmt:message key="editor.plain.livepreview"/></legend>
-
- <a href="#" class="tool tHORZ" title="<fmt:message key='editor.plain.tbHORZ.title'/>">tile-horz</a>
- <a href="#" class="tool tVERT" title="<fmt:message key='editor.plain.tbVERT.title'/>">tile-vert</a>
- <s:label for="options.livePreview" title="<fmt:message key='editor.plain.livepreview.title'/>" />
- <s:checkbox name="options.livePreview" />On
- </fieldset>
-
- <div id="findDialog" style="display:none;clear:both;">
- <input type="text" name="tbFIND" id="tbFIND" size="16" value="find"/>
- <s:checkbox name="options.findMatchCase" /><fmt:message key="editor.plain.matchcase"/>
- <s:checkbox name="options.findRegex" /><fmt:message key="editor.plain.regexp"/>
- <input type="text" name="tbREPLACE" id="tbREPLACE" size="16" />
- <s:button class="btn" id="doreplace" name="findAndReplace" />
- <s:checkbox name="options.findGlobal" /><fmt:message key="editor.plain.global"/>
- </div>
+ <div id="configDialog" style="display:none;">
+ <s:checkbox name="options.tabCompletion" id="tabCompletion" /><fmt:message key="editor.plain.tabcompletion"/>
+ <br />
+ <s:checkbox name="options.smartPairs" id="smartPairs" /><fmt:message key="editor.plain.smartpairs"/>
+ </div>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.action'/></legend>
+ <a href="#" class="tool tUNDO" title="<fmt:message key='editor.plain.undo.title'/>">undo</a>
+ <a href="#" class="tool tREDO" title="<fmt:message key='editor.plain.redo.title'/>">redo</a>
+ <a href="#" class="tool tSEARCH" title="<fmt:message key='editor.plain.find.title'/>">find</a>
+ <a href="#" class="tool tCONFIG" title="<fmt:message key='editor.plain.config.title'/>">config</a>
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.insert'/></legend>
+ <a href="#" class="tool tLink" title="<fmt:message key='editor.plain.tbLink.title'/>">link</a>
+ <a href="#" class="tool tH1" title="<fmt:message key='editor.plain.tbH1.title'/>">h1</a>
+ <a href="#" class="tool tH2" title="<fmt:message key='editor.plain.tbH2.title'/>">h2</a>
+ <a href="#" class="tool tH3" title="<fmt:message key='editor.plain.tbH3.title'/>">h3</a>
+ <a href="#" class="tool tPRE" title="<fmt:message key='editor.plain.tbPRE.title'/>">pre</a>
+ <a href="#" class="tool tHR" title="<fmt:message key='editor.plain.tbHR.title'/>">hr</a>
+ <a href="#" class="tool tBR" title="<fmt:message key='editor.plain.tbBR.title'/>">br</a>
+ <a href="#" class="tool tCHAR" title="<fmt:message key='editor.plain.tbCHAR.title'/>">special</a>
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.style'/></legend>
+ <a href="#" class="tool tB" title="<fmt:message key='editor.plain.tbB.title'/>">bold</a>
+ <a href="#" class="tool tI" title="<fmt:message key='editor.plain.tbI.title'/>">italic</a>
+ <a href="#" class="tool tMONO" title="<fmt:message key='editor.plain.tbMONO.title'/>">mono</a>
+ <a href="#" class="tool tCSS" title="<fmt:message key='editor.plain.tbCSS.title'/>">%%</a>
+ <a href="#" class="tool tFONT" title="<fmt:message key='editor.plain.tbFONT.title'/>">font</a>
+ <a href="#" class="tool tCOLOR" title="<fmt:message key='editor.plain.tbCOLOR.title'/>">color</a>
+ <!--
+ <a href="#" class="tool tSUP" title="<fmt:message key='editor.plain.tbSUP.title'/>">sup</a>
+ <a href="#" class="tool tSUB" title="<fmt:message key='editor.plain.tbSUB.title'/>">sub</a>
+ <a href="#" class="tool tSTRIKE" title="<fmt:message key='editor.plain.tbSTRIKE.title'/>">strike</a>
+ -->
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.extra'/></legend>
+ <a href="#" class="tool tACL" title="<fmt:message key='editor.plain.tbACL.title'/>">acl</a>
+ <a href="#" class="tool tIMG" title="<fmt:message key='editor.plain.tbIMG.title'/>">img</a>
+ <a href="#" class="tool tTABLE" title="<fmt:message key='editor.plain.tbTABLE.title'/>">table</a>
+ <a href="#" class="tool tPLUGIN" title="<fmt:message key='editor.plain.tbPLUGIN.title'/>">plugin</a>
+ <%--
+ <a href="#" class="tool tTOC" title="<fmt:message key='editor.plain.tbTOC.title'/>">toc</a>
+ --%>
+ <a href="#" class="tool tDL" title="<fmt:message key='editor.plain.tbDL.title'/>">dl</a>
+ <a href="#" class="tool tCODE" title="<fmt:message key='editor.plain.tbCODE.title'/>">code</a>
+ <a href="#" class="tool tTAB" title="<fmt:message key='editor.plain.tbTAB.title'/>">tab</a>
+ <a href="#" class="tool tSIGN" title="<fmt:message key='editor.plain.tbSIGN.title'/>">sign</a>
+ <%-- --%>
+ </fieldset>
+
+ <div id="findDialog" style="display:none;clear:both;">
+ <input type="text" name="tbFIND" id="tbFIND" size="16" value="find"/>
+ <s:checkbox name="options.findMatchCase" /><fmt:message key="editor.plain.matchcase"/>
+ <s:checkbox name="options.findRegex" /><fmt:message key="editor.plain.regexp"/>
+ <input type="text" name="tbREPLACE" id="tbREPLACE" size="16" />
+ <s:button class="btn" id="doreplace" name="findAndReplace" />
+ <s:checkbox name="options.findGlobal" /><fmt:message key="editor.plain.global"/>
+ </div>
</div><%-- end of the toolbar --%>
@@ -182,12 +172,8 @@
<s:hidden name="page" />
<s:hidden name="startTime" />
<s:hidden name="append" />
- <c:set var="saveTitle" scope="page"><fmt:message key="editor.plain.save.title" /></c:set>
- <s:submit name="save" accesskey="s" title="${saveTitle}" />
- <c:set var="previewTitle" scope="page"><fmt:message key="editor.plain.preview.title" /></c:set>
- <s:submit name="preview" accesskey="v" title="${previewTitle}" />
- <c:set var="cancelTitle" scope="page"><fmt:message key="editor.plain.cancel.title" /></c:set>
- <s:submit name="cancel" accesskey="q" title="${cancelTitle}" />
+ <s:submit name="save" />
+ <s:submit name="cancel" />
</p>
</s:form>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/AttachmentsTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/AttachmentsTab.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/AttachmentsTab.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/AttachmentsTab.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,86 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ 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" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page errorPage="/Error.jsp" %>
+<%-- Show existing attachments --%>
+<wiki:HasAttachments>
+ <h3><fmt:message key="attach.list" /></h3>
+ <div class="zebra-table">
+ <div class="slimbox-img sortable">
+ <table class="wikitable">
+ <tr>
+ <th><fmt:message key="info.attachment.type" /></th>
+ <th><fmt:message key="info.attachment.name" /></th>
+ <th><fmt:message key="info.size" /></th>
+ <th><fmt:message key="info.version" /></th>
+ <th><fmt:message key="info.date" /></th>
+ <th><fmt:message key="info.author" /></th>
+ <wiki:Permission permission="delete"><th><fmt:message key="info.actions" /></th></wiki:Permission>
+ <th class="changenote"><fmt:message key="info.changenote" /></th>
+ </tr>
+
+ <c:forEach var="att" items="${wikiActionBean.attachments}" >
+ <tr>
+ <%-- The 'title' attribute is used to sort empty cells --%>
+ <td title="${att.contentType}">
+ <div class="${fn:replace(att.contentType,'/','-')}"> </div>
+ </td>
+ <td title="${att.name}">
+ <s:link beanclass="org.apache.wiki.action.AttachmentActionBean" event="download">
+ <s:param name="page" value="${att.path}" />
+ ${wiki:shorten(att.name,30)}
+ </s:link>
+ </td>
+ <td style="white-space:nowrap;text-align:right;">
+ <fmt:formatNumber value="${att.size div 1000}" maxFractionDigits="1" minFractionDigits="1" /> <fmt:message key="info.kilobytes" />
+ </td>
+ <c:set var="attTitle"><fmt:message key="attach.moreinfo.title" /></c:set>
+ <td style="text-align:center;">
+ <s:link beanclass="org.apache.wiki.action.ViewActionBean" event="info" title="${attTitle}">
+ <s:param name="page" value="${att.path}" />
+ ${att.version}
+ </s:link>
+ </td>
+ <td jspwiki:sortvalue="${wiki:iso8601date(att.lastModified)}">
+ <fmt:formatDate value="${att.lastModified}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
+ </td>
+ <td style="white-space:nowrap;" ><wiki:Author/></td>
+ <wiki:Permission permission="delete">
+ <td>
+ <s:form beanclass="org.apache.wiki.action.DeleteActionBean">
+ <s:param name="page" value="${att.path}" />
+ <s:submit name="delete"><fmt:message key="attach.delete" /></s:submit>
+ </s:form>
+ </td>
+ </wiki:Permission>
+ <td class="changenote"><c:out value="${att.changeNote}"/></td>
+ </tr>
+ </c:forEach>
+
+ </table>
+ </div>
+ </div>
+
+</wiki:HasAttachments>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/PageInfoTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/PageInfoTab.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/PageInfoTab.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/PageInfoTab.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,132 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ 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" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+
+<%-- Referring pages --%>
+<div class='line'>
+ <div class="collapsebox-closed unit size1of2" id="incomingLinks">
+ <h4><fmt:message key="info.tab.incoming" /></h4>
+ <wiki:Plugin plugin="ReferringPagesPlugin" args="before='*' after='\n' " />
+ </div>
+ <div class="collapsebox-closed lastUnit size1of2 " id="outgoingLinks">
+ <h4><fmt:message key="info.tab.outgoing" /></h4>
+ <wiki:Plugin plugin="ReferredPagesPlugin" args="depth='1' type='local'" />
+ </div>
+</div>
+
+<%-- Diff page versions --%>
+<wiki:CheckRequestContext context="diff">
+ <s:form beanclass="org.apache.wiki.action.DiffActionBean" method="get" acceptcharset="UTF-8">
+ <div class="collapsebox" id="diffcontent">
+ <h4>
+ <s:hidden name="page" />
+ <fmt:message key="diff.difference">
+ <fmt:param>
+ <s:select id="r1" name="r1" value="${wikiActionBean.r1}" onchange="this.form.submit();">
+ <s:options-collection collection="${wikiActionBean.history}" value="version" label="version" />
+ </s:select>
+ </fmt:param>
+ <fmt:param>
+ <s:select id="r2" name="r2" value="${wikiActionBean.r2}" onchange="this.form.submit();">
+ <s:options-collection collection="${wikiActionBean.history}" value="version" label="version" />
+ </s:select>
+ </fmt:param>
+ </fmt:message>
+ </h4>
+ <c:if test='${diffprovider eq "ContextualDiffProvider"}'>
+ <div class="diffnote">
+ <a href="#change-1" title="<fmt:message key='diff.gotofirst.title' />" class="diff-nextprev">
+ <fmt:message key="diff.gotofirst" />
+ </a>»»
+ </div>
+ </c:if>
+ <div class="diffbody">
+ <wiki:InsertDiff><i><fmt:message key="diff.nodiff" /></i></wiki:InsertDiff>
+ </div>
+ </div>
+ </s:form>
+</wiki:CheckRequestContext>
+
+<%-- Previous versions --%>
+<wiki:CheckVersion mode="notfirst">
+ <c:if test="${fn:length(wikiActionBean.history) > 1}">
+ <div class="zebra-table sortable">
+ <table class="wikitable">
+ <tr>
+ <th><fmt:message key="info.version" /></th>
+ <th><fmt:message key="info.date" /></th>
+ <th><fmt:message key="info.size" /></th>
+ <th><fmt:message key="info.author" /></th>
+ <th><fmt:message key="info.changes" /></th>
+ <th class='changenote'><fmt:message key="info.changenote" /></th>
+ </tr>
+ <c:forEach var="page" items="${wikiActionBean.history}">
+ <tr>
+ <td>
+ <s:link beanclass="org.apache.wiki.action.ViewActionBean" event="view">
+ <s:param name="page" value="${page.name}" />
+ <s:param name="version" value="${page.version}" />
+ ${page.version}
+ </s:link>
+ </td>
+
+ <td>
+ <fmt:formatDate value="${page.lastModified}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
+ </td>
+
+ <td style="white-space:nowrap;text-align:right;">
+ <c:set var="ff"><wiki:PageSize/></c:set>
+ <fmt:formatNumber value='${ff/1000}' maxFractionDigits='3' minFractionDigits='1' /> <fmt:message key="info.kilobytes" />
+ </td>
+
+ <td>${page.author}</td>
+
+ <td>
+ <c:if test="${page.version > 1}">
+ <s:link beanclass="org.apache.wiki.action.DiffActionBean" event="diff">
+ <s:param name="page" value="${page.name}" />
+ <s:param name="r1" value="${page.version}" />
+ <s:param name="r2" value="${page.version - 1}" />
+ <fmt:message key="info.difftoprev" />
+ </s:link>
+ </c:if>
+ <c:if test="${page.version < wikiActionBean.page.version}">
+ <s:link beanclass="org.apache.wiki.action.DiffActionBean" event="diff">
+ <s:param name="page" value="${page.name}" />
+ <s:param name="r1" value="${page.version}" />
+ <s:param name="r2" value="${wikiActionBean.page.version}" />
+ <fmt:message key="info.difftolast" />
+ </s:link>
+ </c:if>
+ </td>
+
+ <td class="changenote">${page.changeNote}</td>
+ </tr>
+ </c:forEach>
+
+ </table>
+ </div>
+ </c:if>
+</wiki:CheckVersion>
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/ProfileTab.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/ProfileTab.jsp?rev=905899&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/ProfileTab.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/tabs/ProfileTab.jsp Wed Feb 3 05:27:01 2010
@@ -0,0 +1,138 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
+<h3>
+ <wiki:UserProfile property="exists"><fmt:message key="prefs.oldprofile" /></wiki:UserProfile>
+ <wiki:UserProfile property="new"><fmt:message key="prefs.newprofile" /></wiki:UserProfile>
+</h3>
+
+<%-- Global form errors and messages --%>
+<div class="formhelp"><fmt:message key="login.help"></fmt:message></div>
+<div class="instructions"><s:messages key="login" /></div>
+<div class="errors"><s:errors beanclass="org.apache.wiki.action.UserProfileActionBean" globalErrorsOnly="true" /></div>
+
+<div class="formcontainer">
+ <s:form beanclass="org.apache.wiki.action.UserProfileActionBean" id="editProfile" class="wikiform" method="post" acceptcharset="UTF-8">
+ <s:param name="tab" value="profile" />
+
+ <%-- Login name --%>
+ <div>
+ <s:label for="profile.loginName" />
+ <wiki:UserProfile property="canChangeLoginName">
+ <s:text name="profile.loginName" id="loginName" size="20"><wiki:UserProfile property="loginname" /></s:text>
+ <s:errors field="profile.loginName" />
+ </wiki:UserProfile>
+ <wiki:UserProfile property="!canChangeLoginName">
+ <!-- If user can't change their login name, it's because the container manages the login -->
+ <wiki:UserProfile property="new">
+ <div class="warning"><fmt:message key="prefs.loginname.cannotset.new" /></div>
+ </wiki:UserProfile>
+ <wiki:UserProfile property="exists">
+ <span class="formvalue"><wiki:UserProfile property="loginname" /></span>
+ <div class="warning"><fmt:message key="prefs.loginname.cannotset.exists" /></div>
+ </wiki:UserProfile>
+ </wiki:UserProfile>
+ </div>
+
+ <%-- Password; not displayed if container authentication used --%>
+ <wiki:UserProfile property="canChangePassword">
+ <div>
+ <s:label for="profile.password" />
+ <s:password name="profile.password" id="password" size="20" value="" />
+ <s:errors field="profile.password" />
+ </div>
+ <div>
+ <s:label for="passwordAgain" />
+ <s:password name="passwordAgain" id="passwordAgain" size="20" value="" />
+ <s:errors field="profile.passwordAgain" />
+ </div>
+ </wiki:UserProfile>
+
+ <%-- Full name --%>
+ <div>
+ <s:label for="profile.fullname" />
+ <wiki:UserProfile property="canChangeFullname">
+ <s:text name="profile.fullname" id="fullname" size="20"><wiki:UserProfile property="fullname" /></s:text>
+ <s:errors field="profile.fullname" />
+ </wiki:UserProfile>
+ <wiki:UserProfile property="!canChangeFullname">
+ <wiki:UserProfile property="fullname" />
+ </wiki:UserProfile>
+ <div class="description"><fmt:message key="prefs.fullname.description" /></div>
+ </div>
+
+ <%-- E-mail --%>
+ <div>
+ <s:label for="profile.email" name="email" />
+ <wiki:UserProfile property="canChangeEmail">
+ <s:text name="profile.email" id="email" size="20"><wiki:UserProfile property="email" /></s:text>
+ <s:errors field="profile.email" />
+ </wiki:UserProfile>
+ <wiki:UserProfile property="!canChangeEmail">
+ <wiki:UserProfile property="email" />
+ </wiki:UserProfile>
+ <div class="description"><fmt:message key="prefs.email.description" /></div>
+ </div>
+
+ <%-- Creation and group info --%>
+ <wiki:UserProfile property="exists">
+ <div>
+ <fmt:message key="prefs.roles" />
+ <div class="formvalue"><wiki:UserProfile property="roles" /></div>
+ </div>
+ <div>
+ <fmt:message key="prefs.groups" />
+ <%-- TODO this should become clickable group links so you can immediately go and look at them if you want --%>
+ <div class="formvalue"><wiki:UserProfile property="groups" /></div>
+ <div class="formhelp"><fmt:message key="prefs.acl.info" /></div>
+ </div>
+ <div>
+ <fmt:message key="prefs.creationdate" />
+ <fmt:formatDate value="${profile.Created}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
+ </div>
+ <tr class="additinfo">
+ <fmt:message key="prefs.profile.lastmodified" />
+ <fmt:formatDate value="${profile.LastModified}" pattern="${prefs.TimeFormat}" timeZone="${prefs.TimeZone}" />
+ </div>
+ </wiki:UserProfile>
+
+ <%-- Spam protection: password confirmation or CAPTCHA --%>
+ <wiki:UserCheck status="notAuthenticated">
+ <div>
+ <s:label for="captcha" />
+ <wiki:SpamProtect challenge="captcha" />
+ </div>
+ </wiki:UserCheck>
+
+ <%-- Save submit button --%>
+ <div>
+ <s:submit name="save" />
+ <wiki:UserCheck status="assertionsAllowed">
+ <div class="description"><fmt:message key="prefs.cookie.info" /></div>
+ </wiki:UserCheck>
+ </div>
+
+ </s:form>
+</div>
\ No newline at end of file
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java Wed Feb 3 05:27:01 2010
@@ -63,10 +63,7 @@
import org.apache.wiki.preferences.Preferences.TimeFormat;
import org.apache.wiki.providers.ProviderException;
import org.apache.wiki.render.RenderingManager;
-import org.apache.wiki.ui.stripes.HandlerPermission;
-import org.apache.wiki.ui.stripes.SpamProtect;
-import org.apache.wiki.ui.stripes.WikiActionBeanContext;
-import org.apache.wiki.ui.stripes.WikiRequestContext;
+import org.apache.wiki.ui.stripes.*;
import org.apache.wiki.util.HttpUtil;
import org.apache.wiki.util.TextUtil;
import org.apache.wiki.workflow.DecisionRequiredException;
@@ -76,6 +73,7 @@
* ActionBean that manages how users edit and comment on WikiPages.
*/
@HttpCache( allow = false )
+@UrlBinding( "/Edit.jsp" )
public class EditActionBean extends AbstractPageActionBean
{
private static final String LOCK_PREFIX = "lock-";
@@ -103,30 +101,30 @@
private long m_startTime = -1;
/**
- * Using AJAX, returns a {@link StreamingResolution} containing
- * a preview for the current page.
+ * AJAX event handler that returns an {@link EventResolution} containing
+ * a preview of the page contents, as submitted by the {@code wikiText}
+ * field.
*
- * @return always returns a {@link StreamingResolution} containing the
+ * @return always returns a {@link EventResolution} containing the
* results
*/
- @HandlesEvent( "ajaxPreview" )
- public Resolution ajaxPreview()
+ @HandlesEvent( "preview" )
+ @HandlerPermission( permissionClass = PagePermission.class, target = "${page.path}", actions = PagePermission.VIEW_ACTION )
+ @WikiRequestContext( "preview" )
+ public Resolution preview() throws IOException
{
- Resolution r = new StreamingResolution( "text/html; charset=UTF-8" ) {
- public void stream( HttpServletResponse response ) throws IOException
- {
- // Parse the wiki markup
- WikiContext context = getContext();
- RenderingManager renderer = context.getEngine().getRenderingManager();
- MarkupParser mp = renderer.getParser( context, m_wikiText );
- mp.disableAccessRules();
- WikiDocument doc = mp.parse();
-
- // Get the text directly from the RenderingManager, without caching
- String result = renderer.getHTML( context, doc );
- response.getWriter().write( result );
- }
- };
+ // Parse the wiki markup
+ WikiActionBeanContext context = getContext();
+ RenderingManager renderer = context.getEngine().getRenderingManager();
+ MarkupParser mp = renderer.getParser( context, m_wikiText );
+ mp.disableAccessRules();
+ WikiDocument doc = mp.parse();
+
+ // Get the text directly from the RenderingManager, without caching
+ String result = renderer.getHTML( context, doc );
+
+ // Return an EventResolution
+ Resolution r = new EventResolution( context, result, true );
return r;
}
@@ -182,9 +180,16 @@
// Init edit fields and forward to the display JSP
m_append = true;
initEditFields( "Commenting on" );
- return new ForwardResolution( "/Comment.jsp" );
+ return new ForwardResolution( "/templates/default/Comment.jsp" );
}
+ /**
+ * Loads the page's current text, initializes the EditActionBean for
+ * editing, and forwards to the template JSP {@code /templates/default/Edit.jsp}.
+ * @return always returns a {@link ForwardResolution} to the template JSP
+ * @throws ProviderException if the page's current contents cannot
+ * be retrieved
+ */
@DefaultHandler
@HandlesEvent( "edit" )
@HandlerPermission( permissionClass = PagePermission.class, target = "${page.path}", actions = PagePermission.EDIT_ACTION )
@@ -196,7 +201,7 @@
// Init edit fields and forward to the display JSP
initEditFields( "Editing" );
- return new ForwardResolution( "/Edit.jsp" );
+ return new ForwardResolution( "/templates/default/Edit.jsp" );
}
/**
@@ -346,20 +351,6 @@
}
/**
- * Event that the user to the preview display JSP.
- *
- * @return a forward resolution back to the preview page.
- */
- @HandlesEvent( "preview" )
- @HandlerPermission( permissionClass = PagePermission.class, target = "${page.path}", actions = PagePermission.VIEW_ACTION )
- @WikiRequestContext( "preview" )
- public Resolution preview()
- {
- log.debug( "Previewing " + getPage().getName() );
- return new ForwardResolution( "/Preview.jsp" );
- }
-
- /**
* Validation method that checks to see if another user has locked the page
* before the current user starts to edit or comment on it. This method
* fires when the {@code edit} or {@code comment} methods are executed,
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java?rev=905899&r1=905898&r2=905899&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/LoginActionBean.java Wed Feb 3 05:27:01 2010
@@ -22,39 +22,31 @@
package org.apache.wiki.action;
import java.security.Principal;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-import javax.mail.AuthenticationFailedException;
-import javax.mail.SendFailedException;
import javax.security.auth.login.LoginException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import org.apache.wiki.WikiContext;
+import net.sourceforge.stripes.action.*;
+import net.sourceforge.stripes.util.UrlBuilder;
+import net.sourceforge.stripes.validation.*;
+
import org.apache.wiki.WikiEngine;
import org.apache.wiki.WikiSession;
-import org.apache.wiki.auth.NoSuchPrincipalException;
import org.apache.wiki.auth.WikiSecurityException;
import org.apache.wiki.auth.login.CookieAssertionLoginModule;
import org.apache.wiki.auth.login.CookieAuthenticationLoginModule;
import org.apache.wiki.auth.permissions.WikiPermission;
-import org.apache.wiki.auth.user.UserDatabase;
-import org.apache.wiki.auth.user.UserProfile;
import org.apache.wiki.log.Logger;
import org.apache.wiki.log.LoggerFactory;
import org.apache.wiki.ui.stripes.HandlerPermission;
import org.apache.wiki.ui.stripes.WikiRequestContext;
-import org.apache.wiki.util.MailUtil;
-import org.apache.wiki.util.TextUtil;
-import net.sourceforge.stripes.action.*;
-import net.sourceforge.stripes.util.UrlBuilder;
-import net.sourceforge.stripes.validation.*;
-
-
-@UrlBinding( "/Login.action" )
+/**
+ * Logs the user into the wiki.
+ */
+@UrlBinding( "/Login.jsp" )
public class LoginActionBean extends AbstractActionBean
{
private static final Logger log = LoggerFactory.getLogger( LoginActionBean.class );
@@ -88,8 +80,6 @@
return new RedirectResolution( builder.toString() );
}
- private String m_email = null;
-
private String m_username = null;
private boolean m_remember = false;
@@ -98,16 +88,6 @@
private String m_redirect = null;
- /**
- * Returns the e-mail address.
- *
- * @return the e-mail address
- */
- public String getEmail()
- {
- return m_email;
- }
-
public String getJ_password()
{
return m_password;
@@ -164,8 +144,7 @@
{
// Set cookies as needed and redirect
log.info( "Successfully authenticated user " + m_username + " (custom auth)" );
- Resolution r = saveCookiesAndRedirect( m_redirect, m_remember );
- return r;
+ return saveCookiesAndRedirect( m_redirect, m_remember );
}
@HandlesEvent( "logout" )
@@ -190,17 +169,6 @@
return new RedirectResolution( ViewActionBean.class );
}
- /**
- * Sets the e-mail property. Used by the {@link #resetPassword()} event.
- *
- * @param email the e-mail address
- */
- @Validate( required = true, on = "resetPassword", converter = net.sourceforge.stripes.validation.EmailTypeConverter.class )
- public void setEmail( String email )
- {
- m_email = email;
- }
-
@Validate( required = true, on = "login", minlength = 1, maxlength = 128 )
public void setJ_password( String password )
{
@@ -278,90 +246,7 @@
log.info( "Successfully authenticated user " + user.getName() + " (container auth)" );
}
- // The user hasn't logged in yet, so send them to the login page
- ForwardResolution r = new ForwardResolution( "/Login.jsp" );
- return r;
+ // The user hasn't logged in yet, so forward them to the template JSP
+ return new ForwardResolution( "/templates/default/Login.jsp" ).addParameter( "tab", "login" );
}
-
- /**
- * Event handler that resets the user's password, based on the e-mail
- * address returned by {@link #getEmail()}.
- *
- * @return always returns <code>null</code>
- */
- @HandlesEvent( "resetPassword" )
- public Resolution resetPassword()
- {
- String message = null;
- ResourceBundle rb = getContext().getBundle( "CoreResources" );
-
- // Reset pw for account name
- WikiEngine wiki = getContext().getEngine();
- WikiSession wikiSession = getContext().getWikiSession();
- UserDatabase userDatabase = wiki.getUserManager().getUserDatabase();
- boolean success = false;
-
- try
- {
- // Look up the e-mail supplied by the user
- UserProfile profile = userDatabase.findByEmail( m_email );
- String email = profile.getEmail();
- String randomPassword = TextUtil.generateRandomPassword();
-
- // Compose the message e-mail body
- Object[] args = { profile.getLoginName(), randomPassword,
- wiki.getURLConstructor().makeURL( WikiContext.NONE, "Login.jsp", true, "" ), wiki.getApplicationName() };
- String mailMessage = MessageFormat.format( rb.getString( "lostpwd.newpassword.email" ), args );
-
- // Compose the message subject line
- args = new Object[] { wiki.getApplicationName() };
- String mailSubject = MessageFormat.format( rb.getString( "lostpwd.newpassword.subject" ), args );
-
- // Send the message.
- MailUtil.sendMessage( wiki, email, mailSubject, mailMessage );
- log.info( "User " + email + " requested and received a new password." );
-
- // Mail succeeded. Now reset the password.
- // If this fails, we're kind of screwed, because we already mailed
- // it.
- profile.setPassword( randomPassword );
- userDatabase.save( profile );
- success = true;
- }
- catch( NoSuchPrincipalException e )
- {
- Object[] args = { m_email };
- message = MessageFormat.format( rb.getString( "lostpwd.nouser" ), args );
- log.info( "Tried to reset password for non-existent user '" + m_email + "'" );
- }
- catch( SendFailedException e )
- {
- message = rb.getString( "lostpwd.nomail" );
- log.error( "Tried to reset password and got SendFailedException: " + e );
- }
- catch( AuthenticationFailedException e )
- {
- message = rb.getString( "lostpwd.nomail" );
- log.error( "Tried to reset password and got AuthenticationFailedException: " + e );
- }
- catch( Exception e )
- {
- message = rb.getString( "lostpwd.nomail" );
- log.error( "Tried to reset password and got another exception: " + e );
- }
-
- if( success )
- {
- wikiSession.addMessage( "resetpwok", rb.getString( "lostpwd.emailed" ) );
- getContext().getRequest().setAttribute( "passwordreset", "done" );
- }
- else
- // Error
- {
- wikiSession.addMessage( "resetpw", message );
- }
-
- return new ForwardResolution( "/LostPassword.jsp" );
- }
-
}