Re: Roundtripping using Digester and Betwixt

2006-08-20 Thread Simon Kitching
Hi Jeff,

On Fri, 2006-08-18 at 13:19 -0700, Jeff Marendo wrote:
 Hello,
   
   I'm using the Commons Digester, specifically, to read data from XML  files 
 in order to create objects and I later use Betwixt to write  objects out to 
 XML.  I'm using Digester rules files to specifiy  XML layout so a known 
 pattern is used while reading and creating  objects.
   

[snip]

   How can I instruct Betwixt (the BeanWriter instance, I think) to write  out 
 the info so that it matches the pattern that I'm using when  reading?  
 Perhaps I should just be using Betwixt for both reading  and writing, but I'd 
 still like to be able to set things up,  explicitly, so that the XML format 
 for a given class is knowing ahead  of time (so the format for reading and 
 writing is the same).
   
   Please reply, if someone has an idea about this.  Thanks!

Yes you should probably be using Betwixt for both reading and writing
(betwixt uses Digester internally for reading anyway).

You can create a .betwixt file for a class to define how you want the
xml to be written/read, eg for class example.foo.Bar, create a file
example.foo.Bar.betwixt containing the necessary definitions. This
file is used automatically when an object is *written to xml* by
betwixt. When reading xml, you do need to register the classes that
you expect to be reading from the xml; betwixt then finds the
appropriate .betwixt files for them to use when reading the xml in.


See the betwixt documentation for further details; the examples show how
to do all this.

If you do want to ask further questions on this list, please place the
name(s) of the relevant commons subprojects in the subject line, eg
  [betwixt][digester] How do I xxyyzzz...

Regards,

Simon


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



[chain] Strategies for alternate paths through a chain

2006-08-20 Thread Karr, David
Spring 1.2.1, commons-chain 1.0, JDK 1.4.2, WebLogic 8.1.4.

I have a relatively simple chain in a large Spring application context.
I've realized that somewhat near the end of the chain, I need to be able
to skip one or more commands, and at least one of those commands is a
reusable parameterized component, so I can't just put a chain-specific
flag into the context to make the skippable command(s) be a noop.

So, what are my options for following alternate paths through a command
chain?

The point where I determine I'll need to skip 1 or more commands is in a
chain-specific class (not a reusable component), so I can write code in
there to do whatever I need.

I see that within the code of a command, I can get the Catalog through
the static method in CatalogFactory, and then I can get a specific
command (I assume that the id property in the context is the name
the API refers to?), which I could then execute, and then perhaps return
true from the calling command.

If in that code of the command, I determine I need to skip the next
command, but execute the last two commands of the chain, could I wrap
the last two commands in a nested command (a ChainBase), so I could then
get that ChainBase from the catalog and execute that? If I didn't need
to skip the command, would it execute into the nested command normally?

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



[Id commons] Configuration howto

2006-08-20 Thread D.O.M.

Hello,
I'm doing an application on Java but I'm not an expert in it, and I want
to use the Id component, but I don't know how to configure my
system(if I have to) for using it or where to put the component files.

Also I want to be sure that I have all the files belonging to the component.  I 
downloaded all the files from the site 
http://svn.apache.org/viewvc/jakarta/commons/sandbox/id/trunk/  is that correct?

I'll hope you help me, because I really want to use this component.

Thank you,