Monday, October 20, 2008

Learning Surf 1 - building from source

My goal was to build the latest Alfresco from source, and begin to develop and extend it using Eclipse. I followed the instructions on: Alfresco's developer wiki . I followed the guidance of the Eclipse section to import all alfresco projects.

Unfortunately, between the first time I did this (early September) and the latest time (October 15), there was significant changes to the codebase that affected the Eclipse projects I imported earlier. I went through the pain of refreshing projects and rebuilding everything until I finally got everything to pass. It was probably better that i deleted these older projects and started with fresh imports. This is a large code base (over 500 meg compressed) so I warn you that this will take some time. Once the code base is built from source, I can follow along refreshing as needed.

Note, since I am developing on a Windows laptop (dont ask why), I used tortoise svn. This worked fairly well for me. I also got the subversion plug in for Eclipse. These two seem to work well with each other well for now.

My first step was to build the alfresco war. I had already created an alfresco database in MySQL as the wiki suggested. I also had tomcat 5.5 installed and Ant so the build was fairly painless.

ant build-tomcat

This created the alfresco.war and deployed it to TOMCAT_HOME. Make sure to set up the environment variables as described. TOMCAT_HOME will be where the alfresco.war will be deployed. APP_TOMCAT_HOME will be where share.war and alfwf.war will be deployed. These can be different or the same. Alfresco 3.0 is now truly service oriented and webapps can be developed (i.e. share.war) and deployed independently of the repository (alfresco.war). For development purposes, I set these to the same tomcat instance.

One problem my team ran into was that share.war refused to authenticate admin/admin. We later determined this was due to the fact that we were running tomcat on a different port than 8080 and there were several configuration files that needed to be changed to reflect this:


After building and deploying alfresco.war and share.war, and testing, I switched to the instructions for building and deploying the surf platform. In these instructions, the alfwf.war is built and deployed (alfwf.war) to APP_TOMCAT_HOME. This is a minimal implementation of the webframework that only brings up a test page:


which runs some tests and dumps some configurations.

Alfresco Surf applications are created leveraging the following technologies and we should be familiar with all of them:
At this point, the fun begins - creating templates and components to the new surf platform.

No comments: