Instead of going with a traditional Java-only based stack, Dievision chose to integrate Magnolia CMS with (J)Ruby on Rails and to use Rails as the web development framework for its Magnolia-based sites.
In this session, will share some of our experiences with this approach. We will talk about the initial motivation and the differences the environment makes for a developer as well as for a team. You will learn about the practical aspects of the Java/Ruby co-existence, how to integrate Magnolia CMS with the Rails framework and how to work with JCR-based content from a Ruby perspective. Finally, we will cover some options of testing and deploying a site.
10. Invent as few wheels as possible
Leverage ready-made web-focussed solutions,
best practices and a large development community
11. Clie
nt-s
perf ide
Dependency orm
E-Mails opti ance
ching Management ing miza
Ca U nit Test tion
Templating ce Reu Integration
an
m g sable
or rin Comp Testing
P erf ito onents Hel pers/
on
M Ut ilites
Prototyping
/CSS Scalab
HTML ORM ility
roce ssors JavaScript
Prep Integration
F orms
AJAX
IDE/Editor Validation Dep
Sec loym
support VC urit ent
M y
22. Model View Controller
File-based
configuration
ActiveRecord-like JCR/
Object Mapper
JCR-Wrapper with Helpers to match the Magnolia/Rails “Base”
Ruby Semantics Taglib Controller
Utilities: Scheduler, Imaging, Testing, etc.
Magnolia Module for JRuby/Rack integration
31. app/models/templates/press_release.rb
class Templates::PressRelease
include Sinicum::Jcr::Base
scope :ordered, order("release_date desc", "order_day")
scope :for_homepage, ordered.where(:show_on_homepage => true).limit(2)
def title_homepage
title_short || title
end
end
42. spec/views/layouts/homepage.html.erb_spec.rb
describe "layouts/homepage.html.erb" do
before(:each) do
assign(:releases, [Factory(:sustainability_release)])
end
it "displays the title of a press release" do
render
rendered.should contain("Sustainability World Index")
end
end
spec/factories/templates/press_releases.rb
Factory.define :sustainability_release,
:class => Templates::PressRelease do |r|
r.title "Lorem ipsum Sustainability World Index dolor sit amet",
r.title_short "Sustainability World Index"
end
46. Very productive and “scalable” environment
Performance is just fine
Save/Reload vs. Save/Compile/Restart/Reload
You can refactor in a dynamic language
Collaboration is easier when everyone uses the
same tools