Feeds:
Posts
Comments

Posts Tagged ‘SURF’

I just read about Sachin’s blog on Maven and just thought of writing this one i.e. integrating SURF into your web application using Maven.

Just to let you know if you were not using Maven and you needed to install SURF in to your web application all you need to do is just drop the below mentioned jars into your WEB-INF/lib directory of your project. The jars to be included are:

  1. alfresco-core-3.3.0-SNAPSHOT.jar
  2. alfresco-jlan-3.3.0-SNAPSHOT.jar
  3. alfresco-web-framework-3.3.0-SNAPSHOT.jar
  4. alfresco-webscript-framework-3.3.0-SNAPSHOT.jar

Now make sure that your application has the following imports in your web mvc application as :

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

Once you are done with the above steps you just need to restart your application server and SURF will get bootstrapped and available as view resolver.

Now to achieve the same in MAVEN all you need to do is have the below mentioned dependency into your Maven powered web application:

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

and the above mentioned import statements.

Now run mvn install and the build process will get all the dependencies related to SURF.

Happy SURFing until next time!!!

Read Full Post »

SURF helps you to build user interfaces for your Web Applications using server-side scripts and templates.

Alfresco Share is the best example for its implementation and the other one is Activison’s DAM (Digital Asset Management) system.It’s the first application to be developed on SURF at the Enterprise level and I feel really proud to work on with it. I would like to thank Timothy Bergeron and Jeremy Osterloh at Activision for all their support and help in making me learn SURF.

The best thing I like about SURF is no JAVA coding(yes really no java coding….), no recompilation and no server restarts. You just need a text editor and there you are ready to make changes to live site. It provides features such as Scripts & Templates, Reusability,Spring Web MVC, Content Management, 2-tier mashup architecture.

As a developer you need to look into SprinRoo a light weight developer tool released by SpringSource community.

You may read more information @ http://wiki.alfresco.com/wiki/Spring_Surf

Content
It is the dynamic information that the web application looks to at runtime to inform its decision about what to render or how to render.
A Spring Surf Web Application may have two kinds of dynamic content – Semantic Content & Presentation Content. These both together inform SURF of what to render as well as how to render .

Semantic Content It consists of documents or files that may describe business-generated content. Such content are authored, approved and published. e.g. A Contact Detail content to be displayed on the home page.
Semantic Content can be thought of as information that describes what should be rendered. It contains the approved messaged but it doesn’t contain any formatting information. The data may be in pure data format such as JSON or XML. Consider my contact details in JSON format as
below:
{
“contact_name”    :    “Sujay Pillai”,
“contact_number”:    “8008882182”,
“designation”    :    “Software Engineer”,
“organization”    :    “Zensar Technologies Ltd.”
}

Presentation ContentIt consists of documents and files that descibe presentation configuration for a Web Site. It contains all the configurations that informs the SURF rendering engine how the Web page or page component should look and feel.

It contains answers to questions from Semantic Content such as –
1) Which theme should be used to render the Web site’s home page?
2) How many contacts should I display on the front page?
3) For a current user which advertisement should be displayed?

It answers the question of how things should be rendered.

Consider the following XML configuration that is responsible for rendering the Global header in “Alfresco Share” –
<component>
<scope>global</scope>
<region-id>header</region-id>
<source-id>global</source-id>
<url>/components/header</url>
</component>

Consider the scenario when you hit the login button on Alfresco Share –
1. The browser request arrives to Spring Surf.
2. Surf asks the content delivery services for the presentation content that describes what is being requested.
3. The presentation content is handed back as XML.
4. Surf determines the Web Script to execute and does so using the configuration specified by the XML.
5. The Web script calls over to the content delivery services and asks for header data.
6. The header is returned as HTML.

Read Full Post »