Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to export elements from existing languages
How to export elements from existing languages [message #724941] Tue, 13 September 2011 14:41 Go to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi,

I'm trying to reference elements in WSDL resources (EMF-based XMI files).

I've managed to import the WSDL file using the following parser rule:

ImportWsdl : 'import' importURI=STRING;

in combination with the ImportURIScopingFragment. The imports work,
wrong URIs are detected in the editor.

However, I cannot reference the elements contained in the imported WSDL
resource. The rule that contains the reference is:

SomeMetaclass: 'ref' wsdlElement += [xsd::XSDElementDeclaration];

Do I need to make some customization to export the elements contained in
the WSDL resource?

I've also tried to adjust the generated ScopeProvider class, but even
though the respective scope_SomeMetaclass_wsdlElement() method is called
(e.g., IScope.getAllElements()), I cannot access the imported resource.

Thanks a lot!

Best regards,

Mirko
Re: How to export elements from existing languages [message #724953 is a reply to message #724941] Tue, 13 September 2011 15:15 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 14666
Registered: July 2009
Senior Member
Hi,

is the referenced resource an xtext resource. if yes this should work out of the box if the qualified names fit.
if not you have to create a own resource service proivider like i have done it for uml here: http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to export elements from existing languages [message #725291 is a reply to message #724953] Wed, 14 September 2011 12:44 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Christian,

thanks a lot for the pointer! I've implemented the two plug-ins as
described in your tutorial. The bind methods in class RuntimeModule do
need type restrictions for their return type, otherwise Guice complains.
But, other than that, your solution works fine.

Still I'd like to suggest that Xtext could ship with a default resource
service provider that can index arbitrary EMF resources in case no
custom provider can be found. I find it somewhat complex to implement 2
plug-ins with 8 classes that are mostly empty to realize the default
behavior that is available for Xtext resources. I think other resources
(e.g., ones that are based on XMI) should be accessable equally easy. I
think other users of Xtext could benefit from such a feature too.

Best regards and thanks again for your help,

Mirko


On 13.09.2011 17:15, Christian Dietrich wrote:
> Hi,
>
> is the referenced resource an xtext resource. if yes this should work
> out of the box if the qualified names fit.
> if not you have to create a own resource service proivider like i have
> done it for uml here:
> http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/
>
> ~Christian
Re: How to export elements from existing languages [message #726328 is a reply to message #725291] Sat, 17 September 2011 10:41 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 9/14/11 2:44 PM, schrieb Mirko Seifert:
> Still I'd like to suggest that Xtext could ship with a default resource
> service provider that can index arbitrary EMF resources in case no
> custom provider can be found. I find it somewhat complex to implement 2
> plug-ins with 8 classes that are mostly empty to realize the default
> behavior that is available for Xtext resources. I think other resources
> (e.g., ones that are based on XMI) should be accessable equally easy. I
> think other users of Xtext could benefit from such a feature too.

Please file an enhancement request.

We could have a generic catch-all case, which looks into the resource
factory registry and indexes files for all registered file extensions
for which no resource desciption provider had been registered (excluding
the wildcard as well as common generic extensions like xml and xmi).
This might be helpful in case where you create small "disposable DSLs"
as you call them. I'd like to have this functionality switched off by
default and allow people to enable it in the preferences.

Sven


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:Xtend2, dispatch end inject extension
Next Topic:[Serializer 2.0] State 'stop' may not follow 'start'
Goto Forum:
  


Current Time: Fri Apr 26 16:34:56 GMT 2024

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

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

Back to the top