Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Is this possible with EMFCompare?(EMF Compare)
Is this possible with EMFCompare? [message #501524] Wed, 02 December 2009 16:25 Go to next message
Randi  is currently offline Randi Friend
Messages: 31
Registered: November 2009
Member
Hello All,

I want to compare 2 xmi files and make a delta(attributes added/deleted etc) of it.

Is it possible to use EMF Compare for this in standalone?

I checked the code from the CVS , but I only manage to get the match Model from it when I load 2 UML models? But I didn't manage to load only the 2 xmi's in it . I always get an exception.

What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need to give up also the UML's or is it enough to give only the xmi's ?

Also in the standalone version there is some comment:
// Register additionnal packages here. For UML2 for instance :

But how can I do this for loading xmi , what is the code for this?

Also can I serialize the Diffmodel for example with eg JAXB ?Or how can I do this . I want to make Java object eg DiffModel from this delta?

Many thanks

Randi
Re: Is this possible with EMFCompare? [message #501530 is a reply to message #501524] Wed, 02 December 2009 16:38 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030609010308030706030502
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Randi,

comments inlined.

Randi wrote:
> Hello All,
>
> I want to compare 2 xmi files and make a delta(attributes added/deleted
> etc) of it.
>
> Is it possible to use EMF Compare for this in standalone?

EMF Compare is tested to be usable in standalone mode. Check out the
org.eclipse.emf.compare.example.standalone project from the CVS for an
example of how to do it.

>
> I checked the code from the CVS , but I only manage to get the match
> Model from it when I load 2 UML models? But I didn't manage to load only
> the 2 xmi's in it . I always get an exception.

Without the exception and its trace, can't say much. Though loading UML
models with xmi extension is somewhat of a bad idea; EMF detects the
file contains UML and does the necessary arrangements according to the
file extension. Not sure if this applies to standalone loading though.

>
> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need to
> give up also the UML's or is it enough to give only the xmi's ?

I do not understand this. What is your xmi file if it is not your UML model?

>
> Also in the standalone version there is some comment:
> // Register additionnal packages here. For UML2 for instance :
>
> But how can I do this for loading xmi , what is the code for this?

see
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
replacing the UML extension by "xmi"; not sure if this will work as
expected.

>
> Also can I serialize the Diffmodel for example with eg JAXB ?Or how can
> I do this . I want to make Java object eg DiffModel from this delta?

look at the standalone example. How you serialize the model is you call;
be it through the standard EMF "Resource#save()" or some other mean.

>
> Many thanks
> Randi

Laurent Goubet
Obeo

--------------030609010308030706030502
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030609010308030706030502--
Re: Is this possible with EMFCompare? [message #501535 is a reply to message #501530] Wed, 02 December 2009 16:59 Go to previous messageGo to next message
Randi  is currently offline Randi Friend
Messages: 31
Registered: November 2009
Member
Hello Laurent ,

Thanks already for the answers.

Comments between the lines ==><==

Hi Randi,

comments inlined.

Randi wrote:
> Hello All,
>
> I want to compare 2 xmi files and make a delta(attributes added/deleted
> etc) of it.
>
> Is it possible to use EMF Compare for this in standalone?

EMF Compare is tested to be usable in standalone mode. Check out the
org.eclipse.emf.compare.example.standalone project from the CVS for an
example of how to do it.
==> I used the code from CVS in standalone version.But this was only to load models with the extensions*.uml. What I want to do is to load only 2 models with the extension*.xmi which I made with another Case Tool eg BOUML after exporting the UML model as an xmi.But I didn't succeed to load these xmi's.The code I used to load these xmi's is
//Code Start

// Create a resource set.
ResourceSet resourceSet = new ResourceSetImpl();
// Register the default resource factory -- only needed for stand-alone!
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
// Get the URI of the model file.
URI fileURI = URI.createFileURI(new File("T1.xmi")
.getAbsolutePath());
// Demand load the resource for this file.
Resource resource = resourceSet.getResource(fileURI, true);
// Print the contents of the resource to System.out.
try {
resource.save(System.out, Collections.EMPTY_MAP);
} catch (IOException e) {
}

//Code End
<==
>
> I checked the code from the CVS , but I only manage to get the match
> Model from it when I load 2 UML models? But I didn't manage to load only
> the 2 xmi's in it . I always get an exception.

Without the exception and its trace, can't say much. Though loading UML
models with xmi extension is somewhat of a bad idea; EMF detects the
file contains UML and does the necessary arrangements according to the
file extension. Not sure if this applies to standalone loading though.
==> No I used only the xmi which I exported via another tool. So I made the model with a Case Tool ,after that I export it in xmi.

The exception I get is :

emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at LoadXMI.main(LoadXMI.java:25)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1307)
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:87)
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.XMLDocumentFragmentS cannerImpl.scanStartElement(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.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)
... 2 more
<==
>
> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need to
> give up also the UML's or is it enough to give only the xmi's ?

I do not understand this. What is your xmi file if it is not your UML model?

>
> Also in the standalone version there is some comment:
> // Register additionnal packages here. For UML2 for instance :
>
> But how can I do this for loading xmi , what is the code for this?

see
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
replacing the UML extension by "xmi"; not sure if this will work as
expected.

>
> Also can I serialize the Diffmodel for example with eg JAXB ?Or how can
> I do this . I want to make Java object eg DiffModel from this delta?

look at the standalone example. How you serialize the model is you call;
be it through the standard EMF "Resource#save()" or some other mean.

>
> Many thanks
> Randi

Laurent Goubet
Obeo
Re: Is this possible with EMFCompare? [message #501646 is a reply to message #501535] Thu, 03 December 2009 09:05 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060202000202080703070701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Randi,

Comments inlined.

Laurent Goubet
Obeo

Randi wrote:
> Hello Laurent ,
>
> Thanks already for the answers.
>
> Comments between the lines ==><==
>
> Hi Randi,
>
> comments inlined.
>
> Randi wrote:
>> Hello All,
>>
>> I want to compare 2 xmi files and make a delta(attributes
>> added/deleted etc) of it.
>>
>> Is it possible to use EMF Compare for this in standalone?
>
> EMF Compare is tested to be usable in standalone mode. Check out the
> org.eclipse.emf.compare.example.standalone project from the CVS for an
> example of how to do it.
> ==> I used the code from CVS in standalone version.But this was only to
> load models with the extensions*.uml. What I want to do is to load only
> 2 models with the extension*.xmi which I made with another Case Tool eg
> BOUML after exporting the UML model as an xmi.But I didn't succeed to

most external tools have an export to "EMF" instead of "xmi". Then
again, most external tool's export fail in one way or another : bad xml,
missing references, illegal IDs ... Can you open your exported model
with the "UML editor" within eclipse ("open with => UML editor" right
click menu)? If yes, can you validate it (right click on the root =>
"validate"? If either of these is "no" then your external modeler fails
at exporting the model properly.

Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
model is UML, and allows it to set up all the necessary actions for
loading UML models.

> load these xmi's.The code I used to load these xmi's is //Code Start
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
> // Register the default resource factory -- only needed for
> stand-alone!
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto
> ryMap()
> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
> new XMIResourceFactoryImpl());
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("T1.xmi")
> .getAbsolutePath());
> // Demand load the resource for this file.
> Resource resource = resourceSet.getResource(fileURI, true);
> // Print the contents of the resource to System.out.
> try {
> resource.save(System.out, Collections.EMPTY_MAP);
> } catch (IOException e) {
> }
>
> //Code End
> <==

Please follow the instructions from
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
.. This wiki entry describes the _mandatory_ steps for loading UML in a
standalone application, and your code is nowhere near it.

>>
>> I checked the code from the CVS , but I only manage to get the match
>> Model from it when I load 2 UML models? But I didn't manage to load
>> only the 2 xmi's in it . I always get an exception.
>
> Without the exception and its trace, can't say much. Though loading UML
> models with xmi extension is somewhat of a bad idea; EMF detects the
> file contains UML and does the necessary arrangements according to the
> file extension. Not sure if this applies to standalone loading though.
> ==> No I used only the xmi which I exported via another tool. So I made
> the model with a Case Tool ,after that I export it in xmi.
>
> The exception I get is :
>
> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
> mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
> at LoadXMI.main(LoadXMI.java:25)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi,
> 3, 15)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1307)
> 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:87)
> 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.XMLDocumentFragmentS
> cannerImpl.scanStartElement(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.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)
> ... 2 more
> <==
>>
>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>> to give up also the UML's or is it enough to give only the xmi's ?
>
> I do not understand this. What is your xmi file if it is not your UML
> model?
>
>>
>> Also in the standalone version there is some comment:
>> // Register additionnal packages here. For UML2 for instance :
>>
>> But how can I do this for loading xmi , what is the code for this?
>
> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F replacing
> the UML extension by "xmi"; not sure if this will work as expected.
>
>>
>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>> can I do this . I want to make Java object eg DiffModel from this delta?
>
> look at the standalone example. How you serialize the model is you call;
> be it through the standard EMF "Resource#save()" or some other mean.
>
>>
>> Many thanks
>> Randi
>
> Laurent Goubet
> Obeo
>


--------------060202000202080703070701
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------060202000202080703070701--
Re: Is this possible with EMFCompare? [message #501658 is a reply to message #501646] Thu, 03 December 2009 09:58 Go to previous messageGo to next message
Randi  is currently offline Randi Friend
Messages: 31
Registered: November 2009
Member
This is a multi-part message in MIME format.
--------------060202000202080703070701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


Hello Laurent,

Thanks for the answers. I will put alos some comments inline --><--
Hi Randi,

Comments inlined.

Laurent Goubet
Obeo

Randi wrote:
> Hello Laurent ,
>
> Thanks already for the answers.
>
> Comments between the lines ==><==
>
> Hi Randi,
>
> comments inlined.
>
> Randi wrote:
>> Hello All,
>>
>> I want to compare 2 xmi files and make a delta(attributes
>> added/deleted etc) of it.
>>
>> Is it possible to use EMF Compare for this in standalone?
>
> EMF Compare is tested to be usable in standalone mode. Check out the
> org.eclipse.emf.compare.example.standalone project from the CVS for an
> example of how to do it.
> ==> I used the code from CVS in standalone version.But this was only to
> load models with the extensions*.uml. What I want to do is to load only
> 2 models with the extension*.xmi which I made with another Case Tool eg
> BOUML after exporting the UML model as an xmi.But I didn't succeed to

most external tools have an export to "EMF" instead of "xmi". Then
again, most external tool's export fail in one way or another : bad xml,
missing references, illegal IDs ... Can you open your exported model
with the "UML editor" within eclipse ("open with => UML editor" right
click menu)? If yes, can you validate it (right click on the root =>
"validate"? If either of these is "no" then your external modeler fails
at exporting the model properly.

Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
model is UML, and allows it to set up all the necessary actions for
loading UML models.

-->I renamed the eported xmi to uml, I can open them with UML Editor and the validation brings no errors. So this should be OK<--
> load these xmi's.The code I used to load these xmi's is //Code Start
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
> // Register the default resource factory -- only needed for
> stand-alone!
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto
> ryMap()
> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
> new XMIResourceFactoryImpl());
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("T1.xmi")
> .getAbsolutePath());
> // Demand load the resource for this file.
> Resource resource = resourceSet.getResource(fileURI, true);
> // Print the contents of the resource to System.out.
> try {
> resource.save(System.out, Collections.EMPTY_MAP);
> } catch (IOException e) {
> }
>
> //Code End
> <==

Please follow the instructions from
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
.. This wiki entry describes the _mandatory_ steps for loading UML in a
standalone application, and your code is nowhere near it.

-->Maybe here is some misunderstanding. I want to load xmi's which are the result of an export from a uml model. I don't want to load the uml models themselve(I don't want to load *.uml but I want the load only the *.xmi)I can only reach those xmi's, because I have to pick up those from CVS, in the CVS there are no *.uml available
.So is is possible only to load those xmi's and then compare them or is this not possible?<--

>>
>> I checked the code from the CVS , but I only manage to get the match
>> Model from it when I load 2 UML models? But I didn't manage to load
>> only the 2 xmi's in it . I always get an exception.
>
> Without the exception and its trace, can't say much. Though loading UML
> models with xmi extension is somewhat of a bad idea; EMF detects the
> file contains UML and does the necessary arrangements according to the
> file extension. Not sure if this applies to standalone loading though.
> ==> No I used only the xmi which I exported via another tool. So I made
> the model with a Case Tool ,after that I export it in xmi.
>
> The exception I get is :
>
> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
> mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
> at LoadXMI.main(LoadXMI.java:25)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi,
> 3, 15)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1307)
> 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:87)
> 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.XMLDocumentFragmentS
> cannerImpl.scanStartElement(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.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)
> ... 2 more
> <==
>>
>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>> to give up also the UML's or is it enough to give only the xmi's ?
>
> I do not understand this. What is your xmi file if it is not your UML
> model?
>
>>
>> Also in the standalone version there is some comment:
>> // Register additionnal packages here. For UML2 for instance :
>>
>> But how can I do this for loading xmi , what is the code for this?
>
> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F replacing
> the UML extension by "xmi"; not sure if this will work as expected.
>
>>
>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>> can I do this . I want to make Java object eg DiffModel from this delta?
>
> look at the standalone example. How you serialize the model is you call;
> be it through the standard EMF "Resource#save()" or some other mean.
>
>>
>> Many thanks
>> Randi
>
> Laurent Goubet
> Obeo
>
Re: Is this possible with EMFCompare? [message #501666 is a reply to message #501658] Thu, 03 December 2009 11:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030808040906000402040703
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Randi,

Extension doesn't matter. what your "*.xmi" file contains is UML, that
is why renaming it to "*.uml" allows its loading from Eclipse as
expexted. That is also the reason why you must follow the instructions
of the UML2 wiki to load your file.

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());

registers the XMIResourceFactory for all extensions, including your
"*.xmi" extension; and that is the contrary of what must be done. Your
line should look like

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xmi",
UMLResource.Factory.INSTANCE);

So as to register the xmi extension with the UMLResourceFactory for your
resource set. And that will not be enough for standalone loading of your
files; the remaining steps oultined in
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
must be done as well : registering the libraries, metamodels and
profiles pathmaps, registering the UMLPackage instance in the registry...

As first mentionned, EMF Compare can compare any model loadable through
EMF. Yet without those steps, you will not be able to load your models,
let alone compare them.

Laurent Goubet
Obeo

Randi wrote:
> This is a multi-part message in MIME format.
> --------------060202000202080703070701
> Content-Type: text/plain; charset=UTF-8; format=flowed
> Content-Transfer-Encoding: 7bit
>
>
> Hello Laurent,
>
> Thanks for the answers. I will put alos some comments inline --><--
> Hi Randi,
>
> Comments inlined.
>
> Laurent Goubet
> Obeo
>
> Randi wrote:
>> Hello Laurent ,
>>
>> Thanks already for the answers.
>>
>> Comments between the lines ==><==
>>
>> Hi Randi,
>>
>> comments inlined.
>>
>> Randi wrote:
>>> Hello All,
>>>
>>> I want to compare 2 xmi files and make a delta(attributes
>>> added/deleted etc) of it.
>>>
>>> Is it possible to use EMF Compare for this in standalone?
>>
>> EMF Compare is tested to be usable in standalone mode. Check out the
>> org.eclipse.emf.compare.example.standalone project from the CVS for an
>> example of how to do it.
>> ==> I used the code from CVS in standalone version.But this was only
>> to load models with the extensions*.uml. What I want to do is to load
>> only 2 models with the extension*.xmi which I made with another Case
>> Tool eg BOUML after exporting the UML model as an xmi.But I didn't
>> succeed to
>
> most external tools have an export to "EMF" instead of "xmi". Then
> again, most external tool's export fail in one way or another : bad xml,
> missing references, illegal IDs ... Can you open your exported model
> with the "UML editor" within eclipse ("open with => UML editor" right
> click menu)? If yes, can you validate it (right click on the root =>
> "validate"? If either of these is "no" then your external modeler fails
> at exporting the model properly.
>
> Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
> model is UML, and allows it to set up all the necessary actions for
> loading UML models.
>
> -->I renamed the eported xmi to uml, I can open them with UML Editor and
> the validation brings no errors. So this should be OK<--
>> load these xmi's.The code I used to load these xmi's is //Code Start
>>
>> // Create a resource set.
>> ResourceSet resourceSet = new ResourceSetImpl();
>> // Register the default resource factory -- only needed for stand-alone!
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
>> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
>> new XMIResourceFactoryImpl());
>> // Get the URI of the model file.
>> URI fileURI = URI.createFileURI(new File("T1.xmi")
>> .getAbsolutePath());
>> // Demand load the resource for this file.
>> Resource resource = resourceSet.getResource(fileURI, true);
>> // Print the contents of the resource to System.out.
>> try {
>> resource.save(System.out, Collections.EMPTY_MAP);
>> } catch (IOException e) {
>> }
>>
>> //Code End
>> <==
>
> Please follow the instructions from
> http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F . This
> wiki entry describes the _mandatory_ steps for loading UML in a
> standalone application, and your code is nowhere near it.
>
> -->Maybe here is some misunderstanding. I want to load xmi's which are
> the result of an export from a uml model. I don't want to load the uml
> models themselve(I don't want to load *.uml but I want the load only the
> *.xmi)I can only reach those xmi's, because I have to pick up those from
> CVS, in the CVS there are no *.uml available
> So is is possible only to load those xmi's and then compare them or is
> this not possible?<--
>
>>>
>>> I checked the code from the CVS , but I only manage to get the match
>>> Model from it when I load 2 UML models? But I didn't manage to load
>>> only the 2 xmi's in it . I always get an exception.
>>
>> Without the exception and its trace, can't say much. Though loading
>> UML models with xmi extension is somewhat of a bad idea; EMF detects
>> the file contains UML and does the necessary arrangements according to
>> the file extension. Not sure if this applies to standalone loading
>> though.
>> ==> No I used only the xmi which I exported via another tool. So I
>> made the model with a Case Tool ,after that I export it in xmi.
>>
>> The exception I get is :
>>
>> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
>> mandLoadException(ResourceSetImpl.java:315)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
>> adHelper(ResourceSetImpl.java:274)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
>> rce(ResourceSetImpl.java:397)
>> at LoadXMI.main(LoadXMI.java:25)
>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>> with uri 'null' not found.
>> (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
>> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
>> (XMLHandler.java:1307)
>> 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:87)
>> 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.XMLDocumentFragmentS
>> cannerImpl.scanStartElement(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.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)
>> ... 2 more
>> <==
>>>
>>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>>> to give up also the UML's or is it enough to give only the xmi's ?
>>
>> I do not understand this. What is your xmi file if it is not your UML
>> model?
>>
>>>
>>> Also in the standalone version there is some comment:
>>> // Register additionnal packages here. For UML2 for instance :
>>>
>>> But how can I do this for loading xmi , what is the code for this?
>>
>> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
>> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
>> replacing the UML extension by "xmi"; not sure if this will work as
>> expected.
>>
>>>
>>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>>> can I do this . I want to make Java object eg DiffModel from this delta?
>>
>> look at the standalone example. How you serialize the model is you
>> call; be it through the standard EMF "Resource#save()" or some other
>> mean.
>>
>>>
>>> Many thanks
>>> Randi
>>
>> Laurent Goubet
>> Obeo
>>


--------------030808040906000402040703
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030808040906000402040703--
Re: Is this possible with EMFCompare? [message #621879 is a reply to message #501530] Wed, 02 December 2009 16:59 Go to previous message
Randi  is currently offline Randi Friend
Messages: 31
Registered: November 2009
Member
Hello Laurent ,

Thanks already for the answers.

Comments between the lines ==><==

Hi Randi,

comments inlined.

Randi wrote:
> Hello All,
>
> I want to compare 2 xmi files and make a delta(attributes added/deleted
> etc) of it.
>
> Is it possible to use EMF Compare for this in standalone?

EMF Compare is tested to be usable in standalone mode. Check out the
org.eclipse.emf.compare.example.standalone project from the CVS for an
example of how to do it.
==> I used the code from CVS in standalone version.But this was only to load models with the extensions*.uml. What I want to do is to load only 2 models with the extension*.xmi which I made with another Case Tool eg BOUML after exporting the UML model as an xmi.But I didn't succeed to load these xmi's.The code I used to load these xmi's is
//Code Start

// Create a resource set.
ResourceSet resourceSet = new ResourceSetImpl();
// Register the default resource factory -- only needed for stand-alone!
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
// Get the URI of the model file.
URI fileURI = URI.createFileURI(new File("T1.xmi")
.getAbsolutePath());
// Demand load the resource for this file.
Resource resource = resourceSet.getResource(fileURI, true);
// Print the contents of the resource to System.out.
try {
resource.save(System.out, Collections.EMPTY_MAP);
} catch (IOException e) {
}

//Code End
<==
>
> I checked the code from the CVS , but I only manage to get the match
> Model from it when I load 2 UML models? But I didn't manage to load only
> the 2 xmi's in it . I always get an exception.

Without the exception and its trace, can't say much. Though loading UML
models with xmi extension is somewhat of a bad idea; EMF detects the
file contains UML and does the necessary arrangements according to the
file extension. Not sure if this applies to standalone loading though.
==> No I used only the xmi which I exported via another tool. So I made the model with a Case Tool ,after that I export it in xmi.

The exception I get is :

emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at LoadXMI.main(LoadXMI.java:25)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1307)
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:87)
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.XMLDocumentFragmentS cannerImpl.scanStartElement(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.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)
... 2 more
<==
>
> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need to
> give up also the UML's or is it enough to give only the xmi's ?

I do not understand this. What is your xmi file if it is not your UML model?

>
> Also in the standalone version there is some comment:
> // Register additionnal packages here. For UML2 for instance :
>
> But how can I do this for loading xmi , what is the code for this?

see
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
replacing the UML extension by "xmi"; not sure if this will work as
expected.

>
> Also can I serialize the Diffmodel for example with eg JAXB ?Or how can
> I do this . I want to make Java object eg DiffModel from this delta?

look at the standalone example. How you serialize the model is you call;
be it through the standard EMF "Resource#save()" or some other mean.

>
> Many thanks
> Randi

Laurent Goubet
Obeo
Re: Is this possible with EMFCompare? [message #621887 is a reply to message #621879] Thu, 03 December 2009 09:05 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060202000202080703070701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Randi,

Comments inlined.

Laurent Goubet
Obeo

Randi wrote:
> Hello Laurent ,
>
> Thanks already for the answers.
>
> Comments between the lines ==><==
>
> Hi Randi,
>
> comments inlined.
>
> Randi wrote:
>> Hello All,
>>
>> I want to compare 2 xmi files and make a delta(attributes
>> added/deleted etc) of it.
>>
>> Is it possible to use EMF Compare for this in standalone?
>
> EMF Compare is tested to be usable in standalone mode. Check out the
> org.eclipse.emf.compare.example.standalone project from the CVS for an
> example of how to do it.
> ==> I used the code from CVS in standalone version.But this was only to
> load models with the extensions*.uml. What I want to do is to load only
> 2 models with the extension*.xmi which I made with another Case Tool eg
> BOUML after exporting the UML model as an xmi.But I didn't succeed to

most external tools have an export to "EMF" instead of "xmi". Then
again, most external tool's export fail in one way or another : bad xml,
missing references, illegal IDs ... Can you open your exported model
with the "UML editor" within eclipse ("open with => UML editor" right
click menu)? If yes, can you validate it (right click on the root =>
"validate"? If either of these is "no" then your external modeler fails
at exporting the model properly.

Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
model is UML, and allows it to set up all the necessary actions for
loading UML models.

> load these xmi's.The code I used to load these xmi's is //Code Start
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
> // Register the default resource factory -- only needed for
> stand-alone!
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto
> ryMap()
> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
> new XMIResourceFactoryImpl());
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("T1.xmi")
> .getAbsolutePath());
> // Demand load the resource for this file.
> Resource resource = resourceSet.getResource(fileURI, true);
> // Print the contents of the resource to System.out.
> try {
> resource.save(System.out, Collections.EMPTY_MAP);
> } catch (IOException e) {
> }
>
> //Code End
> <==

Please follow the instructions from
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
.. This wiki entry describes the _mandatory_ steps for loading UML in a
standalone application, and your code is nowhere near it.

>>
>> I checked the code from the CVS , but I only manage to get the match
>> Model from it when I load 2 UML models? But I didn't manage to load
>> only the 2 xmi's in it . I always get an exception.
>
> Without the exception and its trace, can't say much. Though loading UML
> models with xmi extension is somewhat of a bad idea; EMF detects the
> file contains UML and does the necessary arrangements according to the
> file extension. Not sure if this applies to standalone loading though.
> ==> No I used only the xmi which I exported via another tool. So I made
> the model with a Case Tool ,after that I export it in xmi.
>
> The exception I get is :
>
> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
> mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
> at LoadXMI.main(LoadXMI.java:25)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi,
> 3, 15)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1307)
> 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:87)
> 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.XMLDocumentFragmentS
> cannerImpl.scanStartElement(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.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)
> ... 2 more
> <==
>>
>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>> to give up also the UML's or is it enough to give only the xmi's ?
>
> I do not understand this. What is your xmi file if it is not your UML
> model?
>
>>
>> Also in the standalone version there is some comment:
>> // Register additionnal packages here. For UML2 for instance :
>>
>> But how can I do this for loading xmi , what is the code for this?
>
> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F replacing
> the UML extension by "xmi"; not sure if this will work as expected.
>
>>
>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>> can I do this . I want to make Java object eg DiffModel from this delta?
>
> look at the standalone example. How you serialize the model is you call;
> be it through the standard EMF "Resource#save()" or some other mean.
>
>>
>> Many thanks
>> Randi
>
> Laurent Goubet
> Obeo
>


--------------060202000202080703070701
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------060202000202080703070701--
Re: Is this possible with EMFCompare? [message #621889 is a reply to message #501646] Thu, 03 December 2009 09:58 Go to previous message
Randi  is currently offline Randi Friend
Messages: 31
Registered: November 2009
Member
This is a multi-part message in MIME format.
--------------060202000202080703070701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


Hello Laurent,

Thanks for the answers. I will put alos some comments inline --><--
Hi Randi,

Comments inlined.

Laurent Goubet
Obeo

Randi wrote:
> Hello Laurent ,
>
> Thanks already for the answers.
>
> Comments between the lines ==><==
>
> Hi Randi,
>
> comments inlined.
>
> Randi wrote:
>> Hello All,
>>
>> I want to compare 2 xmi files and make a delta(attributes
>> added/deleted etc) of it.
>>
>> Is it possible to use EMF Compare for this in standalone?
>
> EMF Compare is tested to be usable in standalone mode. Check out the
> org.eclipse.emf.compare.example.standalone project from the CVS for an
> example of how to do it.
> ==> I used the code from CVS in standalone version.But this was only to
> load models with the extensions*.uml. What I want to do is to load only
> 2 models with the extension*.xmi which I made with another Case Tool eg
> BOUML after exporting the UML model as an xmi.But I didn't succeed to

most external tools have an export to "EMF" instead of "xmi". Then
again, most external tool's export fail in one way or another : bad xml,
missing references, illegal IDs ... Can you open your exported model
with the "UML editor" within eclipse ("open with => UML editor" right
click menu)? If yes, can you validate it (right click on the root =>
"validate"? If either of these is "no" then your external modeler fails
at exporting the model properly.

Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
model is UML, and allows it to set up all the necessary actions for
loading UML models.

-->I renamed the eported xmi to uml, I can open them with UML Editor and the validation brings no errors. So this should be OK<--
> load these xmi's.The code I used to load these xmi's is //Code Start
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
> // Register the default resource factory -- only needed for
> stand-alone!
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto
> ryMap()
> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
> new XMIResourceFactoryImpl());
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("T1.xmi")
> .getAbsolutePath());
> // Demand load the resource for this file.
> Resource resource = resourceSet.getResource(fileURI, true);
> // Print the contents of the resource to System.out.
> try {
> resource.save(System.out, Collections.EMPTY_MAP);
> } catch (IOException e) {
> }
>
> //Code End
> <==

Please follow the instructions from
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
.. This wiki entry describes the _mandatory_ steps for loading UML in a
standalone application, and your code is nowhere near it.

-->Maybe here is some misunderstanding. I want to load xmi's which are the result of an export from a uml model. I don't want to load the uml models themselve(I don't want to load *.uml but I want the load only the *.xmi)I can only reach those xmi's, because I have to pick up those from CVS, in the CVS there are no *.uml available
So is is possible only to load those xmi's and then compare them or is this not possible?<--

>>
>> I checked the code from the CVS , but I only manage to get the match
>> Model from it when I load 2 UML models? But I didn't manage to load
>> only the 2 xmi's in it . I always get an exception.
>
> Without the exception and its trace, can't say much. Though loading UML
> models with xmi extension is somewhat of a bad idea; EMF detects the
> file contains UML and does the necessary arrangements according to the
> file extension. Not sure if this applies to standalone loading though.
> ==> No I used only the xmi which I exported via another tool. So I made
> the model with a Case Tool ,after that I export it in xmi.
>
> The exception I get is :
>
> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
> mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(ResourceSetImpl.java:397)
> at LoadXMI.main(LoadXMI.java:25)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi,
> 3, 15)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1307)
> 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:87)
> 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.XMLDocumentFragmentS
> cannerImpl.scanStartElement(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.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)
> ... 2 more
> <==
>>
>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>> to give up also the UML's or is it enough to give only the xmi's ?
>
> I do not understand this. What is your xmi file if it is not your UML
> model?
>
>>
>> Also in the standalone version there is some comment:
>> // Register additionnal packages here. For UML2 for instance :
>>
>> But how can I do this for loading xmi , what is the code for this?
>
> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F replacing
> the UML extension by "xmi"; not sure if this will work as expected.
>
>>
>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>> can I do this . I want to make Java object eg DiffModel from this delta?
>
> look at the standalone example. How you serialize the model is you call;
> be it through the standard EMF "Resource#save()" or some other mean.
>
>>
>> Many thanks
>> Randi
>
> Laurent Goubet
> Obeo
>
Re: Is this possible with EMFCompare? [message #621891 is a reply to message #621889] Thu, 03 December 2009 11:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030808040906000402040703
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Randi,

Extension doesn't matter. what your "*.xmi" file contains is UML, that
is why renaming it to "*.uml" allows its loading from Eclipse as
expexted. That is also the reason why you must follow the instructions
of the UML2 wiki to load your file.

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());

registers the XMIResourceFactory for all extensions, including your
"*.xmi" extension; and that is the contrary of what must be done. Your
line should look like

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xmi",
UMLResource.Factory.INSTANCE);

So as to register the xmi extension with the UMLResourceFactory for your
resource set. And that will not be enough for standalone loading of your
files; the remaining steps oultined in
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
must be done as well : registering the libraries, metamodels and
profiles pathmaps, registering the UMLPackage instance in the registry...

As first mentionned, EMF Compare can compare any model loadable through
EMF. Yet without those steps, you will not be able to load your models,
let alone compare them.

Laurent Goubet
Obeo

Randi wrote:
> This is a multi-part message in MIME format.
> --------------060202000202080703070701
> Content-Type: text/plain; charset=UTF-8; format=flowed
> Content-Transfer-Encoding: 7bit
>
>
> Hello Laurent,
>
> Thanks for the answers. I will put alos some comments inline --><--
> Hi Randi,
>
> Comments inlined.
>
> Laurent Goubet
> Obeo
>
> Randi wrote:
>> Hello Laurent ,
>>
>> Thanks already for the answers.
>>
>> Comments between the lines ==><==
>>
>> Hi Randi,
>>
>> comments inlined.
>>
>> Randi wrote:
>>> Hello All,
>>>
>>> I want to compare 2 xmi files and make a delta(attributes
>>> added/deleted etc) of it.
>>>
>>> Is it possible to use EMF Compare for this in standalone?
>>
>> EMF Compare is tested to be usable in standalone mode. Check out the
>> org.eclipse.emf.compare.example.standalone project from the CVS for an
>> example of how to do it.
>> ==> I used the code from CVS in standalone version.But this was only
>> to load models with the extensions*.uml. What I want to do is to load
>> only 2 models with the extension*.xmi which I made with another Case
>> Tool eg BOUML after exporting the UML model as an xmi.But I didn't
>> succeed to
>
> most external tools have an export to "EMF" instead of "xmi". Then
> again, most external tool's export fail in one way or another : bad xml,
> missing references, illegal IDs ... Can you open your exported model
> with the "UML editor" within eclipse ("open with => UML editor" right
> click menu)? If yes, can you validate it (right click on the root =>
> "validate"? If either of these is "no" then your external modeler fails
> at exporting the model properly.
>
> Rename your "*.xmi" model as "*.uml". This can help as it tells EMF your
> model is UML, and allows it to set up all the necessary actions for
> loading UML models.
>
> -->I renamed the eported xmi to uml, I can open them with UML Editor and
> the validation brings no errors. So this should be OK<--
>> load these xmi's.The code I used to load these xmi's is //Code Start
>>
>> // Create a resource set.
>> ResourceSet resourceSet = new ResourceSetImpl();
>> // Register the default resource factory -- only needed for stand-alone!
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
>> .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
>> new XMIResourceFactoryImpl());
>> // Get the URI of the model file.
>> URI fileURI = URI.createFileURI(new File("T1.xmi")
>> .getAbsolutePath());
>> // Demand load the resource for this file.
>> Resource resource = resourceSet.getResource(fileURI, true);
>> // Print the contents of the resource to System.out.
>> try {
>> resource.save(System.out, Collections.EMPTY_MAP);
>> } catch (IOException e) {
>> }
>>
>> //Code End
>> <==
>
> Please follow the instructions from
> http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F . This
> wiki entry describes the _mandatory_ steps for loading UML in a
> standalone application, and your code is nowhere near it.
>
> -->Maybe here is some misunderstanding. I want to load xmi's which are
> the result of an export from a uml model. I don't want to load the uml
> models themselve(I don't want to load *.uml but I want the load only the
> *.xmi)I can only reach those xmi's, because I have to pick up those from
> CVS, in the CVS there are no *.uml available
> So is is possible only to load those xmi's and then compare them or is
> this not possible?<--
>
>>>
>>> I checked the code from the CVS , but I only manage to get the match
>>> Model from it when I load 2 UML models? But I didn't manage to load
>>> only the 2 xmi's in it . I always get an exception.
>>
>> Without the exception and its trace, can't say much. Though loading
>> UML models with xmi extension is somewhat of a bad idea; EMF detects
>> the file contains UML and does the necessary arrangements according to
>> the file extension. Not sure if this applies to standalone loading
>> though.
>> ==> No I used only the xmi which I exported via another tool. So I
>> made the model with a Case Tool ,after that I export it in xmi.
>>
>> The exception I get is :
>>
>> emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedEx ception:
>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>> 'null' not found. (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe
>> mandLoadException(ResourceSetImpl.java:315)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
>> adHelper(ResourceSetImpl.java:274)
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
>> rce(ResourceSetImpl.java:397)
>> at LoadXMI.main(LoadXMI.java:25)
>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>> with uri 'null' not found.
>> (file:/E:/WorkspaceEclipse3.5/LoadXMI/T1.xmi, 3, 15)
>> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
>> (XMLHandler.java:1307)
>> 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:87)
>> 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.XMLDocumentFragmentS
>> cannerImpl.scanStartElement(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.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)
>> ... 2 more
>> <==
>>>
>>> What is exactly needed to compare 2 xmi's via EMF Compare ? Do I need
>>> to give up also the UML's or is it enough to give only the xmi's ?
>>
>> I do not understand this. What is your xmi file if it is not your UML
>> model?
>>
>>>
>>> Also in the standalone version there is some comment:
>>> // Register additionnal packages here. For UML2 for instance :
>>>
>>> But how can I do this for loading xmi , what is the code for this?
>>
>> see http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo
>> ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
>> replacing the UML extension by "xmi"; not sure if this will work as
>> expected.
>>
>>>
>>> Also can I serialize the Diffmodel for example with eg JAXB ?Or how
>>> can I do this . I want to make Java object eg DiffModel from this delta?
>>
>> look at the standalone example. How you serialize the model is you
>> call; be it through the standard EMF "Resource#save()" or some other
>> mean.
>>
>>>
>>> Many thanks
>>> Randi
>>
>> Laurent Goubet
>> Obeo
>>


--------------030808040906000402040703
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030808040906000402040703--
Previous Topic:Git integration with EMF Compare
Next Topic:[teneo] Issues adding additional indexes to my entity using @Index
Goto Forum:
  


Current Time: Thu Apr 25 00:19:13 GMT 2024

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

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

Back to the top