cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Franz <afra...@optushome.com.au>
Subject Re: DirectoryGenerator using abstract Source
Date Wed, 13 Jul 2005 21:07:02 GMT
Unico Hommes wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Michael Wechner wrote:
>  
>
>>Joerg Heinicke wrote:
>>
>>    
>>
>>>On 13.07.2005 00:28, Michael Wechner wrote:
>>>
>>>      
>>>
>>>>It seems to me that the directory generator is not really based
>>>>on the "abstract methods" of an excalibur Source, but rather takes
>>>>the source and "maps" it onto a java.io.File.
>>>>
>>>>Is that intended or just not implemented for the lack of time?
>>>>
>>>>I would like to make this more generic with regard to other sources,
>>>>e.g.
>>>>JCR or whatever. If this makes sense then I would patch the
>>>>DirectoryGenerator,
>>>>but otherwise I would write a "DirectoryGenerator" from scratch, e.g
>>>>CollectionGenerator which is making use the TraversableSource interface.
>>>>        
>>>>
>>>
>>>You don't have to:
>>>$COCOON_HOME/src/blocks/repository/java/org/apache/cocoon/generation/TraversableGenerator.java
>>>
>>>      
>>>
>>
>>thanks very much for the pointer. I think it would make sense to make a
>>note
>>within the DirectoryGenerator that the TraversableGenerator exists and is
>>more generic.
>>
>>    
>>
>
>In fact IMHO, it should be deprecated in favor of TraversableGenerator...
>
>- --
>Unico
>
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.1 (Darwin)
>
>iD8DBQFC1UORcuec8tVNKAwRAiA4AJ94XDoBh0ACS2iTFW+uqTDcIBJ6lQCg34Fr
>xYZdDb1pyefSC/Wlf2FAyjw=
>=y0i0
>-----END PGP SIGNATURE-----
>
>
>  
>

As a user, I found that DirectoryGenerator didn't do what I wanted, so I 
went down the path of creating a variant of (not extending) 
DirectoryGenerator essentially to show meta-information (using POIFS) of 
MS-Office files and images (I also added ImageGenerator functionality 
and added .png, .ico, .bmp).
Output looks like this:
<<dx:directory name="*poitest*" lastModified="*1120331938242*" 
date="*7/3/05 5:18 AM*" size="*0*" sort="*name*" reverse="*false*" 
requested="*true*">
- <#>    <dx:file type="*application/msword*" name="*e2u.doc*" 
lastModified="*1118747923320*" date="*6/14/05 9:18 PM*" size="*110080*">
           <dx:doc title="" author="*rvanvuuren*" savedate="*6/14/05 
10:20 AM*" />
  </dx:file>
      <dx:file type="*application/vnd.ms-visio*" name="*Servlet.vsd*" 
lastModified="*998171376000*" date="*8/19/01 7:49 AM*" size="*96256*">
          <dx:doc title="*Servlet*" author="*Roger Dodger*" />
  </dx:file>
- <#>    <dx:file type="*application/vnd.ms-powerpoint*" 
name="*PPT1.ppt*" lastModified="*1116947798687*" date="*5/25/05 1:16 
AM*" size="*11264*">
         <dx:doc title="*Hello*" author="*Andrew Franz*" subject="*POI*" 
savedate="*5/25/05 1:16 AM*" />
  </dx:file>
<    <dx:file type="*image/png*" name="*cocoon-mini.png*" 
lastModified="*1118171481493*" date="*6/8/05 5:11 AM*" size="*299*">
          <dx:image width="*80*" height="*15*" />
  </dx:file>
</dx:directory>

Looking at TraversableGenerator, I saw a reference to an 
'InspectableSource'. This seems a better way to go.

(As a user) Is there a way to achieve the same outcome using 
TraversableGenerator and 'InspectableSource'?
(As a developer) Should I be extending 'InspectableSource' with POIFS or 
am I better off sticking with a custom generator?

The end goal is to extract meta-info and include it in the directory 
listing & then use Lucene to index the meta info - so a variety of file 
types need to be 'inspected'

Mime
View raw message