Bug 236134 - export catalog should add xml extension if not specified
Summary: export catalog should add xml extension if not specified
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Steven Hung CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-06 15:51 EDT by Amy Wu CLA
Modified: 2009-05-04 23:08 EDT (History)
3 users (show)

See Also:
keith.chong.ca: review+


Attachments
Patch (1021 bytes, patch)
2008-09-12 14:30 EDT, Steven Hung CLA
valentinbaciu: iplog+
Details | Diff
Refined Patch (1.02 KB, patch)
2008-09-12 16:38 EDT, Steven Hung CLA
valentinbaciu: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2008-06-06 15:51:44 EDT
using wtp 3.0 rc4

1. file -> export -> export catalog
2. enter a new file name with no extension

exported catalog file name does not automatically append .xml

this means when i go and try to import the exported catalog, it wont be listed in the list of possible catalog files to import
Comment 1 Steven Hung CLA 2008-09-12 14:30:35 EDT
Created attachment 112455 [details]
Patch

Used the setFileExtension method in org.eclipse.ui.dialogs.WizardNewFileCreationPage to set the extension type to XML.  The XML file extension will automatically be appended to the XML catalog file name.  In the case where the user specifies a file ending with .xml, the method is intelligent enough to not append the XML extension.
Comment 2 Valentin Baciu CLA 2008-09-12 14:49:08 EDT
Thanks Steven, the string used to specify the extension should be marked with the //$NON-NLS-1$ comment as we don't want it externalized for translation. Alternatively, perhaps there's already a constant that can be re-used?

I have tentatively targetted for 3.0.3 since it's appears to be a simple, safe fix.

Keith please commit the fix when ready and the 3.0.3 stream opens.
Comment 3 Steven Hung CLA 2008-09-12 16:38:19 EDT
Created attachment 112463 [details]
Refined Patch
Comment 4 Valentin Baciu CLA 2008-10-06 16:08:23 EDT
Keith please review and commit the fix for 3.1 M3. We may decide to backport later on to 3.0* but only if there's a strong reason.
Comment 5 Valentin Baciu CLA 2008-10-06 16:09:08 EDT
Comment on attachment 112463 [details]
Refined Patch

This fix was contributed.
Comment 6 Keith Chong CLA 2008-10-22 14:14:53 EDT
Patch looks good.  I've committed the patch to HEAD.
Comment 7 Amy Wu CLA 2008-11-11 12:16:32 EST
verified with wtp 3.1 M3 20081107075001 sdk
Comment 8 Valentin Baciu CLA 2008-11-11 13:43:37 EST
Closing.