vgritsenko 02/01/16 19:51:38
Modified: src/java/org/apache/cocoon/components/language/markup/sitemap/java
sitemap.xsl
src/webapp/mount/lint sitemap.xmap
. changes.xml
Log:
Remove substitution for @type attribute (as it was before)
Revision Changes Path
1.5 +20 -23
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sitemap.xsl 15 Jan 2002 07:42:02 -0000 1.4
+++ sitemap.xsl 17 Jan 2002 03:51:38 -0000 1.5
@@ -214,7 +214,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken
Barozzi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter
Royal</a>
- * @version CVS $Id: sitemap.xsl,v 1.4 2002/01/15 07:42:02 cziegeler Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.5 2002/01/17 03:51:38 vgritsenko 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"/>";
@@ -793,9 +793,9 @@
<xsl:template match="map:match" mode="method">
<!-- get the type of matcher used -->
<xsl:variable name="matcher-type">
- <xsl:call-template name="get-parameter-substituted">
+ <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:with-param name="default"><xsl:value-of
select="/map:sitemap/map:components/map:matchers/@default"/></xsl:with-param>
<xsl:with-param name="required">true</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@@ -837,8 +837,8 @@
String cocoon_action = environment.getAction();
final boolean debug_enabled = getLogger().isDebugEnabled();
- if ((map = matches(<xsl:value-of select="$matcher-type"/>, <xsl:value-of
select="$matcher-name"/>, <xsl:apply-templates select="@pattern"/>, <xsl:value-of
select="$component-param"/>, objectModel)) != null) {
- if (debug_enabled) getLogger().debug("Matched " + <xsl:value-of
select="$matcher-type"/> + " pattern <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @pattern)"/>");
+ if ((map = matches("<xsl:value-of select="$matcher-type"/>", <xsl:value-of
select="$matcher-name"/>, <xsl:apply-templates select="@pattern"/>, <xsl:value-of
select="$component-param"/>, objectModel)) != null) {
+ if (debug_enabled) getLogger().debug("Matched <xsl:value-of
select="$matcher-type"/> pattern <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @pattern)"/>");
listOfMaps.add (map);
this.dumpParameters(listOfMaps);
<xsl:apply-templates/>
@@ -855,9 +855,9 @@
<xsl:template match="map:match//map:match">
<!-- get the type of matcher used -->
<xsl:variable name="matcher-type">
- <xsl:call-template name="get-parameter-substituted">
+ <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:with-param name="default"><xsl:value-of
select="/map:sitemap/map:components/map:matchers/@default"/></xsl:with-param>
<xsl:with-param name="required">true</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@@ -887,8 +887,8 @@
<!-- this is the actual code produced -->
// handling "<xsl:value-of select="@pattern"/>"
- if ((map = matches(<xsl:value-of select="$matcher-type"/>, <xsl:value-of
select="$matcher-name"/>, <xsl:apply-templates select="@pattern"/>, <xsl:value-of
select="$component-param"/>, objectModel)) != null) {
- if (debug_enabled) getLogger().debug("Matched " + <xsl:value-of
select="$matcher-type"/> + " pattern <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @pattern)"/>");
+ if ((map = matches("<xsl:value-of select="$matcher-type"/>", <xsl:value-of
select="$matcher-name"/>, <xsl:apply-templates select="@pattern"/>, <xsl:value-of
select="$component-param"/>, objectModel)) != null) {
+ if (debug_enabled) getLogger().debug("Matched <xsl:value-of
select="$matcher-type"/> pattern <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @pattern)"/>");
listOfMaps.add (map);
this.dumpParameters(listOfMaps);
<xsl:apply-templates/>
@@ -905,9 +905,9 @@
<!-- get the type of selector used -->
<xsl:variable name="selector-type">
- <xsl:call-template name="get-parameter-substituted">
+ <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:selectors/@default"/>"</xsl:with-param>
+ <xsl:with-param name="default"><xsl:value-of
select="/map:sitemap/map:components/map:selectors/@default"/></xsl:with-param>
<xsl:with-param name="required">true</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@@ -941,8 +941,8 @@
<xsl:call-template name="line-number"/>
<xsl:if test="position() > 1">
else </xsl:if>
- if (isSelected(<xsl:value-of select="$selector-type"/>, <xsl:apply-templates
select="@test"/>, <xsl:value-of select="$component-param"/>, objectModel)) {
- if (debug_enabled) getLogger().debug("Select " + <xsl:value-of
select="$selector-type"/> + " Test <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @test)"/>");
+ if (isSelected("<xsl:value-of select="$selector-type"/>",
<xsl:apply-templates select="@test"/>, <xsl:value-of select="$component-param"/>,
objectModel)) {
+ if (debug_enabled) getLogger().debug("Select <xsl:value-of
select="$selector-type"/> Test <xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, @test)"/>");
<xsl:apply-templates/>
}
</xsl:for-each>
@@ -951,7 +951,7 @@
<xsl:for-each select="map:otherwise">
<xsl:text>else {
</xsl:text><xsl:call-template name="line-number"/>
- if (debug_enabled) getLogger().debug("Select " + <xsl:value-of
select="$selector-type"/> + " Otherwise");
+ if (debug_enabled) getLogger().debug("Select <xsl:value-of
select="$selector-type"/> Otherwise");
<xsl:apply-templates/>
}
</xsl:for-each>
@@ -964,9 +964,8 @@
<!-- get the type of action used -->
<xsl:variable name="action-type">
- <xsl:call-template name="get-parameter-substituted">
+ <xsl:call-template name="get-parameter">
<xsl:with-param name="parname">type</xsl:with-param>
- <xsl:with-param name="default">null</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@@ -998,7 +997,7 @@
</xsl:variable>
<!-- generate the invocation of the act method of the action component -->
- Action <xsl:value-of select="$action-name"/> =
(Action)this.actions.select(<xsl:value-of select="$action-type"/>);
+ Action <xsl:value-of select="$action-name"/> =
(Action)this.actions.select("<xsl:value-of select="$action-type"/>");
try {
<xsl:choose>
<xsl:when test="*[namespace-uri()=$ns and local-name() != 'parameter']">
@@ -1006,7 +1005,7 @@
if (redirector.hasRedirected()) {
return true;
}
- if (debug_enabled) getLogger().debug("Action " + <xsl:value-of
select="$action-type"/>);
+ if (debug_enabled) getLogger().debug("Action <xsl:value-of
select="$action-type"/>");
listOfMaps.add (map);
this.dumpParameters(listOfMaps);
<xsl:apply-templates select="*[namespace-uri()=$ns and local-name() !=
'parameter']"/>
@@ -1036,9 +1035,8 @@
<!-- get the type of action used -->
<xsl:variable name="action-type">
- <xsl:call-template name="get-parameter-substituted">
+ <xsl:call-template name="get-parameter">
<xsl:with-param name="parname">type</xsl:with-param>
- <xsl:with-param name="default">null</xsl:with-param>
</xsl:call-template>
</xsl:variable>
@@ -1068,12 +1066,12 @@
</xsl:variable>
<!-- generate the invocation of the act method of the action component -->
- Action <xsl:value-of select="$action-name"/> =
(Action)this.actions.select(<xsl:value-of select="$action-type"/>);
+ Action <xsl:value-of select="$action-name"/> =
(Action)this.actions.select("<xsl:value-of select="$action-type"/>");
try {
map = <xsl:value-of select="$action-name"/>.act(redirector, environment,
objectModel, <xsl:value-of select="$action-source"/>, <xsl:value-of
select="$component-param"/>);
<xsl:if test="*[namespace-uri()=$ns and local-name() != 'parameter']">
if (map != null) {
- if (debug_enabled) getLogger().debug("Action " + <xsl:value-of
select="$action-type"/>);
+ if (debug_enabled) getLogger().debug("Action <xsl:value-of
select="$action-type"/>");
listOfMaps.add (map);
this.dumpParameters(listOfMaps);
<xsl:apply-templates select="*[namespace-uri()=$ns and local-name()
!= 'parameter']" mode="set"/>
@@ -1095,7 +1093,6 @@
<xsl:variable name="action-set">
<xsl:call-template name="get-parameter">
<xsl:with-param name="parname">set</xsl:with-param>
- <xsl:with-param name="default">null</xsl:with-param>
</xsl:call-template>
</xsl:variable>
1.2 +5 -4 xml-cocoon2/src/webapp/mount/lint/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/mount/lint/sitemap.xmap,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sitemap.xmap 14 Jan 2002 02:58:35 -0000 1.1
+++ sitemap.xmap 17 Jan 2002 03:51:38 -0000 1.2
@@ -221,13 +221,14 @@
<!-- Test substitutions -->
<map:pipeline>
- <map:match type="substitute-match-type-{dummy}"
pattern="substitute-match-pattern-{dummy}">
- <map:generate type="not-substituted" src="substitute-generate-src-{dummy}"/>
+ <map:match type="not-substituted" pattern="substitute-match-pattern-{dummy}">
+ <map:generate type="not-substituted"
+ src="substitute-generate-src-{dummy}" label="not-substituted"/>
<map:transform type="not-substituted"
src="substitute-transform-src-{dummy}"/>
- <map:act type="substitute-act-type-{dummy}"
src="substitute-act-src-{dummy}"/>
+ <map:act type="not-substituted" src="substitute-act-src-{dummy}"/>
- <map:select type="substitute-select-type-{dummy}">
+ <map:select type="not-substituted">
<map:when test="substitute-when-test-{dummy}">
<map:transform src="dummy"/>
</map:when>
1.75 +10 -1 xml-cocoon2/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/changes.xml,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- changes.xml 16 Jan 2002 03:33:47 -0000 1.74
+++ changes.xml 17 Jan 2002 03:51:38 -0000 1.75
@@ -4,7 +4,7 @@
<!--
History of Cocoon changes
- $Id: changes.xml,v 1.74 2002/01/16 03:33:47 crossley Exp $
+ $Id: changes.xml,v 1.75 2002/01/17 03:51:38 vgritsenko Exp $
-->
<changes title="History of Changes">
@@ -30,6 +30,15 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="VG" type="update">
+ Perform substitution in the sitemap only when it is required (improves
+ performace).
+ </action>
+ <action dev="VG" type="add">
+ Additions to sitemap syntax: (1) allow all elements at root level, not
+ only matchers, (2) perform some validation checks, (3) perform attribute
+ substitution on all attributes except @type and @label.
+ </action>
<action dev="DC" type="add">
Added "List of Docs" which automatically generates a list
of all Cocoon documentation by aggregating each xdocs/**/book.xml
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]