|
|
Choosing A Webhost: |
svn commit: r521331 - in /lenya/trunk/src/modules/collection: config/cocoon: msg#00027cms.lenya.cvs
Author: andreas Date: Thu Mar 22 09:36:08 2007 New Revision: 521331 URL: http://svn.apache.org/viewvc?view=rev&rev=521331 Log: Added option to generate child collection dynamically Added: lenya/trunk/src/modules/collection/samples/children.xml lenya/trunk/src/modules/collection/sitemap.xmap lenya/trunk/src/modules/collection/xslt/ lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl Modified: lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf Modified: lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf?view=diff&rev=521331&r1=521330&r2=521331 ============================================================================== --- lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf (original) +++ lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf Thu Mar 22 09:36:08 2007 @@ -23,7 +23,8 @@ <component-instance name="collection" logger="lenya.resourcetypes.collectoin" class="org.apache.lenya.cms.publication.ResourceTypeImpl"> - <sample-name>fallback://lenya/modules/collection/samples/collection.xml</sample-name> + <sample-name name="Manual">fallback://lenya/modules/collection/samples/collection.xml</sample-name> + <sample-name name="Children">fallback://lenya/modules/collection/samples/children.xml</sample-name> </component-instance> </xconf> Added: lenya/trunk/src/modules/collection/samples/children.xml URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/samples/children.xml?view=auto&rev=521331 ============================================================================== --- lenya/trunk/src/modules/collection/samples/children.xml (added) +++ lenya/trunk/src/modules/collection/samples/children.xml Thu Mar 22 09:36:08 2007 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<collection xmlns="http://apache.org/cocoon/lenya/collection/1.0" type="children"/> Added: lenya/trunk/src/modules/collection/sitemap.xmap URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/sitemap.xmap?view=auto&rev=521331 ============================================================================== --- lenya/trunk/src/modules/collection/sitemap.xmap (added) +++ lenya/trunk/src/modules/collection/sitemap.xmap Thu Mar 22 09:36:08 2007 @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- $Id: doctypes.xmap 179488 2005-06-02 02:29:39Z gregor $ --> + +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> + +<!-- =========================== Components ================================ --> + + <map:pipelines> + + <map:pipeline> + + <!-- collectionWithChildren/{uuid}.xml --> + <map:match pattern="collectionWithChildren/*.xml"> + <map:generate type="sitetree-fragment"> + <map:parameter name="areas" value="{page-envelope:area}"/> + <map:parameter name="area" value="{page-envelope:area}"/> + <map:parameter name="path" value="{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{1}:{page-envelope:document-language}:path}"/> + <map:parameter name="initial" value="false"/> + <map:parameter name="mimetype" value=""/> + </map:generate> + <map:transform src="fallback://lenya/modules/collection/xslt/sitetree2children.xsl"/> + <map:transform src="fallback://lenya/modules/collection/xslt/collection2cinclude.xsl"> + <map:parameter name="uuid" value="{1}"/> + </map:transform> + <map:transform type="cinclude"/> + <map:serialize type="xml"/> + </map:match> + + <!-- metadata-{uuid}.xml --> + <map:match pattern="metadata-*.xml"> + <map:generate type="lenyaMetaData"> + <map:parameter name="pubid" value="{page-envelope:publication-id}"/> + <map:parameter name="area" value="{page-envelope:area}"/> + <map:parameter name="uuid" value="{1}"/> + <map:parameter name="lang" value="{page-envelope:document-language}"/> + </map:generate> + <map:serialize type="xml"/> + </map:match> + + </map:pipeline> + + </map:pipelines> +</map:sitemap> Added: lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl?view=auto&rev=521331 ============================================================================== --- lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl (added) +++ lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl Thu Mar 22 09:36:08 2007 @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:col="http://apache.org/cocoon/lenya/collection/1.0" + xmlns:ci="http://apache.org/cocoon/include/1.0"> + + + <xsl:param name="uuid"/> + + + <xsl:template match="col:collection"> + <xsl:choose> + <xsl:when test="@type = 'children'"> + <ci:include src="cocoon://modules/collection/collectionWithChildren/{$uuid}.xml"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:copy-of select="@*"/> + <ci:include src="cocoon://modules/collection/metadata-{$uuid}.xml"/> + <xsl:apply-templates select="col:document"/> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="col:document"> + <xsl:copy> + <xsl:copy-of select="@*"/> + <ci:include src="cocoon://modules/collection/metadata-{@uuid}.xml"/> + <ci:include src="lenya-document:{@uuid}"/> + </xsl:copy> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file Added: lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl?view=auto&rev=521331 ============================================================================== --- lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl (added) +++ lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl Thu Mar 22 09:36:08 2007 @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:site="http://apache.org/cocoon/lenya/sitetree/1.0" + xmlns:col="http://apache.org/cocoon/lenya/collection/1.0" + xmlns:ci="http://apache.org/cocoon/include/1.0"> + + + <xsl:template match="site:fragment"> + <col:collection> + <xsl:apply-templates select="site:node"/> + </col:collection> + </xsl:template> + + + <xsl:template match="site:node"> + <col:document uuid="{@uuid}"/> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |