LOMBART Christophe wrote:

Hi Daniel,

Thanks, I will check it.
Another question : if the extractor is defined globally, is it still necessary to use the PropertyExtractorTrigger ? If yes on add the referent to my extratoc into the PropertyExtractorTrigger ?
In order to avoid confusion, is there a new version in cvs for the domain.xml ?


Yes, PropertyExtractorTrigger is required to trigger Extractor via events. The extractors are defined in a separat section because Maritn wanted to have the ability to call it directly. I don't know he is still working on this.
I've checked in a new Domain.xml showing the way to configure it.
Regards,
Daniel


Regards,
Christophe



<listener classname="org.apache.slide.extractor.PropertyExtractorTrigger">
<configuration>
<extractor classname="org.apache.slide.extractor.SimpleXmlExtractor" uri="/files/articles/test.xml">
<configuration>
<instruction property="title" xpath="/article/title/text()" />
<instruction property="summary" xpath="/article/summary/text()" />
</configuration>
</extractor>
</configuration>



-----Original Message-----
From: Daniel Florey [mailto:[EMAIL PROTECTED]
Sent: Tue 3/9/2004 11:23 AM
To: Slide Developers Mailing List
Cc:
Subject: Re: Extractor framework
Hi Christophe,
I've added some lines to call PropertyExtractorTrigger on create as well.
So you have to check out the cvs HEAD. Remind that some things have changed in Domain.xml (Extractors are now defined globally).
Regards,
Daniel


Christophe wrote:



Hi Daniel,

I'm using the following listener :
<listener classname="org.apache.slide.extractor.PropertyExtractorTrigger">
<configuration>
<extractor classname="org.apache.slide.extractor.SimpleXmlExtractor" uri="/files/articles/test.xml">
<configuration>
<instruction property="title" xpath="/article/title/text()" />
<instruction property="summary" xpath="/article/summary/text()" />
</configuration>
</extractor>
</configuration>


</listener> It is correctly called on content.store(...) but not on the content.create(...).
Is it possible to activate this listener on create ?


Thanks,
Christophe

Daniel Florey wrote:



Hi,
I just checked in some classes for the extractor thing.
I've implemented a very simple demo extractor that extracts data from xml documents by doing some configurable xpath queries. If you want to test this you have to enable the extractor trigger.
This is done in the Domain.xml file in the event section:


<listener classname="org.apache.slide.extractor.ExtractorTrigger">
<configuration>
<extractor classname="org.apache.slide.extractor.SimpleXmlExtractor" uri="/files/articles/test.xml">
<configuration>
<instruction property="title" xpath="/article/title/text()" />
<instruction property="summary" xpath="/article/summary/text()" />
</configuration>
</extractor>
</configuration>
</listener>


In this example only the document with uri = /files/articles/test.xml will be processed. If the content would be:

<?xml version="1.0" encoding="UTF-8" ?>
<article>
   <title>Title of article</title>
   <summary>The summary of this article</summary>
</article>

there are some new properties (title, summary) available containing the text.
If some error occurs, the file cannot be uploaded. This is done by throwing an extractor exception.
Any comments are welcome.
Regards,
Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


.







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to