Hi Johan, Having looked back at the minimal changes between 1.0 RC2 and the final release I spotted that you said May 2007, which was the RC2 for the beta1 release, so if it is these two distros you have been using then there are a large number of changes between them, see [1]. I'm not an expert on the details of ecore model formats, but aside from that, my main worry would be that you have been building a solution by working inside the Tuscany implementation which is subject to change; the breaking change you point out being a case in point, I can see this is an area in which the implementation is likely to change more in the future too. Clearly you could get round this by building a converter which uses the EMF APIs to traverse the ecore models and the SDO API to dynamically build SDO metadata. Is this something you'd be interested in contributing to Tuscany?
Best Regards, Kelvin. [1] https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310210&fixfor=12312521&resolution=1&sorter/field=issuekey&sorter/order=DESC&sorter/field=issuetype&sorter/order=DESC On 24/09/2007, Johan Gielstra <[EMAIL PROTECTED]> wrote: > Hi All, > I have some ecore models that I want to load directly, rather than > exporting them to a schema and using XSDHelper to load them in. > I have experimented with the Tuscany SDO 1.0rc2 (May 2007 ) to and > loaded + used the model successfully... > > The code I was using stopped working in Tuscany SDO 1.0 release (August > 2007). and I made the changes below.. > > Anyway, I get the model loaded and when I call > somedo.getInstanceProperty("name") it fails and their are no attributes ? > When I dump somedo.getInstanceProperties() I see only Reference and > no Attributes ? > > I am unable to share my models but I can make some sample models+code if > someone is willing to help ? > > ////////////////////////////////////////////////////////// > For 1.0 rc2 > ////////////////////////////////////////////////////////// > public class CreateSDODatagraph { > // TODO this is a hack need to figure out how to properly initialize > // SDOEcoreFactory... > // thepack is hack something change in the initialization code that > cuased problems... > private static EcorePackage thepack = EcorePackage.eINSTANCE; > static { > EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, > new EPackage.Descriptor() { > public EPackage getEPackage() { > return thepack; > } > > public EFactory getEFactory() { > return new SDOFactoryImpl.SDOEcoreFactory(); > } > }); > } > public void loadModel(URI uri) { > Resource r = > datagraph.getResourceSet().getResource(uriConverter.normalize(uri), true); > EPackage pack = getEPackage(r); > //String prefix = pack.getNsPrefix(); > String namespace = pack.getNsURI(); > // Do both just in case ... > EPackage.Registry.INSTANCE.put(namespace, pack); > datagraph.getResourceSet().getPackageRegistry().put(namespace, > pack); > pack.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); > } > ............ > > } > ///////////////////////////////// > For 1.0 > /////////////////////////////// > public void init(){ > .... > EcorePackage.eINSTANCE.setEFactoryInstance(new > SDOFactoryImpl.SDOEcoreFactory()); > .... > } > public void loadModel(URI uri) { > // internally the normalized URI is used to resolve > inter-related models > Resource r = datagraph.getResourceSet().getResource( > uriconverter.normalize(uri), true); > EPackage pack = getEPackage(r); > String prefix = pack.getNsPrefix(); > String namespace = pack.getNsURI(); > // EPackage.Registry.INSTANCE.put(namespace, pack); > HelperContextImpl.getBuiltInModelRegistry().put(namespace, pack); > pack.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); > prefix2namespace.put(prefix, namespace); > } > > --------------------------------------------------------------------- > 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]
