cziegeler 01/11/06 01:55:38
Modified: . Tag: cocoon_20_branch changes.xml
documentation Tag: cocoon_20_branch sitemap.xmap
src/org/apache/cocoon Tag: cocoon_20_branch cocoon.roles
src/org/apache/cocoon/components/language/markup/sitemap/java
Tag: cocoon_20_branch sitemap.xsl
src/org/apache/cocoon/components/store Tag: cocoon_20_branch
MRUMemoryStore.java
src/org/apache/cocoon/environment Tag: cocoon_20_branch
Request.java
src/org/apache/cocoon/matching Tag: cocoon_20_branch
Matcher.java RegexpTargetHostMatcherFactory.java
RegexpURIMatcherFactory.java
WildcardHeaderMatcherFactory.java
WildcardParameterValueMatcherFactory.java
WildcardSessionAttributeMatcherFactory.java
WildcardURIMatcherFactory.java
src/org/apache/cocoon/selection Tag: cocoon_20_branch
BrowserSelectorFactory.java
HeaderSelectorFactory.java HostSelectorFactory.java
ParameterSelectorFactory.java
RequestSelectorFactory.java Selector.java
SessionAttributeSelectorFactory.java
src/org/apache/cocoon/sitemap Tag: cocoon_20_branch
PatternException.java XSLTFactoryLoader.java
webapp Tag: cocoon_20_branch cocoon.xconf sitemap.xmap
webapp/i18n Tag: cocoon_20_branch sitemap.xmap
webapp/protected Tag: cocoon_20_branch sitemap.xmap
Added: src/org/apache/cocoon/components/store Tag: cocoon_20_branch
FilesystemQueue.java FilesystemQueueImpl.java
FilesystemQueueObject.java
src/org/apache/cocoon/environment Tag: cocoon_20_branch
ObjectModelHelper.java
src/org/apache/cocoon/matching Tag: cocoon_20_branch
AbstractPreparableMatcher.java
AbstractRegexpMatcher.java
AbstractWildcardMatcher.java PreparableMatcher.java
RegexpTargetHostMatcher.java RegexpURIMatcher.java
WildcardHeaderMatcher.java
WildcardParameterValueMatcher.java
WildcardSessionAttributeMatcher.java
WildcardURIMatcher.java
src/org/apache/cocoon/matching/helpers Tag: cocoon_20_branch
WildcardHelper.java
src/org/apache/cocoon/selection Tag: cocoon_20_branch
BrowserSelector.java HeaderSelector.java
HostSelector.java NamedPatternsSelector.java
ParameterSelector.java RequestSelector.java
SessionAttributeSelector.java
Removed: src/org/apache/cocoon Tag: cocoon_20_branch CodeFactory.java
src/org/apache/cocoon/matching Tag: cocoon_20_branch
BrowserMatcherFactory.java
src/org/apache/cocoon/selection Tag: cocoon_20_branch
CodedSelectorFactory.java
Log:
Synced with 2.1: Deprecated CodeFactories
Revision Changes Path
No revision
No revision
1.2.2.43 +8 -1 xml-cocoon2/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/changes.xml,v
retrieving revision 1.2.2.42
retrieving revision 1.2.2.43
diff -u -r1.2.2.42 -r1.2.2.43
--- changes.xml 2001/10/22 09:15:06 1.2.2.42
+++ changes.xml 2001/11/06 09:55:35 1.2.2.43
@@ -4,7 +4,7 @@
<!--
History of Cocoon changes
- $Id: changes.xml,v 1.2.2.42 2001/10/22 09:15:06 cziegeler Exp $
+ $Id: changes.xml,v 1.2.2.43 2001/11/06 09:55:35 cziegeler Exp $
-->
<changes title="History of Changes">
@@ -26,6 +26,13 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="SW" type="add">
+ Deprecation of CodeFactory in preparation of the tree traversal
implementation of the sitemap.
+ All factory-based matchers have been rewritten using the new
PreparableMatcher interface, and
+ all factory-based selectors have been rewritten as regular
implementations of Selector.
+ For patterns whose syntax uses '{' like regexp, sitemap substitution can
be avoided by escaping the
+ brace character (example : "pat\{2}ern" will match "pattern").
+ </action>
<action dev="SW" type="fix">
Reduce exception nesting in case of sitemap setup errors, and display
all nested exceptions
in the error page (avoids searching the logs for the failure cause).
No revision
No revision
1.14.2.4 +5 -7 xml-cocoon2/documentation/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/documentation/sitemap.xmap,v
retrieving revision 1.14.2.3
retrieving revision 1.14.2.4
diff -u -r1.14.2.3 -r1.14.2.4
--- sitemap.xmap 2001/10/23 11:16:58 1.14.2.3
+++ sitemap.xmap 2001/11/06 09:55:35 1.14.2.4
@@ -34,7 +34,7 @@
</map:serializers>
<map:matchers default="wildcard">
- <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
+ <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>
</map:components>
@@ -121,12 +121,13 @@
</map:match>
<!-- ================ Static =========================== -->
+
<map:match pattern="**sample/**">
- <map:read src="xdocs/{1}sample/{2}" mime-type="text"/>
+ <map:read src="xdocs/{1}sample/{2}" mime-type="text/plain"/>
</map:match>
<map:match pattern="**.txt">
- <map:read src="xdocs/{1}.txt" mime-type="text"/>
+ <map:read src="xdocs/{1}.txt" mime-type="text/plain"/>
</map:match>
<map:match pattern="**resources/script.js">
@@ -138,7 +139,7 @@
</map:match>
<map:match pattern="**.css">
- <map:read src="{1}.css" mime-type="text"/>
+ <map:read src="{1}.css" mime-type="text/css"/>
</map:match>
<map:match pattern="**images/*.png">
@@ -153,7 +154,6 @@
<map:read src="images/{2}.gif" mime-type="image/gif"/>
</map:match>
-
<map:match pattern="**graphics/**-*.jpg">
<map:generate src="svg/{3}.xml"/>
<map:transform src="svg/addlabel.xsl">
@@ -167,5 +167,3 @@
</map:pipelines>
</map:sitemap>
-
-<!-- end of file -->
No revision
No revision
1.6.2.16 +4 -0 xml-cocoon2/src/org/apache/cocoon/cocoon.roles
Index: cocoon.roles
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/cocoon.roles,v
retrieving revision 1.6.2.15
retrieving revision 1.6.2.16
diff -u -r1.6.2.15 -r1.6.2.16
--- cocoon.roles 2001/09/10 10:59:58 1.6.2.15
+++ cocoon.roles 2001/11/06 09:55:35 1.6.2.16
@@ -96,6 +96,10 @@
shorthand="store-janitor"
default-class="org.apache.cocoon.components.store.StoreJanitorImpl"/>
+ <role name="org.apache.cocoon.components.store.FilesystemQueue"
+ shorthand="filesystem-queue"
+
default-class="org.apache.cocoon.components.store.FilesystemQueueImpl"/>
+
<role name="org.apache.cocoon.components.hsqldb.Server"
shorthand="hsqldb-server"
default-class="org.apache.cocoon.components.hsqldb.ServerImpl"/>
No revision
No revision
1.11.2.36 +93 -10
xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
retrieving revision 1.11.2.35
retrieving revision 1.11.2.36
diff -u -r1.11.2.35 -r1.11.2.36
--- sitemap.xsl 2001/10/17 10:05:53 1.11.2.35
+++ sitemap.xsl 2001/11/06 09:55:35 1.11.2.36
@@ -107,6 +107,7 @@
import org.apache.cocoon.environment.Environment;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.matching.Matcher;
+ import org.apache.cocoon.matching.PreparableMatcher;
import org.apache.cocoon.selection.Selector;
import org.apache.cocoon.sitemap.AbstractSitemap;
import org.apache.cocoon.components.pipeline.StreamPipeline;
@@ -124,7 +125,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo
Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin
Loritsch</a>
- * @version CVS $Id: sitemap.xsl,v 1.11.2.35 2001/10/17 10:05:53 sylvain
Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.11.2.36 2001/11/06 09:55:35
cziegeler Exp $
*/
public class <xsl:value-of select="@file-name"/> extends AbstractSitemap
{
static final String LOCATION = "<xsl:value-of
select="translate(@file-path, '/', '.')"/>.<xsl:value-of select="@file-name"/>";
@@ -143,7 +144,8 @@
<xsl:variable name="src">
<xsl:value-of select="@src"/>
</xsl:variable>
- <xsl:if test="XSLTFactoryLoader:isFactory($factory-loader,
string($src))">
+ <xsl:choose>
+ <xsl:when test="XSLTFactoryLoader:isFactory($factory-loader,
string($src))">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="type" select="translate(@name, '- ', '__')"/>
<xsl:variable name="default" select="@name = ../@default"/>
@@ -163,9 +165,33 @@
// The generated matcher for a pattern of "<xsl:value-of
select="@pattern"/>"
<xsl:value-of
select="XSLTFactoryLoader:getClassSource($factory-loader,string($src),string($matcher-name),string(@pattern),$config)"/>
</xsl:for-each>
- </xsl:if>
+ </xsl:when>
+ </xsl:choose>
</xsl:for-each>
+ <!-- Generate variables for non-factory patterns -->
+ <xsl:for-each select="/map:sitemap/map:pipelines//map:match">
+
+ <!-- get the type of matcher used -->
+ <xsl:variable name="matcher-type">
+ <xsl:call-template name="get-parameter">
+ <xsl:with-param name="parname">type</xsl:with-param>
+ <xsl:with-param name="default"><xsl:value-of
select="/map:sitemap/map:components/map:matchers/@default"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="src"
select="/map:sitemap/map:components/map:matchers/map:[EMAIL
PROTECTED]($matcher-type)]/@src"/>
+ <xsl:if test="not(XSLTFactoryLoader:isFactory($factory-loader,
string($src)))">
+ <xsl:variable name="matcher-name">
+ <xsl:call-template name="generate-name">
+ <xsl:with-param name="prefix">matcher_</xsl:with-param>
+ <xsl:with-param name="suffix"><xsl:value-of
select="$matcher-type"/>_<xsl:value-of
select="generate-id(.)"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ // Pattern for "<xsl:value-of select="@pattern"/>" (either String
or prepared pattern)
+ private Object <xsl:value-of select="$matcher-name"/>_expr;
+ </xsl:if>
+ </xsl:for-each>
<!-- Generate selectors which implements CodeFactory -->
<xsl:for-each
select="/map:sitemap/map:components/map:selectors/map:selector">
@@ -212,10 +238,14 @@
/**
* Method that handles non-factory matchers.
*/
- private Map matches(String hint, String patternValue, List listOfMaps,
Parameters params, Map objectModel) throws Exception {
- Matcher matcher = (Matcher)this.matchers.select(hint);
+ private Map matches(String hint, Object preparedPattern, String
pattern, List listOfMaps, Parameters params, Map objectModel) throws Exception {
+ Component matcher = (Component)this.matchers.select(hint);
try {
- return matcher.match(substitute(listOfMaps, patternValue),
objectModel, params);
+ if (preparedPattern == null) {
+ return ((Matcher)matcher).match(substitute(listOfMaps, pattern),
objectModel, params);
+ } else {
+ return
((PreparableMatcher)matcher).preparedMatch(preparedPattern, objectModel,
params);
+ }
} finally {
this.matchers.release(matcher);
}
@@ -253,6 +283,7 @@
this.readers.initialize();
this.actions.initialize();
this.matchers.initialize();
+ this.prepareMatchers();
this.selectors.initialize();
this.manager.initialize();
@@ -338,6 +369,57 @@
}
}
+ public Object preparePattern(String type, String pattern) throws
Exception {
+ Component matcher = this.matchers.select(type);
+ try {
+ if (matcher instanceof PreparableMatcher) {
+ // Prepare pattern ('{' have been unescaped)
+ return ((PreparableMatcher)matcher).preparePattern(pattern);
+ } else {
+ // Return null : regular Matcher will be used.
+ return null;
+ }
+ } finally {
+ this.matchers.release(matcher);
+ }
+ }
+ /** Prepare patterns of PreparableMatchers. */
+ public void prepareMatchers() throws Exception {
+
+ <!-- Generate variables for non-factory patterns -->
+ <xsl:for-each select="/map:sitemap/map:pipelines//map:match">
+
+ <!-- get the type of matcher used -->
+ <xsl:variable name="matcher-type">
+ <xsl:call-template name="get-parameter">
+ <xsl:with-param name="parname">type</xsl:with-param>
+ <xsl:with-param name="default"><xsl:value-of
select="/map:sitemap/map:components/map:matchers/@default"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="src"
select="/map:sitemap/map:components/map:matchers/map:[EMAIL
PROTECTED]($matcher-type)]/@src"/>
+
+ <xsl:if test="not(XSLTFactoryLoader:isFactory($factory-loader,
string($src)))">
+ <xsl:choose>
+ <xsl:when test="XSLTFactoryLoader:hasSubstitutions(@pattern)">
+ // Pattern "<xsl:value-of select="@pattern"/>" has
substitutions and is not prepared.
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="matcher-name">
+ <xsl:call-template name="generate-name">
+ <xsl:with-param name="prefix">matcher_</xsl:with-param>
+ <xsl:with-param name="suffix"><xsl:value-of
select="$matcher-type"/>_<xsl:value-of
select="generate-id(.)"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ // Prepare the pattern for "<xsl:value-of
select="@pattern"/>"
+ this.<xsl:value-of select="$matcher-name"/>_expr =
this.preparePattern("<xsl:value-of select="$matcher-type"/>", "<xsl:value-of
select="XSLTFactoryLoader:escapeBraces($factory-loader, @pattern)"/>");
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+
+ }
+
<!-- generate methods for every map:resource element -->
<xsl:for-each select="/map:sitemap/map:resources/map:resource">
<xsl:call-template name="line-number"/>
@@ -679,7 +761,7 @@
<xsl:value-of select="translate($matcher-type, '- ',
'__')"/>Match(<xsl:value-of select="$matcher-name2"/>_expr, objectModel,
<xsl:value-of select="$component-param"/>)
</xsl:when>
<xsl:otherwise>
- matches("<xsl:value-of select="$matcher-type"/>", "<xsl:value-of
select="$pattern-value"/>", listOfMaps, <xsl:value-of
select="$component-param"/>, objectModel)
+ matches("<xsl:value-of select="$matcher-type"/>", <xsl:value-of
select="$matcher-name2"/>_expr, "<xsl:value-of
select="XSLTFactoryLoader:escape($pattern-value)"/>", listOfMaps, <xsl:value-of
select="$component-param"/>, objectModel)
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -687,7 +769,7 @@
<!-- this is the actual code produced -->
// handling "<xsl:value-of select="@pattern"/>"
if ((map = <xsl:value-of select="$matcher-name"/>) != null) {
- getLogger().debug("Matched <xsl:value-of
select="$matcher-type"/><xsl:text> </xsl:text><xsl:value-of
select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of
select="@pattern"/>");
+ getLogger().debug("Matched <xsl:value-of
select="$matcher-type"/><xsl:text> </xsl:text><xsl:value-of
select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, $pattern-value)"/>");
listOfMaps.add (map);
<xsl:apply-templates/>
listOfMaps.remove (listOfMaps.size()-1);
@@ -764,8 +846,9 @@
<xsl:when test="string($is-factory)='true'">
<xsl:value-of select="translate($matcher-type, '- ',
'__')"/>Match(<xsl:value-of select="$matcher-name2"/>_expr, objectModel,
<xsl:value-of select="$component-param"/>)
</xsl:when>
+
<xsl:otherwise>
- <xsl:text>((Matcher)this.matchers.select(</xsl:text>"<xsl:value-of
select="$matcher-type"/>")).match(substitute(listOfMaps,"<xsl:value-of
select="$pattern-value"/>"), objectModel, <xsl:value-of
select="$component-param"/><xsl:text>)</xsl:text>
+ <xsl:text>matches("</xsl:text><xsl:value-of
select="$matcher-type"/>", <xsl:value-of select="$matcher-name2"/>_expr,
"<xsl:value-of select="XSLTFactoryLoader:escape($pattern-value)"/>",
listOfMaps, <xsl:value-of select="$component-param"/><xsl:text>,
objectModel)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -785,7 +868,7 @@
String cocoon_action = environment.getAction();
if ((map = <xsl:value-of select="$matcher-name"/>) != null) {
- getLogger().debug("Matched <xsl:value-of select="$matcher-type"/>
<xsl:value-of select="$matcher-name2"/><xsl:text>
</xsl:text>pattern:<xsl:value-of select="@pattern"/>");
+ getLogger().debug("Matched <xsl:value-of select="$matcher-type"/>
<xsl:value-of select="$matcher-name2"/><xsl:text>
</xsl:text>pattern:<xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @pattern)"/>");
listOfMaps.add (map);
<xsl:apply-templates/>
listOfMaps.remove (listOfMaps.size()-1);
No revision
No revision
1.2.2.20 +40 -120
xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java
Index: MRUMemoryStore.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java,v
retrieving revision 1.2.2.19
retrieving revision 1.2.2.20
diff -u -r1.2.2.19 -r1.2.2.20
--- MRUMemoryStore.java 2001/10/10 09:23:29 1.2.2.19
+++ MRUMemoryStore.java 2001/11/06 09:55:35 1.2.2.20
@@ -7,58 +7,34 @@
*****************************************************************************/
package org.apache.cocoon.components.store;
+import org.apache.avalon.excalibur.collections.SynchronizedPriorityQueue;
import org.apache.avalon.framework.component.ComponentException;
-
import org.apache.avalon.framework.component.ComponentManager;
-
import org.apache.avalon.framework.component.Composable;
-
import org.apache.avalon.framework.configuration.Configurable;
-
import org.apache.avalon.framework.configuration.Configuration;
-
import org.apache.avalon.framework.configuration.ConfigurationException;
-
import org.apache.avalon.framework.context.Context;
-
import org.apache.avalon.framework.context.ContextException;
-
import org.apache.avalon.framework.context.Contextualizable;
-
import org.apache.avalon.framework.logger.AbstractLoggable;
-
import org.apache.avalon.framework.parameters.Parameters;
-
import org.apache.avalon.framework.thread.ThreadSafe;
-
import org.apache.cocoon.Constants;
-
import org.apache.cocoon.util.ClassUtils;
-
import org.apache.cocoon.util.IOUtils;
-
-
import java.io.File;
-
import java.io.IOException;
-
import java.net.URLEncoder;
-
import java.util.Enumeration;
-
import java.util.HashMap;
-
import java.util.LinkedList;
-import java.util.Stack;
-
/**
* This class provides a cache algorithm for the requested documents.
* It combines a HashMap and a LinkedList to create a so called MRU
* (Most Recently Used) cache.
- * The objects can also be stored onto the filesystem to hold them in a
- * persitent state over jvm restarts.
*
* The idea was taken from the "Writing Advanced Application Tutorial" from
* javasoft. Many thanx to the writers!
@@ -66,26 +42,23 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
*/
-
-public class MRUMemoryStore extends AbstractLoggable implements Store,
Configurable,
- ThreadSafe,
Runnable,
- Composable,
Contextualizable {
-
- private int priority;
+public class MRUMemoryStore extends AbstractLoggable implements Store,
+ Configurable,
+ ThreadSafe,
+ Composable,
+
Contextualizable {
private int maxobjects;
private boolean filesystem;
private HashMap cache;
private LinkedList mrulist;
- private Runtime jvm;
private File cachefile;
private Store fsstore;
private StoreJanitor storejanitor;
- private Stack writerstack;
- private Thread writer;
private File cachedir;
private File workdir;
private String cachedirstr;
+ private FilesystemQueue filesystemQueue;
protected ComponentManager manager;
/**
@@ -100,6 +73,8 @@
this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
getLogger().debug("Looking up " + StoreJanitor.ROLE);
this.storejanitor = (StoreJanitor)manager.lookup(StoreJanitor.ROLE);
+ getLogger().debug("Looking up " + FilesystemQueue.ROLE);
+ this.filesystemQueue =
(FilesystemQueue)manager.lookup(FilesystemQueue.ROLE);
} catch(ComponentException e) {
getLogger().error("Error in compose()!", e);
}
@@ -118,8 +93,13 @@
this.workdir = (File)context.get(Constants.CONTEXT_WORK_DIR);
this.cachedirstr = IOUtils.getContextFilePath(this.workdir.getPath(),
this.cachedir.getPath());
+
+
- getLogger().debug("Context path="
+ this.getLogger().debug("cachedir=" + this.cachedir);
+ this.getLogger().debug("workdir=" + this.workdir);
+ this.getLogger().debug("cachedirstr=" + this.cachedirstr);
+ this.getLogger().debug("Context path="
+
IOUtils.getContextFilePath(this.workdir.getPath(),this.cachedir.getPath()));
} catch (Exception e) {
@@ -132,7 +112,6 @@
* A few options can be used :
* <UL>
* <LI>maxobjects = how many objects will be stored in memory (Default:
10 objects)</LI>
- * <LI>threadpriority = priority of the threads (1-10). (Default: 10)</LI>
* <LI>filesystem = use filesystem storage to keep object persistent
(Default: false)</LI>
* </UL>
*
@@ -140,57 +119,17 @@
* @exception ConfigurationException
*/
public void configure(Configuration conf) throws ConfigurationException {
- this.jvm = Runtime.getRuntime();
- this.mrulist = new LinkedList();
- this.writerstack = new Stack();
-
- this.storejanitor.register(this);
-
Parameters params = Parameters.fromConfiguration(conf);
this.maxobjects =
params.getParameterAsInteger("maxobjects",100);
- this.cache = new HashMap((int)(this.maxobjects * 1.2));
- this.priority =
params.getParameterAsInteger("threadpriority",Thread.currentThread().getPriority());
this.filesystem =
params.getParameterAsBoolean("filesystem",false);
- if ((this.priority < 1) || (this.priority > 10)) {
- throw new ConfigurationException("MRUMemoryStore cleanup thread
priority must be between 1 and 10!");
- }
if ((this.maxobjects < 1)) {
throw new ConfigurationException("MRUMemoryStore maxobjects must be at
least 1 milli second!");
}
- if (this.filesystem) {
- getLogger().debug("Intializing writer thread");
- writer = new Thread(this);
- writer.setPriority(this.priority);
- writer.setDaemon(true);
- writer.setName("writer");
- writer.start();
- }
- }
-
- /**
- * The writer thread writes objects from the writer stack onto the
filesystem.
- */
- public void run() {
- while (true) {
- getLogger().debug("Writerthread awake!");
- while(!writerstack.empty()) {
- try {
- TmpStackObject tmp = (TmpStackObject)this.writerstack.pop();
- this.fsstore.store(getFileName(tmp.getKey().toString()),
tmp.getObject());
- } catch(IOException e) {
- getLogger().error("Error in writer thread",e);
- } catch(Exception ex) {
- getLogger().error("Error in writer thread",ex);
- }
- }
+ this.cache = new HashMap((int)(this.maxobjects * 1.2));
+ this.mrulist = new LinkedList();
- synchronized (this.writer) {
- try {
- writer.wait();
- } catch (InterruptedException ignored) {}
- }
- }
+ this.storejanitor.register(this);
}
/**
@@ -225,12 +164,13 @@
/** put the object on the filesystem */
if(this.filesystem) {
- if(this.checkSerializable(value)) {
- getLogger().debug("Storing object on fs");
- this.writerstack.push(new TmpStackObject(key,value));
- getLogger().debug("Stack size=" + writerstack.size());
- synchronized (this.writer) {
- this.writer.notify();
+ if(this.checkSerializable(value) &&
+ !this.fsstore.containsKey(getFileName(key.toString()))) {
+ this.getLogger().debug("Storing object on fs");
+ try {
+ this.filesystemQueue.insert(new FilesystemQueueObject(key,value));
+ } catch(Exception e) {
+ this.getLogger().error("Error storing Object on fs",e);
}
}
}
@@ -238,7 +178,7 @@
this.cache.put(key, value);
this.mrulist.remove(key);
this.mrulist.addFirst(key);
- getLogger().debug("Cache size=" + cache.size());
+ this.getLogger().debug("Cache size=" + cache.size());
}
/**
@@ -248,7 +188,7 @@
* @return the requested object
*/
public Object get(Object key) {
- getLogger().debug("Getting object from memory. Key: " + key);
+ this.getLogger().debug("Getting object from memory. Key: " + key);
Object tmpobject = this.cache.get(key);
if ( tmpobject != null ) {
@@ -258,24 +198,27 @@
return tmpobject;
}
- getLogger().debug("Object not found in memory");
+ this.getLogger().debug("Object not found in memory");
/** try to fetch from filesystem */
if(this.filesystem) {
tmpobject = this.fsstore.get(getFileName(key.toString()));
if (tmpobject == null) {
- getLogger().debug( "Object was NOT found on fs. Looked for: " +
URLEncoder.encode(key.toString()) );
+ this.getLogger().debug( "Object was NOT found on fs. Looked for: "
+ + getFileName(key.toString()));
return null;
} else {
- getLogger().debug("Object was found on fs");
+ this.getLogger().debug("Object was found on fs");
try {
tmpobject = IOUtils.deserializeObject((File)tmpobject);
+ if(!this.cache.containsKey(key)) {
this.hold(key,tmpobject);
+ }
return tmpobject;
} catch (ClassNotFoundException ce) {
- getLogger().error("Error in get()!", ce);
+ this.getLogger().error("Error in get()!", ce);
return null;
} catch (IOException ioe) {
- getLogger().error("Error in get()!", ioe);
+ this.getLogger().error("Error in get()!", ioe);
return null;
}
}
@@ -289,7 +232,7 @@
* @param the key of to be removed object
*/
public void remove(Object key) {
- getLogger().debug("Removing object from store");
+ this.getLogger().debug("Removing object from store");
this.cache.remove(key);
this.mrulist.remove(key);
if(this.filesystem && key != null) {
@@ -329,10 +272,10 @@
this.getLogger().debug("Freeing cache");
this.cache.remove(this.mrulist.getLast());
this.mrulist.removeLast();
- getLogger().debug("Cache size=" + cache.size());
+ this.getLogger().debug("Cache size=" + cache.size());
}
} catch (Exception e) {
- getLogger().error("Error in free()", e);
+ this.getLogger().error("Error in free()", e);
}
}
@@ -346,7 +289,7 @@
*/
private boolean checkSerializable(Object object) {
try {
- getLogger().debug("Object=" + object);
+ this.getLogger().debug("Object=" + object);
if((object.getClass().getName().equals("org.apache.cocoon.caching.CachedEventObject"))
||
(object.getClass().getName().equals("org.apache.cocoon.caching.CachedStreamObject"))
||
(ClassUtils.implementsInterface(object.getClass().getName(),"org.apache.cocoon.caching.CacheValidity")))
{
@@ -355,7 +298,7 @@
return false;
}
} catch (Exception e) {
- getLogger().error("Error in checkSerializable()!", e);
+ this.getLogger().error("Error in checkSerializable()!", e);
return false;
}
}
@@ -375,28 +318,5 @@
.append(File.separator)
.append(URLEncoder.encode(key.toString()))
.toString();
- }
-
- /**
- * Temporary container object for the writerstack
- */
- static class TmpStackObject {
- private Object object;
- private Object key;
-
- public TmpStackObject (Object key, Object object) {
- this.object = object;
- this.key = key;
- }
-
- public TmpStackObject() {}
-
- public Object getKey() {
- return this.key;
- }
-
- public Object getObject() {
- return this.object;
- }
}
}
No revision
No revision
1.1.2.1 +0 -0
xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueue.java
Index: FilesystemQueue.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueue.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
1.1.2.1 +0 -0
xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueueImpl.java
Index: FilesystemQueueImpl.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueueImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
1.1.2.1 +0 -0
xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueueObject.java
Index: FilesystemQueueObject.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemQueueObject.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
No revision
No revision
1.1.1.1.2.7 +5 -5
xml-cocoon2/src/org/apache/cocoon/environment/Request.java
Index: Request.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Request.java,v
retrieving revision 1.1.1.1.2.6
retrieving revision 1.1.1.1.2.7
diff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7
--- Request.java 2001/10/11 08:56:10 1.1.1.1.2.6
+++ Request.java 2001/11/06 09:55:36 1.1.1.1.2.7
@@ -18,7 +18,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.1.1.2.6 $ $Date: 2001/10/11 08:56:10 $
+ * @version CVS $Revision: 1.1.1.1.2.7 $ $Date: 2001/11/06 09:55:36 $
*
*/
@@ -688,13 +688,13 @@
/**
*
- * Returns the current <code>HttpSession</code>
+ * Returns the current <code>Session</code>
* associated with this request or, if if there is no
* current session and <code>create</code> is true, returns
* a new session.
*
* <p>If <code>create</code> is <code>false</code>
- * and the request has no valid <code>HttpSession</code>,
+ * and the request has no valid <code>Session</code>,
* this method returns <code>null</code>.
*
* <p>To make sure the session is properly maintained,
@@ -710,7 +710,7 @@
* if there's no current session
*
*
- * @return the <code>HttpSession</code> associated
+ * @return the <code>Session</code> associated
* with this request or <code>null</code> if
* <code>create</code> is <code>false</code>
* and the request has no valid session
@@ -727,7 +727,7 @@
* Returns the current session associated with this request,
* or if the request does not have a session, creates one.
*
- * @return the <code>HttpSession</code> associated
+ * @return the <code>Session</code> associated
* with this request
*
* @see #getSession(boolean)
No revision
No revision
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/environment/ObjectModelHelper.java
Index: ObjectModelHelper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/ObjectModelHelper.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- ObjectModelHelper.java 2001/10/18 08:51:10 1.1
+++ ObjectModelHelper.java 2001/11/06 09:55:36 1.1.2.1
@@ -24,7 +24,7 @@
* environment.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/18 08:51:10 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public final class ObjectModelHelper {
No revision
No revision
1.2.2.5 +3 -2 xml-cocoon2/src/org/apache/cocoon/matching/Matcher.java
Index: Matcher.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/Matcher.java,v
retrieving revision 1.2.2.4
retrieving revision 1.2.2.5
diff -u -r1.2.2.4 -r1.2.2.5
--- Matcher.java 2001/10/11 08:56:13 1.2.2.4
+++ Matcher.java 2001/11/06 09:55:36 1.2.2.5
@@ -9,13 +9,14 @@
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.sitemap.PatternException;
import java.util.Map;
/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.2.2.4 $ $Date: 2001/10/11 08:56:13 $
+ * @version CVS $Revision: 1.2.2.5 $ $Date: 2001/11/06 09:55:36 $
*/
public interface Matcher extends Component {
@@ -36,7 +37,7 @@
* contained in the pattern.
* If the return value is null there was no match.
*/
- Map match (String pattern, Map objectModel, Parameters parameters);
+ Map match (String pattern, Map objectModel, Parameters parameters)
throws PatternException;
}
1.1.1.1.2.4 +7 -94
xml-cocoon2/src/org/apache/cocoon/matching/RegexpTargetHostMatcherFactory.java
Index: RegexpTargetHostMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/RegexpTargetHostMatcherFactory.java,v
retrieving revision 1.1.1.1.2.3
retrieving revision 1.1.1.1.2.4
diff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4
--- RegexpTargetHostMatcherFactory.java 2001/10/11 08:56:13
1.1.1.1.2.3
+++ RegexpTargetHostMatcherFactory.java 2001/11/06 09:55:36
1.1.1.1.2.4
@@ -7,104 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLoggable;
-import org.apache.cocoon.CodeFactory;
-import org.apache.regexp.RECompiler;
-import org.apache.regexp.REProgram;
-import org.apache.regexp.RESyntaxException;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
-
/**
- * This class generates source code which represents a specific pattern
matcher
- * for request URIs
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.1.1.1.2.3 $ $Date: 2001/10/11 08:56:13 $
+ * @version CVS $Revision: 1.1.1.1.2.4 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by RegexpTargetHostMatcher - code factories should
no longer be used
*/
-
-public class RegexpTargetHostMatcherFactory extends AbstractLoggable
implements CodeFactory {
-
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "org.apache.regexp.RE";
- }
- public String generateClassSource (String prefix, String pattern,
- NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer ();
- String pat = correctPattern(pattern);
- try {
- RECompiler r = new RECompiler();
- String name = prefix;
- String instructions = name + "PatternInstructions";
- sb.append("\n // Pre-compiled regular expression '")
- .append(pat).append("'\n")
- .append(" static char[] ");
- sb.append(instructions).append(" = \n {");
- REProgram program = r.compile(pat);
- int numColumns = 7;
- char[] p = program.getInstructions();
- for (int j = 0; j < p.length; j++) {
- if ((j % numColumns) == 0) {
- sb.append("\n ");
- }
- String hex = Integer.toHexString(p[j]);
- while (hex.length() < 4) {
- hex = "0" + hex;
- }
- sb.append("0x").append(hex).append(", ");
- }
- sb.append("\n };")
- .append("\n static org.apache.regexp.RE ")
- .append(name)
- .append("_expr = new org.apache.regexp.RE(new
org.apache.regexp.REProgram(")
- .append(instructions)
- .append("));");
- return sb.toString();
- } catch (RESyntaxException rse) {
- getLogger().warn("Syntax exception while compiling regexp '" +
pat + "'.", rse);
- throw new ConfigurationException (rse.getMessage(), rse);
- }
+public class RegexpTargetHostMatcherFactory extends RegexpTargetHostMatcher
implements Initializable {
+
+ public void initialize() {
+ getLogger().warn("RegexpTargetHostMatcherFactory is deprecated.
Please use RegexpTargetHostMatcher");
}
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer ();
- sb.append("HashMap map = new HashMap ();")
- .append("String host =
XSPRequestHelper.getHeader(objectModel,\"Host\");")
- .append("getLogger().debug(\"Matching against host: \" + host +
\".\");")
- .append("if(pattern.match(host)) {");
- /* Handle parenthesised subexpressions. XXX: could be faster if we
count
- * parens *outside* the generated code.
- * Note: *ONE* based, not zero.
- */
- sb.append("int parenCount = pattern.getParenCount();")
- .append("for (int paren = 1; paren <= parenCount; paren++) {")
- .append("map.put(Integer.toString(paren),
pattern.getParen(paren));")
- .append("}");
- sb.append("return map; } else { return null; }");
- return sb.toString();
- }
-
- private String correctPattern (String pattern) {
- char[] pat = new char[pattern.length()];
- pattern.getChars (0, pattern.length(), pat, 0);
- int j = 0;
- int i = 0;
- while (i < pat.length-1) {
- if (pat[i] == '\\') {
- if (pat[i+1] == '\\') {
- i++;
- }
- }
- pat[j++]=pat[i++];
- }
- pat[j]=pat[i];
- return new String(pat,0,j+1);
- }
}
1.1.1.1.2.4 +7 -109
xml-cocoon2/src/org/apache/cocoon/matching/RegexpURIMatcherFactory.java
Index: RegexpURIMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/RegexpURIMatcherFactory.java,v
retrieving revision 1.1.1.1.2.3
retrieving revision 1.1.1.1.2.4
diff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4
--- RegexpURIMatcherFactory.java 2001/10/11 08:56:13 1.1.1.1.2.3
+++ RegexpURIMatcherFactory.java 2001/11/06 09:55:36 1.1.1.1.2.4
@@ -7,119 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLoggable;
-import org.apache.cocoon.CodeFactory;
-import org.apache.regexp.RECompiler;
-import org.apache.regexp.REProgram;
-import org.apache.regexp.RESyntaxException;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which represents a specific pattern
matcher
- * for request URIs
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.1.1.2.3 $ $Date: 2001/10/11 08:56:13 $
+ * @version CVS $Revision: 1.1.1.1.2.4 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by RegexpURIMatcher - code factories should no
longer be used
*/
-public class RegexpURIMatcherFactory extends AbstractLoggable implements
CodeFactory {
-
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "org.apache.regexp.RE";
- }
-
- public String generateClassSource (String prefix, String pattern,
- NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer ();
- try {
- RECompiler r = new RECompiler();
- String name = prefix;
- String instructions = name + "PatternInstructions";
- String pat = correctPattern (pattern);
- sb.append("// Pre-compiled regular expression '")
- .append(pat).append("'\n")
- .append(" static char[] ");
- sb.append(instructions).append(" = {");
- REProgram program = r.compile(pat);
- int numColumns = 7;
- char[] p = program.getInstructions();
- for (int j = 0; j < p.length; j++) {
- if ((j % numColumns) == 0) {
- sb.append("\n");
- }
- String hex = Integer.toHexString(p[j]);
- while (hex.length() < 4) {
- hex = "0" + hex;
- }
- sb.append("0x").append(hex).append(", ");
- }
- sb.append("\n};\nstatic org.apache.regexp.RE ")
- .append(name)
- .append("_expr = new org.apache.regexp.RE(new
org.apache.regexp.REProgram(")
- .append(instructions)
- .append("));\n")
- .append("static ArrayList ")
- .append(name)
- .append("_list = new ArrayList();\n")
- .append("static {");
- // Count number of parens
- int i = 0;
- int j = -1;
- while ((j = pat.indexOf('(', j+1)) != -1) {
- if (j == 0 || pat.charAt(j-1) != '\\') {
- sb.append(name)
- .append("_list.add (")
- .append(name)
- .append("_expr.getParen(")
- .append(++i).append("));");
- }
- }
- sb.append("}");
- return sb.toString();
- } catch (RESyntaxException rse) {
- getLogger().debug("RegexpURIMatcherFactory", rse);
- throw new ConfigurationException (rse.getMessage(), rse);
- }
+public class RegexpURIMatcherFactory extends RegexpURIMatcher implements
Initializable {
+
+ public void initialize() {
+ getLogger().warn("RegexpURIMatcherFactory is deprecated. Please use
RegexpURIMatcher");
}
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer ();
- sb.append("HashMap map = new HashMap ();")
- .append("String uri =
XSPRequestHelper.getSitemapURI(objectModel);")
- .append("if(uri.startsWith(\"/\")) uri = uri.substring(1);")
- .append("if(pattern.match(uri)) {");
- /* Handle parenthesised subexpressions. XXX: could be faster if we
count
- * parens *outside* the generated code.
- * Note: *ONE* based, not zero.
- */
- sb.append("int parenCount = pattern.getParenCount();")
- .append("for (int paren = 1; paren <= parenCount; paren++) {")
- .append("map.put(Integer.toString(paren),
pattern.getParen(paren));")
- .append("}");
-
- sb.append("return map; } else { return null; }");
- return sb.toString();
- }
-
- private String correctPattern (String pattern) {
- char[] pat = new char[pattern.length()];
- pattern.getChars (0, pattern.length(), pat, 0);
- int j = 0;
- int i = 0;
- while (i < pat.length-1) {
- if (pat[i] == '\\') {
- if (pat[i+1] == '\\') {
- i++;
- }
- }
- pat[j++]=pat[i++];
- }
- pat[j]=pat[i];
- return new String(pat,0,j+1);
- }
}
1.1.2.9 +7 -78
xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcherFactory.java
Index: WildcardHeaderMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcherFactory.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- WildcardHeaderMatcherFactory.java 2001/10/25 20:36:24 1.1.2.8
+++ WildcardHeaderMatcherFactory.java 2001/11/06 09:55:36 1.1.2.9
@@ -7,88 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which represents a specific pattern
matcher
- * for values of request headers, e.g. "referer"
- *
- * <p><b>Global and local configuration</b></p>
- * <table border="1">
- * <tr><td><code>parameter-name</code></td><td>Name of the request header to
- * match against</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by WildcardHeaderMatcher - code factories should no
longer be used
*/
-public class WildcardHeaderMatcherFactory extends WildcardURIMatcherFactory {
-
- /**
- * Generates the matcher method level source code
- */
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
-
- String parameterName = null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("parameter-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- parameterName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("HashMap map = new HashMap(1);")
- .append("String parameterName = null;")
- .append("String parameterValue = null;")
- .append("if (parameters.getNames().length == 0) {");
- if ( parameterName == null ) {
- sb
- .append(" getLogger().warn(\"No request header name and no
default name given. FAILING\");")
- .append("} else { ")
- .append(" parameterName =
parameters.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request header name and no
default name given. FAILING\");")
- .append(" } else {")
- .append(" parameterValue =
XSPRequestHelper.getHeader(objectModel, parameterName); ")
- .append(" }");
- } else {
- sb
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" parameterValue =
XSPRequestHelper.getHeader(objectModel, parameterName);")
- .append("} else { ")
- .append(" parameterName =
parameters.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request header name given,
will use default\");")
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" }")
- .append(" parameterValue =
XSPRequestHelper.getHeader(objectModel, parameterName); ");
- }
- sb
- .append("}")
- .append("if ( parameterValue == null ) {")
- .append(" getLogger().debug(\"Request header not set\");")
- .append("} else {")
- .append(" if
(org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (map,
parameterValue, pattern)) {")
- .append(" map.put(parameterName, parameterValue ); ")
- .append(" return map;")
- .append(" }")
- .append("}")
- .append("return null;");
- return sb.toString();
+public class WildcardHeaderMatcherFactory extends WildcardHeaderMatcher
implements Initializable {
+
+ public void initialize() {
+ getLogger().warn("WildcardHeaderMatcherFactory is deprecated. Please
use WildcardHeaderMatcher");
}
}
1.1.2.9 +9 -83
xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcherFactory.java
Index: WildcardParameterValueMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcherFactory.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- WildcardParameterValueMatcherFactory.java 2001/10/25 20:36:24 1.1.2.8
+++ WildcardParameterValueMatcherFactory.java 2001/11/06 09:55:36 1.1.2.9
@@ -7,91 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which represents a specific pattern
matcher
- * for request parameters.
- *
- * <p> In contrast to the [EMAIL PROTECTED] RequestParamMatcher} this matcher
- * factory generates matchers that match the <b>value</b> of a request
- * parameter.</p>
- *
- * <p><b>Global and local configuration</b></p>
- * <table border="1">
- * <tr><td><code>parameter-name</code></td><td>Name of the request parameter
to
- * match against</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $ */
-
-public class WildcardParameterValueMatcherFactory extends
WildcardURIMatcherFactory {
-
- /**
- * Generates the matcher method level source code
- */
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
-
- String parameterName = null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("parameter-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- parameterName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("HashMap map = new HashMap(1);")
- .append("String parameterName = null;")
- .append("String parameterValue = null;")
- .append("if (parameters.getNames().length == 0) {");
- if ( parameterName == null ) {
- sb
- .append(" getLogger().warn(\"No request parameter name and no
default name given. FAILING\");")
- .append("} else { ")
- .append(" parameterName =
parameters.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request parameter name and
no default name given. FAILING\");")
- .append(" } else {")
- .append(" parameterValue =
XSPRequestHelper.getParameter(objectModel, parameterName, null); ")
- .append(" }");
- } else {
- sb
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" parameterValue =
XSPRequestHelper.getParameter(objectModel, parameterName, null);")
- .append("} else { ")
- .append(" parameterName =
parameters.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request parameter name
given, will use default\");")
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" }")
- .append(" parameterValue =
XSPRequestHelper.getParameter(objectModel, parameterName, null); ");
- }
- sb
- .append("}")
- .append("if ( parameterValue == null ) {")
- .append(" getLogger().debug(\"Request parameter not set\");")
- .append("} else {")
- .append(" if
(org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (map,
parameterValue, pattern)) {")
- .append(" map.put(parameterName, parameterValue ); ")
- .append(" return map;")
- .append(" }")
- .append("}")
- .append("return null;");
- return sb.toString();
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by WildcardParameterValueMatcher - code factories
should no longer be used
+ */
+
+public class WildcardParameterValueMatcherFactory extends
WildcardParameterValueMatcher implements Initializable {
+
+ public void initialize() {
+ getLogger().warn("WildcardParameterValueMatcherFactory is
deprecated. Please use WildcardParameterValueMatcher");
}
}
1.1.2.6 +8 -77
xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcherFactory.java
Index: WildcardSessionAttributeMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcherFactory.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- WildcardSessionAttributeMatcherFactory.java 2001/10/25 20:36:24
1.1.2.5
+++ WildcardSessionAttributeMatcherFactory.java 2001/11/06 09:55:36
1.1.2.6
@@ -7,86 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which represents a specific pattern
matcher
- * for a session attribute.
- *
- * <p><b>Global and local configuration</b></p>
- * <tableborder="1">
- * <tr><td><code>attribute-name</code></td><td>String identifying the
session attribute</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by WildcardSessionAttributeMatcher - code factories
should no longer be used
*/
-public class WildcardSessionAttributeMatcherFactory extends
WildcardURIMatcherFactory {
-
- /**
- * Generates the matcher method level source code
- */
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
-
- String attributeName=null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("attribute-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- attributeName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("HashMap map = new HashMap(1);")
- .append("String attributeName = null;")
- .append("String attributeValue = null;")
- .append("if (parameters.getNames().length == 0) {");
- if ( attributeName == null ) {
- sb
- .append(" getLogger().warn(\"No session attribute and no
default attribute given. FAILING\");")
- .append("} else { ")
- .append(" attributeName =
parameters.getParameter(\"attribute-name\", null);")
- .append(" if ( attributeName == null ) {")
- .append(" getLogger().warn(\"No session attribute and no
default attribute given. FAILING\");")
- .append(" } else {")
- .append(" attributeValue = (String)
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ")
- .append(" }");
- } else {
- sb
- .append(" attributeName =
\"").append(attributeName).append("\";")
- .append(" attributeValue = (String)
XSPRequestHelper.getSessionAttribute(objectModel, attributeName);")
- .append("} else { ")
- .append(" attributeName =
parameters.getParameter(\"attribute-name\", null);")
- .append(" if ( attributeName == null ) {")
- .append(" getLogger().warn(\"No session attribute given,
will use default\");")
- .append(" attributeName =
\"").append(attributeName).append("\";")
- .append(" }")
- .append(" attributeValue = (String)
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ");
- }
- sb
- .append("}")
- .append("if ( attributeValue == null ) {")
- .append(" getLogger().debug(\"Session attribute not set\");")
- .append("} else {")
- .append(" if
(org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (map,
attributeValue, pattern)) {")
- .append(" map.put(attributeName, attributeValue ); ")
- .append(" return map;")
- .append(" }")
- .append("}")
- .append("return null;");
- return sb.toString();
+public class WildcardSessionAttributeMatcherFactory extends
WildcardSessionAttributeMatcher implements Initializable {
+
+ public void initialize() {
+ getLogger().warn("WildcardSessionAttributeMatcherFactory is
deprecated. Please use WildcardSessionAttributeMatcher");
}
+
}
1.2.2.4 +6 -166
xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcherFactory.java
Index: WildcardURIMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcherFactory.java,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -r1.2.2.3 -r1.2.2.4
--- WildcardURIMatcherFactory.java 2001/10/25 20:36:24 1.2.2.3
+++ WildcardURIMatcherFactory.java 2001/11/06 09:55:36 1.2.2.4
@@ -7,177 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.matching;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLoggable;
-import org.apache.cocoon.CodeFactory;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which represents a specific pattern
matcher
- * for request URIs
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.2.2.3 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.2.2.4 $ $Date: 2001/11/06 09:55:36 $
+ * @deprecated replaced by WildcardURIMatcher - code factories should no
longer be used
*/
-public class WildcardURIMatcherFactory extends AbstractLoggable implements
CodeFactory {
+public class WildcardURIMatcherFactory extends WildcardURIMatcher implements
Initializable {
- /** The int representing '*' in the pattern <code>int []</code>. */
- protected static final int MATCH_FILE = -1;
- /** The int representing '**' in the pattern <code>int []</code>. */
- protected static final int MATCH_PATH = -2;
- /** The int representing begin in the pattern <code>int []</code>. */
- protected static final int MATCH_BEGIN = -4;
- /** The int representing end in pattern <code>int []</code>. */
- protected static final int MATCH_THEEND = -5;
- /** The int value that terminates the pattern <code>int []</code>. */
- protected static final int MATCH_END = -3;
-
- /** The <code>int []</code> identifying the pattern to match. */
- protected int[] sourcePattern = null;
-
- /**
- * Generates the matcher parameter level source code
- */
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "int []";
+ public void initialize() {
+ getLogger().warn("WildcardURIMatcherFactory is deprecated. Please
use WildcardURIMatcher");
}
- /**
- * Generates the matcher method level source code
- */
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- return new StringBuffer("HashMap map = new HashMap();")
- .append("String uri =
XSPRequestHelper.getSitemapURI(objectModel);")
- .append("if (uri.startsWith(\"/\")) uri = uri.substring(1);")
- .append("if
(org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (map, uri,
pattern)) {")
- .append("return map;").append("} else {")
- .append("return null;}").toString();
- }
-
- /**
- * Generates the matcher class level source code
- */
- public String generateClassSource (String prefix, String pattern,
- NodeList conf)
- throws ConfigurationException {
- StringBuffer result = new StringBuffer();
- try {
- this.setPattern (pattern);
-
- result.append ("\n// wildcard pattern =
\"").append(pattern).append("\"\n\t")
- .append ("static int[] ").append(prefix).append("_expr =
{");
-
- int j = sourcePattern.length - 1;
- for (int i = 0; i < j; i++) {
- result.append (sourcePattern[i])
- .append (',');
- }
- return result.append (sourcePattern[j])
- .append ("};\n").toString();
- } catch (NullPointerException pe) {
- getLogger().error("WildcardURIMatcherFactory:NULL", pe);
- throw new ConfigurationException (pe.getMessage(), pe);
- }
- }
-
- /**
- * Set the pattern for matching.
- */
- public void setPattern(String pattern)
- throws NullPointerException {
- if (pattern == null) throw new NullPointerException("Pattern cannot
be null");
- this.sourcePattern = this.convertPattern(pattern);
- }
-
- /**
- * Translate the given <code>String</code> into a <code>int []</code>
- * representing the pattern matchable by this class.
- * <br>
- * This function translates a <code>String</code> into an int array
- * converting the special '*' and '\' characters.
- * <br>
- * Here is how the conversion algorithm works:
- * <ul>
- * <li>The '*' character is converted to MATCH_FILE, meaning that zero
- * or more characters (excluding the path separator '/') are to
- * be matched.</li>
- * <li>The '**' sequence is converted to MATCH_PATH, meaning that zero
- * or more characters (including the path separator '/') are to
- * be matched.</li>
- * <li>The '\' character is used as an escape sequence ('\*' is
- * translated in '*', not in MATCH_FILE). If an exact '\' character
- * is to be matched the source string must contain a '\\'.
- * sequence.</li>
- * </ul>
- * When more than two '*' characters, not separated by another character,
- * are found their value is considered as '**' (MATCH_PATH).
- * <br>
- * The array is always terminated by a special value (MATCH_END).
- * <br>
- * All MATCH* values are less than zero, while normal characters are
equal
- * or greater.
- *
- * @parameter data The string to translate.
- * @return The encoded string as an int array, terminated by the
MATCH_END
- * value (don't consider the array length).
- * @exception NullPointerException If data is null.
- */
- protected int[] convertPattern(String data)
- throws NullPointerException {
-
- // Prepare the arrays
- int expr[] = new int[data.length() + 2];
- char buff[] = data.toCharArray();
-
- // Prepare variables for the translation loop
- int y = 0;
- boolean slash = false;
-
- // Must start from beginning
- expr[y++] = MATCH_BEGIN;
-
- if (buff.length > 0) {
- if (buff[0]=='\\') {
- slash = true;
- } else if (buff[0] == '*') {
- expr[y++] = MATCH_FILE;
- } else {
- expr[y++] = buff[0];
- }
-
- // Main translation loop
- for (int x = 1; x < buff.length; x++) {
- // If the previous char was '\' simply copy this char.
- if (slash) {
- expr[y++] = buff[x];
- slash = false;
- // If the previous char was not '\' we have to do a bunch of
checks
- } else {
- // If this char is '\' declare that and continue
- if (buff[x] == '\\') {
- slash = true;
- // If this char is '*' check the previous one
- } else if (buff[x] == '*') {
- // If the previous character als was '*' match a path
- if (expr[y-1] <= MATCH_FILE) {
- expr[y-1] = MATCH_PATH;
- } else {
- expr[y++] = MATCH_FILE;
- }
- } else {
- expr[y++]=buff[x];
- }
- }
- }
- }
-
- // Must match end at the end
- expr[y] = MATCH_THEEND;
- return expr;
- }
}
No revision
No revision
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/AbstractPreparableMatcher.java
Index: AbstractPreparableMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/AbstractPreparableMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- AbstractPreparableMatcher.java 2001/10/22 10:17:45 1.1
+++ AbstractPreparableMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -20,7 +20,7 @@
* or to match with a request-time evaluated pattern (for {..} substitution).
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public abstract class AbstractPreparableMatcher extends AbstractLoggable
implements PreparableMatcher {
1.2.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/AbstractRegexpMatcher.java
Index: AbstractRegexpMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/AbstractRegexpMatcher.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- AbstractRegexpMatcher.java 2001/10/22 10:17:45 1.2
+++ AbstractRegexpMatcher.java 2001/11/06 09:55:36 1.2.2.1
@@ -27,7 +27,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @authos <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.2 $ $Date: 2001/10/22 10:17:45 $
+ * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public abstract class AbstractRegexpMatcher extends
AbstractPreparableMatcher implements ThreadSafe {
1.2.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/AbstractWildcardMatcher.java
Index: AbstractWildcardMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/AbstractWildcardMatcher.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- AbstractWildcardMatcher.java 2001/10/22 10:17:45 1.2
+++ AbstractWildcardMatcher.java 2001/11/06 09:55:36 1.2.2.1
@@ -23,7 +23,7 @@
* Base class for wildcard matchers
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.2 $ $Date: 2001/10/22 10:17:45 $
+ * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public abstract class AbstractWildcardMatcher extends
AbstractPreparableMatcher implements ThreadSafe {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/PreparableMatcher.java
Index: PreparableMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/PreparableMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- PreparableMatcher.java 2001/10/22 10:17:45 1.1
+++ PreparableMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -20,7 +20,7 @@
* or to match with a request-time evaluated pattern (for {..} substitution).
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public interface PreparableMatcher extends Matcher {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/RegexpTargetHostMatcher.java
Index: RegexpTargetHostMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/RegexpTargetHostMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- RegexpTargetHostMatcher.java 2001/10/19 15:28:45 1.1
+++ RegexpTargetHostMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -19,7 +19,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class RegexpTargetHostMatcher extends AbstractRegexpMatcher {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/RegexpURIMatcher.java
Index: RegexpURIMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/RegexpURIMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- RegexpURIMatcher.java 2001/10/19 15:28:45 1.1
+++ RegexpURIMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -26,7 +26,7 @@
* Matches the request URIs against a regular expression pattern.
*
* @authos <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class RegexpURIMatcher extends AbstractRegexpMatcher {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcher.java
Index: WildcardHeaderMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardHeaderMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- WildcardHeaderMatcher.java 2001/10/19 15:28:45 1.1
+++ WildcardHeaderMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -27,7 +27,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class WildcardHeaderMatcher extends AbstractWildcardMatcher
implements Configurable {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcher.java
Index: WildcardParameterValueMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardParameterValueMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- WildcardParameterValueMatcher.java 2001/10/19 15:28:45 1.1
+++ WildcardParameterValueMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -27,7 +27,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class WildcardParameterValueMatcher extends AbstractWildcardMatcher
implements Configurable {
1.2.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java
Index: WildcardSessionAttributeMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- WildcardSessionAttributeMatcher.java 2001/10/22 10:17:46 1.2
+++ WildcardSessionAttributeMatcher.java 2001/11/06 09:55:36 1.2.2.1
@@ -26,7 +26,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.2 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class WildcardSessionAttributeMatcher extends WildcardURIMatcher {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcher.java
Index: WildcardURIMatcher.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardURIMatcher.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- WildcardURIMatcher.java 2001/10/19 15:28:45 1.1
+++ WildcardURIMatcher.java 2001/11/06 09:55:36 1.1.2.1
@@ -22,7 +22,7 @@
* Match the request URI against a regular expression.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:36 $
*/
public class WildcardURIMatcher extends AbstractWildcardMatcher {
No revision
No revision
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardHelper.java
Index: WildcardHelper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardHelper.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- WildcardHelper.java 2001/10/19 15:28:45 1.1
+++ WildcardHelper.java 2001/11/06 09:55:37 1.1.2.1
@@ -18,7 +18,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class WildcardHelper {
No revision
No revision
1.1.1.1.2.6 +7 -62
xml-cocoon2/src/org/apache/cocoon/selection/BrowserSelectorFactory.java
Index: BrowserSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/BrowserSelectorFactory.java,v
retrieving revision 1.1.1.1.2.5
retrieving revision 1.1.1.1.2.6
diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6
--- BrowserSelectorFactory.java 2001/10/11 08:56:13 1.1.1.1.2.5
+++ BrowserSelectorFactory.java 2001/11/06 09:55:37 1.1.1.1.2.6
@@ -7,72 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.cocoon.CodeFactory;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code which tests a specific browser pattern
- * agains the requesting user-agent
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.1.1.2.5 $ $Date: 2001/10/11 08:56:13 $
-*/
+ * @version CVS $Revision: 1.1.1.1.2.6 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by BrowserSelector - code factories should no longer
be used
+ */
+public class BrowserSelectorFactory extends BrowserSelector implements
Initializable {
-public class BrowserSelectorFactory implements CodeFactory {
-
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "String []";
- }
-
- public String generateClassSource (String prefix, String test, NodeList
conf)
- throws ConfigurationException {
- Node node = null;
- Node nodeattrname = null;
- Node nodeattruseragent = null;
- NamedNodeMap nm = null;
- int cnt = 0;
- StringBuffer sb = new StringBuffer();
- sb.append("static String [] ")
- .append(prefix)
- .append("_expr = {");
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- node = conf.item(k);
- if (node != null &&
- node.getNodeName().equals("browser") &&
- node.getNodeType() == Node.ELEMENT_NODE) {
- nm = node.getAttributes();
- if (nm != null) {
- nodeattrname = nm.getNamedItem("name");
- nodeattruseragent = nm.getNamedItem("useragent");
- if (nodeattrname != null && nodeattruseragent != null
- && nodeattrname.getNodeValue().equals(test)) {
- sb.append(cnt++==0 ? "\"" : ",\"")
- .append(nodeattruseragent.getNodeValue())
- .append("\"");
- }
- }
- }
- }
- return sb.append("};").toString();
+ public void initialize() {
+ getLogger().warn("BrowserSelectorFactory is deprecated. Please use
BrowserSelector");
}
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer();
- sb.append("if (pattern != null &&
objectModel.get(Constants.REQUEST_OBJECT) != null) {")
- .append("String userAgent =
XSPRequestHelper.getHeader(objectModel,\"User-Agent\");")
- .append("if(null == userAgent)\nreturn false;")
- .append("XSPResponseHelper.addHeader(objectModel, \"Vary\",
\"User-Agent\");")
- .append("for (int i = 0; i < pattern.length; i++) {")
- .append("if (userAgent.indexOf(pattern[i]) != -1) return true;}");
- return sb.append("} return false;").toString();
- }
}
1.1.2.9 +7 -65
xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelectorFactory.java
Index: HeaderSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelectorFactory.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- HeaderSelectorFactory.java 2001/10/25 20:36:24 1.1.2.8
+++ HeaderSelectorFactory.java 2001/11/06 09:55:37 1.1.2.9
@@ -7,75 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code to implement a selector that
- * matches a string against a configurable request header, e.g. "referer".
- *
- * <p><b>Global and local configuration</b></p>
- * <table border="1">
- * <tr><td><code>parameter-name</code></td><td>Name of the request header to
- * match against</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by HeaderSelector - code factories should no longer
be used
*/
-public class HeaderSelectorFactory extends ParameterSelectorFactory {
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
+public class HeaderSelectorFactory extends HeaderSelector implements
Initializable {
- String parameterName = null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("parameter-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- parameterName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("String compareToString = null;")
- .append("if (param.getNames().length == 0) {");
- if ( parameterName == null ) {
- sb
- .append(" getLogger().warn(\"No request header name and no
default name given. FAILING\");")
- .append("} else { ")
- .append(" String parameterName =
param.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request header name and no
default name given. FAILING\");")
- .append(" } else {")
- .append(" compareToString = (String)
XSPRequestHelper.getHeader(objectModel, parameterName);")
- .append(" }");
- } else {
- sb
- .append(" compareToString = (String)
XSPRequestHelper.getHeader(objectModel,
\"").append(parameterName).append("\");")
- .append("} else { ")
- .append(" String parameterName =
param.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request header name given,
will use default\");")
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" }")
- .append(" compareToString = (String)
XSPRequestHelper.getHeader(objectModel, parameterName);");
- }
- sb
- .append("}")
- .append("if ( compareToString == null ) {")
- .append(" getLogger().debug(\"request header not set\");")
- .append("}")
- .append("return compareToString != null && compareToString.equals
(pattern);");
- return sb.toString();
+ public void initialize() {
+ getLogger().warn("HeaderSelectorFactory is deprecated. Please use
HeaderSelector");
}
+
}
1.1.1.1.2.6 +7 -73
xml-cocoon2/src/org/apache/cocoon/selection/HostSelectorFactory.java
Index: HostSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/HostSelectorFactory.java,v
retrieving revision 1.1.1.1.2.5
retrieving revision 1.1.1.1.2.6
diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6
--- HostSelectorFactory.java 2001/10/11 08:56:13 1.1.1.1.2.5
+++ HostSelectorFactory.java 2001/11/06 09:55:37 1.1.1.1.2.6
@@ -7,83 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.cocoon.CodeFactory;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code to implement a selector that
- * matches a string from within the host parameter of the HTTP request
- *
- * <map:selector name="host"
src="org.apache.cocoon.selection.HostSelectorFactory">
- * <host name="uk-site" value="www.foo.co.uk"/>
- * </map:selector>
- *
- *
- * <map:select type="host">
- * <map:when test="uk-site">
- * <map:transform src="stylesheets/page/uk.xsl"/>
- * </map:when>
- * <map:otherwise>
- * <map:transform src="stylesheets/page/us.xsl"/>
- * </map:otherwise>
- * </map:select>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Colin Britton</a>
- * @version CVS $Revision: 1.1.1.1.2.5 $ $Date: 2001/10/11 08:56:13 $
-*/
+ * @version CVS $Revision: 1.1.1.1.2.6 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by HostSelector - code factories should no longer be
used
+ */
+public class HostSelectorFactory extends HostSelector implements
Initializable {
-public class HostSelectorFactory implements CodeFactory {
-
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "String []";
- }
-
- public String generateClassSource (String prefix, String test, NodeList
conf)
- throws ConfigurationException {
- Node node = null;
- Node nodeattrname = null;
- Node nodeattrhost = null;
- NamedNodeMap nm = null;
- int cnt = 0;
- StringBuffer sb = new StringBuffer();
- sb.append("static String [] ")
- .append(prefix)
- .append("_expr = {");
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- node = conf.item(k);
- if (node != null &&
- node.getNodeName().equals("host") &&
- node.getNodeType() == Node.ELEMENT_NODE) {
- nm = node.getAttributes();
- if (nm != null) {
- nodeattrname = nm.getNamedItem("name");
- nodeattrhost = nm.getNamedItem("value");
- if (nodeattrname != null && nodeattrhost != null
- && nodeattrname.getNodeValue().equals(test)) {
- sb.append(cnt++==0 ? "\"" : ",\"")
- .append(nodeattrhost.getNodeValue())
- .append("\"");
- }
- }
- }
- }
- return sb.append("};").toString();
+ public void initialize() {
+ getLogger().warn("HostSelectorFactory is deprecated. Please use
HostSelector");
}
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer();
- sb.append("if (pattern != null &&
objectModel.get(Constants.REQUEST_OBJECT) != null) {")
- .append("String hostServer =
XSPRequestHelper.getHeader(objectModel, \"host\");")
- .append("XSPResponseHelper.addHeader(objectModel, \"Vary\",
\"host\");")
- .append("for (int i = 0; i < pattern.length; i++) {")
- .append("if (hostServer.indexOf(pattern[i]) != -1) return true;}");
- return sb.append("} return false;").toString();
- }
}
1.1.1.1.2.5 +7 -50
xml-cocoon2/src/org/apache/cocoon/selection/ParameterSelectorFactory.java
Index: ParameterSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/ParameterSelectorFactory.java,v
retrieving revision 1.1.1.1.2.4
retrieving revision 1.1.1.1.2.5
diff -u -r1.1.1.1.2.4 -r1.1.1.1.2.5
--- ParameterSelectorFactory.java 2001/10/11 08:56:13 1.1.1.1.2.4
+++ ParameterSelectorFactory.java 2001/11/06 09:55:37 1.1.1.1.2.5
@@ -7,61 +7,18 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.cocoon.CodeFactory;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.logger.Loggable;
+import org.apache.log.Logger;
/**
- * This class generates source code to implement a selector that
- * matches a string in the parameters object passed to it.
- *
- * <pre>
- * <map:selector name="parameter"
factory="org.apache.cocoon.selection.ParameterSelectorFactory"/>
- *
- * <map:select type="parameter">
- * <parameter name="parameter-selector-test"
value="{$mySitemapParameter}"/>
- * <map:when test="myParameterValue">
- * <!-- executes iff {$mySitemapParameter} == "myParameterValue"
-->
- * <map:transform src="stylesheets/page/uk.xsl"/>
- * </map:when>
- * <map:otherwise>
- * <map:transform src="stylesheets/page/us.xsl"/>
- * </map:otherwise>
- * </map:select>
- * </pre>
- *
- * The purpose of this selector is to allow an action to set parameters
- * and to be able to select between different pipeline configurations
- * depending on those parameters.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Leo Sutic</a>
- * @version CVS $Revision: 1.1.1.1.2.4 $ $Date: 2001/10/11 08:56:13 $
+ * @version CVS $Revision: 1.1.1.1.2.5 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by ParameterSelector - code factories should no
longer be used
*/
-public class ParameterSelectorFactory implements CodeFactory {
- public String generateParameterSource (NodeList conf)
- throws ConfigurationException {
- return "String ";
- }
+public class ParameterSelectorFactory extends ParameterSelector implements
Loggable {
- public String generateClassSource (String prefix, String test, NodeList
conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer ();
- sb.append("static String ")
- .append(prefix)
- .append("_expr = \"")
- .append (test)
- .append ("\";");
- return sb.toString();
+ public void setLogger(Logger logger) {
+ logger.warn("ParameterSelectorFactory is deprecated. Please use
ParameterSelector");
}
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
- StringBuffer sb = new StringBuffer();
- sb.append("if (param != null) {")
- .append("String compareToString = param.getParameter
(\"parameter-selector-test\", null);")
- .append("return compareToString != null && compareToString.equals
(pattern);")
- .append("} return false;");
- return sb.toString();
- }
}
1.1.2.9 +7 -65
xml-cocoon2/src/org/apache/cocoon/selection/RequestSelectorFactory.java
Index: RequestSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/RequestSelectorFactory.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- RequestSelectorFactory.java 2001/10/25 20:36:24 1.1.2.8
+++ RequestSelectorFactory.java 2001/11/06 09:55:37 1.1.2.9
@@ -7,75 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code to implement a selector that
- * matches a string against a configurable request parameter's value.
- *
- * <p><b>Global and local configuration</b></p>
- * <table border="1">
- * <tr><td><code>parameter-name</code></td><td>Name of the request
- * parameter whose value to match against</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by RequestSelector - code factories should no longer
be used
*/
-public class RequestSelectorFactory extends ParameterSelectorFactory {
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
+public class RequestSelectorFactory extends RequestSelector implements
Initializable {
- String parameterName = null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("parameter-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- parameterName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("String compareToString = null;")
- .append("if (param.getNames().length == 0) {");
- if ( parameterName == null ) {
- sb
- .append(" getLogger().warn(\"No request parameter name and no
default request parameter name given. FAILING\");")
- .append("} else { ")
- .append(" String parameterName =
param.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request parameter name and
no default request parameter name given. FAILING\");")
- .append(" } else {")
- .append(" compareToString = (String)
XSPRequestHelper.getParameter(objectModel, parameterName, null);")
- .append(" }");
- } else {
- sb
- .append(" compareToString = (String)
XSPRequestHelper.getParameter(objectModel,
\"").append(parameterName).append("\", null);")
- .append("} else { ")
- .append(" String parameterName =
param.getParameter(\"parameter-name\", null);")
- .append(" if ( parameterName == null ) {")
- .append(" getLogger().warn(\"No request parameter name
given, will use default\");")
- .append(" parameterName =
\"").append(parameterName).append("\";")
- .append(" }")
- .append(" compareToString = (String)
XSPRequestHelper.getParameter(objectModel, parameterName, null);");
- }
- sb
- .append("}")
- .append("if ( compareToString == null ) {")
- .append(" getLogger().debug(\"request parameter not set\");")
- .append("}")
- .append("return compareToString != null && compareToString.equals
(pattern);");
- return sb.toString();
+ public void initialize() {
+ getLogger().warn("RequestSelectorFactory is deprecated. Please use
RequestSelector");
}
+
}
1.1.1.1.2.5 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/Selector.java
Index: Selector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/Selector.java,v
retrieving revision 1.1.1.1.2.4
retrieving revision 1.1.1.1.2.5
diff -u -r1.1.1.1.2.4 -r1.1.1.1.2.5
--- Selector.java 2001/10/11 08:56:14 1.1.1.1.2.4
+++ Selector.java 2001/11/06 09:55:37 1.1.1.1.2.5
@@ -16,7 +16,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:leo.sutic">Leo Sutic</a>
- * @version CVS $Revision: 1.1.1.1.2.4 $ $Date: 2001/10/11 08:56:14 $
+ * @version CVS $Revision: 1.1.1.1.2.5 $ $Date: 2001/11/06 09:55:37 $
*/
public interface Selector extends Component {
1.1.2.7 +7 -64
xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelectorFactory.java
Index: SessionAttributeSelectorFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelectorFactory.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- SessionAttributeSelectorFactory.java 2001/10/25 20:36:24 1.1.2.6
+++ SessionAttributeSelectorFactory.java 2001/11/06 09:55:37 1.1.2.7
@@ -7,74 +7,17 @@
*****************************************************************************/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.apache.avalon.framework.activity.Initializable;
/**
- * This class generates source code to implement a selector that
- * matches a string against an arbitrary session attribute.
- *
- * <p><b>Global and local configuration</b></p>
- * <table border="1">
- * <tr><td><code>attribute-name</code></td><td>String identifying the
session attribute.</td></tr>
- * </table>
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/10/25 20:36:24 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/11/06 09:55:37 $
+ * @deprecated replaced by SessionAttributeSelector - code factories should
no longer be used
*/
-public class SessionAttributeSelectorFactory extends
ParameterSelectorFactory {
- public String generateMethodSource (NodeList conf)
- throws ConfigurationException {
+public class SessionAttributeSelectorFactory extends
SessionAttributeSelector implements Initializable {
- String attributeName = null;
-
- int count = conf.getLength();
- for(int k = 0; k < count;k++) {
- Node node = conf.item(k);
- if (node != null &&
- node.getNodeName() != null &&
- node.getNodeName().equals("attribute-name"))
- {
- Node textNode = node.getFirstChild();
- if (textNode != null) {
- attributeName = textNode.getNodeValue().trim();
- }
- }
- }
-
- StringBuffer sb = new StringBuffer();
- sb
- .append("String compareToString = null;")
- .append("if (param.getNames().length == 0) {");
- if ( attributeName == null ) {
- sb
- .append(" getLogger().warn(\"No session attribute and no
default attribute given. FAILING\");")
- .append("} else { ")
- .append(" String attributeName =
param.getParameter(\"attribute-name\", null);")
- .append(" if ( attributeName == null ) {")
- .append(" getLogger().warn(\"No session attribute and no
default attribute given. FAILING\");")
- .append(" } else {")
- .append(" compareToString = (String)
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ")
- .append(" }");
- } else {
- sb
- .append(" compareToString = (String)
XSPRequestHelper.getSessionAttribute(objectModel,
\"").append(attributeName).append("\");")
- .append("} else { ")
- .append(" String attributeName =
param.getParameter(\"attribute-name\", null);")
- .append(" if ( attributeName == null ) {")
- .append(" getLogger().warn(\"No session attribute given,
will use default\");")
- .append(" attributeName =
\"").append(attributeName).append("\";")
- .append(" }")
- .append(" compareToString = (String)
XSPRequestHelper.getSessionAttribute(objectModel, attributeName); ");
- }
- sb
- .append("}")
- .append("if ( compareToString == null ) {")
- .append(" getLogger().debug(\"Session attribute not set\");")
- .append("}")
- .append("return compareToString != null && compareToString.equals
(pattern);");
- return sb.toString();
+ public void initialize() {
+ getLogger().warn("SessionAttributeSelectorFactory is deprecated.
Please use SessionAttributeSelector");
}
+
}
No revision
No revision
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/BrowserSelector.java
Index: BrowserSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/BrowserSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- BrowserSelector.java 2001/10/22 10:17:46 1.1
+++ BrowserSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -23,7 +23,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class BrowserSelector extends NamedPatternsSelector {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelector.java
Index: HeaderSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/HeaderSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- HeaderSelector.java 2001/10/22 10:17:46 1.1
+++ HeaderSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -30,7 +30,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class HeaderSelector extends AbstractLoggable
implements Configurable, ThreadSafe, Selector {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/HostSelector.java
Index: HostSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/HostSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- HostSelector.java 2001/10/22 10:17:46 1.1
+++ HostSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -40,7 +40,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Colin Britton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class HostSelector extends NamedPatternsSelector {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/NamedPatternsSelector.java
Index: NamedPatternsSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/NamedPatternsSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- NamedPatternsSelector.java 2001/10/22 10:17:46 1.1
+++ NamedPatternsSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -26,7 +26,7 @@
* @see BrowserSelector
* @see HostSelector
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public abstract class NamedPatternsSelector extends AbstractLoggable
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/ParameterSelector.java
Index: ParameterSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/ParameterSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- ParameterSelector.java 2001/10/22 10:17:46 1.1
+++ ParameterSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -36,7 +36,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Leo Sutic</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class ParameterSelector implements ThreadSafe, Selector {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/RequestSelector.java
Index: RequestSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/RequestSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- RequestSelector.java 2001/10/22 10:17:46 1.1
+++ RequestSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -30,7 +30,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class RequestSelector extends AbstractLoggable
implements Configurable, ThreadSafe, Selector {
1.1.2.1 +1 -1
xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelector.java
Index: SessionAttributeSelector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/selection/SessionAttributeSelector.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- SessionAttributeSelector.java 2001/10/22 10:17:46 1.1
+++ SessionAttributeSelector.java 2001/11/06 09:55:37 1.1.2.1
@@ -30,7 +30,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/10/22 10:17:46 $
+ * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/11/06 09:55:37 $
*/
public class SessionAttributeSelector extends AbstractLoggable
implements Configurable, ThreadSafe, Selector {
No revision
No revision
1.1.1.1.2.2 +24 -3
xml-cocoon2/src/org/apache/cocoon/sitemap/PatternException.java
Index: PatternException.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/PatternException.java,v
retrieving revision 1.1.1.1.2.1
retrieving revision 1.1.1.1.2.2
diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2
--- PatternException.java 2001/06/08 14:42:06 1.1.1.1.2.1
+++ PatternException.java 2001/11/06 09:55:38 1.1.1.1.2.2
@@ -8,6 +8,8 @@
package org.apache.cocoon.sitemap;
+import org.apache.avalon.framework.CascadingException;
+
/**
* This exception is thrown by a <code>URIMatcher</code> or by a
* <code>URITranslator</code> when there's something wrong with the matching
or
@@ -15,13 +17,32 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/06/08 14:42:06 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
+ * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/11/06 09:55:38 $
*/
-public class PatternException extends Exception {
+public class PatternException extends CascadingException {
+
/**
* Construct a new <code>PatternException</code> instance.
*/
public PatternException(String message) {
- super(message);
+ super(message, null);
+ }
+
+ /**
+ * Creates a new <code>PatternException</code> instance.
+ *
+ * @param ex an <code>Exception</code> value
+ */
+ public PatternException(Exception ex) {
+ super(ex.getMessage(), ex);
+ }
+
+ /**
+ * Construct a new <code>PatternException</code> that references
+ * a parent Exception.
+ */
+ public PatternException(String message, Throwable t) {
+ super(message, t);
}
}
1.2.2.7 +146 -65
xml-cocoon2/src/org/apache/cocoon/sitemap/XSLTFactoryLoader.java
Index: XSLTFactoryLoader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/XSLTFactoryLoader.java,v
retrieving revision 1.2.2.6
retrieving revision 1.2.2.7
diff -u -r1.2.2.6 -r1.2.2.7
--- XSLTFactoryLoader.java 2001/10/11 08:56:15 1.2.2.6
+++ XSLTFactoryLoader.java 2001/11/06 09:55:38 1.2.2.7
@@ -9,7 +9,7 @@
package org.apache.cocoon.sitemap;
import org.apache.avalon.framework.logger.Loggable;
-import org.apache.cocoon.CodeFactory;
+//import org.apache.cocoon.CodeFactory;
import org.apache.cocoon.util.ClassUtils;
import org.apache.log.Logger;
import org.w3c.dom.NodeList;
@@ -26,7 +26,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.2.2.6 $ $Date: 2001/10/11 08:56:15 $
+ * @version CVS $Revision: 1.2.2.7 $ $Date: 2001/11/06 09:55:38 $
*/
public class XSLTFactoryLoader {
protected static Logger log;
@@ -34,24 +34,28 @@
public String getClassSource(String className, String prefix, String
pattern, NodeList conf) throws ClassNotFoundException,
InstantiationException, IllegalAccessException, Exception {
- try {
- Object factory = obj.get(className);
- if (factory == null) {
- factory = ClassUtils.newInstance(className);
- }
- obj.put(className, factory);
- if (factory instanceof Loggable) {
- ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
- }
- if (factory instanceof CodeFactory) {
- return ((CodeFactory)factory).generateClassSource(prefix,
pattern, conf);
- }
- throw new Exception("Wrong class \"" +
factory.getClass().getName() +
- "\". Should implement the CodeFactory interface");
- } catch (RuntimeException re){
- log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
- throw re;
- }
+
+ throw new UnsupportedOperationException("CodeFactory is no longer
supported.");
+
+// CodeFactory handling code - now removed.
+// try {
+// Object factory = obj.get(className);
+// if (factory == null) {
+// factory = ClassUtils.newInstance(className);
+// }
+// obj.put(className, factory);
+// if (factory instanceof Loggable) {
+// ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
+// }
+// if (factory instanceof CodeFactory) {
+// return ((CodeFactory)factory).generateClassSource(prefix,
pattern, conf);
+// }
+// throw new Exception("Wrong class \"" +
factory.getClass().getName() +
+// "\". Should implement the CodeFactory interface");
+// } catch (RuntimeException re){
+// log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
+// throw re;
+// }
}
public static void setLogger(Logger logger) {
@@ -62,57 +66,134 @@
public String getParameterSource(String className, NodeList conf) throws
ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
- try {
- Object factory = obj.get(className);
- if (factory == null) {
- factory = ClassUtils.newInstance(className);
- }
- obj.put(className, factory);
- if (factory instanceof Loggable) {
- ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
- }
- if (factory instanceof CodeFactory) {
- return ((CodeFactory)factory).generateParameterSource(conf);
- }
- throw new Exception("Wrong class \"" +
factory.getClass().getName() +
- "\". Should implement the CodeFactory interface");
- } catch (RuntimeException re){
- log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
- throw re;
- }
- }
+
+ throw new UnsupportedOperationException("CodeFactory is no longer
supported.");
+
+// CodeFactory handling code - now removed.
+// try {
+// Object factory = obj.get(className);
+// if (factory == null) {
+// factory = ClassUtils.newInstance(className);
+// }
+// obj.put(className, factory);
+// if (factory instanceof Loggable) {
+// ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
+// }
+// if (factory instanceof CodeFactory) {
+// return
((CodeFactory)factory).generateParameterSource(conf);
+// }
+// throw new Exception("Wrong class \"" +
factory.getClass().getName() +
+// "\". Should implement the CodeFactory interface");
+// } catch (RuntimeException re){
+// log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
+// throw re;
+// }
+ }
public String getMethodSource(String className, NodeList conf) throws
ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
- try {
- Object factory = obj.get(className);
- if (factory == null) {
- factory = ClassUtils.newInstance(className);
- }
- obj.put(className, factory);
- if (factory instanceof Loggable) {
- ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
- }
- if (factory instanceof CodeFactory) {
- return ((CodeFactory)factory).generateMethodSource(conf);
- }
- throw new Exception("Wrong class \"" +
factory.getClass().getName() +
- "\". Should implement the CodeFactory interface");
- } catch (RuntimeException re){
- log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
- throw re;
- }
+
+ throw new UnsupportedOperationException("CodeFactory is no longer
supported.");
+
+// CodeFactory handling code - now removed.
+// try {
+// Object factory = obj.get(className);
+// if (factory == null) {
+// factory = ClassUtils.newInstance(className);
+// }
+// obj.put(className, factory);
+// if (factory instanceof Loggable) {
+// ((Loggable)factory).setLogger(XSLTFactoryLoader.log);
+// }
+// if (factory instanceof CodeFactory) {
+// return ((CodeFactory)factory).generateMethodSource(conf);
+// }
+// throw new Exception("Wrong class \"" +
factory.getClass().getName() +
+// "\". Should implement the CodeFactory interface");
+// } catch (RuntimeException re){
+// log.debug("Exception in XSLTFactoryLoader.getMethodSource
calling className:" + className, re);
+// throw re;
+// }
}
public boolean isFactory(String className) {
- boolean result = false;
- try {
- result = ClassUtils.implementsInterface(className,
CodeFactory.class.getName());
- } catch (ClassNotFoundException e) {
- log.debug("ClassNotFoundException in XSLTFactoryLoader.isFactory
checking for " + className, e);
- } catch (Exception e) {
- log.debug("Exception in XSLTFactoryLoader.isFactory checking for
" + className, e);
+ return false;
+
+// CodeFactory handling code - now removed.
+// boolean result = false;
+//
+// if (className == null)
+// return false;
+//
+// try {
+// result = ClassUtils.implementsInterface(className,
CodeFactory.class.getName());
+// } catch (ClassNotFoundException e) {
+// log.debug("ClassNotFoundException in
XSLTFactoryLoader.isFactory checking for " + className, e);
+// } catch (Exception e) {
+// log.debug("Exception in XSLTFactoryLoader.isFactory checking
for " + className, e);
+// }
+// return result;
+ }
+
+ /**
+ * Escapes '"' and '\' characters in a String (add a '\' before them) so
that it can
+ * be inserted in java source.
+ */
+ public String escape(String string) {
+ if (string.indexOf('\\') == -1 && string.indexOf('"') == -1) {
+ // Nothing to escape
+ return string;
+ }
+
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < string.length(); i++) {
+ char ch = string.charAt(i);
+ if (ch == '\\' || ch == '"') {
+ buf.append('\\');
+ }
+ buf.append(ch);
+ }
+ return buf.toString();
+ }
+
+ /**
+ * Escapes like [EMAIL PROTECTED] escape(String)} after having removed
any '\' preceding a '{'.
+ * This is used to insert a pattern with escaped subsitution syntax in
Java source.
+ */
+ public String escapeBraces(String string) {
+ if (string.indexOf("\\{") == -1)
+ {
+ return escape(string);
}
- return result;
+
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < string.length(); i++) {
+ char ch = string.charAt(i);
+ if (ch != '\\' || i >= (string.length() - 1) ||
string.charAt(i+1) != '{') {
+ buf.append(ch);
+ }
+ }
+ return escape(buf.toString());
+ }
+
+ public boolean hasSubstitutions(String pattern) {
+ if (pattern.length() == 0) {
+ return false;
+ }
+ // Does it start by a substitution ?
+ if (pattern.charAt(0) == '{') {
+ return true;
+ }
+
+ // Search for an unescaped '{'
+ int i = 1;
+ while ((i = pattern.indexOf('{', i)) != -1) {
+ if (pattern.charAt(i-1) != '\\') {
+ return true;
+ }
+ i++; // Pass '{'
+ }
+
+ return false;
}
}
No revision
No revision
1.7.2.27 +14 -15 xml-cocoon2/webapp/cocoon.xconf
Index: cocoon.xconf
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/cocoon.xconf,v
retrieving revision 1.7.2.26
retrieving revision 1.7.2.27
diff -u -r1.7.2.26 -r1.7.2.27
--- cocoon.xconf 2001/11/05 23:51:11 1.7.2.26
+++ cocoon.xconf 2001/11/06 09:55:38 1.7.2.27
@@ -40,13 +40,10 @@
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
- threadpriority: Indicates the priority of the writer thread.
- (1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<store class="org.apache.cocoon.components.store.MRUMemoryStore"
logger="root.store">
<parameter name="maxobjects" value="100"/>
- <parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</store>
@@ -75,6 +72,20 @@
<parameter name="threadpriority" value="5"/>
</store-janitor>
+ <!-- Filesystem Queue
+ The Filesystem Queue is the central queue for writing objects onto
+ the filesystem:
+ handlerinterval = How often (seconds) is the queue checked for new
objects
+ threadpriority = The priority of the Handler Thread
+ maxobjects = Defines the maximum numbers of objects in the queue.
+ If the queue is full no objects can be inserted.
+ -->
+ <filesystem-queue
class="org.apache.cocoon.components.store.FilesystemQueueImpl"
logger="root.store">
+ <parameter name="handlerinterval" value="10"/>
+ <parameter name="threadpriority" value="5"/>
+ <parameter name="maxobjects" value="100"/>
+ </filesystem-queue>
+
<!-- Entity resolution catalogs:
catalog:
The default catalog is distributed at /resources/entities/catalog
@@ -318,22 +329,13 @@
pool-max="32" pool-min="16" pool-grow="4"/>
<!-- Caching of stream pipeline:
- freememory: Indicates how much memory should be left free in the
- JVM for normal operation.
- heapsize: Indicates how big the heap size can grow to before the
- cleanup thread kicks in.
- cleanupthreadinterval: Indicates the interval of the cleanup thread in
seconds.
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
- usecleanupthread: Indicates whether we use a cleanup thread or not.
- threadpriority: Indicates the priority of the cleanup thread.
- (1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<stream-cache class="org.apache.cocoon.components.store.MRUMemoryStore"
logger="root.store">
<parameter name="maxobjects" value="100"/>
- <parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</stream-cache>
@@ -349,13 +351,10 @@
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
- threadpriority: Indicates the priority of the cleanup thread.
- (1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<event-cache class="org.apache.cocoon.components.store.MRUMemoryStore"
logger="root.store">
<parameter name="maxobjects" value="100"/>
- <parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</event-cache>
1.11.2.39 +8 -10 xml-cocoon2/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
retrieving revision 1.11.2.38
retrieving revision 1.11.2.39
diff -u -r1.11.2.38 -r1.11.2.39
--- sitemap.xmap 2001/10/19 20:47:05 1.11.2.38
+++ sitemap.xmap 2001/11/06 09:55:38 1.11.2.39
@@ -71,7 +71,7 @@
</map:serializers>
<map:selectors default="browser">
- <map:selector name="browser"
src="org.apache.cocoon.selection.BrowserSelectorFactory">
+ <map:selector name="browser"
src="org.apache.cocoon.selection.BrowserSelector">
<!-- # NOTE: The appearance indicates the search order. This is very
important since
# some words may be found in more than one browser
description. (MSIE is
# presented as "Mozilla/4.0 (Compatible; MSIE 4.01; ...")
@@ -91,22 +91,21 @@
<browser name="mozilla5" useragent="Netscape6/"/>
<browser name="netscape" useragent="Mozilla"/>
</map:selector>
- <map:selector name="coded"
src="org.apache.cocoon.selection.CodedSelectorFactory"/>
- <map:selector name="parameter"
src="org.apache.cocoon.selection.ParameterSelectorFactory"/>
+ <map:selector name="parameter"
src="org.apache.cocoon.selection.ParameterSelector"/>
</map:selectors>
<map:matchers default="wildcard">
- <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
- <map:matcher name="regexp"
src="org.apache.cocoon.matching.RegexpURIMatcherFactory"/>
+ <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
+ <map:matcher name="regexp"
src="org.apache.cocoon.matching.RegexpURIMatcher"/>
<map:matcher name="request"
src="org.apache.cocoon.matching.RequestParamMatcher"/>
- <map:matcher name="sessionstate"
src="org.apache.cocoon.matching.WildcardSessionAttributeMatcherFactory">
+ <map:matcher name="sessionstate"
src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
<attribute-name>org.apache.cocoon.SessionState</attribute-name>
</map:matcher>
- <map:matcher name="next-page"
src="org.apache.cocoon.matching.WildcardParameterValueMatcherFactory">
+ <map:matcher name="next-page"
src="org.apache.cocoon.matching.WildcardParameterValueMatcher">
<parameter-name>next-state</parameter-name>
</map:matcher>
- <map:matcher name="referer-match"
src="org.apache.cocoon.matching.WildcardHeaderMatcherFactory">
- <parameter-name>referer</parameter-name>
+ <map:matcher name="referer-match"
src="org.apache.cocoon.matching.WildcardHeaderMatcher">
+ <header-name>referer</header-name>
</map:matcher>
</map:matchers>
@@ -254,7 +253,6 @@
</map:pipeline>
<map:pipeline>
-
<map:match pattern="">
<map:redirect-to uri="welcome"/>
</map:match>
No revision
No revision
1.5.2.3 +1 -3 xml-cocoon2/webapp/i18n/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/i18n/sitemap.xmap,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -r1.5.2.2 -r1.5.2.3
--- sitemap.xmap 2001/09/05 22:18:17 1.5.2.2
+++ sitemap.xmap 2001/11/06 09:55:38 1.5.2.3
@@ -7,9 +7,7 @@
<map:readers default="resource"/>
<map:serializers default="html"/>
<map:selectors default="browser"/>
- <map:matchers default="wildcard">
- <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
- </map:matchers>
+ <map:matchers default="wildcard"/>
</map:components>
<!-- =========================== Pipelines
================================= -->
No revision
No revision
1.4.2.2 +1 -4 xml-cocoon2/webapp/protected/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/protected/sitemap.xmap,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- sitemap.xmap 2001/06/21 19:24:06 1.4.2.1
+++ sitemap.xmap 2001/11/06 09:55:38 1.4.2.2
@@ -16,10 +16,7 @@
<map:selectors default="browser"/>
- <map:matchers default="wildcard">
- <map:matcher name="wildcard"
- src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
- </map:matchers>
+ <map:matchers default="wildcard"/>
<map:actions>
<map:action name="session-validator"
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]