13 Replies Last post: Feb 11, 2010 3:39 PM by Nikolay Chashnikov (JetBrains)  
HugoPalma Novice 177 posts since
Dec 10, 2002
Currently Being Moderated

Jul 22, 2005 2:54 PM

How can i get a web modules deployment descriptors path ?

I have to have access to a web modules deployment descriptors. I've been digging the Module class but couldn't find that information. Anyone knows how to do this ?

 

Thanks

 

Hugo

Guest
Currently Being Moderated
Jul 23, 2005 11:34 AM in response to: HugoPalma
Re: How can i get a web modules deployment descriptors path ?

Would you mind sharing your knowledge with us?

 

Hugo Palma wrote:

Nevermind, figured this one out.

 

--

Martin Fuhrer

Fuhrer Engineering AG

http://www.fuhrer.com

 

Gaurav  Joshi Newbie 20 posts since
Feb 8, 2010
Currently Being Moderated
Feb 8, 2010 10:27 AM in response to: HugoPalma
Re: How can i get a web modules deployment descriptors path ?

J2EEDeploymentDescriptor, seems to be missing in 9.x version, Is there a counterpart for it now?

Guest
Currently Being Moderated
Feb 8, 2010 12:05 PM in response to: Gaurav Joshi
Re: How can i get a web modules deployment descriptors path ?

webFacet.getDescriptorsContainer().getConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA).getUrl()

 

J2EEDeploymentDescriptor, seems to be missing in 9.x version, Is there a counterpart for it now?

 

---

Original message URL: http://www.jetbrains.net/devnet/message/5256149#5256149

 

 

--

Nikolay Chashnikov

Software Developer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

 

Gaurav  Joshi Newbie 20 posts since
Feb 8, 2010
Currently Being Moderated
Feb 8, 2010 12:42 PM in response to: Nikolay Chashnikov (JetBrains)
Re: How can i get a web modules deployment descriptors path ?

Thanks Nikolay Chashnikovfor the instant reply. One final thing, I am using the IntelliJ CE, and the snippet mentioned by you make use of javaee package, officially part of UE.  Does that mean, making it part of CE is compilation of javaee package and bundling it in plugin jar.

Guest
Currently Being Moderated
Feb 8, 2010 1:06 PM in response to: Gaurav Joshi
Re: How can i get a web modules deployment descriptors path ?

If your plugin depends on JavaEE classes you won't be able to use it in IDEA CE.

 

Thanks Nikolay Chashnikovfor the instant reply. One final thing, I am using the IntelliJ CE, and the snippet mentioned by you make use of javaee package, officially part of UE.  Does that mean, making it part of CE is compilation of javaee package and bundling it in plugin jar.

 

 

---

Original message URL: http://www.jetbrains.net/devnet/message/5256155#5256155

 

 

--

Nikolay Chashnikov

Software Developer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

 

Gaurav  Joshi Newbie 20 posts since
Feb 8, 2010
Currently Being Moderated
Feb 9, 2010 10:05 AM in response to: Nikolay Chashnikov (JetBrains)
Re: How can i get a web modules deployment descriptors path ?

Previously with intelliJ 5.0 we used to create web modules using J2EEModuleProperties and J2EEDeploymentDescriptor. I am stuck with snippet present in old module

 

     J2EEModuleProperties webProps = J2EEModuleProperties.getInstance(webModule);

     J2EEDeploymentDescriptor[] descriptors = webProps.getDeploymentDescriptors();

     if (descriptors.length > 0) {

            descriptors[0].setUrl(webModuleRoot.getAbsolutePath() + "\\WEB-INF\\web.xml");

     }  

as these classes has been removed altogether. Now as said by you

        webFacet.getDescriptorsContainer().getConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA).getUrl()

can be used.

 

I am assuming that I have to

1. Create a simple java module (cannot create a web module as initially it was done by ModulyType.web)

2.  Attach a web facet to it with

     FacetType type = FacetTypeRegistry.getInstance().findFacetType(WebFacet.ID);

     FacetManager.getInstance(webModule).addFacet(type, moduleName, null);

How would I add the descriptors as defined above.

 

Also,

We have the license for Intellij 5 and had build up a custom plugin for that. Now we have decided to purchase IntelliJ 9 license, and the resposibility of migrating the plugin lies upon me.

Since I am new to Intellij plugin development field, I am facing hell lot of difficulty as there is neither java docs or proper documentation nor any kind of tutorial. I tried looking into API of 5.0 and it contains no description at all. I have read the architecture and various other documentation available at (http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment) .

Is there any other way I can expedite the process other than looking for individual queries posted in confluence and make desperate try of bringing any sense how so ever little I can.

 

Appreciate the prompt replies I have got till now

Guest
Currently Being Moderated
Feb 9, 2010 12:53 PM in response to: Gaurav Joshi
Re: How can i get a web modules deployment descriptors path ?

WebModuleType was removed in IDEA 7. You indeed need to use Java module with WebFacet instead.

To add a descriptor you can use

webFacet.getDescriptorsContainer().getConfiguration().addConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA, webXmlUrl).

 

Unfortunately there are no other sources of documentation/tutorials regarding plugin development.

 

Previously with intelliJ 5.0 we used to create web modules using J2EEModuleProperties and J2EEDeploymentDescriptor. I am stuck with snippet present in old module

 

+     J2EEModuleProperties webProps = J2EEModuleProperties.getInstance(webModule);+

+     J2EEDeploymentDescriptor[] descriptors = webProps.getDeploymentDescriptors();+

+     if (descriptors.length > 0) {+

+            descriptors[0].setUrl(webModuleRoot.getAbsolutePath() + "
WEB-INF
web.xml");+

+     }  +

as these classes has been removed altogether. Now as said by you

+        webFacet.getDescriptorsContainer().getConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA).getUrl()+

can be used.

 

I am assuming that I have to

1. Create a simple java module (cannot create a web module as initially it was done by ModulyType.web)

2.  Attach a web facet to it with

+     FacetType type = FacetTypeRegistry.getInstance().findFacetType(WebFacet.ID);+

FacetManager.getInstance(webModule).addFacet(type, moduleName, null);

How would I add the descriptors as defined above.

 

Also,

We have the license for Intellij 5 and had build up a custom plugin for that. Now we have decided to purchase IntelliJ 9 license, and the resposibility of migrating the plugin lies upon me.

Since I am new to Intellij plugin development field, I am facing hell lot of difficulty as there is neither java docs or proper documentation nor any kind of tutorial. I tried looking into API of 5.0 and it contains no description at all. I have read the architecture and various other documentation available at (http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment) .

Is there any other way I can expedite the process other than looking for individual queries posted in confluence and make desperate try of bringing any sense how so ever little I can.

 

Appreciate the prompt replies I have got till now

 

---

Original message URL: http://www.jetbrains.net/devnet/message/5256240#5256240

 

 

--

Nikolay Chashnikov

Software Developer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

 

Gaurav  Joshi Newbie 20 posts since
Feb 8, 2010
Currently Being Moderated
Feb 10, 2010 3:24 PM in response to: Nikolay Chashnikov (JetBrains)
Re: How can i get a web modules deployment descriptors path ?

Thanks Nikoly for the prompt and useful reply. Dont know how will I manage without you. Hopefully one last thing, I have created the java module and added web facet to it using

  

   FacetType type = FacetTypeRegistry.getInstance().findFacetType(WebFacet.ID);
            FacetManager.getInstance(webModule).addFacet(type, moduleName, null);           
            Collection facets = WebFacet.getInstances(webModule);
            if(facets.size() > 0)
            {
                Iterator iterator = facets.iterator();
                WebFacet webFacet = (WebFacet)iterator.next();
                webFacet.getDescriptorsContainer().getConfiguration().addConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA,webModuleRoot.getAbsolutePath() + "\\WEB-INF\\web.xml");
            }

 

but when I module is created in IntelliJ, it still ask for web facet to be attached to it. Is there something I am doing wrong. And when I manually do it then the icon for module changes to web but when done through the plug-in the icon besides the module is still that of java project.

Guest
Currently Being Moderated
Feb 11, 2010 1:33 PM in response to: Gaurav Joshi
Re: How can i get a web modules deployment descriptors path ?

What do you mean by "it still ask for web facet"? Your code should add a Web facet to any existing Java module regardless of how this module was

created (by user or via API). Also a web facet added to a module doesn't change icon of that module. It will be shown as a separate node under the

module node in Project Structure dialog.

 

Thanks Nikoly for the prompt and useful reply. Dont know how will I manage without you. Hopefully one last thing, I have created the java module and added web facet to it using

+  +

+   FacetType type = FacetTypeRegistry.getInstance().findFacetType(WebFacet.ID);

            FacetManager.getInstance(webModule).addFacet(type, moduleName, null);           

            Collection facets = WebFacet.getInstances(webModule);

            if(facets.size() > 0)

            {

                Iterator iterator = facets.iterator();

                WebFacet webFacet = (WebFacet)iterator.next();

                webFacet.getDescriptorsContainer().getConfiguration().addConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA,webModuleRoot.getAbsolutePath() + "
WEB-INF
web.xml");

            }+

 

but when I module is created in IntelliJ, it still ask for web facet to be attached to it. Is there something I am doing wrong. And when I manually do it then the icon for module changes to web but when done through the plug-in the icon besides the module is still that of java project.

 

---

Original message URL: http://www.jetbrains.net/devnet/message/5256391#5256391

 

 

--

Nikolay Chashnikov

Software Developer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

 

Gaurav  Joshi Newbie 20 posts since
Feb 8, 2010
Currently Being Moderated
Feb 11, 2010 3:20 PM in response to: Nikolay Chashnikov (JetBrains)
Re: How can i get a web modules deployment descriptors path ?

Thanks Nikolay for your instant replies. Well, Once I have added the Web Facet to Java Module, when I work in IntelliJ 9, the notification tab ask through the pop up that whether the same module to be added as web face? screen shot is attached as well

Attachments:
Guest
Currently Being Moderated
Feb 11, 2010 3:39 PM in response to: Gaurav Joshi
Re: How can i get a web modules deployment descriptors path ?

These notifications come from automatic facet detection. When IDEA see web.xml file somewhere in sources it suggest you to create a Web Facet for that

file. However if you've already created a Web facet for that web.xml via API the notification should not be shown for that file.

 

Thanks Nikolay for your instant replies. Well, Once I have added the Web Facet to Java Module, when I work in IntelliJ 9, the notification tab ask through the pop up that whether the same module to be added as web face? screen shot is attached as well

 

---

Original message URL: http://www.jetbrains.net/devnet/message/5256500#5256500

 

 

------------------------------------------------------------------------

 

 

 

--

Nikolay Chashnikov

Software Developer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

 

More Like This

  • Retrieving data ...