Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EGL imports(EGL imports)
EGL imports [message #1226440] Wed, 01 January 2014 20:14 Go to next message
Arseniy Isakov is currently offline Arseniy IsakovFriend
Messages: 118
Registered: May 2012
Senior Member
Hello

I have following egl template

[%

import "common/typePointer.eol";

var util := new Native("org.tura.metamodel.commons.Util");

if (model_mapper.getQueries().size()<> 0) {
var query = model_mapper.getQueries().get(0);
var type = util.runQuery(query,model_mapper);

var remoteInterface : Template = TemplateFactory.load("remoteInterface.egl");
remoteInterface.generate(type.getMappedJavaType() + ".java");

}
%]

Seems like import for EGL is not working.
Can you please help me to resolve the problem.
Thanks
Arseniy Isakov


Re: EGL imports [message #1226462 is a reply to message #1226440] Wed, 01 January 2014 21:38 Go to previous messageGo to next message
Arseniy Isakov is currently offline Arseniy IsakovFriend
Messages: 118
Registered: May 2012
Senior Member
I figured out my mistake I have to define relative path in my imports
import "../../commons/typeElementUtil.eol";
But this solution is not very useful because if I move my egl template to another location I have to modify my imports
If I use following :
import "/commons/typeElementUtil.eol";
I am getting an error
Re: EGL imports [message #1226608 is a reply to message #1226462] Thu, 02 January 2014 07:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The EMF way is to operate relative to the virtual "platform:". Have you
tried "platform:/project/....."

Relative paths should work stably if you go up to platform: and down again.

Regards

Ed Willink


On 01/01/2014 21:38, Arseniy Isakov wrote:
> I figured out my mistake I have to define relative path in my imports
> import "../../commons/typeElementUtil.eol";
> But this solution is not very useful because if I move my egl template
> to another location I have to modify my imports
> If I use following :
> import "/commons/typeElementUtil.eol";
> I am getting an error
Re: EGL imports [message #1227024 is a reply to message #1226608] Fri, 03 January 2014 10:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
Apologies. A misleading email to start the new year.<br>
<br>
You should of course try "platform:/resource/<i>project</i>/....."
for workspace content and "platform:/plugin/<i>bundle</i>/....."
for installed plugin content.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
<br>
On 02/01/2014 07:29, Ed Willink wrote:<br>
</div>
<blockquote cite="mid:la34hi$5lj$1@xxxxxxxxe.org" type="cite">Hi
<br>
<br>
The EMF way is to operate relative to the virtual "platform:".
Have you tried "platform:/project/....."
<br>
<br>
Relative paths should work stably if you go up to platform: and
down again.
<br>
<br>
    Regards
<br>
<br>
        Ed Willink
<br>
<br>
<br>
On 01/01/2014 21:38, Arseniy Isakov wrote:
<br>
<blockquote type="cite">I figured out my mistake I have to define
relative path in my imports
<br>
import "../../commons/typeElementUtil.eol";
<br>
But this solution is not very useful because if I move my egl
template to another location I have to modify my imports
<br>
If I use following :
<br>
import "/commons/typeElementUtil.eol";
<br>
 I am getting an error </blockquote>
<br>
</blockquote>
<br>
</body>
</html>
Re: EGL imports [message #1227073 is a reply to message #1226608] Fri, 03 January 2014 13:04 Go to previous messageGo to next message
Arseniy Isakov is currently offline Arseniy IsakovFriend
Messages: 118
Registered: May 2012
Senior Member
This is code from EolImport

// Useful for plugin developers: fall back on platform:/resource if platform:/plugin does not work
if ("platform".equals(uri.getScheme()) && uri.getPath().startsWith("/plugin/")) {
final String sNewURI = uri.toString().replaceFirst("/plugin/", "/resource/");
uri = new URI(sNewURI);
importedModule.parse(uri);

According this logic path has to be
import "platform:/plugin/commons/typeElementUtil.eol";

But first eclipse editor gives you parsing error
second it is trying to locate platform:/resources/commons/typeElementUtil.eol which is not exists because bundle has /commons/typeElementUtil.eol




Re: EGL imports [message #1227187 is a reply to message #1227073] Fri, 03 January 2014 20:03 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

As Ed Willink said, you need to add the name of your plugin. Try this:

import "platform:/plugin/name.of.your.plugin/path/within/your/plugin";

This Eclipse help page might be useful:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fplatform-scheme-uri.html
Re: EGL imports [message #1227247 is a reply to message #1227187] Sat, 04 January 2014 00:12 Go to previous message
Arseniy Isakov is currently offline Arseniy IsakovFriend
Messages: 118
Registered: May 2012
Senior Member
yes it works.
Thanks
Arseniy Isakov
Previous Topic:EGL Native class instantiation
Next Topic:EGL and User defined operation
Goto Forum:
  


Current Time: Thu Apr 25 05:15:29 GMT 2024

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

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

Back to the top