Hey Victor,
I am trying to generate the sos model with emf but for some reason I don't
see the option to create a model from xsd. For the life of me i can't
figure out how to get that option, which i thought i had before.
What versions of eclipse, and emf are you using? And when you create a new
model you are doing it from xsd?
@Andrea: you recently did this for csw I assume, how did you install emf?
Anyways, i looked at the sos schema and it looks like a complicated beast,
i am not sure how much a simple tutorial is going to help here.
-Justin
On Wed, Oct 3, 2012 at 1:43 AM, <[email protected]> wrote:
> Hi Justin,****
>
> ** **
>
> I am really struggling to generate the binding. I am trying to generate
> the model using eclipse emf plugin and below are my errors. Are there any
> good tutorial and examples on how to generate the models using emf from
> ground up? Are there any hacks or tips to get around some of the
> limitations of the emf plugins eg, hacking the schema files to get the
> model to generate?****
>
> ** **
>
> What are the typical scenario in the schema you have to hack that doesn’t
> comply to the emf model?****
>
> ** **
>
> If it’s not too much work, is it possible for you to generate a binding
> for sosGetObservation.xsd so we can reference it as example. ****
>
> ** **
>
> ** **
>
> ** **
>
> *java.lang.IllegalArgumentException: The 'no null' constraint is violated*
>
> * at
> org.eclipse.emf.common.util.AbstractEList.validate(AbstractEList.java:101)
> *
>
> * at
> org.eclipse.emf.ecore.util.EcoreEList.validate(EcoreEList.java:69)*
>
> * at
> org.eclipse.emf.common.util.BasicEList.addAllUnique(BasicEList.java:514)*
>
> * at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddAllUnique(NotifyingListImpl.java:506)
> *
>
> * at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:478)
> *
>
> * at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:406)
> *
>
> * at
> org.eclipse.emf.common.util.AbstractEList.addAll(AbstractEList.java:374)*
>
> * at
> org.eclipse.emf.mapping.impl.MappingRootImpl.initializeNewMapping(MappingRootImpl.java:729)
> *
>
> * at
> org.eclipse.emf.mapping.impl.MappingRootImpl.createMapping(MappingRootImpl.java:714)
> *
>
> * at
> org.eclipse.emf.mapping.xsd2ecore.XSD2EcoreMapper.map(XSD2EcoreMapper.java:88)
> *
>
> * at org.eclipse.xsd.ecore.MapBuilder.map(MapBuilder.java:61)*
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:274)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClass(XSDEcoreBuilder.java:1217)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.computeEClassifier(XSDEcoreBuilder.java:321)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEClassifier(XSDEcoreBuilder.java:273)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.createFeature(XSDEcoreBuilder.java:2037)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.getEStructuralFeature(XSDEcoreBuilder.java:2851)
> *
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuilder.java:2942)*
>
> * at
> org.eclipse.xsd.ecore.XSDEcoreBuilder.generate(XSDEcoreBuilder.java:2904)*
>
> * at
> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackages(XSDImporter.java:127)
> *
>
> * at
> org.eclipse.emf.importer.ModelImporter.computeEPackages(ModelImporter.java:529)
> *
>
> * at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterDetailPage.refreshModel(ModelImporterDetailPage.java:406)
> *
>
> * at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterDetailPage$3.execute(ModelImporterDetailPage.java:351)
> *
>
> * at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
> *
>
> * at
> org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)*
>
> * at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
> *
>
> * at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
> *
>
> * at
> org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)*
>
> * at
> org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:944)*
>
> * at
> org.eclipse.emf.importer.ui.contribution.base.ModelImporterDetailPage.refreshModel(ModelImporterDetailPage.java:374)
> *
>
> * at
> org.eclipse.xsd.ecore.importer.ui.XSDDetailPage.doHandleEvent(XSDDetailPage.java:89)
> *
>
> * at
> org.eclipse.emf.converter.ui.contribution.base.ModelConverterPage.handleEvent(ModelConverterPage.java:145)
> *
>
> * at
> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)*
>
> * at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> *
>
> * at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)*
>
> * at
> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)*
>
> * at
> org.eclipse.jface.window.Window.runEventLoop(Window.java:825)*
>
> * at org.eclipse.jface.window.Window.open(Window.java:801)*
>
> * at
> org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:253)
> *
>
> * at
> org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:273)
> *
>
> * at
> org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
> *
>
> * at
> org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)*
>
> * at
> org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
> *
>
> * at
> org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
> *
>
> * at
> org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
> *
>
> * at
> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
> *
>
> * at
> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
> *
>
> * at
> org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
> *
>
> * at
> org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
> *
>
> * at
> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)*
>
> * at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> *
>
> * at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)*
>
> * at
> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)*
>
> * at
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)*
>
> * at
> org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)*
>
> * at
> org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)*
>
> * at
> org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)*
>
> * at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> *
>
> * at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
> *
>
> * at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)*
>
> * at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
> *
>
> * at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
> *
>
> * at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> *
>
> * at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> *
>
> * at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
> *
>
> * at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> *
>
> * at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)*
>
> * at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> *
>
> * at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> *
>
> * at java.lang.reflect.Method.invoke(Method.java:597)*
>
> * at
> org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)*
>
> * at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)*
>
> * at org.eclipse.equinox.launcher.Main.run(Main.java:1311)*
>
> * at org.eclipse.equinox.launcher.Main.main(Main.java:1287)*
>
> ** **
>
> *From:* Justin Deoliveira [mailto:[email protected]]
> *Sent:* Saturday, 29 September 2012 1:04 AM
> *To:* Andrea Aime
> *Cc:* Tey, Victor (CESRE, Kensington);
> [email protected]
>
> *Subject:* Re: [Geotools-gt2-users] xmlcodegen for sos 2.0****
>
> ** **
>
> A while back i also put together some docs to help with generating emf
> models.****
>
> ** **
>
> https://github.com/jdeolive/geotools/tree/emfdoc/modules/ogc/doc****
>
> On Fri, Sep 28, 2012 at 12:42 PM, Andrea Aime <
> [email protected]> wrote:****
>
> On Fri, Sep 28, 2012 at 10:35 AM, <[email protected]> wrote:****
>
> Hi Justin and Andrea,****
>
> ****
>
> My public repo is https://github.com/victortey/geotool.git****
>
> ****
>
> Looks like I have done it the wrong way, I was following
> http://docs.geotools.org/latest/userguide/library/xml/internal/tutorial.htmland
> used jaxb as documented.
> ****
>
> ****
>
> Perhaps I should be using EMF as Andrea have done. Is
> net.opengis.cat.csw20.Csw20Factory auto generated? If yes, how is it done?
> ****
>
> ****
>
> Were you following any documentation Andrea?****
>
> ****
>
> ** **
>
> Hmm... I don't think I was, but here is some steps from memory:****
>
> - install emf and xsd extensions in eclipse****
>
> - copy the xsd schemas in the module that will contain the model****
>
> - create the first emf model by having it read the xsd****
>
> - generate the code****
>
> - throw away the impl and modify the generated interfaces as needed****
>
> - reload the EMF model, regenerate****
>
> - kill the util package just generated, it's not needed****
>
> - often that required me to do a "mvn eclipse:eclipse -pl myModule -am" to
> have the eclipse project compile again****
>
> - iterate over it until you're satistified with package names, return
> types and the model in general****
>
> ** **
>
> Cheers****
>
> Andrea****
>
> ** **
>
> -- ****
>
> ==****
>
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
> information.****
>
> ==****
>
> ** **
>
> Ing. Andrea Aime ****
>
> @geowolf****
>
> Technical Lead****
>
> ** **
>
> GeoSolutions S.A.S.****
>
> Via Poggio alle Viti 1187****
>
> 55054 Massarosa (LU)****
>
> Italy****
>
> phone: +39 0584 962313****
>
> fax: +39 0584 1660272****
>
> mob: +39 339 8844549****
>
> ** **
>
> http://www.geo-solutions.it****
>
> http://twitter.com/geosolutions_it****
>
> ** **
>
> -------------------------------------------------------****
>
> ** **
>
>
>
> ****
>
> ** **
>
> --
> Justin Deoliveira****
>
> OpenGeo - http://opengeo.org****
>
> Enterprise support for open source geospatial.****
>
> ** **
>
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users