Community
Participate
Working Groups
Steps To Reproduce: (1) Open any TOC (2) Select any Topic (3) Input 'a.x' into the 'Location' field (4) Click 'Location' hyperlink -> BUG: New HTML file wizard opens with an error indicating the filename must have an HTML extension Valid extensions are ".xhtml", ".htm", ".html". I think we should just force an extension of '.htm' for any files we create (i.e. set as the default extension in the wizard and remove the validation regarding whether the file extension is valid or not). These are the reasons: (1) We are not in the business of creating HTML files (leave that to WTP) (2) The new HTML wizard was added for convenience only and is spawned off a hyperlink (3) The HTML file content we generate is HTML 4.01 Transitional (4) .htm is the common extension used for doc files in the Eclipse Project
Created attachment 76949 [details] Patch for bug 200933. This patch changes the wizard so that ".htm" is automatically added. To me this seems like a reduction in functionality, in that users are not able to specify the extensions that they want for the wizard. For example, a user types "index.xhtml" into a Topic, and then proceeds to attempt to make the file. The result is "index.xhtml.htm", which was not their intention. If possible, I'd like to hear a third opinion before we go ahead and commit this. We were violating a convention before, but this may be too restrictive a solution.
CC'ing Brian. What are your thoughts on this Brian? (ping either of us if you need some background information)
It is my understanding that the content we create in the wizard is valid for each of the three valid extensions .htm, .html and .xhtml. With this in mind, what we can do is check to see if the user specified one of the valid extensions in the file name. If so, keep the extension. If they specified "index.xhtml", write our template our but keep the name the user specified. If the file extension does not exist or is not one of the three valid types, then we can default back to the .htm extension. This solution allows us to be as user friendly and least restrictive as possible with very little work (simply check to see if the file extension is valid one of the three valid types). We are not in the business of creating web files. I don't want to multiple template file for each file type(.htm, .html, .xhtml), but if the content is the same and it is only a matter of file name, we can try to accommodate user's intent.
RE: Comment #3 >> simply check to see if the file extension is valid one of the >> three valid types One complication is that this type of checking / validation is done at a higher level in the IDE wizard component. This mechanism does not support multiple valid file extensions. We will have to either replicate the functionality we require within PDE or submit a patch to the IDE team to adjust their mechanism. >> I don't want to have multiple template files for each file type Unfortunately, if we do allow the xhtml file extension, then the HTML 4.01 template content is invalid and misleading. If we do end up supporting all three extensions (really two xhtml and htm/html) then we should have template content for each.
CC'ing Chris. Chris we are sort of deadlocked on this issue. What are your thoughts? (ping any of us if you need some background information)
I think that we should let the user type in whatever extension they want. If the file exists clicking on "Location" should open it. If the file does not exist and the extension is not one of our three favorites let the user know that we can't create it. Is "Location" the best name for this label, I find it a litle surprising that clicking on a hyperlink called "Location" will try to create a file for me.
So now that I talked to Mike, the main issue is the error showing up in the wizard upon being opened. I found a similar scenario. In any plug-in project, create a view extension. Create a view element. Add "1" to the beginning of any segment of the package. Since this is not a valid package, the New Java Wizard will open in an invalid state. Click the hyperlink in our editor and you get a wizard which displays no error but does have the finish button disabled. Once you modify any setting, it comes up with the error message. For consistency, we should do the same. Open the wizard with no error but keep the finish button disabled. Then when anything is modified, go ahead and display errors/warnings. It is arguable if this is the best behavior, but it is important that we stay consistent with the behavior of other components. If our users are gravely upset with the behavior, they can open a bug and we can consider what action should be taken.
Created attachment 77186 [details] Revised patch, as per Brian's suggestion.
Comment on attachment 77186 [details] Revised patch, as per Brian's suggestion. Excellent patch. Thanks Noam.
Patch released to HEAD. Target: 3.4 M2