giacomo 00/09/02 12:28:13
Modified: src/org/apache/cocoon/components/language/markup/sitemap/java
Tag: xml-cocoon2 sitemap.xsl
Log:
Enabled default label processing to have exit points in the pipeline for view
processing
Revision Changes Path
No revision
No revision
1.1.2.28 +25 -6
xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
retrieving revision 1.1.2.27
retrieving revision 1.1.2.28
diff -u -r1.1.2.27 -r1.1.2.28
--- sitemap.xsl 2000/08/31 15:53:55 1.1.2.27
+++ sitemap.xsl 2000/09/02 19:28:12 1.1.2.28
@@ -11,7 +11,7 @@
<!--
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.27 $ $Date: 2000/08/31 15:53:55 $
+ * @version CVS $Revision: 1.1.2.28 $ $Date: 2000/09/02 19:28:12 $
-->
<!-- Sitemap Core logicsheet for the Java language -->
@@ -229,7 +229,7 @@
<xsl:for-each select="/map:sitemap/map:resources/map:resource">
private boolean resource_<xsl:value-of select="translate(@name, '- ',
'__')"/> (ResourcePipeline pipeline,
- List listOfLists, Environment environment)
+ List listOfLists, Environment environment, String cocoon_view)
throws Exception {
List list = null;
Parameters param = null;
@@ -258,7 +258,7 @@
List list = null;
Parameters param = null;
Dictionary objectModel = environment.getObjectModel();
- String view = environment.getView();
+ String cocoon_view = environment.getView();
<xsl:for-each select="/map:sitemap/map:pipelines/map:pipeline">
<xsl:variable name="pipeline-position" select="position()"/>
try {
@@ -521,7 +521,7 @@
<xsl:template match="map:redirect-to">
<xsl:choose>
<xsl:when test="@resource">
- return resource_<xsl:value-of select="translate(@resource, '- ',
'__')"/>(pipeline, listOfLists, environment);
+ return resource_<xsl:value-of select="translate(@resource, '- ',
'__')"/>(pipeline, listOfLists, environment, cocoon_view);
</xsl:when>
<xsl:when test="@uri">
environment.redirect (substitute(listOfLists, "<xsl:value-of
select="@uri"/>"));
@@ -537,7 +537,7 @@
<xsl:template match="map:label">
<xsl:apply-templates/>
- if ("<xsl:value-of select="@name"/>".equals(view))
+ if ("<xsl:value-of select="@name"/>".equals(cocoon_view))
return view_<xsl:value-of select="translate(@name, '- ', '__')"/>
(pipeline, listOfLists, environment);
</xsl:template> <!-- match="map:label" -->
@@ -711,7 +711,26 @@
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
- </xsl:choose>
+ </xsl:choose>
+ <!-- view/label check -->
+ <xsl:variable name="component-label">
+ <xsl:if test="$prefix='generator'">
+ <xsl:value-of
select="/map:sitemap/map:components/map:generators/map:[EMAIL
PROTECTED]/@label"/>
+ </xsl:if>
+ <xsl:if test="$prefix='transformer'">
+ <xsl:value-of
select="/map:sitemap/map:components/map:transformers/map:[EMAIL
PROTECTED]/@label"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="$component-label">
+ <xsl:variable name="component-view">
+ <xsl:value-of select="/map:sitemap/map:views/map:[EMAIL
PROTECTED]/@name"/>
+ </xsl:variable>
+ <xsl:if test="/map:sitemap/map:views/map:[EMAIL PROTECTED]">
+ if ("<xsl:value-of select="$component-view"/>".equals(cocoon_view)) {
+ return view_<xsl:value-of select="translate($component-view, '- ',
'__')"/> (pipeline, listOfLists, environment);
+ }
+ </xsl:if>
+ </xsl:if>
</xsl:template>
<xsl:template name="mangle-name">