Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Form Editor for a WS-Policy ecore model
EMF Form Editor for a WS-Policy ecore model [message #639908] Thu, 18 November 2010 11:31 Go to next message
Tom Sattler is currently offline Tom SattlerFriend
Messages: 3
Registered: November 2010
Junior Member
Hi,

I am creating a form editor based on the generated classes usinf the EMF generator. Therefore I have created a genmodel of the WS-Policy and WS-SecurityPolicy specifications. Futhermore I created ecore models on the depending specifications as well.

When I now try to load a serialized policy.xml the generated editor or my created form editor give a NullPointerException. Only the Sample Reflective Ecore XML Editor seemed working.
Sometimes the generated editor also shows data when I name the file in 'policy.policy' using the same file.

Anyway I prefer to create a form editor using also *.xml if it is possible.

It would be if anybody could give a hint.

Thanks in advice
Best regards
Tom


org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Policy' is not found or is abstract. (platform:/resource/Sample/src/Copy%20of%20policy5.policy, 2, 139)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2244)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2235)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1332)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:83)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at org.xmlsoap.schemas.ws._2004._09.wspolicy.presentation.Polic yEditor.createModel(PolicyEditor.java:966)
at org.xmlsoap.schemas.ws._2004._09.wspolicy.presentation.Polic yEditor.createPages(PolicyEditor.java:1023)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:348)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:289)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2863)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2768)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2707)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2691)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2682)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:365)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:168)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 9)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 8)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(Open AndExpand.java:49)
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.jav a:221)
at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(Commo nNavigatorManager.java:185)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener. open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:845)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:843)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1131)
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewe r.java:462)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1235)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:298)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Re: EMF Form Editor for a WS-Policy ecore model [message #639922 is a reply to message #639908] Thu, 18 November 2010 12:27 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi
> I am creating a form editor based on the generated classes usinf the EMF
> generator. Therefore I have created a genmodel of the WS-Policy and
> WS-SecurityPolicy specifications. Futhermore I created ecore models on
> the depending specifications as well.

I assume your model has two classes, Policy and Security Policy? I also
assume you created an ecore, a genModel and generated code? Maybe you
could describe that a little more in detail?

>
> When I now try to load a serialized policy.xml the generated editor or
> my created form editor give a NullPointerException.

Is that the exception down below? That is a classnotfound. Check whether
Policy is abstract. If so, you cannot create it. Can you describe how
you exactly load xml into the editor? There is something with jdt in the
stack trace...


Only the Sample
> Reflective Ecore XML Editor seemed working. Sometimes the generated
> editor also shows data when I name the file in 'policy.policy' using the
> same file.

What do you mean by sometimes?

Cheers
Jonas





> Anyway I prefer to create a form editor using also *.xml if it is possible.
>
> It would be if anybody could give a hint.
>
> Thanks in advice
> Best regards
> Tom
>
>
> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Policy' is not
> found or is abstract.
> (platform:/resource/Sample/src/Copy%20of%20policy5.policy, 2, 139)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje
> ctFromFactory(XMLHandler.java:2244)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje
> ctFromFactory(XMLHandler.java:2235)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1332)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM
> LHandler.java:1468)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML
> Handler.java:1019)
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI
> Handler.java:83)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:1001)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:712)
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa
> ndler.java:169)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .startElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.
> startElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanStartElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm
> pl$ContentDriver.scanRootElementHook(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl$FragmentContentDriver.next(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm
> pl$PrologDriver.next(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm
> pl.next(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanDocument(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA
> XParser.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes
> ourceImpl.java:180)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1494)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1282)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> ad(ResourceSetImpl.java:255)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:270)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
> at org.xmlsoap.schemas.ws._2004._09.wspolicy.presentation.Polic
> yEditor.createModel(PolicyEditor.java:966)
> at org.xmlsoap.schemas.ws._2004._09.wspolicy.presentation.Polic
> yEditor.createPages(PolicyEditor.java:1023)
> at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu
> ltiPageEditorPart.java:348)
> at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi
> torReference.java:670)
> at org.eclipse.ui.internal.EditorReference.createPart(EditorRef
> erence.java:465)
> at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb
> enchPartReference.java:595)
> at org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe
> rence.java:289)
> at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(
> WorkbenchPage.java:2863)
> at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben
> chPage.java:2768)
> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag
> e.java:2760)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2707)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2691)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2682)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
> at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE
> ditor(EditorUtility.java:365)
> at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE
> ditor(EditorUtility.java:168)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 9)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 8)
> at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR
> un(SelectionDispatchAction.java:274)
> at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec
> tionDispatchAction.java:250)
> at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(Open
> AndExpand.java:49)
> at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.jav a:221)
> at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(Commo
> nNavigatorManager.java:185)
> at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.
> open(OpenAndLinkWithEditorHelper.java:48)
> at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV
> iewer.java:845)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur
> edViewer.java:843)
> at org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct
> uredViewer.java:1131)
> at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewe r.java:462)
> at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru
> cturedViewer.java:1235)
> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate
> gy.java:264)
> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:258)
> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate
> gy.java:298)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:664)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start
> (IDEApplication.java:115)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:196)
> 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(EclipseS
> tarter.java:369)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Re: EMF Form Editor for a WS-Policy ecore model [message #639931 is a reply to message #639922] Thu, 18 November 2010 13:02 Go to previous messageGo to next message
Tom Sattler is currently offline Tom SattlerFriend
Messages: 3
Registered: November 2010
Junior Member
Hi Jonas,

I have created a genmodel including the 8 ecore models (e.g. the ws-policy and ws-security-policy). All of the I have generated based on the xsds of ths specifications from the w3c and open oasis.
Furthermore I generated th model code, the edit code and the editors. That was done more or less fast.

Now I have a policy.xml that I open in the workspace with one of the generated editors (more than one cause of the different ecores), when a new eclipse enviroment was started. None of the editor can open the file of the ClassNotFoundException (no Nullpointer, sorry!).

>What do you mean by sometimes?

I meant that I had configurations when I did work to show a policy.policy in the generated editor, the extension of the particular generated editor. I tried to change the file extension in the plugin.xml but it still accepted the '*.policy'.

The point of the exception is that a policy.class does not exist. The transfomation from the wspolicy.xsd to the ecore put the policy as a ereference into the documentRoot (like shown below).
In java classes that means I have a 'DocumentRoot.java' containing the methods
PolicyType getPolicy();
and
void setPolicy(PolicyType value);


Best Regards,
Tom


ecore excerpt
-------
<eStructuralFeatures xsi:type="ecore:EReference" name="policy" upperBound="-2"
        eType="#//PolicyType" volatile="true" transient="true" derived="true" containment="true"
        resolveProxies="false">
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="kind" value="element"/>
        <details key="name" value="Policy"/>
        <details key="namespace" value="##targetNamespace"/>
      </eAnnotations>
    </eStructuralFeatures>


Re: EMF Form Editor for a WS-Policy ecore model [message #639987 is a reply to message #639931] Thu, 18 November 2010 15:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Tom,

Comments below.


Tom Sattler wrote:
> Hi Jonas,
>
> I have created a genmodel including the 8 ecore models (e.g. the
> ws-policy and ws-security-policy). All of the I have generated based
> on the xsds of ths specifications from the w3c and open oasis.
> Furthermore I generated th model code, the edit code and the editors.
> That was done more or less fast.
>
> Now I have a policy.xml that I open in the workspace with one of the
> generated editors (more than one cause of the different ecores), when
> a new eclipse enviroment was started. None of the editor can open the
> file of the ClassNotFoundException (no Nullpointer, sorry!).
Is your generated resource factory registered against this extension?
>
>> What do you mean by sometimes?
>
> I meant that I had configurations when I did work to show a
> policy.policy in the generated editor, the extension of the particular
> generated editor. I tried to change the file extension in the
> plugin.xml but it still accepted the '*.policy'.
I imagine that registering against *.xml might be in conflict with
others. Likely you should be using the content type support if you need
to handle such a general extension...
>
> The point of the exception is that a policy.class does not exist. The
> transfomation from the wspolicy.xsd to the ecore put the policy as a
> ereference into the documentRoot (like shown below).
> In java classes that means I have a 'DocumentRoot.java' containing the
> methods PolicyType getPolicy(); and void setPolicy(PolicyType value);
Check carefully which type of resource is being createed.
>
> Best Regards,
> Tom
>
>
> ecore excerpt
> -------
> <eStructuralFeatures xsi:type="ecore:EReference" name="policy"
> upperBound="-2"
> eType="#//PolicyType" volatile="true" transient="true"
> derived="true" containment="true"
> resolveProxies="false">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="Policy"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Form Editor for a WS-Policy ecore model [message #640469 is a reply to message #639987] Mon, 22 November 2010 08:55 Go to previous messageGo to next message
Tom Sattler is currently offline Tom SattlerFriend
Messages: 3
Registered: November 2010
Junior Member
Hi,

I register the created ItemProviderAdapterFactories like done in the generated editors. But when I like to create a resource, there is no content.
The DocumentRootImpl is used in the generated editors to provide the 'Policy' element and apears in the content of the resource.
In my own built editor it still give the error which I already mentioned.
Where is the content set exactly?

Do I need to register the ResourceFactory more often than only in the initializeEditingDomain() ? You said against the extension.

Thanks for your advices.
Regards

Tom
Re: EMF Form Editor for a WS-Policy ecore model [message #640590 is a reply to message #640469] Mon, 22 November 2010 14:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Tom,

Comments below.

Tom Sattler wrote:
> Hi,
>
> I register the created ItemProviderAdapterFactories like done in the
> generated editors. But when I like to create a resource, there is no
> content. The DocumentRootImpl is used in the generated editors to
> provide the 'Policy' element and apears in the content of the resource.
> In my own built editor it still give the error which I already mentioned.
So in each case, you've set a breakpoint in your resource factory to see
that it's really being used to create the resource?
> Where is the content set exactly?
>
> Do I need to register the ResourceFactory more often than only in the
> initializeEditingDomain() ?
Typically, for an Eclipse application, you'd register it in the plugin.xml.
> You said against the extension.
Yes, doing that locally should do the trick to avoid conflicts. Using
the debugger to very it's being used is a good idea.
>
> Thanks for your advices.
> Regards
>
> Tom


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Error in links between components of the same ESuper type
Next Topic:Modeling custom properties
Goto Forum:
  


Current Time: Thu Apr 25 12:53:29 GMT 2024

Powered by FUDForum. Page generated in 0.03795 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top