Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 414587

Summary: Data Provider API can only be used internally
Product: [Modeling] ECP Reporter: Max Hohenegger <eclipse>
Component: CommonAssignee: Project Inbox <emfcp.common-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eneufeld
Version: 1.0.2   
Target Milestone: 1.1.0.M2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 412270    
Bug Blocks:    

Description Max Hohenegger CLA 2013-08-07 10:57:29 EDT
According to the documentation [1] it should be possible to implement a custom data provider, however; at the moment this is not possible without producing "Discouraged Access"-warnings.

For a current requirement I need to load ECPProjects from a specific location in the filesystem w/o user interaction. Implementing InternalProvider would produce said warnings.
For now I have a workaround, and possibly in 1.1.0 I will be able to use the FileProvider [2]. However, in the near future I will also need to implement data providers that access hardware over a custom protocol, with no filesystem or resource in between.


I suggest to create a new non-internal Provider-interface extending InteralProvider, or to avoid migration issues in the future, an abstract class similar to DefaultProvider.

Also, the related .EXSDs need some clean up. Extension points I touched so far:
org.eclipse.emf.ecp.core.providers
org.eclipse.emf.ecp.ui.uiProviders


[1] http://eclipsesource.com/blogs/tutorials/getting-started-with-the-emf-client-platform/#components
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=411987
Comment 1 Eugen Neufeld CLA 2013-08-07 11:07:06 EDT
You can use the Workspace provider for now for this. With the split of the two you can use the FileProvider then. 
The InternalProvider and the DefaultProvider are currently private as we want to check the spi once more before we make it public.
The bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=412270 is already targeted for 1.1.0 .
Comment 2 Max Hohenegger CLA 2013-08-07 11:21:39 EDT
No surprise I didn't find this bug, I have no idea what SPI means. But I'm glad to hear this is a work in progress! :)

Yes, the WorkspaceProvider is part of my current solution, but I have to call it a workaround because it is internal as well, and I have to configure it using string literals.

(In reply to comment #1)
> You can use the Workspace provider for now for this. With the split of the
> two you can use the FileProvider then. 
> The InternalProvider and the DefaultProvider are currently private as we
> want to check the spi once more before we make it public.
> The bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=412270 is already
> targeted for 1.1.0 .
Comment 3 Eike Stepper CLA 2013-08-20 05:57:59 EDT
(In reply to comment #2)
> No surprise I didn't find this bug, I have no idea what SPI means.

SPI means "service provider interface" and differs from API (application programming interface) in that minor releases may involve breaking changes. That is because service providers usually have a more intimate relationship to the framework than service consumers.

Also compare http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf
Comment 4 Jonas Helming CLA 2013-08-20 06:12:53 EDT
fixed with 4add9a12f4ae88b66724686244b007401461cbbf
Comment 5 Jonas Helming CLA 2013-08-24 16:21:16 EDT
fixed
Comment 6 Max Hohenegger CLA 2013-09-05 06:00:49 EDT
I've had a look at the 1.1.0 M1 release. The DefaultProvider looks good, however; I still have a problem with the UIProvider. This interface requires me to implement the following method:
org.eclipse.emf.ecp.spi.ui.UIProvider.createNewProjectUI(Composite, CompositeStateObserver, ECPProperties)
CompositeStateObserver is part of the package org.eclipse.emf.ecp.ui.common, which is flagged as x-internal:=true
Therefore, I still get the discouraged access when I implement that interface.

If I sub-class DefaultUIProvider instead, I have an implementation that returns null on said method, which is not an option for my use-case.
Comment 7 Jonas Helming CLA 2013-09-10 09:02:06 EDT
thanks for the report, we will have a look for M2
Comment 8 Jonas Helming CLA 2013-09-24 04:43:38 EDT
moved interface to SPI in 2a95a0b9f8afe3023038328d2595e6aae5d56124