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/23 22:56:20 UTC
svn commit: r915540 - in /incubator/jspwiki/trunk/src: WebContent/
WebContent/WEB-INF/ WebContent/error/ WebContent/images/
WebContent/templates/default/ WebContent/templates/default/images/
java/org/apache/wiki/parser/ java/org/apache/wiki/plugin/
Author: ajaquith
Date: Tue Feb 23 21:56:19 2010
New Revision: 915540
URL: http://svn.apache.org/viewvc?rev=915540&view=rev
Log:
Moved all images in top-level /images directory to template /images dir, and made code/JSP changes to make sure they can be "found" as needed by the TemplateManager resource resolver.
Added:
incubator/jspwiki/trunk/src/WebContent/templates/default/Forbidden.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/atom.css
incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_big.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.gif (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/favicon.ico (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-icons.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-strip.gif (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo_s.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/out.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/xml.png (with props)
incubator/jspwiki/trunk/src/WebContent/templates/default/images/xmlCoffeeCup.png (with props)
Removed:
incubator/jspwiki/trunk/src/WebContent/atom.css
incubator/jspwiki/trunk/src/WebContent/error/Forbidden.html
incubator/jspwiki/trunk/src/WebContent/favicon.ico
incubator/jspwiki/trunk/src/WebContent/images/attachment_big.png
incubator/jspwiki/trunk/src/WebContent/images/attachment_small.gif
incubator/jspwiki/trunk/src/WebContent/images/attachment_small.png
incubator/jspwiki/trunk/src/WebContent/images/jspwiki-icons.png
incubator/jspwiki/trunk/src/WebContent/images/jspwiki-strip.gif
incubator/jspwiki/trunk/src/WebContent/images/jspwiki_logo.png
incubator/jspwiki/trunk/src/WebContent/images/jspwiki_logo_s.png
incubator/jspwiki/trunk/src/WebContent/images/out.png
incubator/jspwiki/trunk/src/WebContent/images/xml.png
incubator/jspwiki/trunk/src/WebContent/images/xmlCoffeeCup.png
Modified:
incubator/jspwiki/trunk/src/WebContent/WEB-INF/web.xml
incubator/jspwiki/trunk/src/WebContent/templates/default/Search.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/jspwiki.css
incubator/jspwiki/trunk/src/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java
Modified: incubator/jspwiki/trunk/src/WebContent/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/web.xml?rev=915540&r1=915539&r2=915540&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/WEB-INF/web.xml (original)
+++ incubator/jspwiki/trunk/src/WebContent/WEB-INF/web.xml Tue Feb 23 21:56:19 2010
@@ -212,7 +212,7 @@
<!-- Error pages -->
<error-page>
<error-code>403</error-code>
- <location>/error/Forbidden.html</location>
+ <location>/templates/default/Forbidden.jsp</location>
</error-page>
<!-- REMOVE ME TO ENABLE JDBC DATABASE
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/Forbidden.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Forbidden.jsp?rev=915540&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Forbidden.jsp (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Forbidden.jsp Tue Feb 23 21:56:19 2010
@@ -0,0 +1,52 @@
+<!--
+ 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://stripes.sourceforge.net/stripes.tld" prefix="s"%>
+<s:layout-render name="${templates['layout/StaticLayout.jsp']}">
+
+ <s:layout-component name="headTitle">
+ Forbidden
+ </s:layout-component>
+
+ <s:layout-component name="pageTitle">
+ Forbidden
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <p>
+ <strong>Sorry, but you are not allowed to do that.</strong>
+ </p>
+ <p>
+ Usually we block access to
+ something because you do not have the correct privileges (<em>e.g.</em>,
+ read, edit, comment) for the page you are looking for. In this particular case,
+ it is likely that you are not listed in the page’s access control list
+ or that your privileges aren’t high enough (you want
+ to edit, but ACL only allows ‘read’).
+ </p>
+ <p>
+ It is also possible that JSPWiki cannot find its security policy, or that
+ the policy is not configured correctly. Either of these cases would cause
+ JSPWiki to block access, too.
+ </p>
+ <p><a href=".">Better luck next time.</a></p>
+ </s:layout-component>
+
+</s:layout-render>
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/Search.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/Search.jsp?rev=915540&r1=915539&r2=915540&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/Search.jsp (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/Search.jsp Tue Feb 23 21:56:19 2010
@@ -69,9 +69,9 @@
</fmt:message></h4>
<p>
<fmt:message key="find.externalsearch" />
- <a class="external" href="http://www.google.com/search?q=<c:out value='${wikiActionBean.query}' />" title="Google Search '<c:out value='${wikiActionBean.query}' />'" target="_blank">Google</a><img class="outlink" src="images/out.png" alt="" />
+ <a class="external" href="http://www.google.com/search?q=<c:out value='${wikiActionBean.query}' />" title="Google Search '<c:out value='${wikiActionBean.query}' />'" target="_blank">Google</a><img class="outlink" src="${templates['images/out.png']}" alt="" />
|
- <a class="external" href="http://en.wikipedia.org/wiki/Special:Search?search=<c:out value='${wikiActionBean.query}' />" title="Wikipedia Search '<c:out value='${wikiActionBean.query}' />'" target="_blank">Wikipedia</a><img class="outlink" src="images/out.png" alt="" />
+ <a class="external" href="http://en.wikipedia.org/wiki/Special:Search?search=<c:out value='${wikiActionBean.query}' />" title="Wikipedia Search '<c:out value='${wikiActionBean.query}' />'" target="_blank">Wikipedia</a><img class="outlink" src="${templates['images/out.png']}" alt="" />
</p>
<wiki:SetPagination start="${wikiActionBean.start}" total="${fn:length(wikiActionBean.results)}"
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/atom.css
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/atom.css?rev=915540&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/atom.css (added)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/atom.css Tue Feb 23 21:56:19 2010
@@ -0,0 +1,102 @@
+/*
+ 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.
+*/
+feed {
+ display:block;
+ font-family:verdana, sans-serif;
+ margin:2%;
+ font-size:90%;
+ color:#000000;
+ background:#ffffff;
+}
+
+title {
+ display:block;
+ font-size:1.3em;
+ color:inherit;
+ background:inherit;
+ font-weight:bold;
+}
+
+tagline, link {
+ display:block;
+ font-size:0.9em;
+}
+
+id, modified {
+ display:none;
+}
+
+generator {
+ display:block;
+ font-size:0.9em;
+}
+
+info {
+ display:block;
+ margin:3em 4em 3em 4em;
+ color:#CC3333;
+ background:#FFFF66;
+ border:solid #CCCC66 2px;
+ text-align:center;
+ padding:1.5em;
+ font-family:mono;
+ font-size:0.8em;
+}
+
+entry {
+ display:block;
+ color:inherit;
+ background:inherit;
+ padding:0;
+ margin:1em 1em 4em 1em;
+
+}
+
+entry modified, entry name {
+ display:inline;
+ color:#999999;
+ background:inherit;
+ font-size:0.8em;
+}
+
+entry created, entry issued, entry id {
+ display:none;
+}
+
+entry title {
+ display:block;
+ font-size:1em;
+ font-weight:bold;
+ color:inherit;
+ background:inherit;
+ padding:1em 1em 0em 1em;
+ margin:0;
+ border-top:solid 1px #dddddd;
+}
+
+content {
+ display:block;
+ font-size:0.9em;
+ color:inherit;
+ background:inherit;
+ padding:1em;
+ line-height:1.5em;
+}
\ No newline at end of file
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_big.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_big.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_big.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.gif
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.gif?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/attachment_small.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/favicon.ico
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/favicon.ico?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/favicon.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-icons.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-icons.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-icons.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-strip.gif
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-strip.gif?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki-strip.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo_s.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo_s.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/jspwiki_logo_s.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/out.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/out.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/out.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/xml.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/xml.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/xml.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/jspwiki/trunk/src/WebContent/templates/default/images/xmlCoffeeCup.png
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/images/xmlCoffeeCup.png?rev=915540&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/templates/default/images/xmlCoffeeCup.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: incubator/jspwiki/trunk/src/WebContent/templates/default/jspwiki.css
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/jspwiki.css?rev=915540&r1=915539&r2=915540&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/jspwiki.css (original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/jspwiki.css Tue Feb 23 21:56:19 2010
@@ -743,7 +743,7 @@
}
a.external {
padding-right:6px;
- background:transparent url(../../images/out.png) no-repeat center right;
+ background:transparent url(images/out.png) no-repeat center right;
}
/* FIXME
a.external {
@@ -765,7 +765,7 @@
a.infolink {
margin-left:3px;
padding-right:16px;
- background:transparent url(../../images/attachment_small.png) no-repeat center right;
+ background:transparent url(images/attachment_small.png) no-repeat center right;
}
a.infolink img {
display:none;
@@ -1241,7 +1241,7 @@
width:64px;
margin:0 auto;/* center logo, in case the width of the parent block is larger */
text-indent:-1000px;/* hide link text*/
- background:url(../../images/jspwiki_logo.png) -64px 0 no-repeat;
+ background:url(images/jspwiki_logo.png) -64px 0 no-repeat;
}
.applicationlogo a:hover {
background-position:0 0;
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/parser/JSPWikiMarkupParser.java?rev=915540&r1=915539&r2=915540&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/parser/JSPWikiMarkupParser.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/parser/JSPWikiMarkupParser.java Tue Feb 23 21:56:19 2010
@@ -55,6 +55,7 @@
import org.apache.wiki.plugin.WikiPlugin;
import org.apache.wiki.render.CleanTextRenderer;
import org.apache.wiki.render.RenderingManager;
+import org.apache.wiki.ui.TemplateManager;
import org.apache.wiki.util.RegExpUtil;
import org.apache.wiki.util.StringTransmutator;
import org.apache.wiki.util.TextUtil;
@@ -370,6 +371,8 @@
PROP_USERELNOFOLLOW,
m_useRelNofollow );
+ m_resources = TemplateManager.getResourceResolver( m_engine.getServletContext() );
+
if( m_engine.getUserManager().getUserDatabase() == null || m_engine.getAuthorizationManager() == null )
{
disableAccessRules();
@@ -620,7 +623,7 @@
link );
String imglink = m_context.getURL( WikiContext.NONE,
- "images/attachment_small.png" );
+ m_resources.get( "images/attachment_small.png" ) );
el = createAnchor( ATTACHMENT, attlink, text, "" );
@@ -1305,7 +1308,7 @@
{
if( m_outlinkImageURL == null )
{
- m_outlinkImageURL = m_context.getURL( WikiContext.NONE, OUTLINK_IMAGE );
+ m_outlinkImageURL = m_resources.get( OUTLINK_IMAGE );
}
el = new Element("img").setAttribute("class", "outlink");
@@ -2032,6 +2035,9 @@
private boolean m_newLine;
+ /** Resolves requests for template resources */
+ private Map<String,String> m_resources = null;
+
/**
* Starts a block level element, therefore closing
* a potential open paragraph tag.
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java?rev=915540&r1=915539&r2=915540&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/RecentChangesPlugin.java Tue Feb 23 21:56:19 2010
@@ -35,6 +35,7 @@
import org.apache.wiki.preferences.Preferences;
import org.apache.wiki.preferences.Preferences.TimeFormat;
import org.apache.wiki.providers.ProviderException;
+import org.apache.wiki.ui.TemplateManager;
import org.apache.wiki.util.TextUtil;
@@ -157,11 +158,10 @@
{
linkel = new a().setHref(context.getURL(WikiContext.INFO,pageref.getName()));
linkel.setClass("infolink");
- linkel.addElement( new img().setSrc(context.getURL(WikiContext.NONE, "images/attachment_small.png")));
-
+ String src = TemplateManager.getResourceResolver( m_engine.getServletContext() ).get( "attachment_small.png" );
+ linkel.addElement( new img().setSrc( src ) );
col.addElement( linkel );
}
-
row.addElement(col);
rt.addElement(row);