Surf

cancel
Showing results for 
Search instead for 
Did you mean: 

Surf

resplin
Intermediate
0 0 3,280

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Surf
3.3

NOTE: This document describes features for the Spring Surf project.  This is a work-in-progress.  For information about Surf in Alfresco 3.2 and prior, please see the Alfresco Surf Platform.



Surf Logo|center



Surf is a scriptable view composition framework for Spring MVC.  It enables developers to quickly develop rich web application interfaces using templates and scripting.  Surf provides view resolution for Spring MVC applications and integrates nicely with the Spring technology stack including Spring Web Flow, SpringSource Tool Suite and alternative view resolvers technologies.

By late November 2009, Surf will be available as an community extension for Spring.  This project will consist of the following:


  • Web Script Framework
  • Web Framework
  • Web Studio

Please keep an eye on this page for more details as they become available.





Overview


Surf provides an descriptive web site object-model enabling developers to quickly create pages from templates, components, themes, chrome and more.  Surf extends the principles of Web Scripts so that entire web applications can be scripted on top of content delivery services such as CMIS, ATOM, XML, JSON, RSS and more.

Using Surf, developers can:


  • Create brand new web applications in a pure scripting environment.
  • Add pages and views to new or existing Spring MVC applications.
  • Develop views using best-of-breed scripting technologies including Freemarker, Groovy, PHP and server-side Javascript.
  • Work with an expressive and extensible site composition object model which includes pages, templates, components and more.
  • Take advantage of scoped-component bindings for component reuse and brand consistency.
  • Work with remote feeds and connector credential management to mashup content presentation.
  • Script the creation of the web site and installation of sample content using Spring Roo.
  • Leverage Surf add-ons and templates for SpringSource Tool Suite.




Why was Surf developed?


Surf was developed by Alfresco Software as a better way to build web applications and web sites.  Prior to Surf, Alfresco had resorted to building its applications using heavier, more costly Java-intensive technologies such as JSF or Struts.

Instead, Alfresco's community asked for an easier and more lightweight approach to creating application service and user interface extensions.

The Alfresco Web Scripts framework was developed to provide an easy and scriptable way to build new remote REST interfaces for Alfresco.  The Alfresco Surf Web Framework was then developed to provide an easy and scriptable way to do the same thing for entire web applications.

Alfresco Share is an example of a web application that was built using Surf.

Alfresco Share|400px|center




Getting Started


Surf is available to the community under the Apache License 2.0.  You are welcome to use it in your own projects and we encourage the community to participate in Surf's development.


Binary Installation


Installing Surf is as simple as dropping a few JAR files into your web application.  The following JAR files are all you need:


  • alfresco-core-3.3.0-SNAPSHOT.jar
  • alfresco-jlan-3.3.0-SNAPSHOT.jar
  • alfresco-web-framework-3.3.0-SNAPSHOT.jar
  • alfresco-webscript-framework-3.3.0-SNAPSHOT.jar

You just drop these into your web application's WEB-INF/lib directory.  You then need to make sure your Spring MVC application performs the following imports in your web mvc configuration file:



<import resource='classpath*:org/alfresco/web/scripts/*-context.xml' />
<import resource='classpath*:org/alfresco/web/framework/*-context.xml' />

When you restart your application server, Surf will bootstrap and make itself available as a view resolver.


Maven Installation


A much better way to use Surf in your Spring projects is to simply adjust your Maven builds to pull Surf in.  Surf will soon be available on in the following Maven repositories:


  • Maven Central
  • SpringSource's Maven Repository

To install Surf into your Maven-powered Spring project, all you need to do is add the following dependency:



<dependency>
   <groupId>org.alfresco</groupId>
   <artifactId>alfresco-web-framework</artifactId>
   <version>3.3.0-SNAPSHOT</version>
</dependency>

You can then run a mvn install and your Maven build process will pull down Surf as well as its dependencies.

You will also need to make sure that your Spring MVC application performs the following imports in its web mvc configuration file:



<import resource='classpath*:org/alfresco/web/scripts/*-context.xml' />
<import resource='classpath*:org/alfresco/web/framework/*-context.xml' />

When you restart your application server, Surf will bootstrap and make itself available as a view resolver.


Community Contribution


Alfresco would like to encourage participation from the community in the development of Surf.


Source Code


The source code for Surf is currently part of the Alfresco source tree available via Subversion:



svn://svn.alfresco.com/alfresco/HEAD

For more information on the Alfresco build and setting up your build project, please read about the Alfresco Development Environment.