Re: [Native] New DeveloperWorks article
These things are like buses! Slightly more timely, there's another DeveloperWorks article out at [1] titled Build mashups with the Service Component Architecture and Apache Tuscany. This article explains how the Alert Aggregator sample in the Tuscany Native M3 release works and steps through the components and code it uses. Cheers Andy [1] http://www.ibm.com/developerworks/library/ws-soa-scamashups/ On 5/4/07, Andrew Borley [EMAIL PROTECTED] wrote: Hi all, In the inevitable way that these things work out, my latest DeveloperWorks article, based on the C++ M2 release, has been published a day after the M3 release is announced! It's at [1] and is titled Build a simple C++ service component, Part 2: Using Python, Ruby, and Web services with the service component architecture. It steps through the creation of an SCA app based on the Python, Ruby and Web Services support we have in the past 2 releases. Cheers! Andy [1] http://www-128.ibm.com/developerworks/webservices/library/ws-soa-capisca2/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Evolution of a specific SDO structure over time
Hi Frank It works if the following line is added to the configureXMLResource method of class DataObjectUtil: resource.getDefaultLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,Boolean.TRUE); Could you add this? Regards, Daniel. __ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Evolution of a specific SDO structure over time
Hi Daniel, I guess it would be OK, but the downside of making it a default option (i.e., always do it) is that the SDO loader will then pretty much never fail - you'll be able to load any junk without getting any load errors. The other alternative is to expose the RECORD_UNKNOWN_FEATURE option as one supported by Tuscany SDO, so you can pass it to the XMLHelper.load() method when you want this behavior. Comments? What do others thing about this? Thanks Frank. Daniel Peter [EMAIL PROTECTED] wrote on 05/25/2007 10:12:29 AM: Hi Frank It works if the following line is added to the configureXMLResource method of class DataObjectUtil: resource.getDefaultLoadOptions().put(XMLResource. OPTION_RECORD_UNKNOWN_FEATURE,Boolean.TRUE); Could you add this? Regards, Daniel. __ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Evolution of a specific SDO structure over time
I think exposing RECORD_UNKNOWN_FEATURE as an option to XMLHelper.load() is a good solution. I would vote against making it the default behavior. - Ron - Original Message From: Frank Budinsky [EMAIL PROTECTED] To: tuscany-user@ws.apache.org Sent: Friday, May 25, 2007 10:30:52 AM Subject: Re: Evolution of a specific SDO structure over time Hi Daniel, I guess it would be OK, but the downside of making it a default option (i.e., always do it) is that the SDO loader will then pretty much never fail - you'll be able to load any junk without getting any load errors. The other alternative is to expose the RECORD_UNKNOWN_FEATURE option as one supported by Tuscany SDO, so you can pass it to the XMLHelper.load() method when you want this behavior. Comments? What do others thing about this? Thanks Frank. Daniel Peter [EMAIL PROTECTED] wrote on 05/25/2007 10:12:29 AM: Hi Frank It works if the following line is added to the configureXMLResource method of class DataObjectUtil: resource.getDefaultLoadOptions().put(XMLResource. OPTION_RECORD_UNKNOWN_FEATURE,Boolean.TRUE); Could you add this? Regards, Daniel. __ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about setting an element's value
Hi, I have the following schema: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:ext=urn:Extension xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:Extension elementFormDefault=unqualified attributeFormDefault=unqualified version=1.0 xs:element name=Extension xs:complexType xs:sequence xs:element ref=ext:SubCategory minOccurs=0 maxOccurs=unbounded / /xs:sequence /xs:complexType /xs:element xs:element name=SubCategory xs:complexType xs:simpleContent xs:extension base=xs:string xs:attribute name=displayable type=xs:boolean use=optional / /xs:extension /xs:simpleContent /xs:complexType /xs:element /xs:schema And I'd like to create this xml: ?xml version=1.0 encoding=ASCII? ext:Extension xmlns:ext=urn:Extension ext:SubCategory displayable=truemyCategory/SubCategory /ext:Extension I'm having problems setting the value myCategory. In examples I've seen where the element does not contain an attribute, a simple set(SubCategory, myCategory) would work. It seems that I can't use that in this case. Here's my current code: HelperContext context = SDOUtil.createHelperContext(); InputStream in = new File(Extension.xsd).toURL().openStream(); context.getXSDHelper().define(in, null); DataObject extension = context.getDataFactory().create(urn:Extension, Extension); DataObject subCategory = extension.createDataObject(SubCategory); subCategory.setBoolean(displayable, true); extension.set(SubCategory, myCategory); context.getXMLHelper().save(extension, urn:Extension, Extension, System.out); When the set() method is called, i get the following exception: Exception in thread main java.lang.ClassCastException: java.lang.String at org.eclipse.emf.ecore.util.EcoreEList.set(EcoreEList.java:448) at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateMany.dynamicSet(EStructuralFeatureImpl.java:1647) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:709) at org.apache.tuscany.sdo.impl.DynamicDataObjectImpl.eDynamicSet(DynamicDataObjectImpl.java:159) at org.apache.tuscany.sdo.impl.DataObjectImpl.eSet(DataObjectImpl.java:1459) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142) at org.apache.tuscany.sdo.util.DataObjectUtil.set(DataObjectUtil.java:730) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:225) at Test.valueTest(Test.java:186) at Test.main(Test.java:197) I've tried looking through the samples and test cases, but couldn't find a similar example. Any help in pointing me to the correct API would be appreciated. Thanks, -Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about setting an element's value
Hi Chris, A complexType that extends a simpleType exposes the simple content as a property named value. So, you would set it like this: subCategory.set(value, myCategory); Frank [EMAIL PROTECTED] wrote on 05/25/2007 11:10:35 AM: Hi, I have the following schema: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:ext=urn:Extension xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:Extension elementFormDefault=unqualified attributeFormDefault=unqualified version=1.0 xs:element name=Extension xs:complexType xs:sequence xs:element ref=ext:SubCategory minOccurs=0 maxOccurs=unbounded / /xs:sequence /xs:complexType /xs:element xs:element name=SubCategory xs:complexType xs:simpleContent xs:extension base=xs:string xs:attribute name=displayable type=xs:boolean use=optional / /xs:extension /xs:simpleContent /xs:complexType /xs:element /xs:schema And I'd like to create this xml: ?xml version=1.0 encoding=ASCII? ext:Extension xmlns:ext=urn:Extension ext:SubCategory displayable=truemyCategory/SubCategory /ext:Extension I'm having problems setting the value myCategory. In examples I've seen where the element does not contain an attribute, a simple set(SubCategory, myCategory) would work. It seems that I can't use that in this case. Here's my current code: HelperContext context = SDOUtil.createHelperContext(); InputStream in = new File(Extension.xsd).toURL().openStream(); context.getXSDHelper().define(in, null); DataObject extension = context.getDataFactory().create(urn:Extension, Extension); DataObject subCategory = extension.createDataObject(SubCategory); subCategory.setBoolean(displayable, true); extension.set(SubCategory, myCategory); context.getXMLHelper().save(extension, urn:Extension, Extension, System.out); When the set() method is called, i get the following exception: Exception in thread main java.lang.ClassCastException: java.lang.String at org.eclipse.emf.ecore.util.EcoreEList.set(EcoreEList.java:448) at org.eclipse.emf.ecore.impl. EStructuralFeatureImpl$InternalSettingDelegateMany. dynamicSet(EStructuralFeatureImpl.java:1647) at org.eclipse.emf.ecore.impl.BasicEObjectImpl. eDynamicSet(BasicEObjectImpl.java:709) at org.apache.tuscany.sdo.impl.DynamicDataObjectImpl. eDynamicSet(DynamicDataObjectImpl.java:159) at org.apache.tuscany.sdo.impl.DataObjectImpl. eSet(DataObjectImpl.java:1459) at org.eclipse.emf.ecore.impl.BasicEObjectImpl. eSet(BasicEObjectImpl.java:654) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142) at org.apache.tuscany.sdo.util.DataObjectUtil.set(DataObjectUtil.java:730) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:225) at Test.valueTest(Test.java:186) at Test.main(Test.java:197) I've tried looking through the samples and test cases, but couldn't find a similar example. Any help in pointing me to the correct API would be appreciated. Thanks, -Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about setting an element's value
Thanks, I figured I was missing something simple. Thanks again, -Chris On 5/25/07, Frank Budinsky [EMAIL PROTECTED] wrote: Hi Chris, A complexType that extends a simpleType exposes the simple content as a property named value. So, you would set it like this: subCategory.set(value, myCategory); Frank [EMAIL PROTECTED] wrote on 05/25/2007 11:10:35 AM: Hi, I have the following schema: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:ext=urn:Extension xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=urn:Extension elementFormDefault=unqualified attributeFormDefault=unqualified version=1.0 xs:element name=Extension xs:complexType xs:sequence xs:element ref=ext:SubCategory minOccurs=0 maxOccurs=unbounded / /xs:sequence /xs:complexType /xs:element xs:element name=SubCategory xs:complexType xs:simpleContent xs:extension base=xs:string xs:attribute name=displayable type=xs:boolean use=optional / /xs:extension /xs:simpleContent /xs:complexType /xs:element /xs:schema And I'd like to create this xml: ?xml version=1.0 encoding=ASCII? ext:Extension xmlns:ext=urn:Extension ext:SubCategory displayable=truemyCategory/SubCategory /ext:Extension I'm having problems setting the value myCategory. In examples I've seen where the element does not contain an attribute, a simple set(SubCategory, myCategory) would work. It seems that I can't use that in this case. Here's my current code: HelperContext context = SDOUtil.createHelperContext(); InputStream in = new File(Extension.xsd).toURL().openStream(); context.getXSDHelper().define(in, null); DataObject extension = context.getDataFactory().create(urn:Extension, Extension); DataObject subCategory = extension.createDataObject(SubCategory); subCategory.setBoolean(displayable, true); extension.set(SubCategory, myCategory); context.getXMLHelper().save(extension, urn:Extension, Extension, System.out); When the set() method is called, i get the following exception: Exception in thread main java.lang.ClassCastException: java.lang.String at org.eclipse.emf.ecore.util.EcoreEList.set(EcoreEList.java:448) at org.eclipse.emf.ecore.impl. EStructuralFeatureImpl$InternalSettingDelegateMany. dynamicSet(EStructuralFeatureImpl.java:1647) at org.eclipse.emf.ecore.impl.BasicEObjectImpl. eDynamicSet(BasicEObjectImpl.java:709) at org.apache.tuscany.sdo.impl.DynamicDataObjectImpl. eDynamicSet(DynamicDataObjectImpl.java:159) at org.apache.tuscany.sdo.impl.DataObjectImpl. eSet(DataObjectImpl.java:1459) at org.eclipse.emf.ecore.impl.BasicEObjectImpl. eSet(BasicEObjectImpl.java:654) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142) at org.apache.tuscany.sdo.util.DataObjectUtil.set(DataObjectUtil.java:730) at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:225) at Test.valueTest(Test.java:186) at Test.main(Test.java:197) I've tried looking through the samples and test cases, but couldn't find a similar example. Any help in pointing me to the correct API would be appreciated. Thanks, -Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Evolution of a specific SDO structure over time
Hi Frank Exposing the RECORD_UNKNOWN_FEATURE option is sure a good idea. But I'm not sure if this is sufficient from the Java deserialization point of view. During Java deserialization the method readDataObject in the class HelperProviderImpl.ResolvableImpl calls the XMLHelper.load() method (currently without passing any options). There would be a mechanism needed, that allows to specify options which would then be later picked up by readDataObject during Java deserialization. What do you think? Thanks, Daniel. - Ursprüngliche Mail Von: Frank Budinsky [EMAIL PROTECTED] An: tuscany-user@ws.apache.org Gesendet: Freitag, den 25. Mai 2007, 16:30:52 Uhr Betreff: Re: Evolution of a specific SDO structure over time Hi Daniel, I guess it would be OK, but the downside of making it a default option (i.e., always do it) is that the SDO loader will then pretty much never fail - you'll be able to load any junk without getting any load errors. The other alternative is to expose the RECORD_UNKNOWN_FEATURE option as one supported by Tuscany SDO, so you can pass it to the XMLHelper.load() method when you want this behavior. Comments? What do others thing about this? Thanks Frank. Daniel Peter [EMAIL PROTECTED] wrote on 05/25/2007 10:12:29 AM: Hi Frank It works if the following line is added to the configureXMLResource method of class DataObjectUtil: resource.getDefaultLoadOptions().put(XMLResource. OPTION_RECORD_UNKNOWN_FEATURE,Boolean.TRUE); Could you add this? Regards, Daniel. __ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever
Re: AW: Evolution of a specific SDO structure over time
Good point Daniel. For Java deserialization we can do either or both of the following: 1) provide a way to set default options, e.g., SDOUtil.setDefaultXMLOptions(HelperContext, Object options). 2) provide a way to set the load options on the ObjectInputStream, e.g., SDOObjectInputStream.setXMLOptions(Object options). I think #1 is a general direction the SDO spec (SDO 3) wants to move, but #2 may be useful as well. Frank. Daniel Peter [EMAIL PROTECTED] wrote on 05/25/2007 04:15:15 PM: Hi Frank Exposing the RECORD_UNKNOWN_FEATURE option is sure a good idea. But I'm not sure if this is sufficient from the Java deserialization point of view. During Java deserialization the method readDataObject in the class HelperProviderImpl.ResolvableImpl calls the XMLHelper.load() method (currently without passing any options). There would be a mechanism needed, that allows to specify options which would then be later picked up by readDataObject during Java deserialization. What do you think? Thanks, Daniel. - Ursprüngliche Mail Von: Frank Budinsky [EMAIL PROTECTED] An: tuscany-user@ws.apache.org Gesendet: Freitag, den 25. Mai 2007, 16:30:52 Uhr Betreff: Re: Evolution of a specific SDO structure over time Hi Daniel, I guess it would be OK, but the downside of making it a default option (i.e., always do it) is that the SDO loader will then pretty much never fail - you'll be able to load any junk without getting any load errors. The other alternative is to expose the RECORD_UNKNOWN_FEATURE option as one supported by Tuscany SDO, so you can pass it to the XMLHelper.load() method when you want this behavior. Comments? What do others thing about this? Thanks Frank. Daniel Peter [EMAIL PROTECTED] wrote on 05/25/2007 10:12:29 AM: Hi Frank It works if the following line is added to the configureXMLResource method of class DataObjectUtil: resource.getDefaultLoadOptions().put(XMLResource. OPTION_RECORD_UNKNOWN_FEATURE,Boolean.TRUE); Could you add this? Regards, Daniel. __ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]