A Content-Management System written in Java using the best of the Java stack.
Many CMS systems are written in PHP.
Java brings robust, enterprise-ready power to the server.
Java ecosystem brings solid foundation like Spring, JSP, Freemarker and Groovy.
Great libraries and code already built.
Magnolia began in 1997 as a consulting company.
Built their own CMS tools to handle jobs for clients.
Released them as open source in 2003.
Growing partnerships with it ever since.
Magnolia has been through hundreds of releases, big and small.
5.0 comes in June.
Community Edition is Open Source(GPL). Enterprise comes with support.
These blocks (areas & components) can be tossed together in a static way.
The areas are designed for reuse. They're great for the blocks on the side of a page.
Stack them together like blocks of HTML.
Many of the standard tools like teasers and images are baked in.
MVC
You create Java objects for model and controller.
Use your standard Java database skills to populate it. (Default comes with DerbyDB.)
Templates format the data.
JSPs were once the main template.
Freemarker templates are favored by some.
Grails is new and evolving.
The Java backend converts your IP address into a location.
Magnolia CMS searches for articles about the location.
Template displays them in a component.
First we need to interaction with an API.
Let's use the jSoup library to parse some HTML.
Just include the dependency in Maven. (Java stack power!)
<dependency>
<!-- jsoup HTML parser library @ http://jsoup.org/ -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.6.3</version>
</dependency>
Now extract the IP address.
Dig through Magnolia to get the Servlet information,HttpServletRequest/
Java stack power!
String getIPAddress(){
WebContext c = MgnlContext.getWebContext();
String path = c.getContextPath();
HttpServletRequest request = c.getRequest();
String addr=request.getRemoteAddr();
if (CheckForLocalHostDuringDebugging){
addr=cleanseIPAddress(addr);
}
return addr;
}
192.168.1.1
The location API from ipinfodb.com takes an IP address as a parameter and returns a String separated by semi-colons.
Java stack power!
public String[] getParts(String addr){
String fetchMe=urlBase+addr;
Document doc;
try {
doc = Jsoup.connect(fetchMe).get();
String text=doc.text();
String[] parts=text.split(splittingCharacter);
return parts;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
"Reston Virginia"
Magnolia implements the Java Content Repository Standard
Search it with either SQL or Xpath like syntax.
Java stack power!
public Collection search(String s){
String q="select * from mgnl:content where contains(*,'"+s+"')";
Collection ans = QueryUtil.query("website", q);
return ans;
}
Converts "Reston Virginia" to a Collection.
Collection
[#assign cms=JspTaglibs["cms-taglib"]]
[@cms.editBar /]
[#list model.textsBasedUponIP as n]
<li> <a href="${mgnl.createLink(n)}">${n?node_type}
-- ${n.title}-- ${n.metaData.creationDate}-- ${n.@name}
-- ${n.@handle}-- ${n.@uuid}</a>
</li>
[/#list]
</ul>
(You can also use a JSP.)
Then the Java MVC is added as a component.
And then the components are placed where you want them.
You can preload templates for the user.
Makes it easy for plugins to migrate.
You can use Magnolia as a Grails plugin with Maglev.
All of the table-building CRUD power of Grails can be used in templates.
Version 5.0 is rewritten for mobile.
Touch events treated slightly differently than clicks.
Cleaner APIs and easier Theming
Slides can be nested inside of other slides, try pressing down.
Press down or up to navigate.
Cornify
That's it, time to go back up.
Press ESC to enter the slide overview. Hold down alt and click on any element to zoom in on it using zoom.js. Alt + click anywhere to zoom back out.
If you don't like writing slides in HTML you can use the online editor rvl.io.
Try it out! You can swipe through the slides and pinch your way to the overview.
You can select from different transitions, like:
Cube -
Page -
Concave -
Zoom -
Linear -
Fade -
None -
Default
Reveal.js comes with a few themes built in:
Sky -
Beige -
Simple -
Serif -
Night -
Default
* Theme demos are loaded after the presentation which leads to flicker. In production you should load your theme in the <head> using a <link>.
Set data-state="something" on a slide and "something"
will be added as a class to the document element when the slide is open. This lets you
apply broader style changes, like switching the background.
Additionally custom events can be triggered on a per slide basis by binding to the data-state name.
Reveal.addEventListener( 'customevent', function() {
console.log( '"customevent" has fired' );
} );
These guys come in two forms, inline:
The nice thing about standards is that there are so many to choose from
and block:
For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.
function linkify( selector ) {
if( supports3DTransforms ) {
var nodes = document.querySelectorAll( selector );
for( var i = 0, len = nodes.length; i < len; i++ ) {
var node = nodes[i];
if( !node.className ) ) {
node.className += ' roll';
}
};
}
}
Courtesy of highlight.js.
You can link between slides internally, like this.
Hit the next arrow...
... to step through ...
any typeThere's a few styles of fragments, like:
grow
shrink
roll-in
fade-out
highlight-red
highlight-green
highlight-blue
Presentations can be exported to PDF, below is an example that's been uploaded to SlideShare.
Press b or period on your keyboard to enter the 'paused' mode. This mode is helpful when you want to take distracting slides off the screen during a presentation.
reveal.js and rvl.io are entirely free but if you'd like to support the projects you can donate below. Donations will go towards hosting and domain costs.