Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Delivery default data together with DSL ?
Delivery default data together with DSL ? [message #896215] Tue, 17 July 2012 15:24 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi,

I would like to deliver default data together with my DSL bundles. This data is supposed to be referenced in the text model.

I know that I can put the text file containing those data types in an exported package (by manifest.mf) and then import this package in the other plugin that is using the DSL.

But I would like to know if there is any way of doing that without have to make such explicitly package import. Is there any way ?

thanks,

Cristiano
Re: Delivery default data together with DSL ? [message #896437 is a reply to message #896215] Wed, 18 July 2012 11:57 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
There is another way, but it is a bit hacky.

You have to provide your own org.eclipse.xtext.resource.IContainer
containing the index entries (IResourceDescription) for the elements in
the library models (what you call 'default data').

Then you have make a custom IContainer.Manager return this container as
'visible' for all other containers.

There are several ways to implement this, so it'd be best for you to dig
into the code and into the section on the index (Runtime Concepts /
Scoping / Global Scopes and Resource Descriptions) in the Xtext
documentation.


Am 17.07.12 17:24, schrieb Cristiano Gaviao:
> Hi,
>
> I would like to deliver default data together with my DSL bundles. This
> data is supposed to be referenced in the text model.
>
> I know that I can put the text file containing those data types in an
> exported package (by manifest.mf) and then import this package in the
> other plugin that is using the DSL.
>
> But I would like to know if there is any way of doing that without have
> to make such explicitly package import. Is there any way ?
>
> thanks,
>
> Cristiano
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Delivery default data together with DSL ? [message #896458 is a reply to message #896437] Wed, 18 July 2012 12:38 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi Jan,

Thanks for the tips I will investigate better.

What I'm trying to achieve is a way to deliver extensions to the main DSL, providing one or more library models plus templates (using elements of the library) .

In my osgi systems I used to do this kind of extensions using bundle fragments.

do you thing that approach like that would be possible in a xtext DSL ?

regards,

Cristiano
Re: Delivery default data together with DSL ? [message #896512 is a reply to message #896458] Wed, 18 July 2012 15:40 Go to previous message
Johannes Stelzer is currently offline Johannes StelzerFriend
Messages: 30
Registered: October 2009
Member
I have something similar: builtins.
I've my builtins in a xmi resource on my classpath.
The resource is made visible to global scope by adding its uri like a default imports (search on the forums!)
Previous Topic:How to mark the generated output folder run by XtextBuilder as derived
Next Topic:Replacing the standard EMF/JET based code generator
Goto Forum:
  


Current Time: Sat Jun 06 05:49:45 GMT 2020

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

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

Back to the top