Author: ajaquith
Date: Sat Feb 23 11:38:36 2008
New Revision: 630517
URL: http://svn.apache.org/viewvc?rev=630517&view=rev
Log:
Initial Stripes component commit. Note that of the new JSPs, only Wiki.jsp is
decent. The others need work...
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/EditGroup.jsp
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Group.jsp
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Test.jsp
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/UserPreferences.jsp
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Wiki.jsp
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/EditGroup.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/EditGroup.jsp?rev=630517&view=auto
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/EditGroup.jsp
(added)
+++
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/EditGroup.jsp
Sat Feb 23 11:38:36 2008
@@ -0,0 +1,25 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page import="org.apache.log4j.*" %>
+<%@ page import="com.ecyrd.jspwiki.*" %>
+<%@ page import="com.ecyrd.jspwiki.auth.WikiSecurityException" %>
+<%@ page import="com.ecyrd.jspwiki.auth.authorize.Group" %>
+<%@ page import="com.ecyrd.jspwiki.auth.authorize.GroupManager" %>
+<%@ page errorPage="/Error.jsp" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<%!
+ Logger log = Logger.getLogger("JSPWiki");
+%>
+
+<%
+ WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
+ // Create wiki context and check for authorization
+ WikiContext wikiContext = wiki.createContext( request,
WikiContext.EDIT_GROUP );
+
+ // Set the content type and include the response content
+ response.setContentType("text/html; charset="+wiki.getContentEncoding() );
+ String contentPage = wiki.getTemplateManager().findJSP( pageContext,
+
wikiContext.getTemplate(),
+ "EditTemplate.jsp"
);
+
+%><wiki:Include page="<%=contentPage%>" />
+
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Group.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Group.jsp?rev=630517&view=auto
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Group.jsp
(added)
+++
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Group.jsp
Sat Feb 23 11:38:36 2008
@@ -0,0 +1,79 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ 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="stripes" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<fmt:setBundle basename="templates.DefaultResources"/>
+
+<stripes:useActionBean binding="/ViewGroup.action"/>
+
+<stripes:layout-render name="/WEB-INF/jsp/templates/default/ViewTemplate.jsp">
+ <stripes:layout-component name="contents">
+
+ <script language="javascript" type="text/javascript">
+ function confirmDelete()
+ {
+ var reallydelete = confirm("<fmt:message
key="group.areyousure"><fmt:param>${actionBean.group.name}</fmt:param></fmt:message>");
+
+ return reallydelete;
+ }
+ </script>
+
+ <h3>Group ${actionBean.group.name}</h3>
+
+ <c:choose>
+ <c:when test="${empty actionBean.group.created}">
+ <!-- Group doesn't exist; offer user opportunity to create one if
allowed. -->
+ <fmt:message key="group.doesnotexist"/>
+ <wiki:Permission permission="createGroups">
+ <fmt:message key="group.createsuggestion">
+ <fmt:param>
+ <wiki:Link jsp="NewGroup.jsp">
+ <wiki:Param
name="group"><%=request.getParameter("group")%></wiki:Param>
+ <fmt:message key="group.createit"/>
+ </wiki:Link>
+ </fmt:param>
+ </fmt:message>
+ </wiki:Permission>
+ </c:when>
+
+ <c:otherwise>
+ <!-- Group exists; print details. -->
+ <div class="formcontainer">
+
+ <!-- Group name and instructions -->
+ <div class="instructions">
+ <fmt:message key="group.groupintro">
+ <fmt:param><em>${actionBean.group.name}</em></fmt:param>
+ </fmt:message>
+ </div>
+
+ <!-- Members -->
+ <div class="block">
+ <label><fmt:message key="group.members"/><label>
+ <stripes:label for="group.members" />
+ <c:forEach items="${actionBean.group.members}" var="member"
varStatus="loop">
+ <br>${member.name}</br>
+ </c:forEach>
+ </div>
+
+ <!-- Created/modified info -->
+ <div class="instructions">
+ <fmt:message key="group.modifier">
+ <fmt:param>${actionBean.group.modifier}</fmt:param>
+ <fmt:param>${actionBean.group.modified}</fmt:param>
+ </fmt:message>
+ <br />
+ <fmt:message key="group.creator">
+ <fmt:param>${actionBean.group.creator}</fmt:param>
+ <fmt:param>${actionBean.group.created}</fmt:param>
+ </fmt:message>
+ </div>
+
+ </div>
+ </c:otherwise>
+
+ </c:choose>
+
+ </stripes:layout-component>
+</stripes:layout-render>
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Test.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Test.jsp?rev=630517&view=auto
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Test.jsp
(added)
+++
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Test.jsp
Sat Feb 23 11:38:36 2008
@@ -0,0 +1,74 @@
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean"
var="context"/>
+
+<table>
+ <thead>
+ <th align="left">Tag or expression</th>
+ <th align="left">Value</th>
+ </thead>
+ <tr>
+ <td>
+ ${'${'}wikiPage.name}
+ </td>
+ <td>
+ '${wikiPage.name}'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ ${'${'}wikiSession.userPrincipal}
+ </td>
+ <td>
+ '${wikiSession.userPrincipal}'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ ${'${'}wikiEngine.frontPage}
+ </td>
+ <td>
+ '${wikiEngine.frontPage}'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ ${'${'}wikiActionBean.currentUser}
+ </td>
+ <td>
+ '${wikiActionBean.currentUser}'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <wiki:BaseURL />
+ </td>
+ <td>
+ '<wiki:BaseURL/>'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <wiki:Link format='url' templatefile='jspwiki_print.css'/>
+ </td>
+ <td>
+ '<wiki:Link format='url'
templatefile='jspwiki_print.css'>Test</wiki:Link>'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <wiki:Link format='url' jsp='images/favicon.png'/>
+ </td>
+ <td>
+ '<wiki:Link format='url' jsp='images/favicon.png'/>'
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <wiki:EditLink/>
+ </td>
+ <td>
+ '<wiki:EditLink>Link to edit page</wiki:EditLink>'
+ </td>
+ </tr>
+</table>
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/UserPreferences.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/UserPreferences.jsp?rev=630517&view=auto
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/UserPreferences.jsp
(added)
+++
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/UserPreferences.jsp
Sat Feb 23 11:38:36 2008
@@ -0,0 +1,189 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ 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="stripes" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+<fmt:setBundle basename="templates.DefaultResources"/>
+
+<stripes:layout-render name="/WEB-INF/jsp/templates/default/ViewTemplate.jsp">
+ <stripes:layout-component name="contents">
+
+ <h3><fmt:message key="prefs.heading.yourprofile"><fmt:param><wiki:Variable
var="applicationname"/></fmt:param></fmt:message></h3>
+
+ <wiki:TabbedSection defaultTab='<%=request.getParameter("tab")%>'>
+ <!-- Tab 1: user preferences -->
+ <wiki:Tab id="prefs" title="prefs.tab.prefs">
+ <div class="formcontainer">
+ <div class="instructions">
+ <fmt:message key="prefs.instructions"/>
+ </div>
+ </div>
+ <wiki:Permission permission="editPreferences">
+ <wiki:UserCheck status="anonymous">
+ <div class="formcontainer">
+ <div class="instructions">
+ <wiki:Messages div="error" topic="prefs" prefix="Could not
save prefs: "/>
+ </div>
+ <stripes:form id="createAssertedName"
action="/UserPreferences.action" method="POST" acceptcharset="UTF-8">
+ <stripes:errors/>
+ <div class="block">
+ <stripes:label for="assertedName" />
+ <stripes:text name="assertedName"
size="30"><wiki:UserProfile property="asserted"/></stripes:text>
+ <div class="description">
+ <fmt:message key="prefs.wikiname.description">
+ <fmt:param><wiki:Variable var="applicationname"
/></fmt:param>
+ </fmt:message>
+ </div>
+ <div class="description">
+ <fmt:message key="prefs.wikiname.description2">
+ <fmt:param><a onclick="TabbedSection.onclick('profile')"
><fmt:message key="prefs.wikiname.create"/></a></fmt:param>
+ </fmt:message>
+ </div>
+ <stripes:hidden name="tab" value="prefs" />
+ <stripes:submit name="createAssertedName"/>
+ </div>
+ </stripes:form>
+ </div>
+ </wiki:UserCheck>
+
+ <!-- Clearing the 'asserted name' cookie -->
+ <wiki:UserCheck status="asserted">
+ <div class="formcontainer">
+ <stripes:form id="clearAssertedName"
action="/UserPreferences.action" method="POST" acceptcharset="UTF-8">
+ <div class="block">
+ <div class="description">
+ <fmt:message key="prefs.clear.description"/>
+ </div>
+ <stripes:hidden name="tab" value="prefs" />
+ <stripes:submit name="clearAssertedName"/>
+ </div>
+ </stripes:form>
+ <stripes:form id="editFavorites"
action="/UserPreferences.action" method="GET">
+ <div class="block">
+ <div class="description">
+ <fmt:message key="prefs.favs.description"/>
+ </div>
+ <stripes:hidden name="tab" value="prefs" />
+ <stripes:submit name="editFavorites"/>
+ </div>
+ </stripes:form>
+ </div>
+ </wiki:UserCheck>
+ </wiki:Permission>
+ </wiki:Tab>
+
+ <!-- Tab 2: If user can register, allow edits to profile -->
+ <wiki:Tab id="profile" title="prefs.tab.profile">
+ <wiki:Permission permission="editProfile">
+ <div class="formcontainer">
+ <div class="instructions">
+ <wiki:UserProfile property="new">
+ <fmt:message key="prefs.newprofile"/>
+ </wiki:UserProfile>
+ <wiki:UserProfile property="exists">
+ <fmt:message key="prefs.oldprofile"/>
+ </wiki:UserProfile>
+ </div>
+ <stripes:form id="saveProfile" action="/UserProfile.action"
method="POST" acceptcharset="UTF-8">
+
+ <!-- Any errors? -->
+ <stripes:errors/>
+
+ <!-- Login name -->
+ <div class="block">
+ <stripes:label for="loginName"/>
+ <wiki:UserProfile property="new">
+ <stripes:text name="loginName" size="30"
value="${this.loginName}"/>
+ <div class="description">
+ <fmt:message key="prefs.loginname.description"/>
+ </div>
+ </wiki:UserProfile>
+ <wiki:UserProfile property="exists">
+ <p><wiki:UserProfile property="loginname"/></p>
+ <div class="description">
+ <fmt:message key="prefs.loginname.exists"/>
+ </div>
+ </wiki:UserProfile>
+ </div>
+
+ <!-- Password; not displayed if container auth used -->
+ <wiki:UserCheck status="setPassword">
+ <div class="block">
+ <stripes:label for="password"/>
+ <stripes:password name="password" size="30" value="" />
+ <div class="description">
+ <fmt:message key="prefs.password.description"/>
+ </div>
+ </div>
+
+ <div class="block">
+ <stripes:label for="passwordAgain"/>
+ <stripes:password name="passwordAgain" size="30" value="" />
+ <div class="description">
+ <fmt:message key="prefs.password2.description"/>
+ </div>
+ </div>
+ </wiki:UserCheck>
+
+ <!-- Full name -->
+ <div class="block">
+ <stripes:label for="fullName"/>
+ <wiki:UserProfile property="new">
+ <stripes:text name="fullName" size="30"
value="${this.fullName}" />
+ <div class="description">
+ <fmt:message key="prefs.fullname.description"/>
+ </div>
+ </wiki:UserProfile>
+ <wiki:UserProfile property="exists">
+ <p><wiki:UserProfile property="fullname"/></p>
+ <div class="description">
+ <fmt:message key="prefs.fullname.exists"/>
+ </div>
+ </wiki:UserProfile>
+ </div>
+
+ <!-- E-mail -->
+ <div class="block">
+ <stripes:label for="email"/>
+ <stripes:text name="email" size="30" value="${this.email}" />
+ <div class="description">
+ <fmt:message key="prefs.email.description"/>
+ </div>
+ </div>
+
+ <div class="block">
+ <wiki:UserCheck status="assertionsAllowed">
+ <div class="instructions">
+ <fmt:message key="prefs.cookie.info"/>
+ </div>
+ </wiki:UserCheck>
+ <wiki:UserProfile property="exists">
+ <div class="instructions">
+ <fmt:message key="prefs.acl.info">
+ <fmt:param><strong><wiki:UserProfile
property="wikiname"/></strong></fmt:param>
+ <fmt:param><strong><wiki:UserProfile
property="fullname"/></strong></fmt:param>
+ <fmt:param><strong><wiki:UserProfile property="roles"
/></strong></fmt:param>
+ <fmt:param><strong><wiki:UserProfile property="groups"
/></strong></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:UserProfile>
+ <div class="instructions">
+ <wiki:UserProfile property="exists">
+ <fmt:message key="prefs.lastmodified">
+ <fmt:param><wiki:UserProfile
property="created"/></fmt:param>
+ <fmt:param><wiki:UserProfile
property="modified"/></fmt:param>
+ </fmt:message>
+ </wiki:UserProfile>
+ <fmt:message key="prefs.save.description"/>
+ </div>
+ <stripes:hidden name="tab" value="profile" />
+ <stripes:submit name="ok" />
+ </div>
+ </stripes:form>
+ </div>
+ </wiki:Permission>
+ </wiki:Tab>
+ </wiki:TabbedSection>
+
+ </stripes:layout-component>
+</stripes:layout-render>
Added:
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Wiki.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Wiki.jsp?rev=630517&view=auto
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Wiki.jsp
(added)
+++
incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/webdocs-stripes/Wiki.jsp
Sat Feb 23 11:38:36 2008
@@ -0,0 +1,10 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
+<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
+
+<stripes:useActionBean beanclass="com.ecyrd.jspwiki.action.ViewActionBean" />
+<stripes:layout-render name="/WEB-INF/jsp/templates/default/ViewTemplate.jsp">
+<stripes:layout-component name="contents">
+ <wiki:Include page="/WEB-INF/jsp/templates/default/PageContent.jsp" />
+</stripes:layout-component>
+</stripes:layout-render>