Bug 114943 - XML Catalog allow multiple entries with the same key and type
Summary: XML Catalog allow multiple entries with the same key and type
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 0.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Gabriel Indik CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-11-03 11:42 EST by Lawrence Mandel CLA
Modified: 2009-05-25 14:03 EDT (History)
4 users (show)

See Also:


Attachments
Patch (9.70 KB, patch)
2007-05-15 12:54 EDT, Joshua Gorner CLA
no flags Details | Diff
Patch (9.65 KB, patch)
2007-08-31 09:54 EDT, Joshua Gorner CLA
no flags Details | Diff
Patch (10.04 KB, patch)
2008-04-01 17:22 EDT, Gabriel Indik CLA
bjorn.freeman-benson: iplog+
Details | Diff
Patch (2.61 KB, patch)
2009-05-25 13:46 EDT, Gabriel Indik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lawrence Mandel CLA 2005-11-03 11:42:40 EST
The XML catalog allows a user to enter multiple entries with the same key. For
example, I can create two entries for the namespace http://somenamespace. The
catalog only uses the first entry. Allowing the addition of the second only
seems to add confusion as to which entry will be used doesn't seem to serve a
useful purpose.
Comment 1 David Williams CLA 2006-03-28 02:59:13 EST
Craig, will you please triage and/or re-assign these bugs that were assigned to Ella? 

Comment 2 Craig Salter CLA 2007-01-12 02:12:59 EST
Gabriel, I think we need to add UI feedback in the catalog to guard against this situation.
Comment 3 Joshua Gorner CLA 2007-05-15 12:54:13 EDT
Created attachment 67275 [details]
Patch

Resolves issue whereby duplicate entries were possible in XML catalog. Dialog now compares entry against existing catalog by ensuring that, if key or key type have changed (or is new), the provided key does not already resolve to another record. To ensure optimal performance, comparison only occurs when user clicks "OK", and warning is shown if entry is a duplicate.
Comment 4 Joshua Gorner CLA 2007-08-31 09:54:35 EDT
Created attachment 77468 [details]
Patch

Revised patch.
Comment 5 Valentin Baciu CLA 2007-09-10 17:33:30 EDT
Gabriel, please review Joshua's patch and then work with Keith to commit and release.
Comment 6 Valentin Baciu CLA 2007-12-13 15:14:30 EST
I think we want to make sure that catalog contributions through extensions are treated the same way: we need some sort of warning - perhaps in the log - when we read the catalog contributions from the extensions registry and we encounter a duplicate contribution.
Comment 7 Amy Wu CLA 2008-02-28 14:01:42 EST
Targetting to 3.0 m6 to commit joshua's patch.

Valentin, could you please open a new bug for the issue in comment #6? Thanks.
Comment 8 Valentin Baciu CLA 2008-03-04 15:30:29 EST
(In reply to comment #7)
> Valentin, could you please open a new bug for the issue in comment #6? Thanks.
Done, see bug 221399.

Comment 9 Valentin Baciu CLA 2008-03-31 19:22:54 EDT
Amy, reassigning to you to commit and release for M6.
Comment 10 Gabriel Indik CLA 2008-04-01 17:19:11 EDT
Patch has been revised. It as not become stale and its functionality works properly.
Comment 11 Gabriel Indik CLA 2008-04-01 17:22:03 EDT
Created attachment 94443 [details]
Patch

Updated header dates
Comment 12 Valentin Baciu CLA 2008-04-01 17:58:01 EDT
Thank you Gabriel, I've made a few very minor mods (variable names, etc), committed and released the patch for WTP 3.0 builds > v200804011757.
Comment 13 Valentin Baciu CLA 2008-04-01 18:18:18 EDT
I am thinking the dialog used to add/edit entries could be improved in the future to show the error message in a message area at the top. Perhaps we could use TitleAreaDialog or something similar.

Also, the workspace resource selection dialog seems to show all projects, even the closed ones...I would think we could/should filter those out.

Time is short now, so unless trivial, these enhancements should wait until the next release.

Gabriel, please consider my comments and if appropriate open the required RFEs.
Comment 14 Gabriel Indik CLA 2008-04-04 16:42:16 EDT
Valentin,
With regards of comment 13 I think these are all good suggestions. I would recommend however, rather than treating small UI items of individual components in isolation, revising the look&feel of the complete set of XML tools together in order to come up with a better, more consistant design that blends into the platform style. 
Comment 15 Gabriel Indik CLA 2008-04-04 17:20:10 EDT
Verified with S-3.0M6-20080404114343
Comment 16 David Williams CLA 2008-04-24 00:44:45 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword. 
Comment 17 Valentin Baciu CLA 2008-05-05 15:15:03 EDT
Closing.
Comment 18 Lawrence Mandel CLA 2008-06-23 11:26:25 EDT
Although a little late, I've verified this fix on WTP 3.0RC4.

I was about to open a bug for the way in which the error is reported as it's not consistent with the behaviour of the Eclipse platform (I think the error should be reported as soon as the duplicate key is entered, not after I click OK) but I saw that Valentin has already made this suggestion in comment 13. Was a bug opened to track this issue?
Comment 19 Gabriel Indik CLA 2009-05-25 13:44:32 EDT
The duplicate error message is displayed when the a given entry can be match in any catalog, it should be displayed when a conflict within a catalog entry is found.
Comment 20 Gabriel Indik CLA 2009-05-25 13:46:16 EDT
Created attachment 137042 [details]
Patch

This patch ensures that conflicts are verified within a given catalog entries and not across all catalogs.
Comment 21 Gabriel Indik CLA 2009-05-25 13:54:29 EDT
As requested by Valentin, the fix for the duplicate entry error message will be handled in a separate bug.
Comment 22 Gabriel Indik CLA 2009-05-25 14:03:09 EDT
The issue of the duplicate entry error message will be handled in Bug 277738.