giacomo 01/05/18 08:08:30
Modified: src/org/apache/cocoon/components/language/markup/sitemap/java
sitemap.xsl
webapp sitemap.xmap
Log:
get rid of factory attribute from matchers and selector element in the sitemap
Revision Changes Path
1.6 +8 -50
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sitemap.xsl 2001/05/18 14:16:48 1.5
+++ sitemap.xsl 2001/05/18 15:08:27 1.6
@@ -99,7 +99,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.5 2001/05/18 14:16:48 giacomo Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.6 2001/05/18 15:08:27 giacomo 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"/>";
@@ -112,21 +112,10 @@
private Parameters emptyParam = new Parameters();
- <!-- Generate matchers which implements CodeFactory
- FIXME(GP): We should get rid of the additional factory attribute
in the sitemap
- schema definition because this stylesheet is able to
determine that
- based on the fact that a Matcher implements the
CodeFactory interface
- -->
+ <!-- Generate matchers which implements CodeFactory -->
<xsl:for-each
select="/map:sitemap/map:components/map:matchers/map:matcher">
<xsl:variable name="src">
- <xsl:choose>
- <xsl:when test="@src">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@factory"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="@src"/>
</xsl:variable>
<xsl:if test="java:isFactory($factory-loader, string($src))">
<xsl:variable name="type" select="translate(@name, '- ', '__')"/>
@@ -150,21 +139,10 @@
</xsl:for-each>
- <!-- Generate selectors which implements CodeFactory
- FIXME(GP): We should get rid of the additional factory attribute
in the sitemap
- schema definition because this stylesheet is able to
determine that
- based on the fact that a Selector implements the
CodeFactory interface
- -->
+ <!-- Generate selectors which implements CodeFactory -->
<xsl:for-each
select="/map:sitemap/map:components/map:selectors/map:selector">
<xsl:variable name="src">
- <xsl:choose>
- <xsl:when test="@src">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@factory"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="@src"/>
</xsl:variable>
<xsl:if test="java:isFactory($factory-loader, string($src))">
<xsl:variable name="name" select="@name"/>
@@ -522,17 +500,7 @@
<!-- check if this matcher is a factory ? -->
<xsl:variable name="is-factory">
- <xsl:choose>
- <xsl:when test="/map:sitemap/map:components/map:matchers/map:[EMAIL
PROTECTED]/@factory">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:when test="/map:sitemap/map:components/map:matchers/map:[EMAIL
PROTECTED]/@src">
- <xsl:value-of select="java:isFactory($factory-loader,
string(/map:sitemap/map:components/map:matchers/map:[EMAIL PROTECTED]/@src))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="false()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="java:isFactory($factory-loader,
string(/map:sitemap/map:components/map:matchers/map:[EMAIL PROTECTED]/@src))"/>
</xsl:variable>
<!-- test if we have to define parameters for this matcher -->
@@ -667,17 +635,7 @@
<!-- check if this selector is a factory ? -->
<xsl:variable name="is-factory">
- <xsl:choose>
- <xsl:when
test="/map:sitemap/map:components/map:selectors/map:[EMAIL PROTECTED]/@factory">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:when
test="/map:sitemap/map:components/map:selectors/map:[EMAIL PROTECTED]/@src">
- <xsl:value-of select="java:isFactory($factory-loader,
string(/map:sitemap/map:components/map:selectors/map:[EMAIL PROTECTED]/@src))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="false()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="java:isFactory($factory-loader,
string(/map:sitemap/map:components/map:selectors/map:[EMAIL PROTECTED]/@src))"/>
</xsl:variable>
<!-- Modified 20010509 L.Sutic Changed to pass sitemap parameters. -->
@@ -1123,7 +1081,7 @@
<xsl:variable name="ns" select="namespace-uri(.)"/>
<xsl:for-each select="$components">
<xsl:variable name="is-factory-component"
- select="(@factory and ($name = 'matcher' or $name = 'selector')) or
(@src and ($name = 'matcher' or $name = 'selector') and
java:isFactory($factory-loader, string(@src)))"/>
+ select="@src and ($name = 'matcher' or $name = 'selector') and
java:isFactory($factory-loader, string(@src))"/>
<xsl:if test="$is-factory-component=false()">
{
DefaultConfiguration cconf1 = new
DefaultConfiguration("<xsl:value-of select="translate(@name, '- ', '__')"/>",
LOCATION);
1.6 +5 -5 xml-cocoon2/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sitemap.xmap 2001/05/17 11:42:13 1.5
+++ sitemap.xmap 2001/05/18 15:08:29 1.6
@@ -67,7 +67,7 @@
</map:serializers>
<map:selectors default="browser">
- <map:selector name="browser"
factory="org.apache.cocoon.selection.BrowserSelectorFactory">
+ <map:selector name="browser"
src="org.apache.cocoon.selection.BrowserSelectorFactory">
<!-- # 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; ...")
@@ -87,13 +87,13 @@
<browser name="mozilla5" useragent="Netscape6/"/>
<browser name="netscape" useragent="Mozilla"/>
</map:selector>
- <map:selector name="coded"
factory="org.apache.cocoon.selection.CodedSelectorFactory"/>
- <map:selector name="parameter"
factory="org.apache.cocoon.selection.ParameterSelectorFactory"/>
+ <map:selector name="coded"
src="org.apache.cocoon.selection.CodedSelectorFactory"/>
+ <map:selector name="parameter"
src="org.apache.cocoon.selection.ParameterSelectorFactory"/>
</map:selectors>
<map:matchers default="wildcard">
- <map:matcher name="wildcard"
factory="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
- <map:matcher name="regexp"
factory="org.apache.cocoon.matching.RegexpURIMatcherFactory"/>
+ <map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
+ <map:matcher name="regexp"
src="org.apache.cocoon.matching.RegexpURIMatcherFactory"/>
<map:matcher name="request"
src="org.apache.cocoon.matching.RequestParamMatcher"/>
</map:matchers>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]