How to use material design in Jakarta EE? - intellij-idea

I'm new to web development and currently trying to develop a simple website with a servlet in Jakarta EE. I'm using Intellij IDEA and Apache Tomcat 8.5 as a server. I want to apply material design theme from material.io to my webpage, but the installation process requires using npm.
npm i material-components-web
I downloaded the components to the project folder and I can compile example code, but I can't see any difference on the webpage.
My question is, is it possible to use node.js modules in Jakarta and if yes, what am I doing wrong?

Related

Log::Timeline Visualisation in IntelliJ

Is the Log::Timeline Visualization also supported with the Comma IDEA Plugin for IntelliJ or is it only part of the standalone Comma IDE? And if it is supported with IntelliJ, are there additional components needed in IntelliJ?
It is supported through the plugin also. I just tried it with the latest Comma Community plugin by:
Creating a new Cro Web Application project (though any Perl 6 project type will work, this just got me something to test without needing to write any code).
Creating a run configuration (a Cro one, but again, a normal Perl 6 one would do also).
The Timeline option for this run configuration is then available (for instance, on the Run menu). And here it is running:
Note: make sure you have Cro 0.8.1 installed if trying to visualize a Cro web application.

How to ensure eclipse plugin has required bundles available?

I'm just starting to develop a new eclipse plugin where I want a web application server running in Eclipse. I found a nice blog, OSGi as a Web Application Server, that describes how to do this. The author suggests creating a target environment for my bundle requirements, and some of those bundles get pulled in from the Equinox Project SDK (now called Equinox Target Components in Juno). I notice that the tutorial project runs fine when my target platform is the platform I created in the tutorial, but fails to start when it is the default platform. So, now for my question...
If I need bundles that are not part of the default, how will my plugin project get access to those bundles? Will I need to deploy them along with my plugin? How would I know if the user's eclipse does or does not already have those required bundles?
You was not much clear about what kind of application you are developing. Running a web server in an Eclipse IDE as a plugin don't make any sense to me. This kind of server application is best just running on top of Equinox.
Anyway, the right path is to create a "Product Configuration" file and add categories that contains the needed bundles (go to File/Plug-in Development/Product Configuration).
With this file you can run an instance of the product (inside the IDE) and can export it (create a zip containing all needed bundles)
And if you want to able your user to install plugin inside his IDE you must create a P2 repository (using a Target Definition File) and expose the exported directory within a Http server. You could research about Tycho to build this kind of components in a maven style.
Well, I'm not sure if re-inventing the wheel again is really sufficient.
You might take a look at Pax-Web for inspiration on how to do it, or take a look Apache Karaf as a OSGi-Container (using Pax-Web). Or even better start contributing to one of the two :-)

To use ServiceMix my project has to be an OSGi bundle?

I' starting to use ServiceMix and Camel and I've run through many examples.
It seems that the examples that are OSGi can be deployed in ServiceMix via hot deploy or via console, but I don't know how to deploy a project that is not an OSGI. Can it be done?
For example, I'm looking at the example project from Camel 2.10.0 called camel-example-cxf-proxy. I did some alterations and now I wanted to load it in ServiceMix. If I copy/paste to the deploy directory it is loaded but when I try to run it via osgi:start id it fails.
However if I run it from the IDE as a standalone it runs just fine and I can send and receive requests via SoapUI.
When I'm done with the examples I'll want to create my own project in eclipse and do tests in the IDE and in ServiceMix. I don't really understand the advantage of OSGi yet. SO I'm not too compelled to use OSGi for my project.
My main question is: Can I deploy a non-OSGi non-JBI compliant project in servicemix? Something like the camel-example-cxf-proxy. If yes, how can I do it? If no, how can I OSGi-fy the camel-example-cxf-proxy?
Thank you :)
Apache ServiceMix which uses Apache Karaf as its kernel, support pluggable deployment units. Though OSGi is the main unit.
You can deploy JBI artifacts (eg JBI was used as deployment units for Apache ServiceMix 3.x). So we offer that as a migration path to run JBI in SMX 4.x.
A plain WAR file can be deployed as well. You can for example just drop a .war file in the deploy directory. If you deploy from the shell, you need to prefix the deployer with war so it knows to use the war deployer.
There is some documentation about the various pluggable deployers here
http://fusesource.com/docs/esbent/7.0/esb_deploy_osgi/UrlHandlers.html
For example to install an Apache Wicket WAR example using Maven you can do from the shell:
osgi:install war:mvn:org.apache.wicket/wicket-examples/1.4.7/war?Web-ContextPath=wicket
The Apache documentation about deployer is mainly documented at Apache Karaf
http://karaf.apache.org/manual/2.2.9/users-guide/deployer.html
Now to deploy OSGi applications can be a bit of pain to assemble. And that is why FuseSource created FAB to make it much easier. I blogged about this a bit, which references to videos and more material: http://www.davsclaus.com/2012/08/osgi-deployment-made-easy-with-fab.html
With FAB you can just deploy regular Maven projects out of the box without any OSGi pain.
If your project is a maven project, you can try :
mvn install
Then start your servicemix, and in servicemix command line :
install mvn:groupId/artifactId/version
This will prompt a bundle ID. Then, juste start the bundle :
start <bundle_id>
You can check the state of your bundle with command "list"
The project has to be a bundle to be installed in servicemix / karaf. So the steps to make a camel project work in OSGi are the following.
Use the maven bundle plugin in the pom and configure it to import / export the necessary packages if necessary.
Make sure your camel context is defined in a way that OSGi can start. This is either in the activator of the bundle or in a spring config in the right location or with a blueprint config in the right location.
See two of my karaf tutorials for the details:
CXF: http://www.liquid-reality.de/x/EoBk
Camel: http://www.liquid-reality.de/x/G4Bk

Packaging Apache configuration files with WAR

I have built a Spring 3 MVC driven RESTful web service app. I use Maven 2 to manage the application lifecycle including packaging up the WAR for distribution. As part of the end solution, I filter application requests through Apache to handle some of the GET requests for static content. This of course requires that I have several custom configurations in Apache configuration files.
My question is this, I would like to package and version these Apache configurations with ( not inside) the WAR, is there a clean way to do this? (using maven?)
Currently, the configuration changes are just included as installation instructions.
My question is this, I would like to package and version these Apache configurations with (not inside) the WAR, is there a clean way to do this? (using maven?)
I'd put such files in a dedicated module (with a pom packaging) and use the Maven Assembly Plugin to create a .zip archive to be unzipped on the target machine(s) and that would be part of the delivery.
Worked pretty well in the past.

I cannot add web module to IntellIj 9 Ultimate

I wanted to add a JSP to my project and I think this is most conveniently done by adding a web module. Unfortunately when I do File->New Module the only types available are Java Module and Android Module.
I have tried turning on all likely plug-ins but no Web (or other module type, except Android) Module type appears.
Help About says it's IntelliJ 9.0.2 Ultimate (Personal License). The Register page appears to have a satisfactory license key.
Running on Windows XP.
You need to select the Java Module, and if your JEE integration plugin is enabled, you will be able to select the "web facet" later in your module creation.
You could also install the maven plugin and create a maven module based on the maven-archetype-webapp archetype.