Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Implicitly available instance question
Implicitly available instance question [message #765887] Wed, 14 December 2011 21:00 Go to next message
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

I have a domain model DSL where I model various entity types. There are a number of 'standard' entity types (String, Date, Integer, etc) that I have defined in a model file:

StandardTypes.entity_model:
namespace standard {
  entity String
  entity Date
  entity Integer
  //... etc ...
}


I can then have other models use these by importing the common namespace, e.g.:

CustomTypes.entity_model:
import standard.*

namespace custom {
  entity Person {
    property name : String
    property birthday : Date
  }
}


This works so long as the StandardTypes.entity_model file is in the same project as the CustomTypes.entity_model file, i.e.:

MyProject/
  StandardTypes.entity_model
  CustomTypes.entity_model


BUT what I'd really like to be able to keep the StandardTypes.entity_model in my Xtext DSL plugin and make it automatically available so that any .entity_model instances will automatically link against it without requiring a copy of StandardTypes.entity_model to be physically present in the project where the custom instance resides, i.e.:

MyProject/
  CustomTypes.entity_model


How can I do this?

Thanks,
Edwin
Re: Implicitly available instance question [message #766176 is a reply to message #765887] Thu, 15 December 2011 10:18 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
Have a look at: http://blogs.itemis.de/stundzig/archives/795 (under "URI Imports") and consider using a plugin:/.../-URI instead of a classpath URI.

Re: Implicitly available instance question [message #766843 is a reply to message #766176] Fri, 16 December 2011 14:28 Go to previous message
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member
This is perfect! Thanks!

Edwin
Previous Topic:Where i can download 2.2.1 ?
Next Topic:Duplicate Element 'xyz' - but i know its not
Goto Forum:
  


Current Time: Thu Sep 19 21:16:04 GMT 2024

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

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

Back to the top