Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Extending ECPReferenceService
Extending ECPReferenceService [message #1754206] Wed, 15 February 2017 10:13 Go to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi ,
We want to change the objects that are being displayed in the reference dialog. We have extended ECPReferenceService and attached it to "org.eclipse.emf.ecp.view.context.viewServices" extension point. We have set priority lesser than zero , but the new class's addExistingModelElements method is not getting called.

We want to know as even after setting priority lesser than zero our custom class is not getting called. Do we have to register new class at some other places.

[Updated on: Fri, 17 February 2017 06:05]

Report message to a moderator

Re: Extending ECPReferenceService [message #1754286 is a reply to message #1754206] Thu, 16 February 2017 08:16 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
Hi,

is the bundle containing your custom service in your product/run configuration?

Best regards
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Extending ECPReferenceService [message #1754304 is a reply to message #1754206] Thu, 16 February 2017 09:46 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas,

It is present in our run configuration.

Regards
Rahul

[Updated on: Thu, 16 February 2017 09:47]

Report message to a moderator

Re: Extending ECPReferenceService [message #1754377 is a reply to message #1754304] Fri, 17 February 2017 06:07 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas ,

I have added one plugin for registration of our custom reference service in the makeithappen_e3 application example project. Please find the same in the attachment as "CustomMakeItHappen.zip" at the start of the question topic.
Re: Extending ECPReferenceService [message #1754378 is a reply to message #1754304] Fri, 17 February 2017 06:07 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas ,

I have added one plugin for registration of our custom reference service in the makeithappen_e3 application example project. Please find the same in the attachment as "CustomMakeItHappen.zip" at the start of the question topic.

It would be great if in this sample project if we can have one working custom reference class which we can refer for our understanding.

Thanks in advance!

[Updated on: Fri, 17 February 2017 06:10]

Report message to a moderator

Re: Extending ECPReferenceService [message #1754402 is a reply to message #1754378] Fri, 17 February 2017 10:16 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
Hi,

please use ServiceFactories rather then the extension point to register view model services. Please see attached example.

Best regards

Jonas

Best regards
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Extending ECPReferenceService [message #1754547 is a reply to message #1754402] Mon, 20 February 2017 05:05 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas,

ViewModelService class has one method called as "addExistingModelElements" which is not getting called instead while debugging we found that "ECPReferenceServiceImpl" class "addExistingModelElements" method is getting called.
ViewModelService class instantiate method is getting called right now.

Thanks in advance !!
Re: Extending ECPReferenceService [message #1754578 is a reply to message #1754547] Mon, 20 February 2017 14:13 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
The example that I attached works perfectly for me...

Best regards
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Extending ECPReferenceService [message #1754660 is a reply to message #1754578] Tue, 21 February 2017 11:31 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas ,

i tried to compare your implementation in the example with DefaultReferenceServiceFactory & DefaultReferenceService.
I see that you have also implemented the ReferenceServiceFactory and returned our ViewModelService. But then how are you registering the ReferenceServiceFactory.
Shouldnt it be done thru OSGI Component similar to DefaultReferenceServiceFactory.xml inside the OSGI-INF Folder ?

So we have done that too. But even then it doesnt work for us. Our ViewModelService doesnt get called at all.
We have created a org.eclipse.emf.ecp.makeithappen.modelservice.ReferenceServiceFactory.xml inside OSGI-INF.
Attaching the source for your reference.

Any help in this direction would definitely help.
Re: Extending ECPReferenceService [message #1755134 is a reply to message #1754578] Tue, 28 February 2017 11:06 Go to previous messageGo to next message
Rahul Upadhyay is currently offline Rahul UpadhyayFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Jonas ,

Did you got time to check our question. We have to fix this asap else we have to check some other platform instead of ECP.


Thanks in advance!

[Updated on: Tue, 28 February 2017 11:07]

Report message to a moderator

Re: Extending ECPReferenceService [message #1755146 is a reply to message #1755134] Tue, 28 February 2017 12:11 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
Hi,

in the example that I attached, the viewmodelservice was still registered via extension point. This worked for me and it still does in the attached example. When looking at your product config, the view model service plugin is not in there. So please check this (see also my first comment in this thread).

The registration via ServiceFactory is preferred, thats why I added an example for that. You are right, to make that work, you need to register the factory as an OSGi service. In your attached example, you have renamed/moved the component.xml after it has been created. If you do that, you need to update its entry in the MANIFEST.MF
for your example it would be:
Service-Component: OSGI-INF/org.eclipse.emf.ecp.makeithappen.modelservice.ReferenceServiceFactory.xml

There was actually a message on the console telling this (that the component.xml can not be found). Additionally there is a warning on the build.properteis, that you should include the folder OSGI-INF.

When fixing these three things in your example (adding the bundle to the product, the entry in the MANFIFEST:MF and the build.properties) the registration of the reference service works using both mechnsim, the extension point and the factory.

Best regards

Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[Xcore] Generate code in Tycho build
Next Topic:EMF Forms: How to disable the add button for references field
Goto Forum:
  


Current Time: Thu Sep 21 08:53:43 GMT 2017

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

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