Bug 375605 - "New File (HTML/JSP)" wizard uses wrong default location
Summary: "New File (HTML/JSP)" wizard uses wrong default location
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 3.4.2   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard: Probably involves making use of org.e...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 04:12 EDT by Fred Bricon CLA
Modified: 2012-10-12 11:09 EDT (History)
2 users (show)

See Also:


Attachments
Default location when creating a new file (121.22 KB, image/png)
2012-03-29 04:12 EDT, Fred Bricon CLA
no flags Details
Patch for New HTML File wizard (3.25 KB, patch)
2012-04-11 20:42 EDT, Alexey Kazakov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Bricon CLA 2012-03-29 04:12:03 EDT
Created attachment 213318 [details]
Default location when creating a new file

When using a Mavenized web project with m2e-wtp, org.eclipse.wst.common.component looks like :

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="war">
        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
        <property name="context-root" value="war"/>
        <property name="java-output-path" value="/war/target/classes"/>
    </wb-module>
</project-modules>

If I select the project (or the src/main/webapp folder) and call the "New > HTML File" or "New > JSP file" wizards, the default location is always /target/m2e-wtp/web-resources, which m2e-wtp uses to keep generated files only. 

I expect the default location to be the folder I selected, if it's listed in the deployment assembly or the one tagged with "defaultRootSource" otherwise. 

This is pretty annoying actually, when you do demos.

Tested in Indigo SR2 and Juno M6.
Comment 1 Alexey Kazakov CLA 2012-04-11 20:42:02 EDT
Created attachment 213874 [details]
Patch for New HTML File wizard

See patch.txt. This is a patch for New HTML File wizard.
Comment 2 Nitin Dahyabhai CLA 2012-04-12 13:29:08 EDT
Thank you for the patch, Alexey.  While I don't think it's the full solution, it makes for a good starting point.
Comment 3 Nick Sandonato CLA 2012-10-12 10:47:53 EDT
Thanks for the bug report and the patch. I ended up implementing it a bit differently, included the CSS wizard in the fix, and pushed the changes to R3_4_maintenance and master.

http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=c8c092dd8c2b6f6b54c6d409fed02bcfcd2c057a