Betwixt - convert XML to a bean Collection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Betwixt - convert XML to a bean Collection

Cristiane "Fogaça"
Hi,

Does anybody know how to convert an XML to a
Collection of beans?

Here is the XML that I have:

<ProjectReviews>
  <ProjectReviewStatus>
    <comments>new status with date</comments>
    <createdBy>Cristiane</createdBy>
    <createdOn>2005-08-18 13:32:17.562</createdOn>
    <projectStatus>In Process</projectStatus>
  </ProjectReviewStatus>
  <ProjectReviewStatus>
    <comments>another comment</comments>
    <createdBy>Cristiane II</createdBy>
    <createdOn>2005-08-18 13:32:17.562</createdOn>
    <projectStatus>In Process</projectStatus>
  </ProjectReviewStatus>
</ProjectReviews>


I'm trying to do something like this:
beanReader.registerBeanClass("ProjectReviews",
ArrayList.class);
ArrayList reviews =
(ArrayList)beanReader.parse(xmlReader);

Anything is returned and no error is throw. What is
wrong with this code?

Thanks for any help.
Cristiane



               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Betwixt - convert XML to a bean Collection

robert burrell donkin
i think that this is caused by a bug which has now been fixed. could you
try again using either the code from HEAD or a recent nightly?

- robert

On Fri, 2005-08-19 at 07:25 -0700, Cristiane Fogaça wrote:

> Hi,
>
> Does anybody know how to convert an XML to a
> Collection of beans?
>
> Here is the XML that I have:
>
> <ProjectReviews>
>   <ProjectReviewStatus>
>     <comments>new status with date</comments>
>     <createdBy>Cristiane</createdBy>
>     <createdOn>2005-08-18 13:32:17.562</createdOn>
>     <projectStatus>In Process</projectStatus>
>   </ProjectReviewStatus>
>   <ProjectReviewStatus>
>     <comments>another comment</comments>
>     <createdBy>Cristiane II</createdBy>
>     <createdOn>2005-08-18 13:32:17.562</createdOn>
>     <projectStatus>In Process</projectStatus>
>   </ProjectReviewStatus>
> </ProjectReviews>
>
>
> I'm trying to do something like this:
> beanReader.registerBeanClass("ProjectReviews",
> ArrayList.class);
> ArrayList reviews =
> (ArrayList)beanReader.parse(xmlReader);
>
> Anything is returned and no error is throw. What is
> wrong with this code?
>
> Thanks for any help.
> Cristiane
>
>
>
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs 
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Betwixt - convert XML to a bean Collection

Cristiane "Fogaça"
Hi Robert, I'm using the latest 0.7 version.

Where should I get the version that fix this bug?

Can you send me the URL?

Thanks,
Cristiane

--- robert burrell donkin
<[hidden email]> wrote:

> i think that this is caused by a bug which has now
> been fixed. could you
> try again using either the code from HEAD or a
> recent nightly?
>
> - robert
>
> On Fri, 2005-08-19 at 07:25 -0700, Cristiane Foga?a
> wrote:
> > Hi,
> >
> > Does anybody know how to convert an XML to a
> > Collection of beans?
> >
> > Here is the XML that I have:
> >
> > <ProjectReviews>
> >   <ProjectReviewStatus>
> >     <comments>new status with date</comments>
> >     <createdBy>Cristiane</createdBy>
> >     <createdOn>2005-08-18 13:32:17.562</createdOn>
> >     <projectStatus>In Process</projectStatus>
> >   </ProjectReviewStatus>
> >   <ProjectReviewStatus>
> >     <comments>another comment</comments>
> >     <createdBy>Cristiane II</createdBy>
> >     <createdOn>2005-08-18 13:32:17.562</createdOn>
> >     <projectStatus>In Process</projectStatus>
> >   </ProjectReviewStatus>
> > </ProjectReviews>
> >
> >
> > I'm trying to do something like this:
> > beanReader.registerBeanClass("ProjectReviews",
> > ArrayList.class);
> > ArrayList reviews =
> > (ArrayList)beanReader.parse(xmlReader);
> >
> > Anything is returned and no error is throw. What
> is
> > wrong with this code?
> >
> > Thanks for any help.
> > Cristiane
> >
> >
> >
> >
> >
> ____________________________________________________
> > Start your day with Yahoo! - make it your home
> page
> > http://www.yahoo.com/r/hs 
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [hidden email]
> > For additional commands, e-mail:
> [hidden email]
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Betwixt - convert XML back to bean

Cristiane "Fogaça"
In reply to this post by robert burrell donkin
Hi,

I have this XML generated by betwixt, and now I wanna
to convert back to the bean structure.

I'm not receiving any error, but the comments (List
attribute of ProjectReviewDeliverable object) and
deliverableItems (List attribute of DeliverableItemDTO
object) are null.

Does anybody know why?

Please, any help would be appreciate!!!


Here is the XML file:

<?xml version='1.0' ?>
<ProjectReviews>
  <ProjectReviewDeliverableRow>
   <comments>
    <ProjectReviewDeliverable>
     <attachmentId>3303</attachmentId>
     <comments>new comment , red cell</comments>
     <createdBy>Cristiane</createdBy>
     <createdOn>2005-08-15 16:31:00.746</createdOn>
     <projectReviewId>0</projectReviewId>
     <status>false</status>
   </ProjectReviewDeliverable>
  <ProjectReviewDeliverable>
     <attachmentId>3303</attachmentId>
     <comments>deliverable comment</comments>
     <createdBy>Cristiane</createdBy>
     <createdOn>2005-08-12 17:26:22.062001</createdOn>
     <projectReviewId>0</projectReviewId>
     <status>false</status>
  </ProjectReviewDeliverable>
 </comments>
 <deliverableItems>
  <DeliverableItemDTO>
    <dtPosted>Fri Oct 01 </dtPosted>
    <type>A</type>
  </DeliverableItemDTO>
 </deliverableItems>
 <deliverableName>Architecture</deliverableName>
 <gridId>3303</gridId>
 <issueFound>false</issueFound>
 </ProjectReviewDeliverableRow>
</ProjectReviews>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]