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

Bug 371027

Summary: [Model] platform:/plugin/ not used for fragment uri in org.eclipse.e4.workbench.model extension point
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: cvgaviao, hamorsky, Lars.Vogel, Rene.Brandstetter, yashballal.tech
Version: 4.2   
Target Milestone: 4.4 M3   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 369884    
Bug Blocks:    

Description Lars Vogel CLA 2012-02-08 19:07:50 EST
Similiar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=369884 I think it would more much more consistent if the org.eclipse.e4.workbench.model would use the platform:/plugin/ prefix which
for example are used for CSS resources or Icons. 

Currenty:

<plugin>
   <extension
         id="id1"
         point="org.eclipse.e4.workbench.model">
      <fragment
            uri="fragment.e4xmi">
      </fragment>
   </extension>

</plugin>
Comment 1 Paul Webster CLA 2012-02-09 08:40:20 EST
For reading an extension attribute that points to a resource, depending on what it is we need to support 2 or 3 methods:

1) relative to the plugin root: xmi/myFragment.e4xmi
2) Same as #1 with NL (optional): $nl$/xmi/myFragment.e4xmi
3) platform:/plugin URL

PW
Comment 2 Missing name Mising name CLA 2013-10-14 13:01:51 EDT
I think the methods 1) and 3) are useful and possible with some simple code changes in the ModelAssembler class.

But why should I load different fragment.e4xmi elements based on the locale? Correct me if I'm wrong, but as far as I can remember is the translation of all displayed elements automatically done with the externalization mechanism. If somebody really has the special case to provide different Model-Elements based on the locale I think he is better off using a processor to add them dynamically.
Comment 3 Lars Vogel CLA 2013-10-14 15:38:40 EDT
Rene, maybe a different model fragment should be loaded based on the local setting? But I think if that is a requirements from Paul, we should open a new bug for 2.).

Rene, if you interested in fixing that (I hoped so, therefore I copied you in the bug), can you please provide a Gerrit review to handle 1.) and 3.)

Paul, if 2.) is a valid requirement, can you please open a new bug for this? My original bug was to have consistency in the URI handling.
Comment 4 Missing name Mising name CLA 2013-10-17 13:12:11 EDT
I've provided a fix under:

https://git.eclipse.org/r/17470

As Lars suggested it's just the implementation of method 1) and 3).

But I think there should be a follow-up Bug for updating the PDE Schema-Editor, because the "uri" attribute is now a resource to which the PDE Schema-Editor can navigate. This navigation only works with the relative paths not with the new Platform-URIs.
Comment 5 Lars Vogel CLA 2013-10-21 05:07:28 EDT
*** Bug 376151 has been marked as a duplicate of this bug. ***
Comment 6 Paul Webster CLA 2013-10-21 13:02:57 EDT
(In reply to Lars Vogel from comment #3)
> Paul, if 2.) is a valid requirement, can you please open a new bug for this?
> My original bug was to have consistency in the URI handling.

My thinking on that was to have the same logic that we support in our many icon attributes, but arguably a uri attribute is not the same in this kind of extension point as text or an icon would be.

I think it's fine to ignore that for now, and we could react to it if someone raises a bug about it with a more compelling usecase than "icon" works that way.

PW
Comment 7 Missing name Mising name CLA 2013-10-21 14:17:57 EDT
I think there is a difference between Icon handling and application-model fragment. An Icon is a piece of static that which content can not be translated but sometimes needs to be translated (=Icon which contains text). The application-model instead is an additional static configuration which enriches an existing model and its content will be parsed and the elements which needs to be translated can be translated on demand.
Comment 9 Daniel Rolka CLA 2013-10-29 12:15:11 EDT
Verified in the build: I20131028-2000