Bug 167048 - If diagram/domain file extension contains dot, it is impossible to create diagram.
Summary: If diagram/domain file extension contains dot, it is impossible to create dia...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0   Edit
Assignee: Michael Golubev CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 166505 166561
  Show dependency tree
 
Reported: 2006-12-07 04:16 EST by Michael Golubev CLA
Modified: 2010-07-19 22:18 EDT (History)
1 user (show)

See Also:


Attachments
Hopefully fixes the both issues (7.54 KB, patch)
2006-12-07 04:22 EST, Michael Golubev CLA
no flags Details | Diff
Hopefully fixes the subj (as for reopened version). (7.23 KB, patch)
2006-12-11 09:02 EST, Michael Golubev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Golubev CLA 2006-12-07 04:16:11 EST
Actually when GenEditorGenerator#domainFileExtension (the same -- for #diagramFileExtension) contains ".", the generated CreateWizardPage does not allow to create any diagram ("Resource should have <extension> extension" error message appears even if file actually has it). 

It is because new Path("abc.def.xyz").getFileExtension().equals("xyz").

Expected -- wizard should allow to create diagrams

It is not imaginary case -- in particular, profile definition diagram requires domain resources to have extension "profile.uml"
Comment 1 Michael Golubev CLA 2006-12-07 04:19:45 EST
Also, due to the same reason (that is, generated code uses IPath#getFileExtension() that treats "extension" as "the part after the last dot") generated code incorrectly suggest the "default.extensionPartA2.extensionPartB" name instead of "default2.extensionPartA.extensionPartB" in case of name conflict.

Comment 2 Michael Golubev CLA 2006-12-07 04:22:43 EST
Created attachment 55197 [details]
Hopefully fixes the both issues

Uses string concatenation instead of IPath operations to workaround IPath extension related behavior.
Comment 3 Artem Tikhomirov CLA 2006-12-07 14:08:49 EST
Well, "part after the dot" is essentially the way to define filename "extension", hence IPath.getFileExtension() is the most legitimate way to get . I doubt this wizard is the only place that fails with such an assumption. I do not see a reason to handle *incorrect* extensions in the generator.
Comment 4 Michael Golubev CLA 2006-12-11 08:59:12 EST
Ok, I agree that "extension with dot" is unnatural, and it is OK that GMF does not support it. 

However, I am reopening this scr ascking for very little change -- 
1. Avoid cryptic error message "File should have profile.uml extension" when file name "blah.profile.uml" is entered.
2. Provide extensibility (via custom templates) of the algorithm that determine the suggested unique file name in case of conflict. 

This would allow us to fix the problems with Profile diagram, without limitingdefault GMF behavior. 

Comment 5 Michael Golubev CLA 2006-12-11 09:02:43 EST
Created attachment 55397 [details]
Hopefully fixes the subj (as for reopened version).
Comment 6 Artem Tikhomirov CLA 2006-12-19 08:39:52 EST
reviewed and committed
Comment 7 Richard Gronback CLA 2008-08-13 13:10:50 EDT
[target cleanup] 2.0 M4 was the original target milestone for this bug
Comment 8 Eclipse Webmaster CLA 2010-07-19 22:18:09 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Generation was the original product and component for this bug