Bill,

Answers to your questions below:

> 1. Sorry if I missed it, but can you direct me to documentation/java
> code re: setting up processor factories?

The good news is that you don't need to setup anything. Those
factories are setup automatically by reading processors.xml. I tried
to declare a processor with xmlns:wynn="com:wynnon:oxf:processors" and
this is working fine. It is almost as if your processor.xml was not
read.

> 2. What can I do to get my custom processor, above, running ?

Good questions. I guess this will sound stupid, but did you restart
your servlet container after the changes, and did you double-check
that orbeon.jar contains your latest and greatest processors.xml, or
that you don't have more than one processors.xml, for example one in
orbeon.jar and one under classes?

> 3. Ideally, I would set my processor up so that it is not dependent
> on a customized orbeon jar, which would allow me to simply replace
> orbeon.jar whenever a new version comes out. At present, I modify
> processors.xml in the jar to create the mapping of processor name to
> processor class. Is there a way to map processor classes outside
> orbeon.jar ?

This absolutely makes sense. A first solution (that may change in the
future) is checked in and will show up soon in the unstable
builds. You can create a file called custom-processors.xml under the
config directory. This file has the same format as the regular
processors.xml.

Note that you will still need to restart your servlet container after
changes to custom-processors.xml, because the XInclude mechanism
doesn't detect changes to included resources yet.

-Erik

Bill Winspur wrote:

> I am attempting to get my first custom processor to execute.
>
> 1. Using the URLGenerator processor as a base:
>
>   a. I used IDEA's refactor/rename functionality on the class name, to
> clone
>
>          org.orbeon.oxf.processor.generator.URLGenerator
>
>       as
>          org.orbeon.oxf.processor.HttpPostProcessor.
>
>   b. I defined my custom namespace by modifying URL_NAMESPACE_URI to
>
>      public static final String URL_NAMESPACE_URI =
> "com:wynnon:oxf:processors";
>
>   The new class compiled OK, and I added the resulting class tree to
> WEB-INF/classes/.
>
>   I have not made any other changes to the code, at the moment
>   I'm just trying to produce the URLGenerator functionality in working
>   code that I can modify to achieve the functionality I want.
>
> 2. I modified processors.xml in orbeon.jar, putting my processor into
>   a custom namespace (as per http://www.orbeon.com/ois/doc/home-changes,
> sec 5.2.5),
>   as follows:
>
>   a. Changed <processors ...> to add the wynn ns prefix
>
>      <processors xmlns:oxf="http://www.orbeon.com/oxf/processors";
>            xmlns:wynn="com:wynnon:oxf:processors">
>
>   b. Added the following processor definition:
>
>   <processor name="wynn:http-post">
>      <class name="org.orbeon.oxf.processor.HttpPostProcessor" />
>   </processor>
>
> 3. I invoked the processor with the following code
>
>   <p:config
>        xmlns:p="http://www.orbeon.com/oxf/pipeline";
>        xmlns:oxf="http://www.orbeon.com/oxf/processors";
>        xmlns:wynn="com:wynnon:oxf:processors">
>
>        <!-- Generates a response from the cnn website (Learning)  -->
>        <p:param type="input"  name="instance"/>
>        <p:param type="output" name="data"/>
>              <p:processor name="wynn:http-post"
>                xmlns:p="http://www.orbeon.com/oxf/pipeline";>
>            <p:input name="config">
>                <config>
>                    <url>http://www.cnn.com</url>
>                    <content-type>text/html</content-type>
>                </config>
>            </p:input>
>            <p:output name="data" ref="data"/>
>        </p:processor>
>
>      </p:config>
>
> Execution failed with the following error:
>
> Cannot find processor factory with name
> "{http://www.orbeon.com/oxf/processors}http-post";
>
> I checked the Pipeline API Document and searched google and the list
> archives,
> but have not found anything about setting up processor factories.
>
> I have attached my processor source code to this note.



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to