Bug 232304 - No way to set a human readable name to an update site
Summary: No way to set a human readable name to an update site
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 239424 266321 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-15 09:47 EDT by Samuel Wu CLA
Modified: 2009-02-26 10:47 EST (History)
8 users (show)

See Also:


Attachments
Patch for PDE UI (24.34 KB, patch)
2008-07-31 13:13 EDT, Curtis Windatt CLA
no flags Details | Diff
mylyn/context/zip (38.49 KB, application/octet-stream)
2008-07-31 13:13 EDT, Curtis Windatt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Wu CLA 2008-05-15 09:47:22 EDT
Build ID: Build id: I20080513-0817

Steps To Reproduce:
1. Download eclipse SDK and use it to create a feature com.ibm.test.parent 1.0.0
2. Build an update site using feature com.ibm.test.parent 1.0.0
3. Update the version number of feature com.ibm.test.parent to 1.0.1 and rebuild the update site
4. Update the version number of feature com.ibm.test.parent to 1.0.2 and rebuild the update site
5. Move the update site to a http server
(I'm going to attach the update site later)
6. Start SDK and add this site to the available site

The name of the site looks wired. Instead of showing the URL to the http server, it shows the directory on the local
drive where the update site was built in. Since the URL may not mean anything to the end user, it's better to follow the example of the update manager. It picks up the site name from the site url in the feature.xml or let the user input it when a new site is added.


More information:
Comment 1 Samuel Wu CLA 2008-05-15 12:17:04 EDT
The file is too big to be attached here. You can get it from the following URL. It will be removed on 05/22/2008
ftp://ftp.emea.ibm.com/fromibm/pmr/83938,49R,000/update.zip
Comment 2 John Arthorne CLA 2008-05-15 13:11:07 EDT
I think the update site editor should have a place for the user to enter the name. Currently you can open the content.xml and artifacts.xml files in the update site project and edit the name manually, but this is not intuitive. See the "name" attribute on the repository element:

<repository name='file:/C:/1target/workspace/sitetest - metadata'

If you change this to

<repository name='Here is my site name'

Then you will see this site name in the UI.
Comment 3 Pascal Rapicault CLA 2008-05-15 22:35:48 EDT
Also if you are exporting an old style site and then generating metadata using http://wiki.eclipse.org/Equinox_p2_Metadata_Generator, then  you get the possibility to specify a name for your repository.
Comment 4 Samuel Wu CLA 2008-05-16 09:34:46 EDT
Since our corporate customers are building their internal update site to provide the corporate wide support, it's not a choice to manipulate the xml files manually. They are currently using update site project to do the internal deployment. The current update site name in UM is defined in the feature.xml, which can be input through GUI. P2 has to provide something similar. We can take away an existing function from the product without a good reason.
Comment 5 Chris Aniszczyk CLA 2008-05-16 10:41:46 EDT
PDE has never supported setting a name of an update site, this was something users did when they manually added the site or did it some other way.

Pascal, can p2 do some stupid heuristic to maybe fill in a name somehow?

I'm not sure what PDE can do here...

Maybe in the p2 ui, when adding a site, Susan can offer the ability to name a repo similar to what is done with the old UM?
Comment 6 Susan McCourt CLA 2008-05-16 12:19:36 EDT
>Maybe in the p2 ui, when adding a site, Susan can offer the ability to name a
>repo similar to what is done with the old UM?

The problem is that the name property on the repo is not writable by the UI.  Once created, most repos are not writable by end users.  During our original discussion on this, we said that producers/tooling would take care of it, and then we might consider letting the user override it. (See bug 194224).

To fix at this late date, the UI would have to capture a name and store it separately, associating it with repos in the UI code.  It's a bit late to be doing that.  

If PDE is creating repos, it would make sense to capture a name there.  That is where producers can name the repo.  A further enhancement would be to let users rename.
Comment 7 Chris Aniszczyk CLA 2008-05-16 12:25:57 EDT
The only option I can see it PDE writing out the site URL... ie.,

<description url="www.myupdates.com/site">

as the p2 repo name?

Would this work for people?

If so, how do I set the name of a repo programmatically?
Comment 8 Samuel Wu CLA 2008-05-16 12:58:56 EDT
I'd prefer a readable name and it's better to be a translatable string. I don't expect the end users to remember which URL is for which feature/component.
Comment 9 Darin Wright CLA 2008-07-03 10:19:57 EDT
*** Bug 239424 has been marked as a duplicate of this bug. ***
Comment 10 Jeremy CLA 2008-07-28 20:17:22 EDT
>> PDE has never supported setting a name of an update site, this was something
>> users did when they manually added the site or did it some other way.

I'm probably missing something obvious here, but ... if the name was settable when a repo was manually added  before, why not just make it settable when a repo is manually added one now?  There's no need to add special repo-editing UI functionality that Eclipse has never had; just put the stupid textbox back on the Add Site dialog and everyone will be happy.
Comment 11 Chris Aniszczyk CLA 2008-07-28 20:22:29 EDT
(In reply to comment #10)

Jeremy, feel free to file a bug against p2 telling them todo that ;)

From the PDE side of things, we'll work on providing some type of solution in 3.5
Comment 12 Susan McCourt CLA 2008-07-28 22:13:03 EDT
This bug is "how does the site producer name a site," hence a PDE issue.

>Jeremy, feel free to file a bug against p2 telling them todo that ;)

The "how does a user name a site" bug is bug #194224
Comment 13 Jeremy CLA 2008-07-29 12:23:44 EDT
Thanks for the clarification, and sorry to bother y'all; I'll go bother those p2 fools now :-)
Comment 14 Curtis Windatt CLA 2008-07-31 13:13:05 EDT
Created attachment 108881 [details]
Patch for PDE UI

Adds the UI part to specify a site name as part of the description.  Plays nicely with site.xml files with or without a name specified.  Tried using the a 3.2 build to make sure the xml was still valid, worked fine.

Only problem is that even if I set all the name properties (root, metadata and artifact), none of them show up in the content.xml.  I will have to cc Andrew as it's a problem with PDE Build (or how I'm using it).
Comment 15 Curtis Windatt CLA 2008-07-31 13:13:12 EDT
Created attachment 108882 [details]
mylyn/context/zip
Comment 16 Curtis Windatt CLA 2008-07-31 13:15:23 EDT
Hey Andrew, can you explain to me what properties need to be set when exporting/building to set the repository name?  See patch and comment for details.
Comment 17 Chris Aniszczyk CLA 2008-07-31 13:50:00 EDT
Andrew, I'd like to see this in 3.5M1, any ideas what's up here?
Comment 18 Andrew Niefer CLA 2008-07-31 16:25:06 EDT
The properties
    IBuildPropertiesConstants.PROPERTY_P2_METADATA_REPO_NAME
and IBuildPropertiesConstants.PROPERTY_P2_ARTIFACT_REPO_NAME
should work.

Note that this will not change the name of an existing repo, only set it for new repos.

Note that your attached patch here does not compile for me so I can't try this out.
Comment 19 Curtis Windatt CLA 2008-08-05 15:16:11 EDT
Got it working, fixed in HEAD just in time for M1.

If the name doesn't show up properly when adding the repo to p2's list, just right click and hit refresh and the name should update.
Comment 20 Chris Aniszczyk CLA 2009-02-26 10:47:06 EST
*** Bug 266321 has been marked as a duplicate of this bug. ***