0

Live Blogging – DotCMS Bootcamp Day 2

Posted April 15th, 2010 in DotCMS and tagged , , by cfalzone

Watch this space for updates today.

I will be missing the first session today :(  But stay tuned at 11:15 for updates from the Plugins Session.

Last night we decided to head to the 8 oz Burger for dinner.  There are not many Burger Joints I would feel comfortable getting a raw burger at, but this place was top notch.  Very good burgers.

9:30 – Surprise – I did get to attend the first session – Super Widget

  • Maria is presenting and they are setting everything up still
  • “Planning for flexible and reusable pulls”
  • Arnaud is presenting as well
  • Purpose of a widget
    • Minimize redundancy
    • Facilitate pulls for content editors
    • Permissioning
      • Widgets are Structures which have granular permissions
      • It is the admin’s job to make sure people can’t screw things up
  • Common Uses
    • Content listing
    • Detail Pages
    • Random Pulls
    • UI for a Macro
  • Widgets Overview
    • Can be added on any container
    • Parameters – fields on widget structure
    • Widget Code – Velocity code to be executed
  • Simple Widget -vs- Custom Widgets
    • Simple:  Just a title and the code – used forms, detail page, sitemap
    • Custom:  Parameters – used for pulls, reusable
  • When to create a widget
    • Rule of Thumb 1 – one widget structure per content structure
    • What Content do you need? -> create the structure (ex. news structure)
    • How does this need displayed? -> create the widget (ex. news listing widget)
    • Checklist for creating a widget
      • Wireframes as a foundation for structures
      • Identification of *all* dynamic pulls
      • Definition of Parameters
  • Arnaud is showing several examples, you can see some of these on the demo site:  http://demo.dotcms.org/
  • widget structure -vs- widget content
    • You create the structures and for each structure you can create the content items for your users to use.
  • Arnaud is wrapping up time for questions
  • Maria is showing us — when users change their minds — give them the parameters to change their minds.  If they decide they want the image bigger/smaller then they can change the parameters, if this was a macro or just a contentlet you would be modifying the code.
  • Have a show checkbox for each of the fields so if they don’t want an image they can turn them off
  • If you upgraded from pre-widgets then you didn’t get things like the simple widget and the pre built custom widgets.  You will get these in 1.9 when you upgrade.  Or if you want to see them now you can always copy from the demo site or deploy a starter site of your own,
  • If you started post-widgets then you get those things by default to start with
  • field names:  make them useful for your user not you.  don’t do fields like class names and so forth, just make a radio narrow/wide
  • Maria is demoing creating a structure
  • Now she is showing editing one to add a sort by field
    • Have the content structure open in another window while you are editing so you can see the field names
  • Use line dividers to separate fields into groups:  Pull Options, Display, RSS Feed Options

11:15 – Plugin Training Part 1 — don’t know how well I will do here, lots of information and I want to play with it :)  We’ll see how I do

  • Jason Tesser is presenting …
  • “How to extend and add functionality to the dotCMS”
  • Lots of flexibility and power, be careful, you can brick your system
  • Who can use plugins?
    • Sys Admins – Configuration
    • Java Developers – View tools and so forth
    • Web Developers – Macros/widgets and so forth
  • Deploying  a plugin means stoppin/starting the system
  • What can we do in plugins
    • Macros — New or overriding existing ones the right way
      • This is the only way to really override an existing dotCMS macro
    • Config
    • tinyMCE Config and adding plugins for tinyMCE
      • It is just some HTML but it is in a JSP so you can do things like show different things for different users
    • Velocity Tools
    • Custom Java
      • Override DotCMS java and libraries
      • New tooling, servlets, web services
    • JSP
    • Backend Tooling
      • Velocity / Struts/ or JSP Portlets
  • What’s really important about plugins for Jason — Understanding How it works and what it can do
  • Plugin Idea:  Create a UI to control tinyMCE based on user roles.
  • You don’t have to understand the java stack to create a viewtool.  All the API’s are there to do it for you.  It is very easy, not a scary thing
  • Plugin Idea:  Create a plugin to pull in your SIS or an external Database system as back-end tooling – portlet
  • Query Test Tool in 1.9 beta is a JSP portlet.
  • Eclipse is not that scary — just take some time to learn it
  • Example of an external system brought in via iframe and velocity portlet from @fienen:  http://ow.ly/1ySwb
  • How do they work?
    • Build/Compile
      • One of the primary weaknesses to deploying plugins you have to get to the filesystem
      • You need root access to do this
      • This is not changing in 1.9 but in 2.0 it might with OSGi
    • Deploy
      • By default plugins are deployed in reverse alpha
      • Plugins can overload themselves if you are not careful
      • You can specify the order by modifying the plugin configurations
      • Plugin names are the folders they are stored in and must be unique.  Of course you can’t create 2 folders with the same name, so that won’t be too hard to stick to
      • Don’t just delete a plugin without undeploying it first!!!
      • Your files are put in a JAR file and dropped in a place with your Libraries
      • in 1.7 tomcat was modified for the deploy to work — DotCMS 1.9 is totally different in this respect.  DotCMS can now deploy to potentially any other container as a war file.
    • Configuration
    • Properties
  • dotCMS Architecture
    • Current Status
      • DotCMS is not a new puppy.  This is why the old stuff is still around like old struts and hibernate.  The effort to change this would be huge and not beneficial to us as the customers.  What would be the value add?
      • DotCMS 1.7 has this problem — everything is cached in memory so it does not have to hit the DB.  Where this falls apart is when there is not enough room in memory it has to hit the db and this is expensive.
      • In 1.9 there is a new velocity library because we need the cache on disk to combat this problem
      • Jason is laughing about his use of little guys.  He calls every little component in dotcms a guy
      • These changes made to velocity engine are looking at going back to the velocity project
    • Future Development – New Architecture
      • Possibly upgrade Hibernate
      • Not going to upgrade struts
      • The code has been around a long time.  Some of it is better than others.   The older stuff doesn’t practice good MVC.  But changing this is really hard and again, what is the value for the customer?
    • Legacy -vs- New Code
      • Morale of the story is use the APIs
  • Alright the intro is over — stay tuned for the next session for part 2 for some depth into this info.

12:45 – Time for Lunch.  I am starvin!

2:15 – Plugin Training Part 2

  • Jason is reviewing part 1 now
  • Plugin Development
    • Viewtools
      • This is where you add new functionality for your pages.
      • When it can’t be done in just velocity.
      • When do you use viewtool or struts or Macro/Velocity?
        • It can be done many ways
        • Velocity is for spitting out content on a page
        • Computation and work is done in a viewtool
        • When it is inconvenient to do a viewtool then you need struts
        • When you do not really need to send to a page, just do some action.  Velocity always needs to go to a page
        • Jason can only think of using struts or servlets for handling a form
    • Macros
    • Struts / Servlet
      • Struts gives you the message guy for handling errors and validation and so forth
    • Portlets
  • Jason is showing us the hello world view tool
  • “Let your plugin guy handle that”
  • Viewtool Scope:
    • Request — every request he dies
    • Session — every web session he dies
    • Application — only one ever
  • Now he is showing the guy in action
  • “Always a good idea to throw velocity code in a simple widget”
  • plugins.xml is where you set the order your plugins are deployed is set.
  • If your plugin configuration is malformed it is going to deploy malformed
  • ant -p — displays all the ant targets
  • there is a .bat .sh script to help you deploy your plugins in the bin directory
  • You can run ant directly from eclipse by right-clicking the main build.xml > run as
  • Jason is going over the different Config files you can alter in plugins
    • Hiberbate mapping files — skipping these with a brief explanation of what they are and why
    • dotmarketing-config-ext.properties — modifies the main dotcms configuration
    • dwr-ext.xml — AJAX Library configuration – exposes Java classes to Javascript (Jason doesn’t like this — he uses jQuery load some html method)
    • Language-ext.properties — Language Variables for your portlet
    • liferay-portlet-ext.xml
    • portal-ext.xml
    • portlet-ext.xml   — all 3 for deploying portlets
    • macros-ext.vm — there is where you create macros
    • plugin-controller.properties — this is where you wire hooks like preContentletHooks.  There are a lot of uses for this
    • plugin.properties — allows you to have properties for your plugins
    • struts-cms-ext.xml — for struts on the front-end
    • struts-ext.xml — for struts on the back-end
    • system-ext.properties — configuration for the system, velocity stuff
    • portal-ext.properties — ldap config and so forth
    • tiles-defs-ext.xml — struts and portlet stuff
    • toolbox-ext.xml — for wiring your viewtools
    • urlrewrite-ext.xml — rules for the url rewrite filter
    • web-ext.xml — servlets and filters config
  • It’s always easier to edit than reuse — Jason had said this 3 times now :)
  • Nice plug from Jason for the IRC channel in #dotcms on freenode
  • Jason is going to show us the scripting plugin
    • The scripting plugin allows you to access all the java classess on the classpath via the language of your choice — no plugin no viewtool quick and easy
    • Showed us how to get your user from a viewtool — look at the plugin it is not as easy as you think, but it isn’t too much to get it.
    • Showing us how he modified the CMS Filter
      • Created his own filter extending the dotcms CMS Filter
      • Skip processing and move on if you are a php file
      • Otherwise call the super.doFilter()
  • All done folks — see you next year

Leave a Reply