How to integrate magnolia blossom module with spring mvc - maven

I have created web application in spring.So finally I got requirement to integrate a CMS to my project.I decided to use magnolia with blossom.I am new to magnolia and cms terminology.How should I integrate CMS to spring application.I referred documentation and some examples but I haven't got any clarity on it.So finally what's my doubt is how to integrate magnolia blossom with my spring application with out doing tight coupling.
These are the links I referred Refr Link.
Sample magnolia project Ref Link In this example they have given multi module maven project , in that one module for blossom and one for webapp magnolia.So here I haven't understood how to call my spring application to render my jsp pages or my app associated blog pages.
So please share your ideas or suggestion to implement a cms to spring....

The documentation you link is pretty clear on it
- to get things working you need to deploy Magnolia and your spring app in same war file.
- your spring controller becomes Magnolia page or component template. In case you need dialogs you create those in your code too by annotating appropriate code as a dialog.
- editing/placing of something at give URI/page location is then done via Magnolia using template (controller) found via annotation in your spring code.
If you have concrete issue, it would help to describe it and explain what you tried and what didn't work and where you are actually stuck.
Otherwise you perhaps want to try first few examples of working with just the CMS part of Magnolia and only once you understand that, start merging the two.

Related

Spring Boot/Thymeleaf based large/mid scale application

We are starting out with Spring Boot, and looking for best practices
in implementing a large application. If you can provide links to any large/mid scale open source application
implemented using Spring Boot, that would be helpful.
Also we did research code generated by "JHipster" (jhipster.github.io/) project, which
definitely helps generating lot of boiler plate code like user management, transaction management, REST Services/ AngularJS based application.
The only problem is "JHipster" is AngularJS based. But in our case we
would like to go with "Thymeleaf" based UI.
If you can provide a link to framework/sample application similar to "JHipster",
but based on "Thymeleaf" based UI, that will also be very helpful.
Thanks
JHipster also supports Thymeleaf: by default it generates an AngularJS front-end, and this is its main goal, but you can also use Thymeleaf if you don't want a single Web page application.
If you have a look at the error pages, for example, they are done with Thymeleaf (as the 404 page can't be in the single Web page application, for obvious reasons)

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.

Cannot proceed with Spring Roo: Advaned MVC Problems

I was scheduled to begin work on a new project and decided to make my life easier by adopting a new technology that I had no experience with: Spring!
Specifically Spring Roo, and therein lies my problem.
Spring Roo does so much auto-magical stuff that I really do not know how to proceed. As this runs the risk of turning into a rant, let me be more specific and then follow it up with my question:
Spring works great for setting up my classes and persisting them with Hibernate and all that. The main problem I am having is in trying to scaffold my project.
I am working on a project that manages a few "set" references with many-to-many and many-to-one relationships. This immediately will have problem with the scaffolding application.
Trying to add Google Web Toolkit via 'gwt setup' kills the application immediately. Trying to load in Tomcat server becomes impossible and there is no way to undo the process (as far as I know). Now what? I have to restart my project from the original commands and reapply my changes as far as I can tell.
With this being said it seems to me that the best process is to use ROO to generate my project artifacts and then create my own View/Controller setup. Even here I am having problems though, because the tiles configuration seems so obscured from how it works. I am having a hard time figuring out how to take a custom JSP that can process some of these complex many-to-one relationships (AJAX enabled) and add it to my web front.
Are there any guides for this?
FYI: in the existing Roo Generated MVC I tried
Copying over my JSP
Creating a Form Backing Objects that wraps the different entity types
Modifying the views.xml file in the folder to recognize the page
One this was accomplished, though, I have been unsure how to proceed. How do I access my JSP? Manually typing the URL as it is defined in views.xml does not work.
Should I think about abandoning Roo altogether and starting a Spring project from scratch?
Bet way to learn Spring Roo
read documentation (Spring Roo, enter link description here)
experiment with Roo and watch console output. See files that change, what changes if you add new controller etc.
read and discuss matters in SpringSource forum
follow spring-roo tag in SO
Using Spring Roo for scaffolding
user version control system or backup project. If result does not satisfies you - rollback changes.
Eclipse or SpringSource Tool suite have have hiccups (1, 2). Be aware of them. Use mvn eclipse:clean eclipse:eclipse and re-import project if necessarily.
know the difference between MVC architectural pattern, Web MVC framework and GWT scaffold application.
know limitations and behaviour of scaffolding (ITDs: GWT Style, Expected GWT Add-On Behaviour, JSP Views)
know how Validation, Data Binding, and Type Conversion works, to use effetely in your views
investigate request pipeline (Adding a custom page in spring roo, Adding new Activity in GWT scaffolded app)

Does Spring provide a clean way for building menus?

I'm building a menu with Spring and I'm trying to understand if there is a clean way of doing this. By clean way I mean some module that allows the following:
create a link on a menu entry only if the page shown is not the one to be linked;
apply some CSS class depending on the condition above.
I've just ran accross the spring:url tag: does it have anything to do with what I'm looking for?
No, this is a complexity of user interface way beyond that offered by Spring MVC. You need something higher-level such as JSF or maybe a javascript framework like jquery-ui.
Of course, you could build it yourself using the low-parts provided by Spring MVC, but it's going to be a lot of work.
I would recommend you to have a look at Tiles 2 in combination with SpringMVC. Sample app available on Spring By Example, search for Simple Tiles 2 Spring MVC Webapp.

Easiest way to add GWT to a Spring MVC application?

I've got a Spring MVC application and I've decided that I'd like to try using GWT for the front end. I'd like to continue using MVC as I'll also be using Spring Security and some other springy stuff.
I'm aware of the GWT-SL project, and I guess I'll use it. The documentation is light on examples unfortunately.
What I'm wondering now is.... how do I reconfigure my project so that I can use GWT? I'm assuming that I'll lose the ability to run in hosted mode, and I suppose that's ok. Do I just add the GWT and GWT-SL jars, reconfigure my web.xml, and add a package to my project for the GWT code?
I'm using Eclipse 3.4. My existing project is standard web project.
With the new version of the GWT plugin, you'd have all the benefits of the hosted mode browser without having to modify any options. The GWTHandler from the GWT-SL will take care of your rpc call mapping. However, you will have a problem with your existing domain objects structure. You will either have to put them in GWT's 'client' package, or mirror your existing domain objects to enable them to be compiled to javascript. I have been looking for a stable non-invasive framework for doing this, but have yet to find one. Gilead looks promising, but you will have to extend its classes on your domain.
I have posted a view month ago my simple project (3 classes) how to integrate GWT with existing Spring MVC application. Simple sample also provided.
Try it, it is clear and simple: http://code.google.com/p/gspring.
You won't lose hosted mode. I don't know if you're using the internal server for that - I use -noserver so I can't help you there.
Other than that, I guess the documentation is quite clear. Have you hit any specific problems?

Resources