Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Load Ressource
Load Ressource [message #425753] Sun, 07 December 2008 21:50 Go to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040108050205050301090808
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello,
i have build a default.uma file with some elements in it. It is
generated like this :

<?xml version="1.0" encoding="UTF-8"?>
<uma:MethodLibrary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:uma="http://www.eclipse.org/epf/uma/1.0.5"
name="EPFPracLib_20080306" briefDescription=""
id="_TJVNUOvFEdyp6czxLiQq9g" orderingGuide="" presentationName=""
suppressed="false" authors="" changeDescription="" version=""
tool="epf=1.5.0">
<MethodPlugin name="Test">
</MethodPlugin>
</uma:MethodLibrary>

Now i want to load this file programmatically on this way:

URI fileURI = URI.createFileURI((String) actLayer.getPath());
Resource resource = new XMIResourceImpl(fileURI);
try {
resource.load(null);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
If i do this, the feature MethodPlugin ist not found, but if i rewrite
the feature with a lower letter methodPlugin he founds the feature. But
then the editor says he cant open the file because he can not found the
feature methodPlugin.

I think it depends on the eAnnotations in the ecore file. Is there
another way to load the resource, without rewriting the letters?

Thanks in advance
J
Re: Load Ressource [message #425755 is a reply to message #425753] Sun, 07 December 2008 23:38 Go to previous messageGo to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
I forgot to use the option.

HashMap options = new HashMap();
options.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
resource.load(options);

This is the way, how it works.

Jörg schrieb:
> Hello,
> i have build a default.uma file with some elements in it. It is
> generated like this :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uma:MethodLibrary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:uma="http://www.eclipse.org/epf/uma/1.0.5"
> name="EPFPracLib_20080306" briefDescription=""
> id="_TJVNUOvFEdyp6czxLiQq9g" orderingGuide="" presentationName=""
> suppressed="false" authors="" changeDescription="" version=""
> tool="epf=1.5.0">
> <MethodPlugin name="Test">
> </MethodPlugin>
> </uma:MethodLibrary>
>
> Now i want to load this file programmatically on this way:
>
> URI fileURI = URI.createFileURI((String) actLayer.getPath());
> Resource resource = new XMIResourceImpl(fileURI);
> try {
> resource.load(null);
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> If i do this, the feature MethodPlugin ist not found, but if i rewrite
> the feature with a lower letter methodPlugin he founds the feature. But
> then the editor says he cant open the file because he can not found the
> feature methodPlugin.
>
> I think it depends on the eAnnotations in the ecore file. Is there
> another way to load the resource, without rewriting the letters?
>
> Thanks in advance
> Jörg
>
Re: Load Ressource [message #425757 is a reply to message #425755] Sun, 07 December 2008 23:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Jörg,

Be sure to invoke "Generate Test Code" and look closely at the generated
XyzExample.java. In general you should be loading that example shows you...


Jörg wrote:
> I forgot to use the option.
>
> HashMap options = new HashMap();
> options.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
> resource.load(options);
>
> This is the way, how it works.
>
> Jörg schrieb:
>> Hello,
>> i have build a default.uma file with some elements in it. It is
>> generated like this :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uma:MethodLibrary
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:uma="http://www.eclipse.org/epf/uma/1.0.5"
>> name="EPFPracLib_20080306" briefDescription=""
>> id="_TJVNUOvFEdyp6czxLiQq9g" orderingGuide="" presentationName=""
>> suppressed="false" authors="" changeDescription="" version=""
>> tool="epf=1.5.0">
>> <MethodPlugin name="Test">
>> </MethodPlugin>
>> </uma:MethodLibrary>
>>
>> Now i want to load this file programmatically on this way:
>>
>> URI fileURI = URI.createFileURI((String)
>> actLayer.getPath());
>> Resource resource = new XMIResourceImpl(fileURI);
>> try {
>> resource.load(null);
>> } catch (IOException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>> If i do this, the feature MethodPlugin ist not found, but if i
>> rewrite the feature with a lower letter methodPlugin he founds the
>> feature. But then the editor says he cant open the file because he
>> can not found the feature methodPlugin.
>>
>> I think it depends on the eAnnotations in the ecore file. Is there
>> another way to load the resource, without rewriting the letters?
>>
>> Thanks in advance
>> Jörg
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:"run as eclipse application" starts always old plugin
Next Topic:Re: Value holding in CDO model
Goto Forum:
  


Current Time: Wed Apr 24 17:23:35 GMT 2024

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

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

Back to the top