cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject FW: Directory zip error
Date Mon, 17 May 2004 19:31:54 GMT
-----Original Message-----
From: Moinuddin Ahmed (WT01 - CORPORATE) 
Sent: Monday, May 17, 2004 12:22 PM
Subject: Directory zip error

I am trying to zip a directory and all the content of the directory
I have a directory structure as follows:
      |-- dirA
      |-- dirB
I have written an xsl to read this using Directory generator and zip the
files and the directories recursively till n level..
What I found, all the files at all the levels are getting zipped but not
For directories I get the following error:
'If I comment the zip entry for directories, files gets zipped
"org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
org.apache.excalibur.source.SourceNotFoundException: file:/C:/directory/
doesn't exist"
Though the directory very much exists. I have tried hard coding and
adding the same also, but no luck.
I have the xsl written as below:
Can some one please check out and let me know where I am going wrong, or
is it that we can only zip files using Cocoon and not directories.
Thanks in advance.
Sitemap.xmap is as follows 
 <map:match pattern="zipFolderActions">    
     <map:generate type="directory" src="{request-param:zipFolders}">
               <map:parameter name="depth" value="1000"/>
               <map:parameter name="use-request-parameters"
       <map:transform src="stylesheets/dirzip.xsl"/>
           <map:serialize type="zip"/>
dirzip.xsl is as follows:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
<xsl:param name="dirprefix"/>
<xsl:template match="/">
<xsl:for-each select="//dir:directory">

 <xsl:variable name="directoryPath">
  <xsl:for-each select="ancestor::*">
   <xsl:value-of select="@name"/>
 <xsl:variable name="dirName">
  <xsl:value-of select="@name"/>
  <xsl:variable name="DirToBeZipped"><xsl:value-of
  <zip:entry name="{dirName}" src="{$DirToBeZipped}"/>
    <!-- add code to get the files in each directory -->
    <xsl:for-each select="./dir:file">

   <xsl:variable name="filePath">
     <xsl:for-each select="ancestor::*">
    <xsl:value-of select="@name"/>
   <xsl:variable name="fileName">
    <xsl:value-of select="@name"/>
   <xsl:variable name="fileToBeZipped"><xsl:value-of
  <zip:entry name="{$fileName}" src="{$fileToBeZipped}"/>
    <!-- end of code to get files in each directory -->



Confidentiality Notice

The information contained in this electronic message and any attachments
to this message are intended

for the exclusive use of the addressee(s) and may contain confidential
or privileged information. If

you are not the intended recipient, please notify the sender at Wipro or immediately

and destroy all copies of this message and any attachments.

View raw message