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

Bug 273358

Summary: [p2] Store the license field in the product extension
Product: [Eclipse Project] PDE Reporter: Ian Bull <irbull>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: caniszczyk, contact, jeffmcaffer, john.arthorne
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 241169    
Bug Blocks:    

Description Ian Bull CLA 2009-04-22 19:23:49 EDT
+++ This bug was initially created as a clone of Bug #241169 +++

Since p2 is using the .product file to generate top level IUs, it would be great if the product editor could carry some notion of license such that p2 MD generation could use that has input.

Can we store the license (and URL) as a property of the product in the plugin.xml?  (Just like other fields in the .product editor). This way we could use the plugin.property for translations.
Comment 1 Chris Aniszczyk CLA 2009-04-23 04:18:21 EDT
The license is already in the .product file... what's the problem here?
Comment 2 Ian Bull CLA 2009-04-23 11:32:58 EDT
Sorry Chris,

What I meant was all the other fields (product name, about text, etc...) that is specified in the .product file is also stored in the plugin.xml file of whoever defines the product extension.  I assume this was done in part so we can use a plugin.properties file for translating these strings.  Maybe I'm mistaken about that. 

I was wondering if it makes sense to also store the license in the plugin.xml file.

 <extension
         id="product"
         point="org.eclipse.core.runtime.products">
      <product
            application="mail.bundle.application"
            name="RCP Product">
         <property
               name="aboutText"
               value="RCP Mail template created by PDE">
         </property>
         <property
               name="windowImages"
               value="icons/sample2.gif">
         </property>
         <property
               name="aboutImage"
               value="product_lg.gif">
         </property>
         <property
               name="appName"
               value="RCP Product">
         </property>
      </product>
Comment 3 Jeff McAffer CLA 2009-04-24 09:39:43 EDT
Note that .product files do not have to have an associated product extension nor do they have to be in the plugin that defines the product extension.  The license cotnet should be in some other location.  It may make sense to *also* put the license in the plugin.xml if the product license is going to surface in the running system
Comment 4 Ian Bull CLA 2009-04-24 11:32:05 EDT
(In reply to comment #3)
> Note that .product files do not have to have an associated product extension
> nor do they have to be in the plugin that defines the product extension.  The
> license cotnet should be in some other location.  It may make sense to *also*
> put the license in the plugin.xml if the product license is going to surface in
> the running system
> 

Ok, I thought these strings were in the plugin.xml for translation purposes, but I guess that assumption was wrong.  I thought by putting the license in the plugin that defines the product extension we could treat the plugin like a "branding plugin" for the product (and use the translations). 

Maybe that won't work. Do you have other ideas for how we can do product translations?  What about a product.properties file? (similar to the way features do translations).
Comment 5 Jeff McAffer CLA 2009-04-24 15:18:50 EDT
prior to p2 publishing products, .product files existed solely at development time.  Now that they end up as IUs in the repo, we have the translation problem.

As mentioned in comment 3, the .product need not have any relatsionship to any extensions or bundles so getting translations from there is unlikely.  Most of my .products for example are in generic Projects not even plugin projects.

So, one option is to do something like you say, product.properties.  I dont relly understand how the publisher does translations etc so it is unclear how the translations for the products would ever get in the repo.  It may well be the case that we will need to write some new action that publishes translation IUs.
Comment 6 Ian Bull CLA 2009-04-24 22:40:01 EDT
Since the license field is not shown in the running application, adding to the plugin.xml file is not necessary.  I will close this bug as invalid.  We can re-open it if there is case for showing the license in the product.