Also, the web facet docs say it does some things I don't want:
- Creates the structure of the module with the web and WEB-INF nodes
- Creates a Web application deployment descriptor web.xml under the WEB-INF node.
- Creates an index.jsp file that will be the home page of your application and stores it below the web node.
- Configures a basic artifact of the type exploded with the following structure...
You have me curious now... It looks like creating a Web module would be just as effective, without the extra JEE stuff (though I'll address your points below too). I just created a new test project with only a Web module, instead of Java, and this works fine for CFML. And if you do have a mixed Java/CFML project, then you can create a Java module as well as a Web module to represent your Web root. In a Web module you can add additional content roots, similar to the idea of Web resource directories when you have a Web facet under a Java module.
This makes me think that my usage of Web facet is a workaround, in a way, yet it suits me just fine and does not leave any artifacts or anything laying around at all. So, on to your points below...
Some other levels below that is the (roughly) shipping source tree, which includes both cfm/cfc files, and a large tree of pure html/js/css, which is where the lack of "mappings" is most annoying.
The main point of all that is that my java, CFML, pure html/js, and other random artifact dirs aren't parallel to each other, they're at different places under the project root, which also has files I need to work with. Is it possible to have modules nested inside each other, if the higher-level ones explicitly exclude the trees included by child modules?
Also, according to to a msg near the end of this thread, a Web module "Creates an empty module that enables developing web applications using HTML/HTML5, PHP, JavaScript, and style sheets." Doesn't mention CFML, but the posters on that thread are thinking about JSF etc, not CFML. I gather you tried working with CFML in your web facet and got the usual support from IDEA?
All of which leaves me not knowing what to do here, I've been cruising along, and just plain out and out loving IDEA the way I'm set up. However, the more attention I pay to its warnings, and appreciate completion assists, the more the lack of mappings for html/js/css resources is unfortunate (and also the inability to map CFML namespaces to particular files or dirs).
I wish someone from JetBrains would jump in here with some definitive guidelines. (Not that you're not being super helpful Jamie...)
Can you share a rough outline of your actual directory structure beneath your project root (i.e., you only module's root/location)? It might help to just be explicit with an example here.
Not sure I understand the question here. Maybe examples will help. As for nested modules, I know I can create a Web module within my Java module, but you can't create multiple Web modules within the same tree. It's quick and cheap to create new IDEA projects, temporarily, and experiment, so hack away :)
Hi Dave,you don't really need to create the WebModule, but the Web facet can really help.You should open the Project Structure dialog, select Modules in the left pane tree, select your module and invoke New/Web in its context menu.If this facet is not available for you, you need to enable the JavaEEIntegration plugin)Thus the web facet will be created in your module. Select its node to edit the facet settings.Remove the entry in the DeploymentDescriptors part - it is not necessary;Select the auto-created entry in the WebResourceDirectories list and edit it:the "WebResourceDirectory" should point to the actual file system directory that is your web root: <project_path>/<web root>.The "PathRelativeToDeploymentRoot" should be the /MyApp (in your case).Probably i've missed something, but this works for me.
On Thursday, June 28, 2012 9:14:26 PM UTC+4, Dave Merrill wrote:
That web root directory in my diagram is the genuine Apache web root. In HTML files it's referenced as /MyApp/, so /MyApp/css/somefile.css is actually {web root}/css/somefile.css (which I didn't show in my diagram, just to be clear).I was able to right click my existing root module and add a Web module with that as its content root, but it made no difference to IDEA's inability to resolve /MyApp/ references in HTML files. I first named the module 'MyApp web root', then changed it to just 'MyApp', no change.
There is a build process that creates various generated artifacts, but it's not relevant here.
Sorry I'm being thick, and thanks once again for your patience.Dave Merrill
On Thu, Jun 28, 2012 at 10:27 AM, Jamie Krug wrote:
I'm not sure I understand this part of your directory structure:
- web root
- cfml source tree
- non-cfml root
- html/js/css source tree
Is what you label "web root" an actual Web root, as in the DocumentRoot for your Apache virtual host (or similar on IIS/other)? Or, do you not have a directory in your project structure that truly represents a Web root as is, and you instead require a build process to produce artifacts that result in an actual Web root?If your "web root" is truly a Web root, then you should be able to simply create a Web module and point to that directory as its content root. The same idea would work with a Web facet.If a build process is required, then I'd need more detail to make a suggestion. It would help if you gave a more concrete example.Where might your site root's index.cfm reside?What would the path reference be to something in your "non-cfml root?"Is your "cfml source tree" Web accessible, or do you just use CF mappings to reference stuff there?Best,Jamie
Hi,
Web module is primarily expected to be used for JavaScript or PHP development (technically, it is a module type that WebStorm and PhpStorm use). For example, you may see some JavaScript-specific actions, icons or behavior for the files in this module. Also, Project Structure dialog shows more simple UI (similar to WebStorm/PhpStorm) which we consider to be more convenient for JavaScript and PHP projects.
Kirill
Hi Dave,you don't really need to create the WebModule, but the Web facet can really help.You should open the Project Structure dialog, select Modules in the left pane tree, select your module and invoke New/Web in its context menu.If this facet is not available for you, you need to enable the JavaEEIntegration plugin)Thus the web facet will be created in your module. Select its node to edit the facet settings.Remove the entry in the DeploymentDescriptors part - it is not necessary;Select the auto-created entry in the WebResourceDirectories list and edit it:the "WebResourceDirectory" should point to the actual file system directory that is your web root: <project_path>/<web root>.The "PathRelativeToDeploymentRoot" should be the /MyApp (in your case).
Probably i've missed something, but this works for me.
On Thursday, June 28, 2012 9:14:26 PM UTC+4, Dave Merrill wrote:
--
You received this message because you are subscribed to the Google Groups "CFML plugin for IntelliJ IDEA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfml-plugin-for-inte...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
When you hover over the "+" (for Modules), did you click New Module? And do you not see a list of module types to the left, in the New Module dialog, including a Web Module under the Other section?
--