Roller - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Roller

Description:

Xdoclet is a code generator. A Javadoc extension called a doclet ... STEP 1: Unpack the downloaded ZIP or TAR file. STEP 2: Create Roller tables in your database ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 30
Provided by: michae130
Category:
Tags: code | finder | roller | zip

less

Transcript and Presenter's Notes

Title: Roller


1
Roller
  • A weblog crafted with design patterns and
    open-source Java components

2
Agenda
  • History of Weblogs
  • Roller Architecture
  • Using Roller
  • Roller Toolset

3
History of Weblogs
  • Weblogs are often-updated sites that point to
    articles elsewhere on the web, often with
    comments, and to on-site articles. A weblog is
    kind of a continual tour, with a human guide who
    you get to know. There are many guides to choose
    from, each develops an audience, and there's also
    comraderie and politics between the people who
    run weblogs, they point to each other, in all
    kinds of structures, graphs, loops, etc.
  • From The History of Weblogs, by Dave Winer
    http//newhome.weblogs.com/historyOfWeblogs

4
History of Roller
  • Roller was originally written by a clever
    developer named David Johnson
  • Dave generously made Roller into an open-source
    project
  • Dave also wrote a smart article in OnJava mag
    called Building an Open Source J2EE Weblogger
  • Dave Lance Matt Anthony Mindaugas and are
    the core team

5
Roller Architecturefeatures
  • Maintain a weblog, with user-defined categories
  • Publish your weblog as an RSS news feed
  • Maintain a collection of favorite bookmarks,
    organized by bookmark folders
  • Maintain a collection of favorite RSS news feeds
  • Define a set of Web pages to display your weblog,
    bookmarks, and news feeds.

6
Roller Users
  • Readers anonymous visitors to the website
  • Editors have accounts, must log in with username
    and password. Can edit weblog entries,
    bookmarks, newsfeeds, and page templates.

7
Roller Web Page Nav Tree
8
Roller Architecture in UML
9
Roller Architecture
  • Presentation tier is Model View Controller
  • The model implements the interfaces in the
    org.roller.model package, using the Castor JDO
    persistence framework
  • The view uses JSP, Servlets and Velocity page
    templates
  • The controller is Struts

10
Business tier uses Castor
  • Castor is an object-relational mapping framework
    from www.exolab.org
  • Map Java classes to database tables
  • Castor uses its own OQL object query language.
    Similar to Java Data Objects
  • Use OQL as SQL and receive Java result sets as
    collections of Java objects

11
Business tier uses Castor
  • identity"id" access"shared" key-generator"UUID"
    auto-complete"false"

  • d
  • ield
  • eld
  • ld
  • ...

12
Using Castor
  • // Construct a new query and bind its parameters
  • String query "SELECT p FROM BookmarkData p
    WHERE websiteId"
  • OQLQuery oql db.getOQLQuery( query )
  • oql.bind( websiteId )
  • // Retrieve results and print each one
  • QueryResults results oql.execute()
  • while ( results.hasMore() )
  • BookmarkData bookmark (BookmarkData)results.n
    ext() System.out.println( bookmark.toString()
    )

13
Roller uses XDoclet
  • Xdoclet is a code generator
  • A Javadoc extension called a doclet
  • Xdoclet uses Javadoc tags in your code to
    generate code to
  • Support classes (home/remote interfaces, etc for
    beans)
  • XML mapping files (classes to tables)
  • Deployment descriptors (help deploy classes

14
Xdoclet example
  • /
  • This is the Account entity bean. It is an
    example of how to use the
  • EJBDoclet tags.
  • _at_see Customer
  • _at_ejb.bean
  • name"bank/Account"
  • type"CMP"
  • jndi-name"ejb/bank/Account"
  • local-jndi-name"ejb/bank/LocalAccount"
  • primkey-field"id"
  • _at_ejb.finder
  • signature"java.util.Collection findAll()"
  • unchecked"true"
  • _at_ejb.transaction
  • type"Required"

15
Roller uses XDoclet
16
Roller uses Struts and Velocity
  • Struts is an open-source servlet MVC framework
  • Model is javabeans that hold data
  • View is JSP pages
  • Controller is a servlet and action classes to
    perform the requests

17
Roller Struts Edit-bookmark
18
Roller/Struts process flow
  • Roller Struts controller recs a req to perform
    an action. Uses URI to look up action (e.g.
    BookmarkFormAction
  • Controller dispatches request to appropriate
    method of Action class BookmarkFormAction.edit()
  • BookmarkFormAction calls BookmarkManager to
    retrieve info to be edited
  • BookmarkFormAction creates a bean that holds data
    for the JSP page
  • BookmarkFormAction forwards request to
    edit-bookmark.jsp so the HTML can be generated.
  • The Struts form tags read the data from the bean
    to populate the HTML form

19
Velocity and Roller
  • Velocity uses templates to generate code
  • Expressions begin with
  • macros.showWeblogCategoryChooser()
  • Expressions call JSP tags
  • org.roller.presentation.tags.NavigationTag
  • This expr. Calls the NavigationTag JSP

20
Velocity generates code
21
Roller Toolset
  • Castor Persistance Framework
  • Jakarta Ant XML-driven Java build tool
  • Jakarta Struts Servlet/JSP framework
  • Jakarta Tomcat Servlet/JSP Server
  • Jakarta Velocity code generator
  • Xerces XML Parser
  • Xdoclet Code Generator

22
Ant at the speed of light
  • Ant uses XML to describe
  • Projects name, def task, base directory
  • basedir"."
  • Targets a set of tasks to execute
  • "/
  • Tasks code that can be executed
  • task1.setFoo("bar")
  • Properties
  • builddir/classes.

23
Using Ant
  • basedir"."
  • simple example build file

24
Using Ant
  • description"compile the source "
  • description"generate the distribution"
  • jar" basedir"build"/
  • description"clean up"

25
Installing Roller
  • Prerequisites
  • Java SDK
  • Tomcat Servlet Engine
  • MySQL Database

26
Installing Roller
  • STEP 1 Unpack the downloaded ZIP or TAR file
  • STEP 2 Create Roller tables in your database
  • STEP 3 Download and install JDBC driver
  • STEP 4 Configure Roller's Servlet Context
  • STEP 5 Configure Roller before start-up
  • STEP 6 Start Tomcat and Roller

27
Resources
  • http//www.Rollerweblogger.org Roller homepage
  • http//www.onjava.com/pub/a/onjava/2002/04/17/wblo
    gosj2ee.html - OnJava.com article on Roller, by
    David Johnson
  • http//sourceforge.net/project/showfiles.php?group
    _id47722 - Roller code home at SourceForge
  • Castor - http//castor.exolab.org/castor
  • The Jakarta project - http//jakarta.apache.org
    (youll find Tomcat, Struts, Ant, Velocity and a
    lot more here)
  • Xdoclet at SourceForge http//xdoclet.sourceforg
    e.net/
  • MySQL open-source RDBMS http//www.mysql.com/
  • Weblogs - http//newhome.weblogs.com/historyOfWebl
    ogs
  • Java
  • Thinking in Java, by Bruce Eckel www.mindview.net
  • J2EE Design Patterns, by Floyd Marinescu
    www.theserverside.com
  • Mastering EJB, by Roman, et.al http//www.theserve
    rside.com/books/masteringEJB/index.jsp

28
Thank you!
  • Thanks to
  • Dave, Matt, Lance, Anthony and Mindaugas for
    Roller, the open-source weblog
  • Santa Fe Community College for giving GatorJUG
    a place to meet
  • www.myCGIserver.com - free GatorJUG.org website
    host
  • Greg Quedenfeld GatorJUG.org webmaster
  • Dan Lackey, Wes Lindberg and CyberSaints

29
GatorJUG
Write a Comment
User Comments (0)
About PowerShow.com