Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 68599 invoked from network); 14 Mar 2008 19:47:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2008 19:47:46 -0000 Received: (qmail 31883 invoked by uid 500); 14 Mar 2008 19:47:42 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 31838 invoked by uid 500); 14 Mar 2008 19:47:42 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 31827 invoked by uid 99); 14 Mar 2008 19:47:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2008 12:47:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.136.44.62] (HELO smtp107.prem.mail.sp1.yahoo.com) (98.136.44.62) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 14 Mar 2008 19:47:04 +0000 Received: (qmail 11715 invoked from network); 14 Mar 2008 19:47:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=KTOkgj1JPRjIKIvr1wuIH3fx0hAoVDk3/qwJMzPc3ddsoXJRaz8YVS8s8+SqH1iqjcHsObaJF5yCC9PJu/+PnwASwu2F81bDG7UjyyWqR2O/M4mJIv9TYBHxNqdhb+ngAReSEmuboRpXhD3+ON2PUsqg4+wxMcYj7SHfICJvGJY= ; Received: from unknown (HELO ?192.168.1.101?) (david_jencks@67.102.173.8 with plain) by smtp107.prem.mail.sp1.yahoo.com with SMTP; 14 Mar 2008 19:47:14 -0000 X-YMail-OSG: 0rZfBcAVM1lAbUinkH0zqrdncEHgtxqiTgPhPdsn85YVQHJj4sPFeIUDbmwj5.pbd8UNGmEOCw-- X-Yahoo-Newman-Property: ymail-3 Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <41DFAE0D-5699-4196-8CC5-4377F181456F@yahoo.com> Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: [Discuss] Model for deployment plans in GEP - Move from EMF to XMLBeans or JAXB? Date: Fri, 14 Mar 2008 12:47:57 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.753) X-Virus-Checked: Checked by ClamAV on apache.org On Mar 14, 2008, at 3:54 AM, yunfeng ma wrote: > Cool, great news ... :) > > I'm trying to replace EMF using JAXB and got some issues need your > help. > 1. Some elements in the deployment plan can not be unmarshalled, > such as gbeans in geronimo-web.xml. I'm not sure if it's because > geronimo-web-2.0.1.xsd only includes an abstract element "service" > which is the parent of "gbean". > Is the gbean in the correct namespace for the schemas involved? In the geronimo plan processing we do quite a bit of work to correct namespaces so that the plan author doesn't need to keep changing namespaces; in particular we set the correct namespace for gbeans no matter what the original namespace is. > 2. Now the schema files are compiled to generate the model classes > during every GEP building. I think the better way is generating the > java source codes offline and importing the source codes to svn > directly, this provides us a chance to customize the generated > source codes (like the way in OpenEJB). I agree. > 3. The deployment plan saved by JAXB after modification is > unformatted, only contents are in one line. We need save the > deployment plan with well format. This code seems to work well in AttributesXmlUtil: public static void writeAttributes(AttributesType metadata, Writer out) throws XMLStreamException, JAXBException { Marshaller marshaller = ATTRIBUTES_CONTEXT.createMarshaller(); marshaller.setProperty("jaxb.formatted.output", true); JAXBElement element = new ObjectFactory ().createAttributes(metadata); marshaller.marshal(element, out); } > 4. More elegant way to operate the POJOs generate by JAXB. JAXB > uses POJO to represent the element in XML, so how to create a new > instance of an element (JAX > B way is too fussy), how to set/get the properties of an element > via property name (JAXB doesn't provide any way for this), how to > get the parent instance of an element (JAXB doesn't provide any way > for this) etc. > I don't understand the problem here. I thought the main point of using something like jaxb was so you can write typed java code for a typed java model corresponding to the xml. Do you want to write generic java code to deal with the typed java model? thanks david jencks > Any advice for the above issues? > Thanks a lot. > > -- YunFeng Ma