Finally back and settled in after returning from training in Miami. Now just very busy trying to catch up, and put some of the things that I learned to use. I did manage to grab some photos around the area on CocoWalk where I was, so feel free to browse the Flickr set. I also started playing around with geotagging the photos. I have no idea how useful that will be in the future, but what the heck? I wish that I’d had more time to get out and about, but I did hit two excellent sushi places, instantly reminding me that what I pass off as sushi here is nothing but a sick and twisted joke by comparison.
First, how come no one told me that some Chinese company was making new MGs? I saw one at the condo where I was put up at. It wasn’t anything fancy as far as sport convertibles go, but it was still pretty neat in its own way. Now I want to drive one and see what they feel like.
Nearby was CocoWalk, which is where the dotMarketing headquarters are and where I spent a lot of my time. It was Cinco de Mayo the night I arrived, so it was a pretty popular site, with the shops and restaurants (though I made the mistake of passing up Hooters. I’m not sure what I was thinking to make that mistake). However, I did take a couple hours the night I got there and saw Iron Man. Let me just say, I was absolutely not disappointed. Go see it.
On the travel side, I think I will make the effort to never fly US Airways again. Worst planes and service I’ve ever dealt with. Tiny pretzels, mean spirited, inattentive stewardesses, terribly seats, and small planes. And to top it off, I appear to be getting increasingly worse anxiety while driving long distances by myself. My nerves light up high enough on the drive to KC and back that it very nearly makes me sick. I’m not sure what to do about this yet, but it is very unsettling. Obviously drugs would probably impair my ability to drive, and if I had someone drive me, it would cost a fortune. I think I’m going to try to start flying out of Tulsa, which is a tiny bit closer, or even Joplin, assuming I can find well timed hoppers.
As for dotCMS, I feel much better equipped than I have in the past after opening my skull and letting their lead developer pour knowledge into it for a full day. I anticipate having no problems setting up my development environment soon, and upgrades from here on out should be much, much easier. I also understand better how the parts come together, and what they do when the break. I also agreed to devote some time to helping with their community site doing some writing or theme crafting. That will be a fun side project I think.
I know some people have had questions about setting up dotCMS to run in an Eclipse development environment. If you were like me, you might have been having problems because you were reading the wrong setup documentation. Turns out there is a new one that was misfiled that is much better and up to date. Also, if you are running a dotCMS site on MSSQL, don’t run ant buildsql when you update. It breaks things, because it’s meant for the Oracle and Postgres camps. You’ll want to use ant buildmXsql. Learn from my mistakes, heh.
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.
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.
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:
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.
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.
That 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:
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:
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.
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
). 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.
Posting tweet...