talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

JAXB for schema extensions?

NS
Nate Solas
Mon, Mar 26, 2012 5:08 PM

Hey all -

Making decent progress using Chris Potts' method of writing import XML
using the JAXB marshaller for objects, but I'm getting a bit stuck with
schema extensions. We've extended the persons schema to include employer
(simple test), but I'm not sure how / if I can use that extension? It
doesn't seem to add get/set methods to the PersonsCommon class in
org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's
possible I'm doing something wrong? The other jar we generate with the
extension
(org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has
the xsd file but doesn't seem to be usable as an instantiatable class to
use with JAXB?

What's the right answer to instantiate a person object and populate our
extended schema and then marshal into XML?

Thanks for any tips,
Nate

Hey all - Making decent progress using Chris Potts' method of writing import XML using the JAXB marshaller for objects, but I'm getting a bit stuck with schema extensions. We've extended the persons schema to include employer (simple test), but I'm not sure how / if I can use that extension? It doesn't seem to add get/set methods to the PersonsCommon class in org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's possible I'm doing something wrong? The other jar we generate with the extension (org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has the xsd file but doesn't seem to be usable as an instantiatable class to use with JAXB? What's the right answer to instantiate a person object and populate our extended schema and then marshal into XML? Thanks for any tips, Nate
RM
Richard Millet
Mon, Mar 26, 2012 6:48 PM

Nate,

I'll send you some notes on creating and using the JAX-B
bindings for your extensions either later today or tomorrow. I think Aron
may have creates documentation for this on the wiki so I'll ask him as
well.

Until then, you can take a look at the CollectionObject service to
see an example of an extension that has JAX-B bindings. Notice that there
are TWO corresponding XSD files -one in the "jaxb" Maven module and one in
the "3rdparty" Maven module. These two XSD files are very similar but
differ in that one is for Nuxeo and the other is for JAX-B.

Also, take a
look at the CollectionObject "sample" module to see how to use the JAX-B
generated extension class (the class that the XJC compiler created from the
"collectionobjects_naturalhistory.xsd" file. Notice there are two JAX-B
classes -one derived from collectionobjects_common.xsd and the other from
collectionobjects_naturalhistory.xsd. Also notice the role of the
PoxPayloadOut class and the PoxPayOutputPart class.

-Richard  Making
decent progress using Chris Potts' method of writing import XML using the
JAXB marshaller for objects, but I'm getting a bit stuck with schema
extensions. We've extended the persons schema to include employer (simple
test), but I'm not sure how / if I can use that extension? It doesn't seem
to add get/set methods to the PersonsCommon class in
org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's
possible I'm doing something wrong? The other jar we generate with the
extension
(org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has
the xsd file but doesn't seem to be usable as an instantiatable class to
use with JAXB?  What's the right answer to instantiate a person object and
populate our extended schema and then marshal into XML?  Thanks for any
tips, Nate

Nate, I'll send you some notes on creating and using the JAX-B bindings for your extensions either later today or tomorrow. I think Aron may have creates documentation for this on the wiki so I'll ask him as well. Until then, you can take a look at the CollectionObject service to see an example of an extension that has JAX-B bindings. Notice that there are TWO corresponding XSD files -one in the "jaxb" Maven module and one in the "3rdparty" Maven module. These two XSD files are *very* similar but differ in that one is for Nuxeo and the other is for JAX-B. Also, take a look at the CollectionObject "sample" module to see how to use the JAX-B generated extension class (the class that the XJC compiler created from the "collectionobjects_naturalhistory.xsd" file. Notice there are two JAX-B classes -one derived from collectionobjects_common.xsd and the other from collectionobjects_naturalhistory.xsd. Also notice the role of the PoxPayloadOut class and the PoxPayOutputPart class. -Richard Making decent progress using Chris Potts' method of writing import XML using the JAXB marshaller for objects, but I'm getting a bit stuck with schema extensions. We've extended the persons schema to include employer (simple test), but I'm not sure how / if I can use that extension? It doesn't seem to add get/set methods to the PersonsCommon class in org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's possible I'm doing something wrong? The other jar we generate with the extension (org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has the xsd file but doesn't seem to be usable as an instantiatable class to use with JAXB? What's the right answer to instantiate a person object and populate our extended schema and then marshal into XML? Thanks for any tips, Nate
NS
Nate Solas
Mon, Mar 26, 2012 6:54 PM

Thanks for the pointers, I'll take a look. Phew, I was about to start
hardcoding some extension xml! :)
Nate

On Mon, Mar 26, 2012 at 1:48 PM, Richard Millet <richard.millet@berkeley.edu

wrote:

Nate,

I'll send you some notes on creating and using the JAX-B bindings for your
extensions either later today or tomorrow.  I think Aron may have creates
documentation for this on the wiki so I'll ask him as well.

Until then, you can take a look at the CollectionObject service to see an
example of an extension that has JAX-B bindings.  Notice that there are TWO
corresponding XSD files -one in the "jaxb" Maven module and one in the
"3rdparty" Maven module.  These two XSD files are very similar but differ
in that one is for Nuxeo and the other is for JAX-B.

Also, take a look at the CollectionObject "sample" module to see how to
use the JAX-B generated extension class (the class that the XJC compiler
created from the "collectionobjects_naturalhistory.xsd" file.  Notice there
are two JAX-B classes -one derived from collectionobjects_common.xsd and
the other from collectionobjects_naturalhistory.xsd.  Also notice the role
of the PoxPayloadOut class and the PoxPayOutputPart class.

-Richard

Making decent progress using Chris Potts' method of writing import XML
using the JAXB marshaller for objects, but I'm getting a bit stuck with
schema extensions. We've extended the persons schema to include employer
(simple test), but I'm not sure how / if I can use that extension? It
doesn't seem to add get/set methods to the PersonsCommon class in
org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's
possible I'm doing something wrong? The other jar we generate with the
extension
(org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has
the xsd file but doesn't seem to be usable as an instantiatable class to
use with JAXB?
What's the right answer to instantiate a person object and populate our
extended schema and then marshal into XML?
Thanks for any tips,
Nate

Thanks for the pointers, I'll take a look. Phew, I was about to start hardcoding some extension xml! :) Nate On Mon, Mar 26, 2012 at 1:48 PM, Richard Millet <richard.millet@berkeley.edu > wrote: > Nate, > > I'll send you some notes on creating and using the JAX-B bindings for your > extensions either later today or tomorrow. I think Aron may have creates > documentation for this on the wiki so I'll ask him as well. > > > > Until then, you can take a look at the CollectionObject service to see an > example of an extension that has JAX-B bindings. Notice that there are TWO > corresponding XSD files -one in the "jaxb" Maven module and one in the > "3rdparty" Maven module. These two XSD files are *very* similar but differ > in that one is for Nuxeo and the other is for JAX-B. > > > > Also, take a look at the CollectionObject "sample" module to see how to > use the JAX-B generated extension class (the class that the XJC compiler > created from the "collectionobjects_naturalhistory.xsd" file. Notice there > are two JAX-B classes -one derived from collectionobjects_common.xsd and > the other from collectionobjects_naturalhistory.xsd. Also notice the role > of the PoxPayloadOut class and the PoxPayOutputPart class. > > > > -Richard > > Making decent progress using Chris Potts' method of writing import XML > using the JAXB marshaller for objects, but I'm getting a bit stuck with > schema extensions. We've extended the persons schema to include employer > (simple test), but I'm not sure how / if I can use that extension? It > doesn't seem to add get/set methods to the PersonsCommon class in > org.collectionspace.services.person.jaxb-2.0-SNAPSHOT.jar, but it's > possible I'm doing something wrong? The other jar we generate with the > extension > (org.collectionspace.services.person.3rdparty.nuxeo-2.0-SNAPSHOT.jar) has > the xsd file but doesn't seem to be usable as an instantiatable class to > use with JAXB? > What's the right answer to instantiate a person object and populate our > extended schema and then marshal into XML? > Thanks for any tips, > Nate > > >