Category: Alfresco

Alfresco open source content management

Event: Open Source ECM in Action

If you’re going to be in the Dallas-Ft. Worth area on June 26th, come on by the Westin Galleria. I’ll be speaking at Alfresco’s “Open Source Enterprise Content Management in Action” event. I’ll be talking about some real-world client implementations involving Alfresco and Liferay and I can give a quick update on how the book is coming along. I’m not making any promises, but if I get time between now and then to finish off the Ringside-Alfresco integration demo, I’ll see if I can squeeze that it in as well if there is any interest.I’d also like to use the event to gauge interest in a DFW-area Alfresco meetup. If you can’t come to the event but you think such a thing would be valuable, please let me know.

Alfresco and Ringside

I’ve made moderate progress getting Alfresco and Ringside integrated. If you haven’t played with it yet, Ringside Networks is an open source project that essentially gives you a standalone Facebook server. There’s actually more to it than that, but for this conversation, what matters is that Ringside supports the Facebook API and FBML without requiring a connection to Facebook.My goal is to get the Alfresco Facebook “Document Library” example (screencast) working in Ringside. What I have working now is single sign-on between Alfresco and Ringside, the main web script, the document library creation web script, and the document libraries list web script (pictured). What isn’t working so well (yet) is the file upload.

If you want to try this yourself, you’ll need:

  • A working install of Ringside Networks Social Application Server (Advanced Developer Setup instructions) which requires PHP and MySQL
  • A working install of Alfresco Community
  • The Facebook AMP (or just the web scripts from the AMP) or your own set of Facebook runtime web scripts
  • Alfresco Community SDK & Source

Alfresco has hardcoded Facebook URLs into the FacebookAuthenticatorFactory and FacebookModel classes. You need those to point to your local Ringside server instead of Facebook. I created a RingsideAuthenticatorFactory which is just a dup of FacebookAuthenticatorFactory with LOGIN_REDIRECT changed to:

"<fb:redirect url=\"http://localhost/api/login.php?api_key=%s&v=1.0%s\">"

You’ll need to override the webscripts.authenticator.facebook bean with a pointer to the new class, like so:

<bean id="webscripts.authenticator.facebook" class="com.optaros.ringside.RingsideAuthenticatorFactory" />

I took a more hackish approach to the FacebookModel. I removed Alfresco’s class from alfresco-webscript-framework.jar and replaced it with my own version that has updated getCanvasURL and getPageURL methods:

public String getCanvasURL() {
return "http://localhost/web/canvas.php/" + getCanvasPath();
}

public String getPageURL() {
return “http://localhost/web/canvas.php/” + req.getPagePath();
}

At some point, what should really happen is that all of these URLs should be pulled out into a config. Once I get everything working, maybe I’ll circle back with a better step-by-step and perhaps the changes can be submitted to Alfresco so that it is easier for people to choose whether their Facebook web scripts run against Facebook or a Ringside server.

Drupal-Alfresco Integration and Alfresco’s Move to the Front-End

Via Dries Buytaert, Rob Purdie is announcing the relaunch of Amnesty International‘s site. The new site was built using Drupal and Alfresco.

It is interesting to see how many people have commented on both posts who are craving more information about Drupal and Alfresco integration and it is no wonder. As I mentioned last year in this post, Optaros sees the two offerings as highly complementary–they aren’t (yet) competitors.

We do a lot of implementations in both Drupal and Alfresco. We think PHP plus Alfresco, or in this case, Drupal plus Alfresco is a great combination. Why? Using PHP and Alfresco together is the best-of-both-worlds: You get the speed of development that PHP brings plus the strength of an
open, enterprise repository on the back-end. In Drupal’s case, specifically, add to that the
availability of thousands of pre-built modules as well as a true site (presentation) framework which is something Alfresco currently lacks (more on that in a second). The interface between the two is best facilitated by Alfresco’s REST-based web script framework which is itself based on lightweight coding tools (JavaScript and FreeMarker).

If you’ve been following this blog and the Alfresco Community Conferences, you know that Alfresco is making a move to the front-end. Clearly, Alfresco sees the lack of a Drupal-like front-end as a short-coming, and they are working hard to address this in their coming releases. Here are examples of what’s coming down the pike that may ultimately position Alfresco more directly against Drupal in the future:

  • Web scripts are being split out from the repository process. In the Community head it is now possible to run web scripts in a process separate from that of the core Alfresco repository process. And web scripts running in that standalone process can remotely invoke web scripts running in the Alfresco repository, even if the two are running on separate physical hosts. This will likely form the foundation of Alfresco’s dynamic web site approach: Web scripts running outside of the context of Alfresco, in a plain old servlet container, say, can take advantage of the web script framework, even if they never make a single call to Alfresco.
  • Alfresco is building a WYSIWYG, browser-based site builder tool. The Alfresco Dynamic Website (ADW) will allow you to assemble web sites and web pages by selecting modules (built with web scripts) from a module library and arranging them on the page.
  • Alfresco is moving their web clients from JSF to web script-based web sites. The new Alfresco client will be based on web scripts with the eventual goal being to build it and manage it as if it were any other normal, dynamic web site. The client will be a reference site which you can use to build your own dynamic sites.
  • Alfresco is trying to generate developer excitement around web scripts. Alfresco’s push in the developer community to get people excited about web scripts is no coincidence. If they can get the community to help develop a compelling library of web script-based modules, and if they can create a productive front-end development framework that can plug in those modules, Alfresco will be much more attractive to clients who benefit from a front-end presentation framework and pre-built components than it is today.
  • Alfresco is marketing heavily around community and Enterprise 2.0. As you may have seen at the Community Conference and other Meet-ups, Alfresco is driving towards more community, social networking, and general “Enterprise 2.0” features and functionality. This is usually mentioned in the context of being a Sharepoint Killer but it could also mean a blurring of the differences between Drupal and Alfresco as well.

I’m not saying that when the 3.0 release of Alfresco comes out it is going to be on par with Drupal. But I do think it is interesting to watch what’s happening as Drupal and PHP solutions look for more robust back-ends while Alfresco moves toward better front-end site development and module frameworks.

My Summer Project: a Book

I’ve been doing a lot of writing lately, but as faithful readers have noticed, it hasn’t been in the blog. What’s the cause of the post slowdown? I’ve taken on a project that I hope you’ll be excited about. This Spring, Packt approached me about writing an Alfresco developer’s guide. Honestly, I went back-and-forth with the idea. Ultimately, it was the encouragement from ecmarchitect.com readers that swayed my decision.

I began writing on President’s Day. I thought the Alfresco Developer Series articles would be a good start and would save some time, and they have, but they represent a relatively small portion of the overall work and I’m doing a fair amount of restructuring of that content. The current schedule has the writing finishing up toward the end of summer with us going to press some time after that.

Optaros is fully behind the project–there’s no way I could do this without their support. Alfresco is excited about it too, although we’re all expecting the timing to be a bit tricky with 3.0 coming out in roughly the same time frame. I’m currently making sure all example code runs on both the latest Enterprise release as well as the latest Community release–we’ll see if I can keep that up. It remains to be seen how much of the new 3.0 web client I’ll be able to cover based on the timing.

So that’s why posts and comment responses have slowed down a bit. I think I’ve caught up on responding to comments (and keep those coming, by the way). If you posted a comment within the last month or so and never saw anything from me, you might have a look to see if I’ve addressed your question, especially on the Web Scripts as Liferay Portlets post, which saw a lot of activity.

Running Alfresco web scripts as Liferay portlets

I’ve seen a lot of Liferay and Alfresco forum posts from people having trouble getting Alfresco running within a Liferay portal. Once that’s done, people usually want to invoke Alfresco web scripts as portlets without requiring a separate single sign-on (SSO) infrastructure. Some people have pointed to the Alfresco wiki (Deploying 2.1 WAR Liferay 4.3). That is a helpful reference but it isn’t the full story. Here are some notes that may help.

1. Download the Liferay 4.3.6 + Tomcat 5.5 JDK5 bundle. I had mixed results with the latest release 4.4.2. You may be tempted to try to download the WAR-only distribution and configure it in your existing Tomcat instance. In this case, save yourself the time and headache and get the bundle. Fool with the WAR distribution later.

2. Unpack the Liferay distribution and fire it up. Make sure you can log in as the test@liferay.com (password: test) user to validate that all is well with the Liferay install.

2a. Create a test user. (“Create Account” on the Liferay login screen). Remember the email address. This will matter shortly. For this discussion I’ll assume Foo User with a screen name of fuser and an email address of fuser@foo.com. Make sure you create a home directory. In this example, we’ll call it “fuser”.

2b. Verify that you can log in as your test user.

3. Shut down the server.

4. Download Alfresco 2.1.2 Enterprise, WAR only. Alfresco 2.1.1 has a known issue (AWC-1686) with the way authentication is handled for web scripts in the context of Liferay so make sure you are using 2.1.2.

5. Expand the Alfresco 2.1.2 WAR into the Tomcat webapps/alfresco directory (which you’ll have to create the first time). If you are tweaking the install (such as pointing to a specific MySQL database, using something other than MySQL, pointing to a different data directory, etc.) make sure you have copied your good set of extensions into Tomcat’s shared/classes/alfresco/extension directory.

6. Copy the MySQL connector into Tomcat’s common/lib directory.

7. Start Tomcat. When it comes up, you’ll have Liferay running and you’ll have Alfresco running, but Liferay doesn’t yet know about Alfresco. Verify that you can log in to Alfresco as admin.

7a. While you are here, create a test user account. You need to create a user account that has an email address that matches the test user account you created in Liferay. In this example you created Foo User with a screen name of fuser and an email address of fuser@foo.com so you need to create an Alfresco user with the same settings. You’ll log in to Alfresco as fuser. You’ll log in to Liferay as fuser@foo.com.

7b. Verify that you can log in to Alfresco as fuser.

8. Shut down Tomcat.

9. Now you need to configure Alfresco as a Liferay plug-in. This involves adding four files to Alfresco’s WEB-INF directory: liferay-display.xml, liferay-plugin-package.xml, liferay-portlet.xml, and portlet.xml. Why aren’t these available in the Alfresco source or on the wiki? Apparently someone tried to address this at some point because there is a link on the wiki but it is broken. Until that’s addressed, I’ve put them here.

10. Remove the portlet-api-lib.jar file from Alfresco’s WEB-INF/lib directory.

11. Re-package alfresco.war. It is now ready to hand over to Liferay.

12. Start Tomcat.

13. Find your Liferay deploy directory. If you are running out-of-the-box on Linux, Liferay’s “deploy” directory is called liferay/deploy and it resides in the home directory of the user who started Tomcat. I’m running it as root so my Liferay deploy directory is /root/liferay/deploy.

14. Copy the alfresco.war you just created into the deploy directory. Watch the log. You should see Liferay working on the WAR. He’s finding the plug-in config files and essentially deploying the Alfresco portlets.

15. Now log in to Liferay using the Liferay admin account (test@liferay.com). Go to a page, then use the global navigation dropdown to select “Add Content”. The list of portlets should appear and you should see the “Alfresco” category. If you don’t, look at the log because something is amiss. Add the My Spaces portlet to the page. You may see an error at this point but ignore it. The problem is you probably don’t have a user in Alfresco that has an email address of “test@liferay.com”, which is the currently-logged in user.

16. Log out.

17. Log in as your test user that exists in both Alfresco and Liferay (fuser@foo.com).

18. Go to the page. You should see the “My Spaces” portlet. You should be able to upload content, create spaces, etc.

Exposing your own web scripts as portlets

All Alfresco web scripts are automatically exposed as JSR-168 portlets, including the ones you create. To add your web scripts as portlets, first make sure you have authentication set to “user” and transaction set to “required” in your web script’s descriptor. Then, update portlet.xml, liferay-portlet.xml, and liferay-display.xml. Follow the pattern that’s in those files already and you’ll be fine. For example, if you deploy the Hello World web script from my web script tutorial, you need to add a new portlet to portlet.xml with a “scriptUrl” like: /alfresco/168s/someco/helloworld?name=jeff. Then you update liferay-portlet.xml and liferay-display.xml with the new portlet name or portlet ID.

Single sign-on with no single sign-on?

The web script runtime has a JSR-168 authenticator. So when your web scripts get invoked by the portlet, the current credentials are passed in. That’s why your web script can run without requiring an additional sign in. Prior to this being put in place, people had to implement Yale CAS (or an equivalent) to get SSO between Liferay and Alfresco web scripts.

What’s not covered in these instructions is that you’ll probably want to (1) configure both Alfresco and Liferay to authenticate against LDAP and (2) change the configuration of either Alfresco or Liferay to use the same credential (either username or email address) for both systems so that if you do have users logging in to both, they don’t have to remember that one requires the full email address but the other doesn’t.

Troubleshooting

If you see one of the Alfresco portlets displaying “Data is not currently available” or somesuch, try hitting
Alfresco in another tab. Log in, then log out. Then go back to the
portal and open the page again. It should work now. I’m not sure what’s going on there. I think it may have to do with me switching back-and-forth between Liferay instances (4.3.2 versus 4.4.2) so maybe you won’t see it.

Open issues

You may see an error like this:

21:22:15,965 WARN [BaseDeployer:1038] Unable to format /usr/local/bin/liferay-4.3.6/temp/20080408212212978/WEB-INF/faces-config-jbpm.xml: Error on line 5 of document file:///usr/local/bin/liferay-4.3.6/temp/20080408212212978/WEB-INF/faces-config-jbpm.xml : A ‘)’ is required in the declaration of element type “application”. Nested exception: A ‘)’ is required in the declaration of element type “application”.

I haven’t chased that down yet. I’ll update this post with a comment when I find out. I’m sure fixing that will also fix the problem that you’ll see if you try to start an advanced workflow from a piece of content displayed in the My Spaces portlet.

I was also seeing an error when trying to use the “Add Content” link in the straight Alfresco client. I think it is JSF-related. Again, I’ll update this post with a comment when it is resolved (or when I find a Jira ticket).

MPXJ is a Java API for Microsoft Project files

Reading Microsoft files from Java code is one of the little joys in life (he said sarcastically, through clenched teeth). I’ve worked with the Apache POI project to do this successfully in the past. I recently came across MPXJ. It sits on top of POI to allow Java developers to manipulate Microsoft Project Exchange (MPX), Microsoft
Project (MPP, MPT), and Microsoft Project Data Interchange (MSPDI) files. The project is at SourceForge.

For readers interested in Alfresco, one thing you can do with this library is use it to create metadata extractors and content transformers for Microsoft Project. The latter enables Project files to be full-text indexed by the Lucene search engine. The MPXJ library depends on the same version of Apache POI that is shipped with Alfresco 2.2 Enterprise and 2.9 Community (Apache POI 3.0.2).

Web 2.0 & the Open Source CMS

Dr. Ian Howells, Alfresco’s Chief Marketing Officer, and I will be doing a webinar on Web 2.0 trends in the enterprise and the impact of these trends on content management.

This web seminar will cover:

  • The importance of Web 2.0 in the context of content management strategies and the competitive landscape.
  • How to get beyond the hype and leverage Web 2.0 techniques and technologies to deliver dynamic and interactive content.
  • How to tap into the fast-growing value of the Web 2.0 ecosystem to drive organizational productivity and competitive advantage, while still meeting the compliance and security needs of business.
  • How these ideas have been put into practice by Optaros for companies like Endeca and Swisscom using Alfresco Enterprise as the technology platform for a Web 2.0 solution

If you are interested, you can register online here.

Productively running multiple versions of Alfresco

How do you juggle multiple versions of Alfresco on your local machine? At any given time, I’ve got at least three versions running: The latest Enterprise release, the Enterprise head, and the Community head. If one or more active Optaros clients aren’t yet on the latest release, those older releases are running as well.

There’s always more than one way to skin a cat but here’s how I handle this problem. First, I want to use a single Tomcat instance, but I don’t want all of my Alfresco versions running at the same time. Second, I want to use the same MySQL instance running with version-specific databases to keep them separate. Third, I want separate, version-specific data directories.

The solution is to name your databases and all of your version specific directories with a naming convention, and then use shell scripts to delete and create soft links in the appropriate locations that point to the version specific directories. (If you are running Windows you can do symbolic links too–they are called Junctions).

In an Alfresco install there are four directories that you need to address:

  • The data directory
  • The web application directory
  • The shared extension directory
  • The virtualization server directory

Decide on a naming convention. For my databases, I use alfrescoXXn where XX is the version number and n is the network abbreviation (“c” for community, “e” for enterprise, etc.). So my database for 2.2 Enterprise would be alfresco22e. For directories, I use alfresco-X.X-nnnn. So, for example, the directories for Alfresco 2.2 Enterprise would be:

  • /home/jpotts/alfresco/alfresco-2.2-enterprise/data
  • /home/jpotts/alfresco/alfresco-2.2-enterprise/webapp
  • /home/jpotts/alfresco/alfresco-2.2-enterprise/extension
  • /home/jpotts/alfresco/alfresco-2.2-enterprise/virtual

When I want to switch between versions, I just call a shell script with the version as the argument. It takes care of deleting the existing links and creating the new:

echo Switching to $1...
echo Switching webapp...
rm $TOMCAT_HOME/webapps/alfresco
ln -s /home/jpotts/alfresco/alfresco-$1/webapp $TOMCAT_HOME/webapps/alfresco
echo Switching extension directory...
rm $TOMCAT_HOME/shared/classes/alfresco/extension
ln -s /home/jpotts/alfresco/alfresco-$1/extension $TOMCAT_HOME/shared/classes/alfresco/extension
echo Clearing Tomcat work directory...
rm -rf $TOMCAT_HOME/work/Catalina/localhost/alfresco
echo Clearing Tomcat temp directory...
rm -rf $TOMCAT_HOME/temp/*
echo Switching virtual tomcat directory...
rm $VIRTUAL_TOMCAT_HOME
ln -s /home/jpotts/alfresco/alfresco-$1/virtual $VIRTUAL_TOMCAT_HOME

Note that in this set up, the data directory and the Alfresco database don’t have to be dealt with directly because they are referenced by the custom-repository.properties file residing in the version-specific extension directory.

While you’re at it, why not make it easier to clear out the repository? Set up a “clean” script that cleans out your data directory and then runs the db_remove and db_setup SQL scripts. Remember that you’ll either need version specific copies of these scripts or you’ll need to modify them to accept the version-specific database as an argument.

With this setup in place, you can set up new versions, switch between versions, and start over with a clean repo quickly and easily.

Alfresco pledges to open community by 3.0

At the Alfresco Community Conference in San Jose Wednesday, Kevin Cochrane and John Newton promised to have a process in place to let non-Alfresco employees become committers to the Alfresco Community code line. The pledge, which many in the community may find surprising because up until this point, Alfresco has operated as a “closed community”, came in response to my question during the “Ask an Expert” session about the possibility of opening up. Kevin responded, “It’s coming with 3.0”, to which John added, “We want to make it easier for developers in the community to contribute to the product. We want to remove the bureaucracy that’s there. The more the merrier.”

Committers will have to assign over copyright and make guarantees that the code they contribute is theirs to give. According to John, this assignment of rights may be difficult for developers working for certain types of organizations, particularly those in government agencies, but Alfresco is working on a solution.

Notes on the Alfresco Community Conference in San Jose

More than 150 customers, partners, and prospects attended the Alfresco Community Conference in San Jose yesterday. There was a BarCamp the night before attended by almost 30 people. Alfresco capped attendance for both the Community Conference and the BarCamp.

Opening Keynotes

During the opening keynotes, Alfresco CEO John Powell and CTO John Newton went through their “state of the ECM market” presentations which attendees to the New York conference earlier in the year have already seen, for the most part. The theme is essentially that the old notion of ECM is dead, basic content services will bring ECM to the masses, and web 2.0/enterprise 2.0 needs to be woven throughout. Alfresco sees itself as being perfectly positioned for the transition to this new, more innovative flavor of ECM. They position themselves as being more front office/extranet/internet savvy than Documentum, Filenet, or OpenText, more back office than Vignette, Interwoven, or Drupal, and more enterprise than Sharepoint.

Adobe Share

For the first time that I know of, Adobe talked publicly about the technology behind their online document sharing service currently in beta. The Alfresco-backed service, share.adobe.com, offers anyone a Flex-based user interface for storing, transforming, and sharing documents. It essentially combines three online document-related services: Document Center (protect PDFs and Office documents), Create PDF (online service for creating PDFs), and pdf2text@adobe.com (email-based service for converting PDF to text). It then adds 1 GB of free storage for shared documents.

Any documents shared on the site are stored in Alfresco. After initial storage, several back-end services are executed including a virus scan, conversion to PDF, conversion to Flash, and the creation of thumbnails.

The Flex-based front-end talks to Flex DS which talks to Alfresco via REST. While in beta, the system is running on an active-passive cluster. To scale to the anticipated volume of millions of users and billions of documents, Adobe is going to have to scale both horizontally and vertically. Details on exactly how they plan to do this were not discussed.

Up-coming releases

  • 2.9 Enterprise (Q2 2008) — This is the first I’ve heard of an Enterprise release for 2.9. I’m not sure if this is real or not.
  • 3.0 Community (Early August)
  • 3.0 Enterprise (Early October)
  • 3.1 (End 2008?)
  • 3.5/4.0 (Mid-2009)

Check the Alfresco wiki for official timelines. All 3.0 development tasks are going to be entered into Jira under a project called “Slingshot” so if you’re wondering what’s in the new release, check there. At the time of this writing I couldn’t find any reference to Slingshot.

Web client 3.0: No longer 100% Flex

One 3.0 change that deserves attention is the new web client. Earlier in the year the plan had been to build it entirely on Adobe Flex. The new plan is to build the client entirely on web scripts with strategic use of Flex-based components where it makes sense. That’s right–no more JavaServer Faces. (Alfresco engineers say JSF just kept getting in the way).

Another interesting aspect of the new web client is the plan to make it an Alfresco WCM-managed web site. That means web client customizations would be handled like changes to any other web site. The new web client could also be used as an example of how to build your own dynamic web site on top of Alfresco’s REST interface. Custom solutions could optionally leverage Alfresco components as needed alongside custom components built on web scripts. The “classic” web client will continue to live for at least two years after 3.0.

An important side note to this change is that with 3.0, the web client and the repository no longer run in the same process. The repository will continue to be a web app deployed to a servlet container, but it won’t be coupled with the web client. They will be two separate web apps.

Alfresco’s Moves to the Front-End: Alfresco Dynamic Web Site

The other big buzz was around the new Alfresco Dynamic Web Site. In a nutshell, this gives Alfresco WCM something it has lacked, particularly when compared to offerings from folks like Vignette or Drupal: a front-end presentation framework.

Currently when you install Alfresco WCM you get just about everything you need to manage a web site but you don’t get a web site or any tools to help you build the web site. Alfresco’s Dynamic Web Site is an attempt to provide a sample site, a set of components, and tools for WYSIWYG editing of the web site. It makes more sense when you see it, but imagine previewing a web site and then dragging and dropping components, web content, and images from a tree view of your repository onto regions of a web page and you’ll have some idea of what this is.

Under this model, Alfresco hopes that web script-based components will flourish into a library of publically-shared modules a la Drupal or Sharepoint’s web parts. Web scripts are built with JavaScript (or Java) and Freemarker which is a much simpler (and open) development model than that of Microsoft’s web parts.

Alfresco for the iPhone

Yet another good example of the power of web scripts was Yong Qu’s iPhone demo. Using Apple’s iPhone SDK and development tools, Yong built an interface to Alfresco for the iPhone. Using an online iPhone emulator, he showed how he could browse the repository, view documents and images, and search all through the slick iPhone interface. He tied that in to Alfresco’s new SMTP capability by taking a picture of the audience with his real iPhone, sending it to his Alfresco server via email, and then using the iPhone emulator to search the repository for the newly-added picture. The interface to Alfresco was based on three web scripts–one that handled browsing the DM repository, one that handled browsing the AVM repository, and one that handled search.

[Updated 2.9 Enterprise date which I had incorrectly listed as 2007]