40
A Developer’s Intro to the Alfresco Platform Jeff Potts July 2011

Developer’s intro to the alfresco platform

Embed Size (px)

DESCRIPTION

Slide deck to accompany Jeff Potts' webinar introducing new developers to the Alfresco platform

Citation preview

Page 1: Developer’s intro to the alfresco platform

A Developer’s Intro to the Alfresco Platform

Jeff Potts July 2011

Page 2: Developer’s intro to the alfresco platform

Agenda

•  Extremely High-Level Overview •  Alfresco Architecture •  Developer Setup •  Alfresco Development Model •  Demo • Q & A

Page 3: Developer’s intro to the alfresco platform

EXTREMELY HIGH-LEVEL OVERVIEW

source: flyfshrmn98

Page 4: Developer’s intro to the alfresco platform

Alfresco Overview

• Open source platform for Enterprise Content Management • Can manage any kind/size of file •  Stores the file and metadata about

the file o  Files live on the file system, metadata in the db o  Metadata model is extensible

•  Indexes all content and metadata for search

Page 5: Developer’s intro to the alfresco platform

Alfresco Overview (Cont’d)

•  Secures files to specific users and groups •  Transforms many types of documents •  Provides versioning and check-in/

check-out •  Has a built-in workflow engine • Can be accessed through a browser

or from desktop applications via CIFS, WebDAV, FTP, SMTP, IMAP, SharePoint

Page 6: Developer’s intro to the alfresco platform

Origins

•  Founded in 2005 o  John Newton •  Founding developer of Ingres •  Co-founded Documentum

o  John Powell •  COO of Business Objects •  President of Oracle UK

o  Lots of Engineers from Documentum, Interwoven, Vignette

•  Assembled from Open Source components

Page 7: Developer’s intro to the alfresco platform

Core Products

•  Repository •  Explorer Client •  Share Client • Web Content Management •  Records Management

Page 8: Developer’s intro to the alfresco platform

Add-Ons

•  Web Quick Start •  SharePoint integration •  Google Docs integration •  Facebook integration •  Plus many add-ons and extensions available from

the community o  Alfresco Forge o  Google Code o  SourceForge.net o  Github o  Alfresco Wiki

Page 9: Developer’s intro to the alfresco platform

Available in 3 Editions

•  Enterprise o  Commercial support available from Alfresco o  Clustering, JMX, commercial DB & app server

support

•  Team o  Same software as Enterprise, with a lower price

point o  Meant for departmental and SMB deployments o  User- and content volume-limited license

• Community o  Community- or self-supported

Page 10: Developer’s intro to the alfresco platform

What can I do with Alfresco?

•  Out-of-the-box o  Document Management o  Web Content Management o  Team/Project Collaboration o  Records Management o  Imaging/Digital Asset Management o  SharePoint Replacement

•  Custom content-centric applications o  Lots of options here o  API’s discussed later

Source: craig rodway

Page 11: Developer’s intro to the alfresco platform

Obtaining Alfresco

•  Requirements o  An operating system that can run Java

o  A servlet container such as Tomcat or JBoss

o  A JDBC-compliant database

• Where to get it o  Alfresco home page

o  Public SVN for Community source

o  Alfresco Customer/Partner site for Enterprise binaries

o  Private SVN for Enterprise source

Page 12: Developer’s intro to the alfresco platform

Obtaining Alfresco (cont’d)

•  Distribution o  Repository (binary installer or WAR-only)

•  Includes Alfresco Explorer and Alfresco Share

o  SDK (includes most source)

o  WCM

•  Web Quick Start

•  “AVM” style

100% of the source code is available in SVN. Not necessarily needed for your project, though.

Page 13: Developer’s intro to the alfresco platform

Installing Alfresco

•  Alfresco deploys as a web application

•  Binary installer o  Available for all operating systems

o  Linux installer does not require a GUI

o  Uses PostgeSQL if you do not already have a db

•  Alfresco WAR file o  Deploys like any other WAR

o  By default, looks for MySQL db alfresco/alfresco

Page 14: Developer’s intro to the alfresco platform

ALFRESCO ARCHITECTURE

source: phil romans

Page 15: Developer’s intro to the alfresco platform

High-level Architecture

CIFS

WebDAV

FTP

SMTP

IMAP

SharePoint

Workflow Engine

Search Engine

Transformation Engine

Library Services

Web Script

Engine

Forms Engine

DB LDAP Files

Alfresco WAR

Surf Frame work

Web Script

Engine

Forms Engine

Share WAR

Thick Clients JSO

N, X

ML

Major Browsers

Page 16: Developer’s intro to the alfresco platform

High-level Custom Front-End

Drupal

Web Client

CIFS

Web Services Web Scripts LDAP

SSO

Content Managers &

Administrators

Custom App Users

SOAP HTTP/S

Page 17: Developer’s intro to the alfresco platform

The Beauty of

?

Presentation Tier

Content Services Tier

? Enterprise Apps Tier

Fast, flexible, modular user interface

Open, scalable repository, metadata, versioning, workflow

REST SOAP

Page 18: Developer’s intro to the alfresco platform

Major Sub-systems

•  Authentication •  Workflow

o  JBoss jBPM •  Scheduler •  Auditing •  Renditions

o  ImageMagick o  OpenOffice

•  Email

Page 19: Developer’s intro to the alfresco platform

DEVELOPER SETUP

Sou

rce

: th

om

as

ha

wk

Page 20: Developer’s intro to the alfresco platform

Extensions Mechanism

•  Don’t touch Alfresco’s files •  Use “extension” directory for

alfresco WAR •  Use “web-extension”

directory for share WAR •  Both must live on classpath

o  I prefer copying into an exploded WAR

o  Some prefer using Tomcat shared dir

Sou

rce

: Ma

rtin

De

uts

ch

Page 21: Developer’s intro to the alfresco platform

Development Environment

•  Any IDE o  Eclipse or SpringSource Tool Suite most common

•  Ant-based builds o  Maven archetypes exist for Community edition

•  Sun JDK 1.6 •  Alfresco SDK

Page 22: Developer’s intro to the alfresco platform

Optional Tools

•  Apache Directory Studio (LDAP) •  Apache Chemistry Workbench (CMIS) •  Apache James (SMTP) • Workflow modeler Eclipse plug-in

(JBoss GPD, Activiti) •  cURL •  Firebug Firefox Add-on •  Tamper Data Firefox Add-on

Page 23: Developer’s intro to the alfresco platform

HIGH-LEVEL DEVELOPMENT MODEL

Page 24: Developer’s intro to the alfresco platform

Data Modeling

•  Repository is a collection of nodes •  Everything is a node, nodes are typed • Content Model is expressed in XML

o  Cold-deploy most common, hot deploy possible

•  Types, aspects, properties, associations, constraints •  Hierarchical

o  Types inherit from super types

Page 25: Developer’s intro to the alfresco platform

Forms/UI Config

•  Forms are modeled in XML o  Explorer: web-client-config-custom.xml o  Share: share-config-custom.xml

•  Form Service o  Processes and persists form data o  Filters for intercepting form data before and after

form submit o  RESTful API for retrieving form model as JSON

Page 26: Developer’s intro to the alfresco platform

Form Config Example

<field id=”sc:itemShortDescription" label-id="label.shortDescription" description-id="description.shortDescription" set="header" mandatory="true”> <control template="controls/textfield.ftl”> <control-param name="maxLength">100</control-param> </control> </field>

<field id=”sc:itemSku" label-id="label.sku" description-id="description.sku" set="header" />

<field id=”sc:solutionSections" label-id="label.solutionSections” description-id="description.solutionSections" set="sections”> <control template="/org/alfresco/components/form/controls/sc-association.ftl”> <control-param name="showTargetLink">true</control-param> <control-param name="allowOtherAssocs">false</control-param> </control> </field>

Page 27: Developer’s intro to the alfresco platform

Queries

•  Alfresco isn't relational o  So don’t try to build highly-relational systems

using only the Alfresco repo

•  Lucene •  Alfresco FTS • CMIS queries (SQL-like) •  Xpath •  Apache Solr

o  Coming with the next major release (“Swift”)

Page 28: Developer’s intro to the alfresco platform

Security - Authentication

•  Spring Security Framework (ACEGI) under the covers •  Alfresco can handle it or pass it off to

others •  ActiveDirectory •  LDAP •  Kerberos •  NTLM •  SSO •  Custom

Source: roo reynolds

Page 29: Developer’s intro to the alfresco platform

Security - Authorization

•  Users & Groups •  Access Control Lists •  Permissions •  Hierarchical

o  By default, child nodes inherit ACL of their parent o  Inheritance can be turned off for a given node

Page 30: Developer’s intro to the alfresco platform

Alfresco APIs (1 of 2)

•  Java Foundation API o  Explorer client, actions, behaviors, web script

controllers, workflow logic

•  Server-side JavaScript API o  Web script controllers, utility scripts, workflow

logic

•  Freemarker o  Web script views, Surf templates, email templates

• Client-side JavaScript API o  Share client-side logic

Page 31: Developer’s intro to the alfresco platform

Alfresco APIs (2 of 2)

•  RESTful API (Web Script Framework) o  Remote clients, Share customizations

• Web Services API (SOAP) o  Remote clients

• CMIS API o  Remote clients (Both ATOM Pub and SOAP)

•  JCR API o  Embedded repo, remote clients via RMI

Page 32: Developer’s intro to the alfresco platform

What is the Web Script Framework?

• Web Script Framework used to declare a URL, bind it to logic, provide views o  Model-View-Controller pattern o  Controller implemented in JavaScript or Java o  Views implemented in FreeMarker

•  Deployed to the repository or the classpath •  Part of the Spring Surf Project

http://springsurf.org/

Page 33: Developer’s intro to the alfresco platform

What is Spring Surf?

• Web application development framework built on web scripts •  Essentially web scripts++

o  Page definition o  Declarative handshakes to HTTP end points o  Page, page type, and object dispatching

•  Includes built-in hooks for talking to Alfresco and loading objects from the repository

Page 34: Developer’s intro to the alfresco platform

What is CMIS?

• OASIS standard o  Alfresco, IBM, Microsoft, Oracle, FileNet support o  Alfresco was first to production with CMIS

•  Two parts o  Interoperability through standard SOAP and

Atom Pub bindings o  SQL-based query language for rich content

repositories

•  New JSON binding coming soon

Page 35: Developer’s intro to the alfresco platform

What is CMIS? (Cont’d)

•  Think of it as a language-independent, repository-independent API for content management o  CRUD functions for nodes o  Check-in/check-out o  Associations o  Permissions (Access Control Lists) o  Policies o  Queries o  Repository traversal

Page 36: Developer’s intro to the alfresco platform

Alfresco & Apache Chemistry

• Chemistry is the home of several client-side CMIS libraries as well as server-side reference implementations •  Alfresco employs the Chemistry project

chair and multiple committers • OpenCMIS, the Java API for CMIS, is

used within the product • Chemistry lets you access your Alfresco

repo from Java, PHP, Python, & .NET

Page 37: Developer’s intro to the alfresco platform

Demo/Code

Page 38: Developer’s intro to the alfresco platform

Much More to Explore on Your Own

•  Alfresco Explorer & Share Customization

•  Behaviors •  Metadata

Extractors •  Transformers •  Advanced

Workflow (JBoss jBPM, Activiti)

•  Permissions

•  Authentication against LDAP

•  Web Services API •  AMPs •  Import/Export •  Web Content

Management •  Share Forms •  Share Themes •  Share Dashlets

Page 39: Developer’s intro to the alfresco platform

For More Information…

•  Alfresco Community http://www.alfresco.org

•  Alfresco Forums http://forums.alfresco.com

•  Alfresco Wiki http://wiki.alfresco.com

•  Alfresco Blogs http://blogs.alfresco.com/planet/

•  ECM Architect http://ecmarchitect.com

•  Documentation http://docs.alfresco.com

•  Freenode IRC #alfresco

•  Twitter @alfresco

•  Code Examples http://code.google.com/p/share-extras http://code.google.com/p/alfresco-developer-guide

Page 40: Developer’s intro to the alfresco platform

THANK YOU! Tweet me with questions/feedback @jeffpotts01