Return-Path: Delivered-To: apmail-incubator-abdera-user-archive@locus.apache.org Received: (qmail 5927 invoked from network); 28 Jun 2007 19:40:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 19:40:58 -0000 Received: (qmail 5757 invoked by uid 500); 28 Jun 2007 19:41:01 -0000 Delivered-To: apmail-incubator-abdera-user-archive@incubator.apache.org Received: (qmail 5737 invoked by uid 500); 28 Jun 2007 19:41:01 -0000 Mailing-List: contact abdera-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-user@incubator.apache.org Delivered-To: mailing list abdera-user@incubator.apache.org Received: (qmail 5721 invoked by uid 99); 28 Jun 2007 19:41:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 12:41:01 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jasnell@gmail.com designates 66.249.82.226 as permitted sender) Received: from [66.249.82.226] (HELO wx-out-0506.google.com) (66.249.82.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 12:40:54 -0700 Received: by wx-out-0506.google.com with SMTP id h30so551163wxd for ; Thu, 28 Jun 2007 12:40:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Q88Tmk1XrRNnIfvvFspiJ9wM/9gCwnryyfjA3L0ZIaKTR951E5DJNQFr/yUV/XYztkhQOQHwxObCdv2F9oOCzflmuaaoelhVAk93p7xHR3fjKJjnVEPfIXZXa+1dMS3Z2U16cxOYvkDYYsKjYzvZ+jTwC725G5Y6xD08owzgR1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Fu9HF8V3YUELdxkIKotSY5ys5D8gAJmh2oUhbqKlbJ9jSxdmA5vFyQowvFuGn3lc60foNBUkF1jU/Su9W9MC+FrSMS4dmE+TgCgIpDv+umhziMCF4QQwCQWLZVeUcdOTXBIB1J6a1I5PvtSSiNFINosr66jtgdq7Fa/YoWeAXcg= Received: by 10.90.80.8 with SMTP id d8mr2343813agb.1183059633357; Thu, 28 Jun 2007 12:40:33 -0700 (PDT) Received: from ?192.168.1.118? ( [67.181.218.96]) by mx.google.com with ESMTP id 31sm14562483wri.2007.06.28.12.40.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Jun 2007 12:40:32 -0700 (PDT) Message-ID: <46840EAE.4000705@gmail.com> Date: Thu, 28 Jun 2007 12:40:30 -0700 From: James M Snell User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: abdera-user@incubator.apache.org Subject: Re: Advice on extending Entry References: <5c932c650706270939j1837e076s349b55544be6ca08@mail.gmail.com> <4682A2CD.5050305@gmail.com> <5c932c650706281158t625f4f33x663565f76a20278e@mail.gmail.com> In-Reply-To: <5c932c650706281158t625f4f33x663565f76a20278e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Are you working from the trunk or a specific release? I had to fix a bug last week in the trunk to make this work properly. my apologies for not mentioned that earlier, it had slipped my mind. - James Rob Evans wrote: > On 6/27/07, James M Snell wrote: >> The first question I would have is why :-) >> >> Using ElementWrapper, you can implement code for your application >> specific XML as extensions then work directly with it rather than going >> through a subclassed entry. For instance... >> >> Entry entry = factory.newEntry(); >> >> Foo foo = factory.newElement(MyConstants.FOO); >> foo.setBar("baz"); >> entry.setContent(foo,"application/foo+xml"); >> >> entry.writeTo(System.out); >> >> >> ... >> >> >> baz >> >> >> >> >> All you need to make this work is has Foo extend either the >> ElementWrapper or ExtensibleElementWrapper classes, and provide/register >> an ExtensionFactory implementation. > > This clears things up. I failed to realize that the abdera extension > facility would work for content as well as atom extensions. I should > probably spend some time learning about axiom. > > At any rate, I did as you said and I'm running into trouble. Looks > like FOMFactory.newContent() can't cast my Order to an OMContainer. > Order isa ExtensibleElementWrapper. > > java.lang.ClassCastException: eman.ism.api.rest.model.Order > at > org.apache.abdera.parser.stax.FOMFactory.newContent(FOMFactory.java:230) > at > org.apache.abdera.parser.stax.FOMFactory.newContent(FOMFactory.java:249) > at org.apache.abdera.parser.stax.FOMEntry.setContent(FOMEntry.java:234) > at eman.ism.api.rest.model.OrderTest.testOrder(OrderTest.java:20) >