Currently Being Moderated

Integrating Elastic Path with the Alfresco CMS

Posted by Paul Monk on Oct 18, 2009 11:25:46 PM

We often get asked whether Elastic Path can be integrated with a CMS. We always answer, "yes, of course!" but I suspect at least a few of us wonder how much effort is really involved. I know I did. Well, now I can say that the effort is minimal (no coding required!), at least if you're using Alfresco. Alfresco is a production-ready, open source content management system, and in this post, we'll see just how easy it is to install Alfresco, import your assets, and set up Elastic Path to pull assets from Alfresco.

 

First, you'll need to get Alfresco on your machine. Alfresco comes in two flavors:

  • Enterprise Edition, which includes full commercial support
  • Community Edition, which is unsupported and intended for developers who just want to play around with it.

 

Download the Community Edition (at the time of writing, the current version of the Community Edition is 3.2). Note that although the Community Edition is unsupported, you can still ask questions in the Alfresco forums. The Alfresco wiki is also an excellent source information.

 

When you run the Alfresco setup, it will ask you to specify the setup type. To keep things simple, choose typical. This installs all the required components including Java, Tomcat, and MySQL. If you already have Tomcat installed, you may need to change the Server and Connector ports to avoid conflicts. You can do this after the installation is complete by editing tomcat\conf\server.xml under your Alfresco installation directory.

 

After it's installed and running, go to the login screen (http://localhost/alfresco) and enter the administrator username and password (admin/admin).

 

After logging in, go to the Company Home area and create a space to store the assets for your Elastic Path deployment. Under Browse Spaces, click Sites. (You can choose Web Projects instead if you prefer.)

alfresco_browse_spaces.png

Click Create->Create Space.

alfresco_create_space.png

Enter a name and title for the space and click Create Space. Your space now appears under Browse Spaces.

alfresco_new_space.png

Now you need to add your Elastic Path assets to your space. The fastest way to do this is to zip your entire assets directory and import the zip file into the space.

 

First click the space name. Then click More Actions->Import.

alfresco_import.png

Browse to the assets zip file, select it, and click OK. After the zip file is imported, the contents are extracted automatically and the directory structure is recreated within the space. It might take a few minutes to complete, so the folder may not appear in Alfresco right away. (You can delete the zip file after the assets folder is created.)

 

Now we need to get the SMB/CIFS path that we can use in Windows Explorer to access the assets. Click the View Details icon under the assets folder.

alfresco_view_details.png

If you're using Internet Explorer, click View in CIFS. (Because it's using a UNC path, it won't work in other browsers.)

alfresco_view_in_cifs.png

In the Community Edition, all the supported repository access protocols are enabled by default, including FTP and SMB/CIFS. Unless you've done something strange, you should see a Windows Explorer window showing the contents of the assets folder in Alfresco. (If you're not using Internet Explorer, copy the CIFS link from your browser and paste it into Windows Explorer.)

alfresco_explorer.png

Take note of the path in the address box. It should start with the Alfresco server name followed by an "a". That "a" is automatically added by Alfresco, but it can be configured by changing the cifs.serverName property in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystems\fileServers\default\file-servers.properties , located under your Alfresco installation directory. For more information, see http://wiki.alfresco.com/wiki/File_Server_Subsystem.

 

The next step is to map that path to a Windows drive letter. (The COMMERCE/SYSTEM/assetLocation setting in Elastic Path must be set to a valid file system path; UNC paths are not supported.) In Windows Explorer, click Tools->Map Network Drive. Select an unused drive letter and enter the path in the folder field. Make sure Reconnect at logon is selected. Then click Connect using a different user name. Enter the Alfresco administrator user name and password. Click Finish.

alfresco_map_net_drive.png

The final step is to log on to the Commerce Manager client and configure the COMMERCE/SYSTEM/assetLocation setting to point to the assets folder on the mapped drive. After you do this, restart your app server. Your storefront will now be pulling its theme files, images, etc. from Alfresco. You'll also need to point the different VFS settings in Elastic Path to use Alfresco's FTP so that the CM client's asset manager is able to retrieve the assets from Alfresco as well.

 

Once your assets are in Alfresco, you'll be able to take advantage of its sophisticated content approval workflow and collaboration features.