SlideShare a Scribd company logo
1 of 37
Download to read offline
US NAVY INTEGRATES SPRING APPS
WITH FLYING COLORS THANKS TO WEB CMS
+
WEBINAR
CAMPBELL
EWALD
ABOUT THE WEBINAR
Posting Questions
Viewing the recorded
webinar and related
materials
Contacting Us
Tweeting - use hash tags:
#magnolia_cms #campbellewald
#springframework #springmvc
#USNavy
2
WEBINAR
CAMPBELL
EWALD
ABOUT US
MATT	
  DERTINGER	
  SOLUTIONS	
  ARCHITECT,	
  INTERACTIVE	
  R&D,	
  CE	
  DETROIT
CAMPBELL	
  EWALD
Twi9er:	
  @ma9nolia
SEAN	
  MCMAINS	
  SALES	
  ENGINEER
MAGNOLIA	
  CMS
sean.mcmains@magnolia-­‐CMS.com
TOBIAS	
  MATTSSON	
  SENIOR	
  SOFTWARE	
  ENGINEER	
  &	
  BLOSSOM	
  DEVELOPER
MAGNOLIA	
  CMS
tobias.ma9sson@magnolia-­‐cms.com
3
WEBINAR
CAMPBELL
EWALD
ABOUT CAMPBELL EWALD AND MAGNOLIA
CAMPBELL EWALD
Digital Agency
Magnolia Partner
General Motors, Kaiser Permanente, US Postal Service
Magnolia
Java-based Content Management System
Community and Enterprise Editions
Sony, Deloitte,Airbus and JBoss
4
WEBINAR
CAMPBELL
EWALD
WHAT WE’LL TALK ABOUT
Overview of Magnolia Blossom module
Navy Use Cases
Step-by-Step Walkthrough
Questions
5
WEBINAR
CAMPBELL
EWALD
BLOSSOM OVERVIEW
6
WEBINAR
CAMPBELL
EWALD
A LITTLE PHILOSOPHY
7
The idea that sparked me writing the Blossom Module
for Magnolia CMS was to bring the CMS and
especially the content into Spring Web MVC not the
other way around. Controllers should be the building
blocks when composing pages.
–Tobias Mattsson
http://tobias-mattsson-magnolia.blogspot.com/2011/03/spring-web-mvc-with-content.html
WEBINAR
CAMPBELL
EWALD
WHAT’S BLOSSOM
Spring integration module for Magnolia
CMS
Spring Web MVC with Content
Key features:
Annotation based API
Spring controllers exposed as template
components
Pre-execution of template components
8
WEBINAR
CAMPBELL
EWALD
WHY USE BLOSSOM
Leverages proven Spring Framework
Easily integrate or migrate existing Spring-based applications
Spring developers will feel right at home
Dynamic dialogs,Virtual URI Mappings, Pre-execution
Easily access content in controllers
Best practice web app design patterns (MVC, IoC,AOP)
Open Source and Free to download and use
9
WEBINAR
CAMPBELL
EWALD
NAVY USE CASES
10
TM
WEBINAR
CAMPBELL
EWALD
ABOUT NAVY.COM
Official recruitment Website for
the U.S. Navy
Redesigned in 2010, moved to
Magnolia CMS
Application integration for
subscription services, CRUD
functionality and user-space
applications
11
WEBINAR
CAMPBELL
EWALD
BLOSSOM + RESTEASY
RESTEasy provided nice
JAX-RS client
Aligned with Magnolia CMS
roadmap
Allowed business
components to be loosely-
coupled to CMS
12
Navy Web Service Registry
Business Component 1
Business Component 2
Business Component 3
Business Component n
Navy.com
Navy Custom Module
Blossom
WEBINAR
CAMPBELL
EWALD
BLOSSOM EXAMPLES
Request More Information (Lead) Forms
Find a Recruiter
Subscriber
Life Ops
Reserve Pay Calculator
Training Locations Map
Poll
13
WEBINAR
CAMPBELL
EWALD
FIND A RECRUITER
Finds the nearest Enlisted and Officer
Recruiter Locations based on the postal
code entered by the site visitor
Collect and validate input, call Navy Web
Service, display results.
14
WEBINAR
CAMPBELL
EWALD
LIFE OPS
Personality Profile Test to help
potential recruits plan their
future
Wizard type interface
Collect and validate selected
options from site visitor, populate
model, then calculate and display
results
15
WEBINAR
CAMPBELL
EWALD
STANDARD TEMPLATING KIT
The STK is a production-
ready website construction
framework.
• Best Practices
• Rapid Prototyping
• Modular Architecture
• Extensible
• Standards-Compliant
16
WEBINAR
CAMPBELL
EWALD
BUILDING LIFE OPS: STEP-BY-STEP
17
WEBINAR
CAMPBELL
EWALD
GETTING STARTED
Starting Spring - Add the Blossom Servlet Context Listener to your web.xml
<listener>
<listener-class>info.magnolia.module.blossom.support.ServletContextExposingContextListener</listener-class>
</listener>
Create a module for your custom Spring application components, quickest way:
$ mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/groups/public/
Have your module class extend BlossomModuleSupport and implement start and stop
methods:
public class BlossomSampleModule extends BlossomModuleSupport implements ModuleLifecycle {
public void start(ModuleLifecycleContext moduleLifecycleContext) {
initRootWebApplicationContext("classpath:/applicationContext.xml");
initBlossomDispatcherServlet("blossom", "classpath:/blossom-servlet.xml");
}
public void stop(ModuleLifecycleContext moduleLifecycleContext) {
destroyDispatcherServlets();
closeRootWebApplicationContext();
}
}
18
WEBINAR
CAMPBELL
EWALD
SPRING BEAN CONFIGURATION
Create a Spring bean config file called applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:blossom="http://www.magnolia-cms.com/schema/blossom"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.magnolia-cms.com/schema/blossom http://www.magnolia-cms.com/schema/blossom-1.2.xsd">
<blossom:configuration />
</beans>
19
WEBINAR
CAMPBELL
EWALD
SPRING BEAN CONFIGURATION
Create a Spring bean config file called blossom-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="...">
<context:annotation-config />
<context:component-scan base-package="com.c_e.webinar.magnolia.module.blossomsample" use-default-filters="false">
<context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.Paragraph" />
<context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.Template" />
<context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.DialogFactory" />
<context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.VirtualURIMapper" />
<context:include-filter type="assignable" expression="info.magnolia.cms.beans.config.VirtualURIMapping" />
</context:component-scan>
...
</beans>
20
WEBINAR
CAMPBELL
EWALD
SPRING BEAN CONFIGURATION
Add Spring Handler Adapters and Mappings to blossom-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans ...>
...
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="customArgumentResolver">
<bean class="info.magnolia.module.blossom.web.BlossomWebArgumentResolver" />
</property>
</bean>
<bean class="info.magnolia.module.blossom.preexecution.BlossomHandlerMapping">
<property name="targetHandlerMappings">
<list>
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="useDefaultSuffixPattern" value="false" />
</bean>
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
</list>
</property>
</bean>
...
</beans>
21
WEBINAR
CAMPBELL
EWALD
SPRING BEAN CONFIGURATION
Add SpringView Resolvers to blossom-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans...>
...
<bean class="info.magnolia.module.blossom.view.UuidRedirectViewResolver">
<property name="order" name="1" />
</bean>
<bean class="info.magnolia.module.blossom.view.TemplateViewResolver">
<property name="order" name="2" />
<property name="prefix" name="/ce-webinar-templating-kit/templates/blossomsamples" />
<property name="suffix" name=".ftl" />
<property name="viewRenderer">
<bean class="info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer" />
</property>
</bean>
<bean class="info.magnolia.module.blossom.view.ParagraphViewResolver">
<property name="order" name="3" />
<property name="prefix" name="/ce-webinar-templating-kit/paragraphs/blossomsamples" />
<property name="suffix" name=".ftl" />
<property name="viewRenderer">
<bean class="info.magnolia.module.blossom.view.FreemarkerParagraphViewRenderer" />
</property>
</bean>
</beans>
22
WEBINAR
CAMPBELL
EWALD
LIFE OPS MODEL
Uses BeanValidation API (JSR 303)
Excerpt:
public class LifeOps implements Serializable {
...
@NotNull
@Min(0)
@Max(18)
private Integer advisor;
...
@NotNull
@Min(0)
@Max(18)
private Integer doer;
...
}
23
WEBINAR
CAMPBELL
EWALD
LIFE OPS MODEL
Add in bean validation support to blossom-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans ...>
...
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
...
<property name="webBindingInitializer">
<bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
<property name="validator" ref="validator" />
</bean>
</property>
</bean>
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
...
</beans>
24
WEBINAR
CAMPBELL
EWALD
LIFE OPS MODEL
Constructor
public LifeOps(Integer advisor, Integer doer, Integer innovator, Integer persuader, Integer planner, Integer
problemSolver) {
this.advisor = advisor;
this.doer = doer;
this.innovator = innovator;
this.persuader = persuader;
this.planner = planner;
this.problemSolver = problemSolver;
}
Constructor using transients:
public LifeOps(String[] activities, String[] interests, String[] careers) {
this.activities = activities;
this.interests = interests;
this.careers = careers;
this.resetScores();
this.calculateScores(activities);
this.calculateScores(interests);
this.calculateScores(careers);
}
25
WEBINAR
CAMPBELL
EWALD
LIFE OPS SPRING VALIDATOR
public class LifeOpsValidator implements Validator {
@Override
public boolean supports(Class<?> clazz) {
return LifeOps.class.isAssignableFrom(clazz);
}
@Override
public void validate(Object target, Errors errors) {
LifeOps lifeOps = (LifeOps) target;
if (lifeOps.getActivities() == null || lifeOps.getActivities().length == 0) {
errors.rejectValue("activities", "activities.required", "Please choose at least one activity before proceeding.");
}
if (lifeOps.getInterests() == null || lifeOps.getInterests().length == 0) {
errors.rejectValue("interests", "interests.required", "Please choose at least one interest before proceeding.");
}
if (lifeOps.getCareers() == null || lifeOps.getCareers().length == 0) {
errors.rejectValue("careers", "careers.required", "Please choose at least one career before proceeding.");
}
}
}
26
WEBINAR
CAMPBELL
EWALD
LIFE OPS CONTROLLER
@Controller
@RequestMapping("/life-ops")
@Paragraph("Life Ops form")
@ParagraphDescription("Adds a Life Ops form and displays Life Ops Results")
@I18nBasename("com.c_e.webinar.magnolia.module.blossomsample.messages")
public class LifeOpsController {
	 private static final Logger log = LoggerFactory.getLogger(LifeOpsController.class);
	
	 private final String LIFE_OPS_FORM_PATH = "life-ops/form";
	 private final String LIFE_OPS_SHOW_PATH = "life-ops/show";
	
@Autowired
private Validator validator;
	
@RequestMapping(method = RequestMethod.GET)
public String form(LifeOps lifeOps) {
return LIFE_OPS_FORM_PATH;
}
...
}
27
WEBINAR
CAMPBELL
EWALD
LIFE OPS CONTROLLER
@RequestMapping(method = RequestMethod.POST)
public String processSubmit(@Valid LifeOps lifeOps, BindingResult result, Model model) {
new LifeOpsValidator().validate(lifeOps, result);
if (result.hasErrors()) {
List<FieldError> fieldErrors = result.getFieldErrors();
Map<String, String> errorsMap = new HashMap<String, String>();
for (int i = 0; i < fieldErrors.size(); i++) {
FieldError thisError = fieldErrors.get(i);
errorsMap.put(thisError.getField(), thisError.getDefaultMessage() );
}
lifeOps.setErrors(errorsMap);
model.addAttribute("lifeOps", lifeOps);
return LIFE_OPS_FORM_PATH;
} else {
lifeOps = new LifeOps(lifeOps.getActivities(), lifeOps.getInterests(), lifeOps.getCareers() );
model.addAttribute("lifeOps", lifeOps);
return "redirect:/" + STKUtil.getSite().getName() + "/life-ops/results"
+ "/" + lifeOps.getAdvisor()
+ "/" + lifeOps.getDoer()
+ "/" + lifeOps.getInnovator()
+ "/" + lifeOps.getPersuader()
+ "/" + lifeOps.getPlanner()
+ "/" + lifeOps.getProblemSolver();
}
}
28
WEBINAR
CAMPBELL
EWALD
LIFE OPS CONTROLLER
@RequestMapping(method = RequestMethod.GET, params = "advisor")
public String show(
@RequestParam Integer advisor,
@RequestParam Integer doer,
@RequestParam Integer innovator,
@RequestParam Integer persuader,
@RequestParam Integer planner,
@RequestParam Integer problemSolver,
Model model) {
try {
LifeOps lifeOps = new LifeOps(advisor, doer, innovator, persuader, planner, problemSolver);
model.addAttribute("lifeOps", lifeOps);
} catch (Exception e) {
log.error("LifeOpsController.show() Exception:" + e);
}
return LIFE_OPS_SHOW_PATH;
}
29
WEBINAR
CAMPBELL
EWALD
LIFE OPS CONTROLLER
@TabFactory("Settings")
public void addTab(TabBuilder builder) {
builder.addEdit("activitiesText", "Activities Text", "A short description for the activities fieldset");
builder.addEdit("interestsText", "Interests Text", "A short description for the interests fieldset");
builder.addEdit("careersText", "Careers Text", "A short description for the interests fieldset");
builder.addFckEditor("resultsText", "Results Text", "A short intro for the results page");
}
30
WEBINAR
CAMPBELL
EWALD
LIFE OPS VIRTUAL URI MAPPING
@VirtualURIMapper
public class LifeOpsURIMapper {
private Pattern pattern;
public LifeOpsURIMapper() {
this.pattern = Pattern.compile("^/life-ops/results/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?
[0-8])/([0-1]?[0-8])/?");
}
public String mapping(String uri, HttpServletRequest request) {
this.pattern = Pattern.compile("^/(" + STKUtil.getSite().getName()
+ "/)?life-ops/results/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?
[0-8])/?");
Matcher matcher = pattern.matcher(uri);
if (matcher.matches()) {
return matcher.replaceAll("forward:/" + STKUtil.getSite().getName()
+ "/life-ops/results/?advisor=$2&doer=$3&innovator=$4&persuader=$5&planner=$6&problemSolver=$7");
}
return null;
}
	
}
31
WEBINAR
CAMPBELL
EWALD
LIFE OPS FORM VIEW
[#assign cms=JspTaglibs["cms-taglib"]]
[#assign form=JspTaglibs["http://www.springframework.org/tags/form"]]
<div>
[@cms.editBar /]
[@form.form id="life-ops-form" modelAttribute="lifeOps"]
...
<fieldset>
<legend>Activities</legend>
...
<dl class="prop">
<dt><span>What do you like to do?</span></dt>
<dd class="value">
<ul>
<li>
<input id="activities1" name="activities" value="D" type="checkbox" />
<label for="activities1"><strong>Set up a home computer network</strong></label>
</li>
<li>
<input id="activities2" name="activities" value="S" type="checkbox" />
<label for="activities2"><strong>Track the path of a hurricane</strong></label>
</li>
...
</ul>
</dd>
</dl>
</fieldset>
32
WEBINAR
CAMPBELL
EWALD
LIFE OPS RESULTS VIEW
[#assign results = [
{"name": "problemSolver", "label": "Problem Solver", "score": lifeOps.problemSolver},
{"name": "planner", "label": "Planner", "score": lifeOps.planner},
{"name": "persuader", "label": "Persuader", "score": lifeOps.persuader},
{"name": "innovator", "label": "Innovator", "score": lifeOps.innovator},
{"name": "doer", "label": "Do-er", "score": lifeOps.doer},
{"name": "advisor", "label": "Advisor", "score": lifeOps.advisor}
]]
...
33
WEBINAR
CAMPBELL
EWALD
LIFE OPS RESULTS VIEW
<div class="super-list">
[@cms.editBar /]
<ul>
[#list results?sort_by("score")?reverse as result]
[#assign profileDivId = result.label?lower_case?trim?replace(' ', '-')]
[#assign scoreWidth = (result.score/2)*11+"%"]
[#assign contentCollectionText = result.name + "Text"]
[#assign contentCollectionExtras = result.name + "Extras"]
<li>
<h3>
<a rel="bookmark" href="#${profileDivId}" title="${result.label}">
<dfn style="width:${scoreWidth};"><strong>${result.label}</strong></dfn>
</a>
</h3>
...
[#if contentCollectionText?exists]
[@cms.contentNodeIterator contentNodeCollectionName=contentCollectionText]
[@cms.includeTemplate/]
[/@cms.contentNodeIterator]
[/#if]
[@cms.newBar contentNodeCollectionName=contentCollectionText paragraph="stkTextImage, stkTeaserGroup" /]
...
</li>
[/#list]
</ul>
</div><!-- end super-list -->
34
WEBINAR
CAMPBELL
EWALD
35
QUESTIONS
WEBINAR
CAMPBELL
EWALD
CONTACT INFO
MATT	
  DERTINGER	
  SOLUTIONS	
  ARCHITECT,	
  INTERACTIVE	
  R&D,	
  CE	
  DETROIT
CAMPBELL	
  EWALD
Twi9er:	
  @ma9nolia
SEAN	
  MCMAINS	
  SALES	
  ENGINEER
MAGNOLIA	
  CMS
sean.mcmains@magnolia-­‐cms.com
TOBIAS	
  MATTSSON	
  SENIOR	
  SOFTWARE	
  ENGINEER	
  &	
  BLOSSOM	
  DEVELOPER
MAGNOLIA	
  CMS
tobias.ma9sson@magnolia-­‐cms.com
36
WEBINAR
CAMPBELL
EWALD
FURTHER READING
Visit the Magnolia documentation site to download Magnolia and find tutorials and guides
http://documentation.magnolia-cms.com/index.html
The Blossom reference documentation
http://documentation.magnolia-cms.com/modules/blossom.html
Blossom Sample Webapp
http://documentation.magnolia-cms.com/modules/blossom.html#GettingStarted
Tobias Mattsson's blog
http://tobias-mattsson-magnolia.blogspot.com/
Ask your questions and see what others are doing at the Magnolia community forum
http://forum.magnolia-cms.com/forum.html
37

More Related Content

Similar to US NAVY Slideshare Spring APPS

Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013Min Fang
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
Bee brief-intro-q42016
Bee brief-intro-q42016Bee brief-intro-q42016
Bee brief-intro-q42016wahyu prayudo
 
Stripes RJUG March 2012
Stripes RJUG March 2012Stripes RJUG March 2012
Stripes RJUG March 2012timstone
 
Time to Talk about Data Mesh
Time to Talk about Data MeshTime to Talk about Data Mesh
Time to Talk about Data MeshLibbySchulze
 
Professional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPProfessional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPSeanHolmesby1
 
Analysts Brief VMware and CA on Enterprise Management Challenges
Analysts Brief VMware and CA on Enterprise Management Challenges Analysts Brief VMware and CA on Enterprise Management Challenges
Analysts Brief VMware and CA on Enterprise Management Challenges Carl Terrantroy
 
Democratizing the Cloud with Open Source Cloud Development
Democratizing the Cloud with Open Source Cloud DevelopmentDemocratizing the Cloud with Open Source Cloud Development
Democratizing the Cloud with Open Source Cloud DevelopmentIntel Corporation
 
VMware vFabric - Webinar with CIO Magazine
VMware vFabric - Webinar with CIO MagazineVMware vFabric - Webinar with CIO Magazine
VMware vFabric - Webinar with CIO MagazineAl Sargent
 
Deployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA SolutionsDeployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA SolutionsNic Swart
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaMagnolia
 
Vijay koul Resume_Java old
Vijay koul Resume_Java oldVijay koul Resume_Java old
Vijay koul Resume_Java oldvijay koul
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile WebDynatrace
 
Zero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesZero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesWojciech Barczyński
 

Similar to US NAVY Slideshare Spring APPS (20)

Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Bee brief-intro-q42016
Bee brief-intro-q42016Bee brief-intro-q42016
Bee brief-intro-q42016
 
Stripes RJUG March 2012
Stripes RJUG March 2012Stripes RJUG March 2012
Stripes RJUG March 2012
 
CI/CD for Modern Applications
CI/CD for Modern ApplicationsCI/CD for Modern Applications
CI/CD for Modern Applications
 
Trinada pabolu profile
Trinada pabolu profileTrinada pabolu profile
Trinada pabolu profile
 
Mallesh Aruri
Mallesh AruriMallesh Aruri
Mallesh Aruri
 
Time to Talk about Data Mesh
Time to Talk about Data MeshTime to Talk about Data Mesh
Time to Talk about Data Mesh
 
Professional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPProfessional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XP
 
Analysts Brief VMware and CA on Enterprise Management Challenges
Analysts Brief VMware and CA on Enterprise Management Challenges Analysts Brief VMware and CA on Enterprise Management Challenges
Analysts Brief VMware and CA on Enterprise Management Challenges
 
Democratizing the Cloud with Open Source Cloud Development
Democratizing the Cloud with Open Source Cloud DevelopmentDemocratizing the Cloud with Open Source Cloud Development
Democratizing the Cloud with Open Source Cloud Development
 
VMware vFabric - Webinar with CIO Magazine
VMware vFabric - Webinar with CIO MagazineVMware vFabric - Webinar with CIO Magazine
VMware vFabric - Webinar with CIO Magazine
 
Trinada pabolu profile
Trinada pabolu profileTrinada pabolu profile
Trinada pabolu profile
 
Deployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA SolutionsDeployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA Solutions
 
Amarjit Resume
Amarjit ResumeAmarjit Resume
Amarjit Resume
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and Magnolia
 
Vijay koul Resume_Java old
Vijay koul Resume_Java oldVijay koul Resume_Java old
Vijay koul Resume_Java old
 
Narmada Kannan_Resume
Narmada Kannan_ResumeNarmada Kannan_Resume
Narmada Kannan_Resume
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web
 
Zero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesZero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with Kubernetes
 

More from Cara Lynn Mallow

Helping female veterans with housing
Helping female veterans with housing Helping female veterans with housing
Helping female veterans with housing Cara Lynn Mallow
 
Female veterans and post traumatic stress disorder
Female veterans and post traumatic stress disorderFemale veterans and post traumatic stress disorder
Female veterans and post traumatic stress disorderCara Lynn Mallow
 
Female US Military Veterans Jobs And Challenges
Female US Military Veterans Jobs And ChallengesFemale US Military Veterans Jobs And Challenges
Female US Military Veterans Jobs And ChallengesCara Lynn Mallow
 
UsNavy Nutrition & Excercise
UsNavy Nutrition & Excercise UsNavy Nutrition & Excercise
UsNavy Nutrition & Excercise Cara Lynn Mallow
 
Memorial Day 2016 slideshare
Memorial Day 2016 slideshareMemorial Day 2016 slideshare
Memorial Day 2016 slideshareCara Lynn Mallow
 
Military Veteran staffing slideshare
Military Veteran staffing slideshareMilitary Veteran staffing slideshare
Military Veteran staffing slideshareCara Lynn Mallow
 
Remembering our mil veterans slide
Remembering our mil veterans slideRemembering our mil veterans slide
Remembering our mil veterans slideCara Lynn Mallow
 
US Military Veterans Health Admin
US Military Veterans Health AdminUS Military Veterans Health Admin
US Military Veterans Health AdminCara Lynn Mallow
 
US Military Veterans Resources
US Military Veterans ResourcesUS Military Veterans Resources
US Military Veterans ResourcesCara Lynn Mallow
 
US military presence global info slideshare
US military presence global info slideshareUS military presence global info slideshare
US military presence global info slideshareCara Lynn Mallow
 
Hire USMilitary Veterans Hire Vets
Hire USMilitary Veterans Hire VetsHire USMilitary Veterans Hire Vets
Hire USMilitary Veterans Hire VetsCara Lynn Mallow
 

More from Cara Lynn Mallow (15)

Helping female veterans with housing
Helping female veterans with housing Helping female veterans with housing
Helping female veterans with housing
 
Female veterans and post traumatic stress disorder
Female veterans and post traumatic stress disorderFemale veterans and post traumatic stress disorder
Female veterans and post traumatic stress disorder
 
Female US Military Veterans Jobs And Challenges
Female US Military Veterans Jobs And ChallengesFemale US Military Veterans Jobs And Challenges
Female US Military Veterans Jobs And Challenges
 
UsNavy Nutrition & Excercise
UsNavy Nutrition & Excercise UsNavy Nutrition & Excercise
UsNavy Nutrition & Excercise
 
Memorial Day 2016 slideshare
Memorial Day 2016 slideshareMemorial Day 2016 slideshare
Memorial Day 2016 slideshare
 
Military Veteran staffing slideshare
Military Veteran staffing slideshareMilitary Veteran staffing slideshare
Military Veteran staffing slideshare
 
Hiring Military Veterans
Hiring Military VeteransHiring Military Veterans
Hiring Military Veterans
 
Supporting Our Veterans
Supporting Our Veterans Supporting Our Veterans
Supporting Our Veterans
 
Remembering our mil veterans slide
Remembering our mil veterans slideRemembering our mil veterans slide
Remembering our mil veterans slide
 
US Military Veterans Health Admin
US Military Veterans Health AdminUS Military Veterans Health Admin
US Military Veterans Health Admin
 
US Military Veterans Resources
US Military Veterans ResourcesUS Military Veterans Resources
US Military Veterans Resources
 
US military presence global info slideshare
US military presence global info slideshareUS military presence global info slideshare
US military presence global info slideshare
 
Hire USMilitary Veterans Hire Vets
Hire USMilitary Veterans Hire VetsHire USMilitary Veterans Hire Vets
Hire USMilitary Veterans Hire Vets
 
Navy RTC Slideshare
Navy RTC SlideshareNavy RTC Slideshare
Navy RTC Slideshare
 
Jesus slideshare1
Jesus slideshare1Jesus slideshare1
Jesus slideshare1
 

Recently uploaded

(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...ranjana rawat
 
2024 Zoom Reinstein Legacy Asbestos Webinar
2024 Zoom Reinstein Legacy Asbestos Webinar2024 Zoom Reinstein Legacy Asbestos Webinar
2024 Zoom Reinstein Legacy Asbestos WebinarLinda Reinstein
 
2024: The FAR, Federal Acquisition Regulations - Part 29
2024: The FAR, Federal Acquisition Regulations - Part 292024: The FAR, Federal Acquisition Regulations - Part 29
2024: The FAR, Federal Acquisition Regulations - Part 29JSchaus & Associates
 
Climate change and safety and health at work
Climate change and safety and health at workClimate change and safety and health at work
Climate change and safety and health at workChristina Parmionova
 
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...aartirawatdelhi
 
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...Suhani Kapoor
 
WIPO magazine issue -1 - 2024 World Intellectual Property organization.
WIPO magazine issue -1 - 2024 World Intellectual Property organization.WIPO magazine issue -1 - 2024 World Intellectual Property organization.
WIPO magazine issue -1 - 2024 World Intellectual Property organization.Christina Parmionova
 
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Global debate on climate change and occupational safety and health.
Global debate on climate change and occupational safety and health.Global debate on climate change and occupational safety and health.
Global debate on climate change and occupational safety and health.Christina Parmionova
 
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceCunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceHigh Profile Call Girls
 
Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...ResolutionFoundation
 
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxxIncident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxxPeter Miles
 
Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024ARCResearch
 
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
2024: The FAR, Federal Acquisition Regulations - Part 27
2024: The FAR, Federal Acquisition Regulations - Part 272024: The FAR, Federal Acquisition Regulations - Part 27
2024: The FAR, Federal Acquisition Regulations - Part 27JSchaus & Associates
 

Recently uploaded (20)

Rohini Sector 37 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 37 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 37 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 37 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(NEHA) Bhosari Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
 
2024 Zoom Reinstein Legacy Asbestos Webinar
2024 Zoom Reinstein Legacy Asbestos Webinar2024 Zoom Reinstein Legacy Asbestos Webinar
2024 Zoom Reinstein Legacy Asbestos Webinar
 
2024: The FAR, Federal Acquisition Regulations - Part 29
2024: The FAR, Federal Acquisition Regulations - Part 292024: The FAR, Federal Acquisition Regulations - Part 29
2024: The FAR, Federal Acquisition Regulations - Part 29
 
Climate change and safety and health at work
Climate change and safety and health at workClimate change and safety and health at work
Climate change and safety and health at work
 
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
 
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...
VIP Call Girls Service Bikaner Aishwarya 8250192130 Independent Escort Servic...
 
WIPO magazine issue -1 - 2024 World Intellectual Property organization.
WIPO magazine issue -1 - 2024 World Intellectual Property organization.WIPO magazine issue -1 - 2024 World Intellectual Property organization.
WIPO magazine issue -1 - 2024 World Intellectual Property organization.
 
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service
(TARA) Call Girls Chakan ( 7001035870 ) HI-Fi Pune Escorts Service
 
Global debate on climate change and occupational safety and health.
Global debate on climate change and occupational safety and health.Global debate on climate change and occupational safety and health.
Global debate on climate change and occupational safety and health.
 
The Federal Budget and Health Care Policy
The Federal Budget and Health Care PolicyThe Federal Budget and Health Care Policy
The Federal Budget and Health Care Policy
 
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceCunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
 
Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...
 
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxxIncident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
 
Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024
 
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service
(VASUDHA) Call Girls Balaji Nagar ( 7001035870 ) HI-Fi Pune Escorts Service
 
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service
(SHINA) Call Girls Khed ( 7001035870 ) HI-Fi Pune Escorts Service
 
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Rajgurunagar ( 7001035870 ) HI-Fi Pune Escorts Service
 
2024: The FAR, Federal Acquisition Regulations - Part 27
2024: The FAR, Federal Acquisition Regulations - Part 272024: The FAR, Federal Acquisition Regulations - Part 27
2024: The FAR, Federal Acquisition Regulations - Part 27
 

US NAVY Slideshare Spring APPS

  • 1. US NAVY INTEGRATES SPRING APPS WITH FLYING COLORS THANKS TO WEB CMS +
  • 2. WEBINAR CAMPBELL EWALD ABOUT THE WEBINAR Posting Questions Viewing the recorded webinar and related materials Contacting Us Tweeting - use hash tags: #magnolia_cms #campbellewald #springframework #springmvc #USNavy 2
  • 3. WEBINAR CAMPBELL EWALD ABOUT US MATT  DERTINGER  SOLUTIONS  ARCHITECT,  INTERACTIVE  R&D,  CE  DETROIT CAMPBELL  EWALD Twi9er:  @ma9nolia SEAN  MCMAINS  SALES  ENGINEER MAGNOLIA  CMS sean.mcmains@magnolia-­‐CMS.com TOBIAS  MATTSSON  SENIOR  SOFTWARE  ENGINEER  &  BLOSSOM  DEVELOPER MAGNOLIA  CMS tobias.ma9sson@magnolia-­‐cms.com 3
  • 4. WEBINAR CAMPBELL EWALD ABOUT CAMPBELL EWALD AND MAGNOLIA CAMPBELL EWALD Digital Agency Magnolia Partner General Motors, Kaiser Permanente, US Postal Service Magnolia Java-based Content Management System Community and Enterprise Editions Sony, Deloitte,Airbus and JBoss 4
  • 5. WEBINAR CAMPBELL EWALD WHAT WE’LL TALK ABOUT Overview of Magnolia Blossom module Navy Use Cases Step-by-Step Walkthrough Questions 5
  • 7. WEBINAR CAMPBELL EWALD A LITTLE PHILOSOPHY 7 The idea that sparked me writing the Blossom Module for Magnolia CMS was to bring the CMS and especially the content into Spring Web MVC not the other way around. Controllers should be the building blocks when composing pages. –Tobias Mattsson http://tobias-mattsson-magnolia.blogspot.com/2011/03/spring-web-mvc-with-content.html
  • 8. WEBINAR CAMPBELL EWALD WHAT’S BLOSSOM Spring integration module for Magnolia CMS Spring Web MVC with Content Key features: Annotation based API Spring controllers exposed as template components Pre-execution of template components 8
  • 9. WEBINAR CAMPBELL EWALD WHY USE BLOSSOM Leverages proven Spring Framework Easily integrate or migrate existing Spring-based applications Spring developers will feel right at home Dynamic dialogs,Virtual URI Mappings, Pre-execution Easily access content in controllers Best practice web app design patterns (MVC, IoC,AOP) Open Source and Free to download and use 9
  • 11. WEBINAR CAMPBELL EWALD ABOUT NAVY.COM Official recruitment Website for the U.S. Navy Redesigned in 2010, moved to Magnolia CMS Application integration for subscription services, CRUD functionality and user-space applications 11
  • 12. WEBINAR CAMPBELL EWALD BLOSSOM + RESTEASY RESTEasy provided nice JAX-RS client Aligned with Magnolia CMS roadmap Allowed business components to be loosely- coupled to CMS 12 Navy Web Service Registry Business Component 1 Business Component 2 Business Component 3 Business Component n Navy.com Navy Custom Module Blossom
  • 13. WEBINAR CAMPBELL EWALD BLOSSOM EXAMPLES Request More Information (Lead) Forms Find a Recruiter Subscriber Life Ops Reserve Pay Calculator Training Locations Map Poll 13
  • 14. WEBINAR CAMPBELL EWALD FIND A RECRUITER Finds the nearest Enlisted and Officer Recruiter Locations based on the postal code entered by the site visitor Collect and validate input, call Navy Web Service, display results. 14
  • 15. WEBINAR CAMPBELL EWALD LIFE OPS Personality Profile Test to help potential recruits plan their future Wizard type interface Collect and validate selected options from site visitor, populate model, then calculate and display results 15
  • 16. WEBINAR CAMPBELL EWALD STANDARD TEMPLATING KIT The STK is a production- ready website construction framework. • Best Practices • Rapid Prototyping • Modular Architecture • Extensible • Standards-Compliant 16
  • 18. WEBINAR CAMPBELL EWALD GETTING STARTED Starting Spring - Add the Blossom Servlet Context Listener to your web.xml <listener> <listener-class>info.magnolia.module.blossom.support.ServletContextExposingContextListener</listener-class> </listener> Create a module for your custom Spring application components, quickest way: $ mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/groups/public/ Have your module class extend BlossomModuleSupport and implement start and stop methods: public class BlossomSampleModule extends BlossomModuleSupport implements ModuleLifecycle { public void start(ModuleLifecycleContext moduleLifecycleContext) { initRootWebApplicationContext("classpath:/applicationContext.xml"); initBlossomDispatcherServlet("blossom", "classpath:/blossom-servlet.xml"); } public void stop(ModuleLifecycleContext moduleLifecycleContext) { destroyDispatcherServlets(); closeRootWebApplicationContext(); } } 18
  • 19. WEBINAR CAMPBELL EWALD SPRING BEAN CONFIGURATION Create a Spring bean config file called applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:blossom="http://www.magnolia-cms.com/schema/blossom" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.magnolia-cms.com/schema/blossom http://www.magnolia-cms.com/schema/blossom-1.2.xsd"> <blossom:configuration /> </beans> 19
  • 20. WEBINAR CAMPBELL EWALD SPRING BEAN CONFIGURATION Create a Spring bean config file called blossom-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="..."> <context:annotation-config /> <context:component-scan base-package="com.c_e.webinar.magnolia.module.blossomsample" use-default-filters="false"> <context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.Paragraph" /> <context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.Template" /> <context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.DialogFactory" /> <context:include-filter type="annotation" expression="info.magnolia.module.blossom.annotation.VirtualURIMapper" /> <context:include-filter type="assignable" expression="info.magnolia.cms.beans.config.VirtualURIMapping" /> </context:component-scan> ... </beans> 20
  • 21. WEBINAR CAMPBELL EWALD SPRING BEAN CONFIGURATION Add Spring Handler Adapters and Mappings to blossom-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans ...> ... <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="customArgumentResolver"> <bean class="info.magnolia.module.blossom.web.BlossomWebArgumentResolver" /> </property> </bean> <bean class="info.magnolia.module.blossom.preexecution.BlossomHandlerMapping"> <property name="targetHandlerMappings"> <list> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="useDefaultSuffixPattern" value="false" /> </bean> <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /> </list> </property> </bean> ... </beans> 21
  • 22. WEBINAR CAMPBELL EWALD SPRING BEAN CONFIGURATION Add SpringView Resolvers to blossom-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans...> ... <bean class="info.magnolia.module.blossom.view.UuidRedirectViewResolver"> <property name="order" name="1" /> </bean> <bean class="info.magnolia.module.blossom.view.TemplateViewResolver"> <property name="order" name="2" /> <property name="prefix" name="/ce-webinar-templating-kit/templates/blossomsamples" /> <property name="suffix" name=".ftl" /> <property name="viewRenderer"> <bean class="info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer" /> </property> </bean> <bean class="info.magnolia.module.blossom.view.ParagraphViewResolver"> <property name="order" name="3" /> <property name="prefix" name="/ce-webinar-templating-kit/paragraphs/blossomsamples" /> <property name="suffix" name=".ftl" /> <property name="viewRenderer"> <bean class="info.magnolia.module.blossom.view.FreemarkerParagraphViewRenderer" /> </property> </bean> </beans> 22
  • 23. WEBINAR CAMPBELL EWALD LIFE OPS MODEL Uses BeanValidation API (JSR 303) Excerpt: public class LifeOps implements Serializable { ... @NotNull @Min(0) @Max(18) private Integer advisor; ... @NotNull @Min(0) @Max(18) private Integer doer; ... } 23
  • 24. WEBINAR CAMPBELL EWALD LIFE OPS MODEL Add in bean validation support to blossom-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans ...> ... <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> ... <property name="webBindingInitializer"> <bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"> <property name="validator" ref="validator" /> </bean> </property> </bean> <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" /> ... </beans> 24
  • 25. WEBINAR CAMPBELL EWALD LIFE OPS MODEL Constructor public LifeOps(Integer advisor, Integer doer, Integer innovator, Integer persuader, Integer planner, Integer problemSolver) { this.advisor = advisor; this.doer = doer; this.innovator = innovator; this.persuader = persuader; this.planner = planner; this.problemSolver = problemSolver; } Constructor using transients: public LifeOps(String[] activities, String[] interests, String[] careers) { this.activities = activities; this.interests = interests; this.careers = careers; this.resetScores(); this.calculateScores(activities); this.calculateScores(interests); this.calculateScores(careers); } 25
  • 26. WEBINAR CAMPBELL EWALD LIFE OPS SPRING VALIDATOR public class LifeOpsValidator implements Validator { @Override public boolean supports(Class<?> clazz) { return LifeOps.class.isAssignableFrom(clazz); } @Override public void validate(Object target, Errors errors) { LifeOps lifeOps = (LifeOps) target; if (lifeOps.getActivities() == null || lifeOps.getActivities().length == 0) { errors.rejectValue("activities", "activities.required", "Please choose at least one activity before proceeding."); } if (lifeOps.getInterests() == null || lifeOps.getInterests().length == 0) { errors.rejectValue("interests", "interests.required", "Please choose at least one interest before proceeding."); } if (lifeOps.getCareers() == null || lifeOps.getCareers().length == 0) { errors.rejectValue("careers", "careers.required", "Please choose at least one career before proceeding."); } } } 26
  • 27. WEBINAR CAMPBELL EWALD LIFE OPS CONTROLLER @Controller @RequestMapping("/life-ops") @Paragraph("Life Ops form") @ParagraphDescription("Adds a Life Ops form and displays Life Ops Results") @I18nBasename("com.c_e.webinar.magnolia.module.blossomsample.messages") public class LifeOpsController { private static final Logger log = LoggerFactory.getLogger(LifeOpsController.class); private final String LIFE_OPS_FORM_PATH = "life-ops/form"; private final String LIFE_OPS_SHOW_PATH = "life-ops/show"; @Autowired private Validator validator; @RequestMapping(method = RequestMethod.GET) public String form(LifeOps lifeOps) { return LIFE_OPS_FORM_PATH; } ... } 27
  • 28. WEBINAR CAMPBELL EWALD LIFE OPS CONTROLLER @RequestMapping(method = RequestMethod.POST) public String processSubmit(@Valid LifeOps lifeOps, BindingResult result, Model model) { new LifeOpsValidator().validate(lifeOps, result); if (result.hasErrors()) { List<FieldError> fieldErrors = result.getFieldErrors(); Map<String, String> errorsMap = new HashMap<String, String>(); for (int i = 0; i < fieldErrors.size(); i++) { FieldError thisError = fieldErrors.get(i); errorsMap.put(thisError.getField(), thisError.getDefaultMessage() ); } lifeOps.setErrors(errorsMap); model.addAttribute("lifeOps", lifeOps); return LIFE_OPS_FORM_PATH; } else { lifeOps = new LifeOps(lifeOps.getActivities(), lifeOps.getInterests(), lifeOps.getCareers() ); model.addAttribute("lifeOps", lifeOps); return "redirect:/" + STKUtil.getSite().getName() + "/life-ops/results" + "/" + lifeOps.getAdvisor() + "/" + lifeOps.getDoer() + "/" + lifeOps.getInnovator() + "/" + lifeOps.getPersuader() + "/" + lifeOps.getPlanner() + "/" + lifeOps.getProblemSolver(); } } 28
  • 29. WEBINAR CAMPBELL EWALD LIFE OPS CONTROLLER @RequestMapping(method = RequestMethod.GET, params = "advisor") public String show( @RequestParam Integer advisor, @RequestParam Integer doer, @RequestParam Integer innovator, @RequestParam Integer persuader, @RequestParam Integer planner, @RequestParam Integer problemSolver, Model model) { try { LifeOps lifeOps = new LifeOps(advisor, doer, innovator, persuader, planner, problemSolver); model.addAttribute("lifeOps", lifeOps); } catch (Exception e) { log.error("LifeOpsController.show() Exception:" + e); } return LIFE_OPS_SHOW_PATH; } 29
  • 30. WEBINAR CAMPBELL EWALD LIFE OPS CONTROLLER @TabFactory("Settings") public void addTab(TabBuilder builder) { builder.addEdit("activitiesText", "Activities Text", "A short description for the activities fieldset"); builder.addEdit("interestsText", "Interests Text", "A short description for the interests fieldset"); builder.addEdit("careersText", "Careers Text", "A short description for the interests fieldset"); builder.addFckEditor("resultsText", "Results Text", "A short intro for the results page"); } 30
  • 31. WEBINAR CAMPBELL EWALD LIFE OPS VIRTUAL URI MAPPING @VirtualURIMapper public class LifeOpsURIMapper { private Pattern pattern; public LifeOpsURIMapper() { this.pattern = Pattern.compile("^/life-ops/results/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]? [0-8])/([0-1]?[0-8])/?"); } public String mapping(String uri, HttpServletRequest request) { this.pattern = Pattern.compile("^/(" + STKUtil.getSite().getName() + "/)?life-ops/results/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]?[0-8])/([0-1]? [0-8])/?"); Matcher matcher = pattern.matcher(uri); if (matcher.matches()) { return matcher.replaceAll("forward:/" + STKUtil.getSite().getName() + "/life-ops/results/?advisor=$2&doer=$3&innovator=$4&persuader=$5&planner=$6&problemSolver=$7"); } return null; } } 31
  • 32. WEBINAR CAMPBELL EWALD LIFE OPS FORM VIEW [#assign cms=JspTaglibs["cms-taglib"]] [#assign form=JspTaglibs["http://www.springframework.org/tags/form"]] <div> [@cms.editBar /] [@form.form id="life-ops-form" modelAttribute="lifeOps"] ... <fieldset> <legend>Activities</legend> ... <dl class="prop"> <dt><span>What do you like to do?</span></dt> <dd class="value"> <ul> <li> <input id="activities1" name="activities" value="D" type="checkbox" /> <label for="activities1"><strong>Set up a home computer network</strong></label> </li> <li> <input id="activities2" name="activities" value="S" type="checkbox" /> <label for="activities2"><strong>Track the path of a hurricane</strong></label> </li> ... </ul> </dd> </dl> </fieldset> 32
  • 33. WEBINAR CAMPBELL EWALD LIFE OPS RESULTS VIEW [#assign results = [ {"name": "problemSolver", "label": "Problem Solver", "score": lifeOps.problemSolver}, {"name": "planner", "label": "Planner", "score": lifeOps.planner}, {"name": "persuader", "label": "Persuader", "score": lifeOps.persuader}, {"name": "innovator", "label": "Innovator", "score": lifeOps.innovator}, {"name": "doer", "label": "Do-er", "score": lifeOps.doer}, {"name": "advisor", "label": "Advisor", "score": lifeOps.advisor} ]] ... 33
  • 34. WEBINAR CAMPBELL EWALD LIFE OPS RESULTS VIEW <div class="super-list"> [@cms.editBar /] <ul> [#list results?sort_by("score")?reverse as result] [#assign profileDivId = result.label?lower_case?trim?replace(' ', '-')] [#assign scoreWidth = (result.score/2)*11+"%"] [#assign contentCollectionText = result.name + "Text"] [#assign contentCollectionExtras = result.name + "Extras"] <li> <h3> <a rel="bookmark" href="#${profileDivId}" title="${result.label}"> <dfn style="width:${scoreWidth};"><strong>${result.label}</strong></dfn> </a> </h3> ... [#if contentCollectionText?exists] [@cms.contentNodeIterator contentNodeCollectionName=contentCollectionText] [@cms.includeTemplate/] [/@cms.contentNodeIterator] [/#if] [@cms.newBar contentNodeCollectionName=contentCollectionText paragraph="stkTextImage, stkTeaserGroup" /] ... </li> [/#list] </ul> </div><!-- end super-list --> 34
  • 36. WEBINAR CAMPBELL EWALD CONTACT INFO MATT  DERTINGER  SOLUTIONS  ARCHITECT,  INTERACTIVE  R&D,  CE  DETROIT CAMPBELL  EWALD Twi9er:  @ma9nolia SEAN  MCMAINS  SALES  ENGINEER MAGNOLIA  CMS sean.mcmains@magnolia-­‐cms.com TOBIAS  MATTSSON  SENIOR  SOFTWARE  ENGINEER  &  BLOSSOM  DEVELOPER MAGNOLIA  CMS tobias.ma9sson@magnolia-­‐cms.com 36
  • 37. WEBINAR CAMPBELL EWALD FURTHER READING Visit the Magnolia documentation site to download Magnolia and find tutorials and guides http://documentation.magnolia-cms.com/index.html The Blossom reference documentation http://documentation.magnolia-cms.com/modules/blossom.html Blossom Sample Webapp http://documentation.magnolia-cms.com/modules/blossom.html#GettingStarted Tobias Mattsson's blog http://tobias-mattsson-magnolia.blogspot.com/ Ask your questions and see what others are doing at the Magnolia community forum http://forum.magnolia-cms.com/forum.html 37