Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » eTrice » importURI semantics
importURI semantics [message #786452] Mon, 30 January 2012 12:56 Go to next message
Klaus Birken is currently offline Klaus BirkenFriend
Messages: 25
Registered: December 2009
Junior Member
Hi eTrice-team,

I am using the importURI feature of eTrice, e.g.,

	import room.basic.types.java.* from "../../org.eclipse.etrice.modellib/models/JavaTypes.room"


However, the org.eclipse.etrice.modellib is part of my Eclipse workspace, but the importing project is somewhere outside the workspace (and just imported).

Unfortunately, eTrice cannot resolve the JavaTypes.room reference - is there the possibility to use a different kind of URI (e.g. platform-URI) to resolve cases like mine?

Thanks in advance, regards,
Klaus

Re: importURI semantics [message #786523 is a reply to message #786452] Mon, 30 January 2012 14:26 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Klaus,

relative paths should work. Please double check!

If you you are forced to use absolute paths (e.g. because of different drive letters on a windows machine) you can use the
following form:
import room.basic.types.java from "file:/C:/path/to/modellib/org.eclipse.etrice.modellib/models/JavaTypes.room"

HTH,
Henrik


Am 30.01.2012 13:56, schrieb Klaus Birken:
> Hi eTrice-team,
>
> I am using the importURI feature of eTrice, e.g.,
>
>
> import room.basic.types.java.* from "../../org.eclipse.etrice.modellib/models/JavaTypes.room"
>
>
> However, the org.eclipse.etrice.modellib is part of my Eclipse workspace, but the importing project is somewhere outside the
> workspace (and just imported).
> Unfortunately, eTrice cannot resolve the JavaTypes.room reference - is there the possibility to use a different kind of URI (e.g.
> platform-URI) to resolve cases like mine?
>
> Thanks in advance, regards,
> Klaus
>
>
Re: importURI semantics [message #786569 is a reply to message #786523] Mon, 30 January 2012 15:43 Go to previous messageGo to next message
Klaus Birken is currently offline Klaus BirkenFriend
Messages: 25
Registered: December 2009
Junior Member
Hello Henrik,

thanks for your quick reply. Relative paths work indeed, however, might not be portable to another Eclipse installation because the location of the referencing project and the workspace with the modellib will not be in the same directory structure on all machines.

But I experimented a bit and found that the following also works:

import room.basic.types.java.* from "platform:/resource/org.eclipse.etrice.modellib/models/JavaTypes.room"


This works even if the referencing project physically is stored outside the Eclipse workspace directry. Two interesting questions remain:
- Is this supposed to work? Smile
- What happens with platform-URIs when running standalone (I do not have a proper example environment yet so I cannot test this...)?

Regards,
Klaus
Re: importURI semantics [message #787397 is a reply to message #786569] Tue, 31 January 2012 14:36 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Klaus,

Am 30.01.2012 16:43, schrieb Klaus Birken:
> But I experimented a bit and found that the following also works:
> import room.basic.types.java.* from "platform:/resource/org.eclipse.etrice.modellib/models/JavaTypes.room"
>
> This works even if the referencing project physically is stored outside the Eclipse workspace directry. Two interesting questions
> remain:
> - Is this supposed to work? :)
I've never tried. But since Xtext tries to create an EMF URI it's no complete surprise
> - What happens with platform-URIs when running standalone (I do not have a proper example environment yet so I cannot test this...)?
The eTrice generator (which is a plain Java application) is not able to deal with the platform: scheme. In this context there is
no Eclipse Platform available that could help to resolve this...
>
> Regards,
> Klaus
>
Re: importURI semantics [message #787406 is a reply to message #787397] Tue, 31 January 2012 14:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
In stand-alone mode, you should be able to populate
EcorePlugin.getPlatformResourceMap with mappings for the locations of
all projects. There's even EcorePlugin.handlePlatformResourceOptions
for command line option processing...


On 31/01/2012 3:36 PM, Henrik Rentz-Reichert wrote:
> Hi Klaus,
>
> Am 30.01.2012 16:43, schrieb Klaus Birken:
>> But I experimented a bit and found that the following also works:
>> import room.basic.types.java.* from "platform:/resource/org.eclipse.etrice.modellib/models/JavaTypes.room"
>>
>> This works even if the referencing project physically is stored outside the Eclipse workspace directry. Two interesting questions
>> remain:
>> - Is this supposed to work? :)
> I've never tried. But since Xtext tries to create an EMF URI it's no complete surprise
>> - What happens with platform-URIs when running standalone (I do not have a proper example environment yet so I cannot test this...)?
> The eTrice generator (which is a plain Java application) is not able to deal with the platform: scheme. In this context there is
> no Eclipse Platform available that could help to resolve this...
>> Regards,
>> Klaus
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:eTrice nightly builds available from download site
Next Topic:no option for 'Empty eTrice Java Project'
Goto Forum:
  


Current Time: Fri Mar 29 07:03:17 GMT 2024

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

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

Back to the top