Posts Tagged ‘dotcms’

Breaking ground

// March 19th, 2008 // No Comments » // Scripts, Web

UPDATE: Sorry if you tried to sign up on the forums overnight on 08.03.19.  Turns out there was a bug in the registration system.  I fixed it first thing this morning (08.03.20), and it should work fine now.  Please contact me if you experience any further problems.

I remember a time, many moons ago, when SuperSatellite.com had forums. Back then, I did band and event promotions for the area. phpBB was version….2…point…something. It wasn’t new, I’ll tell you that. Like 2.0.2 or something. But, the forums had a modest, bustling following, and it was well liked. Until we stopped doing that sort of thing. Those forums vanished long ago (well, technically they broke down, sat broken and unused for months, then went away, but you get the idea), and will never be back.

But, that doesn’t mean there isn’t a place for forums around here. As a matter of fact, I’ve been looking for an excuse to play around with the new phpBB3, which came out recently. Given these issues, I set up http://dotcms.supersatellite.com/ (you’ll also note the new link in my header nav for dotCMS, which can take you there) as a sort of test. One, to test the new forum software. But two, to provide some support and community forums for those people wishing to work with others on things related to dotCMS. As of now, nothing like that exists besides their mailing list. The friendly folks at dotMarketing are planning some new community sites and tools this year, but those are still a ways out. Besides, that’s really the glory of open source, isn’t it? Communities coming up on their own and doing their own thing. I’ve got it up and running, and started several forums to see how things work from their. I’m totally open to suggestions for improving the forums as a tool for the dotCMS community.

So, that’s what I got. I’ve been digging around the backside of phpBB3, and I will tell you, it is a totally different beast from 2. They’ve added quite a bit to it, and have tried to bring it up to snuff against the commercial alternatives. For free, they have done well. For now, I’ll keep it there on that subdomain, but if it gets enough traffic, I’ll probably migrate it all over to its own domain name. I’m interested in what kind of conversation this is able to drum up.

Breakthrough!

// March 14th, 2008 // 3 Comments » // Software, Web

Today was a day of days for dotCMS and me. A couple weeks ago I started working on integrating a servlet into dotCMS to handle PHP code. This in part to learn if I could, and also because I know PHP way better than Java. It would also help to keep me from needing to rewrite chunks of code that I might want to keep using or from having to maintain a second server and connect it to Tomcat using mod_jk for the purpose of running PHP. Ideally, I wanted it all wrapped up in one, nice package.

Enter the Tomcat Wiki. That’s where I started out at, specifically this entry about using PHP. It definitely got me started. The only thing that was sorta sucky was that the method did not work with PHP5+. Only PHP4. But I figured I could live with that. Better than nothing, right? After spending two days hammering away at it, I gave up. I was able to eventually get rid of all the errors, but the end result was a big goose egg on code execution. I also wasn’t sure if it’d even work with the 4.4.8 codebase I grabbed from PHP. All around, I just decided this wasn’t a worthwhile course to follow.

Quercus phpinfo() Result Page Enter IRC, JT, and Quercus two weeks later. Jason got to talking with Chris and I about it yesterday in the IRC channel (#dotcms on Freenode), and pointed out Quercus. Quercus is a PHP servlet designed by Caucho for their Resin Java application server. Released under the GPL, no less. Unfortunately, at this time, their site sucks, the mailing list bounces, and the forums error out when trying to make a new account. So, I started sniffing around. Rob Sinner’s blog turned out to be a great starting place, and has the bulk of the information you will need. Quercus was also picked up and integrated into the Liferay project, which was where dotCMS started. I figured if they got it working, there’s no reason I shouldn’t be able to.

Here’s how it went down. Go get the current .war file from Caucho (3.1.5 as of right now). Extract it using 7-Zip, or some equally useful unzipping program. First off, copy the three .jar file (quercus.jar, script-10.jar, and resin-util.jar) into /common/lib or /common/lib/ext in your dotCMS root directory. Then, go into /liferay/WEB-INF (dotcms/WEB-INF in version 1.6 and up) and open the web.xml file. Add to it:

  1. <servlet>
  2.   <servlet-name>Quercus Servlet</servlet-name>
  3.   <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
  4. </servlet><servlet-mapping>
  5.   <servlet-name>Quercus Servlet</servlet-name>
  6.   <url-pattern>*.php</url-pattern>
  7. </servlet-mapping>

That sets up the servlet to handle files that it is told to handle that end in .php. There is a sample web.xml folder in the files you extracted from the .war file that has other stuff like datasource and php.ini designations if you want to connect to a database or use custom PHP settings.

Now, shutdown the dotCMS server if you haven’t already. Do an ant clean and ant deploy. Copy a test php file (I used a basic HTML page with <?php phpinfo(); ?> in it) into /liferay/html on the server’s file structure, and start the server back up. Now, you should be able to open the page http://www.yourdomain.com/html/test.php and see the result page above. dotCMS is set to refer to the real file structure when it sees the folder /html in a URI (Uniform Resource Identifier), rather than its internal virtual file structure.

The kicker that fouled us up originally is that you can’t execute PHP pages from within the dotCMS file structure, since it is a virtual file structure and all the files actually exist in /liferay/assets rather than where they appear in dotCMS’s file browser. If you upload a PHP file to a directory in the back end, it will just come out as a 404, because when the Quercus Servlet tries to call the file by dotCMS’s file structure, it can’t find it’s equivalent in the real server file structure. Get it?

The solution is to this is more complicated than simply making it so there’s a way to run PHP code, and I’m working on it with some help and might get it in to 1.6 if we get it figured out fast enough. We’re trying to modify the CMSFilter.java file and extending the QuercusServlet.java file with code from the SpeedyAssetServlet.java file to make it so that when a PHP file within the dotCMS file structure is dropped to the Quercus servlet, it has the ability to ask dotCMS where in the assets folder it is to execute it. In the mean time, the PHP works with the above solution so long as you store the file in the right place.

Using dotCMS: A Practical Example

// March 11th, 2008 // 7 Comments » // Software, Web

Following up the completion of one of our first successful forays into using dotCMS on campus, I thought it would be time to discuss what we did and how we did it, to give you an idea of what is possible within the platform. I mentioned in past articles that dotCMS is a powerful CMS (Content Management System) framework, you just have to assemble the pieces. Think of templates, structures, containers, and content like Lego blocks. You can have tons of them, different shapes and sizes, and depending on how you assemble them, you can control what the end result is.  This is exactly how you build more complex displays in the system.

Screenshot of dotCMS based newsletterThat was the case with the Gorilla Geeks’ newsletter (alternate here). This was the first advanced usage we tackled, and we did so as part of a proof of concept to show others what we’d be able to do in the new CMS to help sell it around campus. It was created to provide a web page based newsletter that would have a URI (Uniform Resource Identifier) emailed out to people when new issues were made available (based on the schedule they settle on). Note that this was not a newsletter that was embedded in an email, and we didn’t use any of dotCMS’s CRM capabilities. The email just told people to visit the page. It is very similar to a blog, in that it has articles and categories. The main difference is how we display the articles and navigate.

Step one was to plot out how to arrange the content. I needed a way to refer to articles individually, or in groups by newsletter, or groups by category. That was clearly a relationship issue for the former, and category issue for the latter. I needed two content structures to do this. One was the “Blog/news item” structure. This already existed in the system and works well as a generic post-type content handler (title, body, image, tags). The second structure was one I created called “Newsletter.” This was a very basic structure that contained a publish date and an issue number. I then created a one to many relationship between newsletters and news items. What this means is that one newsletter could be related to many news items (Newsletter 1 could have 12 articles under it, Newsletter 2 could have 8). First you go in a make a newsletter, giving it an issue number. Then you create a news item, and on the relationships tab tell it that it’s parent is the newsletter that you just created. That solved the basic content question for the project.

Next I started looking at templates and functionality to actually make the display presentation work. The template provides all the basic display information up until articles show up; that includes the headline and sections region. Initially, the template checks to see if an article or issue number is passed in the URI and uses that to see if it needs to call a specific newsletter or if it should call the newest one. It also looks to see if the user has requested a printable version and will serve a custom CSS (Cascading Style Sheets) for that. As for the newsletter call, it starts with:

  1. #if(!$displayIssue)
  2.   #pullContent(‘+type:content +deleted:false +structureInode:253 +live:true’ ’1′ ‘integer1 desc’)
  3.   #set($displayIssue = $content.issueNumber)
  4. #else
  5.   #pullContent(‘+type:content +deleted:false +structureInode:253 +(+integer1:${displayIssue} +languageId:1* +live:true)’ ’1′ ‘integer1 desc’)
  6. #end

This is just checking to see if the $displayIssue variable was set (which happens on page load using $request.getParameter()), which indicates a preference for a specific issue. If not, it calls the current newsletter issue, and sets $displayIssue to that. All of this leads into the relationship needed to pull in the issue’s headlines, and the newsletter body, if needed. Once the page enters the body, we move to a container for generic web content. There, a widget is loaded that builds out the article(s) based on the request:

  1. #if($UtilMethods.isSet($articleInode))
  2.   #pullContent(‘+type:content +deleted:false +structureInode:5 +identifier:${articleInode} +live:true’ ’1′ ”)
  3. #elseif($UtilMethods.isSet($categoryInode))
  4.   #pullContent(‘+type:content +deleted:false +structureInode:5 +c${categoryInode}c:on +live:true’ ’0′ ‘date1 desc’)
  5. #else
  6.   #pullRelatedContent(‘Newsletter_Issue-Story’ $issueInode ’0′ ‘modDate desc’)
  7. #end

Basically, it figures out which of three Lucene queries to execute, and runs a loop to display them.  This allows one page to serve as the display mechanism for three different views: newsletter, category, single post.  Think of it kind of like how The Loop works in WordPress.  I could just as easily kick them into another page for different views if I wanted, but that’s the benefit of widgets, which are cleverly crafted content items allowing dynamic content display somewhere that normally would require one piece of static content.

This ended up being a fairly simple setup: one relationship, one template, and one widget does this newsletter make.  With it, they get newsletter functionality, RSS, print versions, categorizing, search (via our Google Mini), and nice archiving.  The biggest catch is just making sure to tell a news item which newsletter it needs to relate to.  From here, I’d like to refine the theme and improve the usability some, but none of that changes the basic setup.  I’ll be happy to share more of the code with anyone if you like.

Unwinding

// February 10th, 2008 // 2 Comments » // Travel, Web

Well, I was wrong.  This last day worked out a spot of all right.  Originally, my plan was to take an day of vacation to stay in Miami a day longer.  This went to suck when I found out the hotel we were up in for the conference was…outside my budget.  This forced me to find a different hotel for the final day.  So I sorta thought that the mess wasn’t going to hardly be worth it, as I’d have to pack, switch hotels, be away from the nice area I was in, etc.  As it turns out, I got to enjoy the afternoon all right.  When I got here, they didn’t have a room ready, so I was forced to amuse myself for a couple hours.

As it turned out, the hotel is on what they call the “Miracle Mile” in Coral Gables.  Plenty of shops and stuff (though most were closed on Sunday), but there was a Subway for an affordable lunch, and a car show taking place.  I also found a sushi place about 4 blocks from the hotel the guys from dotMarketing were telling me about called Sushi Maki.  That was dinner.  So I was able to get out and about a couple times, did plenty of walking, and got to enjoy the weather some more.  I also rode in a taxi for the first time.  It was anticlimactic.

I saw a bag lady uptown too.  I was going to take a picture, because I’d never seen an honest to goodness bag lady (she had about 20 garbage bags full of random goods, stacked very well).  I thought better of it, as I should probably respect her right to…well, live how she wants to live and not be bothered by a random, curious, small town tourist.  But, interesting nonetheless.  I also saw a Bentley, which I didn’t think “real” people “drove” in normal, everyday life.  And more small dogs.  What the hell is with the small dogs down here?

Anyway, to the topic of the previous three days, the conference was excellent.  DotMarketing treated us phenomenally.  For one, they hooked us up with some decent swag, including a nice messenger bag that I’ll be putting to use (free stuff is all it’s really about anyway :D ).  They took us out bowling in South Beach last night, which was by far and long the fanciest bowling alley I have ever seen.  The discussions I got to have face to face with their developers were invaluable.  All the guys and gals there are very easy to approach and talk with things about, which is great.  They also bowl better than me.  Except Lianis and David.  Sorry guys, but at least I can beat someone, heh.

Next year, I expect the conference will be a good deal bigger, with a little more diversity in experience levels and presentations from more people in the community.  If so, it would certainly get better and better. All around it was very well organized though, and the tracks were balanced so that at least I never had to argue between two sessions I wanted to go to (or not, were that the case).  The round table discussion I was in was very promising with respect to unifying and building the community of users that were here, and I think that will have a huge impact over the next year.

I’m excited to get back now and put to use some of what I learned and talked about.  That’s the mark of a good product and company in my opinion, that they can get you excited about stuff.  I don’t feel like I’m going back to fight a monster, just build one, heh.

So I will now sign off.  I leave in the morning, and will apparently have to fight some less than appealing weather when I get into KC.  Hopefully it all holds together long enough to get home.

Closing day: Open Minds 2008

// February 9th, 2008 // No Comments » // Web

So, Miami is an interesting place. There is a crazy fetish around here with small dogs, making them into an almost accessory, if you will. And more than you might expect. It’s common enough that we probably saw a dozen of them while eating. Roller blading is still popular too. Lincoln Road is also a neat (expensive) place to explore at night too. You can see everything from living statues to dancing transvestites that look like the serial killer from Silence of the Lambs. I gave him a wide berth.

Today is a big day for more training and roadmap discussions. I started out in the server admin training, since that will be one of my big responsibilities at the college. Jason Tesser, one of the lead developers, was in charge of this discussion. I want to note how awesome it is getting to work directly with the people who make dotCMS. It really helps with insights into the software. He took the time to explain how while dotCMS runs on Tomcat, it can run on really any Java application server. Also, even though dotCMS was based on the Liferay project, Liferay is becoming almost a non-issue in regards to the project, mainly being used for permissioning and users. I talked with him last night some about this, and the thought is that eventually Liferay will disappear entirely as a component of the CMS (Content Management System), and it will be all dotCMS code from that point on. Think Joomla vs. Mambo, how Joomla forked the Mambo project, but by version 2.0 will be wholly Joomla’s own code, not Mambo’s.

In the front end, most content is served to users via the static file storage, which in the latest version is /dotCMS/WEB-INF/velocity/live (in 1.5.x, just swap out “dotCMS” for “liferay”). This allows a site to run with little to no database interaction, and provides a level of redundancy in the event of a loss of database connectivity. This is the same place that the getContentMapDetail() macro references that I mentioned from yesterday’s blogging session. If a page isn’t serving, checking the file store can give you a clue as to where the problem is originating at, if it is or isn’t showing up there. Go up one directory to the velocity file and you can read files in there to see how Velocity macros are written.

He gave a pretty good commentary on what Lucene does, which acts as a query language that indexes the static file store. Sending Lucene queries to the system references pointers in its index to the file store. In the /dotLucene directory, you can view versions of the index, and change the number in the currentindex.txt file to switch to an older or newer index for troubleshooting. Lucene currently will create and manage up to 10 indexes (0-9).

This followed up with information on where configuration data is stored and how it all comes together. I’m not going to provide the nuts and bolts of this info since you can holler on the mailing list and get answers as to where a certain config is stored (besides, I don’t type fast enough to keep up). However, in the portal-ext.properties file, he did talk about the skeleton folder creation section, which is neat for giving a user a default folder architecture to operate within. This is similar to plugin functionality available in CMS’s like Joomla.

The performance tuning section was very interesting, and gave me some good insight into getting into settings to keep servers running top notch. This also included info for clustering environments, not that we run one. Googling for “Java memory options” was recommended as a good way to take care of some settings, and using that in the catalina.sh file. It was also pointed out that the connectors information in server.xml is a big place where you can optimize, especially in lower resource environments. This is because connection threads run in native memory, and not the java memory set in catalina.sh, so between the two, you can potentially overflow your RAM into swap, which slows things down. Threads use up to about 2Mb per connection. If you have 150 HTTP threads, and 150 SSL threads at 2Mb each, that’s 600Mb plus whatever you gave Java. Depending on your server and traffic load, you can do a lot to control memory usage there. Similarly, keep track of database connections that might be higher than what your database server actually allows.

Prior to developer training, I got pointed to some good tools that I tagged in del.icio.us like Aptana and Veloeclipse. These can be helpful for debugging code that you develop that you want to eventually incorporate into dotCMS. This session seems to be much more technically minded, greasemonkey type stuff. I have every reason to believe that this might be largely over my head. Hopefully that’s true, because this is an area I need to improve in. Unfortunately, by lack of experience in Java and Eclipse will limit my ability to comment on this, but it seems very fascinating, and something that will eventually be put to heavy use by me in the future. They did recommend sticking in Java 1.5 for the time being, and not using 1.6, as they won’t be switching to it for at least a year or so.

For Velocity work, learn by doing or learn by example; those were the two main suggestions, which aren’t bad advice. There’s enough information and examples out there and on their demo site that there’s a lot of opportunity to see how Velocity works in files to create content. Plus the Apache documentation is pretty decent with respect to Velocity. The thing that one must remember, Velocity is not Java, but ViewTools are. I’m not particularly good enough to explain what a viewtool is/does. But development of the two are very different, and if I knew Java, it’d make more sense. What I can say is that ViewTools are basically tiny Java applications that run within dotCMS to provide special functionality. The key is that dotCMS provides a lot of tools that you might never even need to worry about making a ViewTool.

And now for what everyone’s been waiting for, the roadmap discussion. Right now we are on version 1.5.1.1. 1.6 is on the way, probably in the next month, and 2.0 sometime this year. They’ve recently topped 10,000 downloads, and still growing, and were 2nd place as the most promising open source content management system. There’s already a lot of headway being made with users helping users on the mailing list, and users committing code to the project. One of the big plans that I think will make a huge break through for them is an open source community source for users to contribute things like macros, viewtools, and reports for others to share (think plugins and modules in other systems). They’ll also be coming out with dotCMS as software as a service to help lower the entry to barrier. On the community side, they are planning to put together a community team that helps with planning, suggestions, task coverage, and supplying feedback. That would be very interesting and really help with exposure too, get people excited about the product. It puts the consumer in a position to “own” the project, even if they can’t directly supply code or development help.

In the spring of 2008 a new documentation site is planned, designed in the fashion of PHP’s or MySQL’s documentation sites, providing the ability for people to add comments and examples, etc. Color me excited. This has been another barrier that has limited dotCMS, that the documentation just isn’t there, and where it is, it isn’t as mature as it could be to provide real, structured help for new users.

On the subject of lowering the barrier to entry, they plan on packaging a starter site into a default installation, based on Yahoo’s CSS (Cascading Style Sheets) framework. Also look for an honest to goodness module framework. Initial configuration will be wizard based, which should definitely help keep people from getting lost in different config files on the file structure. It’s not a big deal, but it’s just cludgy. People are used to, and expect easy configuration these days. WordPress is a good example of a project that took that to heart in an impressive way.

Deploying dotCMS as a software as a service will allow users to have upgrades, backups, and maintenance included. They are looking at using Amazon’s Elastic Cloud Computing to serve as a backbone to that, allowing users to only pay for the load they create.

Partnership is on their mind, working with other groups in different regions and countries to help service people they can’t easily get to. They can also get a different type of feedback from them, and gain marketshare. This also would increase training and support options for end users.

Version 1.6 is scheduled for a spring of ’08 release (the chatter seems to think a month or so from now). It will move off of Tomcat 5.5 and onto Tomcat 6. More items are moving into being based on structures, like events and such, that used to be more self contained (this is very cool). This should open things up for a whole new level of interaction and usability in the front/backend. They will be opening up the API (Application Program Interface), and providing over 200 bug fixes and performance enhancements. Inside 1.6, there is an improved LDAP module, a starter site, added category level permissions, better content ownership features, a customizable content entry form, and a brand new, structure based, social calendar.

Version 2.0 is scheduled for Fall of ’08. It will have a 100% dedicated team internally devoted to developing dotCMS (separate from work they do for clients). They will have a completed framework for add on modules, which will be tied in with the launch of the dotCMSForge, where users will be able to collaborate. dotCMS 2.0 will be JSR-170 compliant, and they will add RESTful Web Services for content, users, and data. RESTful will allow better interaction with external applications, allowing dotCMS to exist as a true content repository, regardless of use.

On the subject of modules, one they are looking at deploying (in conjunction with the JSR-170 specs) is a digital asset management solution. This would be in competition with the likes of the Fedora project, and allow storing and recalling of content through macros, etc into other uses. This is partly because Fedora, in dotMarketing’s eyes, is not a mature enough solution for their customers. They’ll also be releasing an event and conference registration module that works with custom forms, sub events with separate registration, and tie all that into e-commerce and reporting. E-commerce would be a module, allowing products as content. There’s a potential for social networking (including Open Social and OpenID) and wiki functionality as well. The social networking module sounds a lot like Ning. All in all, this module thing will be very good, as that’s part of what makes other open source CMS’s so successful, as it helps really drive a community.

Some links worth noting, in part from the round table, are the Pibb channel and the Facebook group that have been set up to facilitate group intercommunication.  These are also tagged in del.icio.us of course.  What would people think of a Ning group?

Okay, I’m spent.  I hope this was helpful.  I’ll probably throw up some closing thoughts tomorrow.  After we go BOWLING tonight.  Heck yeah baby.