Tag: Surf

Spring, Roo, and Alfresco Too: What Alfresco Gave to Spring and Why

Surf Logo

You’ll recall from my community event takeaways post in November that Alfresco announced plans around Surf, the Apache license, and Spring but the details were foggy at the time. This week, Alfresco and SpringSource announced that Surf, Web Scripts, and Web Studio have been donated to the Spring open source community under the Apache 2.0 license.

What is Surf?

Surf is a lightweight web application development framework. At a very high-level, Surf is essentially Alfresco Web Scripts (an MVC framework for binding URLs to server-side JavaScript/Java and Freemarker-based views) plus some page layout constructs and some built-in objects for connecting to and authenticating with remote HTTP end points, including Alfresco (See also “Alfresco UI Options” and “Surf Code Camp“).

Why Spring Surf Makes Sense

Alfresco’s team collaboration application, Alfresco Share, is built on top of the Surf framework and clients and partners, including Optaros, have built solutions on top of Surf. But so far, our experience has been that we probably could have built solutions faster using a different framework. One of the reasons is because you often can’t do everything you need to with Surf alone–it lacks services that would normally be provided by a broader framework. Your choice is either to re-create what’s missing or bolt on something that exists. So that’s the first reason why Surf becoming part of Spring makes sense. Spring is already a mature and widely-adopted framework. It’s much better to make Surf and Web Scripts part of an established framework (and community) than to try to grow Surf into a full-featured framework.

The second reason is more strategic. Alfresco sees a future dominated by CMIS (See “Getting Started with CMIS“). They want to be the go-to CMIS platform. From a repository perspective, they’ve been very active on this front. But development tools are going to be important, and although part of the beauty of CMIS is that it is tool-agnostic, I think SpringSource and Alfresco would obviously be pleased if their framework became a very natural and productive way to build CMIS apps.

Third, Alfresco doesn’t necessarily want to spend a lot of time on tools and frameworks if it doesn’t have to. Look at how much time Web Studio has languished in Community limbo–it’s clearly not a priority. If Surf catches on in the broader Spring community maybe Web Studio has a chance to turn into something. My guess is that SpringSource would prefer all development to take place within STS, its Eclipse-based IDE. Maybe Web Studio will get sucked into that somehow.

So what is Roo?

One of the things mentioned as part of the Spring Surf announcement is that Spring Roo integration is included. Spring Roo is pretty new so you might be wondering what that is. It’s pretty cool, actually. Basically, it’s a productivity tool for people who are building Spring apps. If you’ve ever worked with frameworks like Ruby on Rails, Grails, or Django, one of the first things you learn is how to use the command-line project scaffolding tools. Those tools make it easy for you to spin up and configure your project. Spring Roo is similar–it gives you a shell and a bunch of commands for things like setting up persistence, adding unit tests, and configuring security.

Spring Roo is extensible which is where Surf comes in. Let’s say you’ve created a Spring project and you want to use Surf as part of that project. All you have to do is go into your Roo shell and type “surf addon install”. No monkeying with the web.xml. No hunting for JAR files. It just happens. Next, suppose you want to add some Surf pages. Type “surf page create –id ‘SomeOtherPage’ –templateInstance home” and the XML is created for you in the right place (yes, the shell provides keyboard assist and hints so you don’t have to remember those commands).

Roo is definitely better appreciated by seeing it or trying it yourself. Michael Uzquiano did a short screencast showing the Spring Roo Surf extension. If you want to try Roo out yourself, go through Ben Alex’s “Getting Started with Spring Roo” posts.

Learn More

The bottom-line is that Surf becoming part of the Spring community is a good thing. You should check it out. The official Spring Surf page is the place to start. That’s where you’ll find the SVN URL, binary downloads, and links to other resources. There’s also going to be a webinar in January if you want to learn more.

Webinar: Developer’s Intro to Alfresco Part 3: Web Scripts & Surf

Part 3 of the “Developer’s Introduction to Alfresco” webinars is today at 12 Eastern (GMT – 5). I’ll be talking about web scripts, Surf, and CMIS. The format will be the same as the first two parts: you’ll watch a pre-recorded presentation for about 30 minutes, then I’ll do at least a 30 minute live Q&A session.

Also, I know I’ve been slow in getting this posted, but the Part Two presentation and Q&A recordings are available at Alfresco’s on-demand events page.

Alfresco Share Screencast Part Two

My colleague, John Eckman, has posted the second part of the Alfresco Share screencast at Optaros Labs. In this screencast I show how a couple of examples of custom share components. One is a team bookmarks component and the other is a status/microblogging component. These components were built with Surf and should work in any Surf-based web site. Obviously, that includes Share but could be other Surf sites that you build. We will make both components available as open source.

New Optaros Screencast: Alfresco Share Part One

My Optaros colleague, John Eckman, has been asking me to do this for some time so I finally caved and knocked it out. It’s a 12-minute screencast that shows the basics of Alfresco Share, an open source team collaboration tool which Alfresco markets as an alternative to Microsoft Sharepoint.

There’s also a “Part Two” which John will post on Optaros Labs next week that shows a couple of the custom Share components we developed. One is a Facebook-like “status” component and the other is a “team bookmarks” component. I’ll post the link when it’s up.

Share is pretty cool both from a functional perspective and with respect to the underlying technology. Share is built on Alfresco Surf plus a ton of YUI. The version I used in the screencast is 3.0.1 Enterprise.

Alfresco Surf Code Camp: Do-It-Yourself

Did you miss the Alfresco Surf Code Camps? I’ve got you covered. With Alfresco’s blessing (they wrote most of the content, after all) I’ve uploaded the Optaros Alfresco 3.0 Surf Code Camp instructor presentations and class labs to slideshare.net.

You might start by looking at the agenda to get an idea of the order you should progress through the lecture and labs. Then, move on to the introduction. Use the agenda to guide you through the rest.

The labs will be a little bit more painful than they were in-person. That’s because for the in-person camps, we used a virtual machine image that had everything pre-installed. For the DIY Code Camp, you’ll need to set this up yourself. To approximate what was on the image:

  1. Install the Alfresco-Tomcat bundle.
  2. Install a second Tomcat instance. This will be your Surf tier.
  3. Build a fresh Surf war. It’s in the “web framework” project in the source code. It will produce a WAR called alfwf.war.
  4. The labs will refer to “assets.zip”. I had an assets.zip file for just about every lab. For this setup, I’ve just got one zip, which is the entire solution source available for download. So when you see that, you’ll have to pick through the solution to find the file dependencies. Sorry.

The image we used for the class ran on 3.0 Labs from head circa mid-November. I believe people have had success running on 3.0 Enterprise. I haven’t tested on Labs 3 Stable. If someone tries it please post a comment here to let us know your degree of success.

The Code Camp doesn’t cover Web Studio. I’ll leave that up to someone else–I’ll be happy to link to it.

UPDATE: Making you find your own dependencies for the labs was lame. I had a few extra minutes so I pulled them into a Code Camp Assets file organized by lab/walkthrough. Now you’ve got no excuse.

Alfresco Surf Code Camp comes to Boston

We’ve just announced a new Code Camp date and city. We’ll be doing a Code Camp on Alfresco Surf in Boston on December 16th (Code Camp Details). Our New York City event filled quickly so if you want to attend you should sign up now. Hope to see you there.

BTW, the Code Camp in Munich looks like it will be some time during the week of January 12th. Obviously it will be posted here, at Optaros.com, and at Alfresco.com when it finalizes.

Alfresco Surf 3.0 Code Camp NYC in the bag

What a great group of campers we had today at the Alfresco 3.0 Surf Camp in New York City. We were all quite impressed with how much the attendees were able to get accomplished.

It’s clear that experience with web scripts sets one up for success with Surf. Surf is a two-tier framework. The repository tier is exposed to the presentation or Surf tier through web scripts running on the repository. So, obviously experience writing repository tier web scripts is directly applicable. On the presentation tier, it is still MVC and web scripts, but Surf adds page definition and templating constructs. The biggest challenge for people already familiar with web scripts, then, is to learn the presentation tier lingo and to sort out the numerous XML files, what they do, where they go, etc.

The best way to learn Surf seems to be to start with a simple Share dashlet then work up to building a complete web site. The dashlet gives you a chance to practice with the Surf JavaScript API and to make remote calls to the Alfresco repository (or other HTTP end points). Once you get the hang of that, try to build a simple one page web site that maybe queries some data from the repository and formats the results. Then, broaden from there.

Anyway, thanks to everyone that attended or helped put this together.

Surfing in D.C. with Alfresco’s new web application framework

If you are in Washington, D.C. today for Alfresco’s North American Community Conference please be sure to stop me and say hello. I’ll be in the sessions, in the Optaros booth, and presenting during the technical track. For my European friends, I’m sad to say that I will not be in Munich for the European version of the conference next week, but I will be in Europe at the end of this year or the first part of January so we can meet up then.

During the technical track (in both D.C and Munich) we will be showing some Surf 3.0 components we’ve built. One is called “Status”. It is kind of like a Facebook status or a Basecamp Journal entry. It allows you to say what you’re working on right now and what your mood is. A dashlet aggregates the status entries for all of your teammates across the site and another one shows status across all sites to which you are a member. When you mark it “Done” that status is archived. When status changes are made the new Activity Service is called so that if people are following site activity by subscribing to the activity feed, the status changes are included.

We’ve also got a simple “bookmark” component that lets you share URLs with other team members. As it exists right this second it allows a team to manage a set of shared bookmarks. Before it is GA we plan to make sure bookmarks are taggable and rateable and marked as shared or private.

I’ll follow up soon with a deconstruction of these components so you can learn more about how they work (and even contribute code to them if you want to make improvements).

Finally, we plan to leverage the Rating Service that was used as an example in the forthcoming Alfresco Developer Guide as the back-end for a five star rating component that would allow any Share or Surf site to enable users to rate any node.

These components will be available for you to add to your Share sites or any site built with Alfresco Surf. Our goal is to have them generally available by the time 3.0 Enterprise ships.

We’ll also be hosting code camps in North America and Europe so that you can learn to build your own Surf components. I’ll provide more details on those as they are available.