Need one example of osgi web example - osgi

Can any one give one example of how OSGi is implemented for WEB-apps.
For example, One page will have some block where other extensions can contribute to it.
It helps me in understanding the OSGI concepts.
Thanks

This is an example OSGi web app: https://bitbucket.org/amdatu/showcase.
It uses RESTful web services (implemented as OSGi services) built on top of Amdatu and Angular.js for the front end.

You might be interested in the samples of Pax Web.
These can be found here

My OSGi for mere mortals sample might help, it's a minimal example built from scratch that uses OSGi Declarative Services to provide plugins.

Here you can find a great and official OSGi example created by Peter Kriens.
It is showing the whole way of doing OSGi for the web.
Git Repo and here are the slide slides.
The repo contains the different steps from the tutorial as branches.

Related

Customizing Spring Initializr

I am working on bringing up a new team in the Spring Boot ecosystem. I love the Spring Initializr service. We have written custom Gradle plugins for unifying our build systems across many Spring Boot projects. I am looking to provide our team with an Initializr that will take advantage of our build tooling as well as inject some of our business practices into the scaffolding of the project.
With these goals in mind we have decided that extending the wonderful Spring Initializr and running a custom instance locally makes a lot of sense.
Unfortunately, it appears that the Initializr project has very little documentation about customizing it, beyond the basics of editing the YAML configuration and the Templates for the java files, it is difficult (for someone with no Groovy Templating experience) to figure out how to best extend the Initializr such that we maintain much of the functionality but can also extend the site and service appropriately.
We have built the github project from source, and published the artifacts to our local artifactory, and have successfully created our own project that uses those artifacts as a dependency and stands up a mildly customized service (basic HTML and Java source editing, simple YAML configuration).
Can anyone help with even basic resources for extending the functionality of the Initializr? perhaps a roadmap? a project specific forum? really any help is appreciated, my google-foo seems to be failing me.
I know this is a reasonably broad question, but I am failing to get in touch with the right people, or find the resources for this.
So the answer is indeed Gitter. Spring Initializr should be seen at the moment as a service and not a library. We do our best to make sure things are nicely separated but that's not the case yet for everything (read: designed for extension).
We have some plans to allow external components to customize how the project is generated. It would help if you could share your use cases on the gitter channel. Thanks!

Magnolia CMS and Spring MVC

We are started implementing a new project using spring MVC.
I am trying to understand How Magnolia CMS will work with Spring MVC.
I gone through lot of documents but still I am not 100% clear on the following information
How to integrate Magnolia into Spring?
is it like Spring application will run on one machine and magnolia will run on other machine. And some plugin(I guess Blossom) will connect both the systems?
Where exactly blossom will come into picture?
How we can handle static pages ?
Any inputs...will be very helpful
Where exactly blossom will come into picture?
It is a magnolia module, if you have a maven project just add the maven dependencies to the project (from the magnolia archetypes you may find one with blossom already included - have a look here).
While for that concerns how the http requests are processed look at his presentation here.
You should be able to find also some some helpful videos on youtube here and here.
How we can handle static pages ?
I would have a look to the standard templating kit or here.
Hope it helps.

Learn about the architecture or relationship between CXF, Spring, JAXWS, etc

I was thrown into a CXF-based project in which the basic HowTo tutorials are easy to follow and implement but the moment there is a problem or a bug in the system, all kinds of exceptions are thrown without me understanding any of the relationship between the various components.
I know that CXF builds on top of Spring.
But I have no experience with Spring and I don't know how it works.
I have also seen references to JAXWS in the cxf.xml but I don't know how it is related to either Spring or CXF.
I can build a perfectly working (simple) CXF-based web service. Contract first, using wsdl2java in a pom.xml (copycatting a sample).
But the moment I face a problem, I am stumped, relying on some tips and clues gleaned from the web.
Ideally, I would like to have a tutorial that walks me through the history of how web services evolved from Java only, to J2EE, to JAXWS, to Spring, to CXF.
But I couldn't find any.
I did find the official Apache CXF documentation but it assumes a lot of prior knowledge that is more than just knowing the Java language.
Any recommendations on how to get to a point of truly understanding what I am doing when I build a web service?
A recommended book? Online tutorial?
Thanks.
Yip it is a bit of a learning curve but well worth it. As far as books are concerned you can try the following.
Apache CXF Web Service Development
Spring In Action
Please be aware that J2EE and Spring are not evolutionary linked to each other Spring was more a reaction to the heavy weight J2EE specification of old. CXF is a web services toolkit/API that can be used outside of J2EE as well.
I would suggest you also join the user lists of the CXF projects and ask questions there. Also why not post some of the code causing exceptions here so we can help you with more detail?

How to integrate Vaadin 7 with OSGi?

I want to integrate vaadin 7 with osgi but there is no longer any AbstractApplicationServlet class.
I've followed the integration using the vaadin bridge by Neil Bartlett https://github.com/njbartlett/VaadinOSGi.
I've tried using the VaadinServlet somehow but with no luck.
I've also searched for other solutions but found none.
Do you have any suggestions?
Thanks
Vaadin 7 has a lot of design changes that are not visible for default use cases, but especially for OSGi integration you have to do some extra work.
To get you started you should try to understand the initialization process concerning the classes:
VaadinServlet, VaadinServletService, VaadinSession and UIProvider.
The problematic parts are the methods that use classname parameters as arguments, you will have to work around this by e.g. implementing a factory that directly injects your instances.
If you look at the source for UIProvider.createInstance(..) you can see that the original implementation tries to create a new instance, this will fail since vaadin does not see your classes in OSGi. The same principle applies for the other classes i mentioned as well.
Another thing you have to look at is the new separation of jars in Vaadin 7.
A good approach is to attach a bundle fragment with a blueprint context. that registers a BundleHttpContext the same way it worked in Vaadin 6. Attaching fragments also works for the themes you want to use.
Sorry that i can't provide a turnkey solution, but i hope this helps you to look into it yourself.

Spring Dynamic Modules and Netbeans Platform

Has anyone integrated Spring Dynamic Modules (or Eclipse Gemini Blueprint) with Netbeans Platform? I cannot find any information on this.
I was thinking about potential use of Spring Services within the Netbeans Platform Application. Is this reasonable?
Thanks!
I don't know anything about Spring Dynamic Modules, but as long as it produces regular Spring services and DAOs, it's totally do-able. I outlined the process in this post. I am now also considering writing up a blog post complete with code examples on this topic since this seems to be a common issue. I'll update this answer with a link as soon as I'm done.

Resources