Alfresco Content Services 5.2 Developer Guide - ?· Developer Guide Developer Guide 5 Alfresco Content…

  • View
    215

  • Download
    0

Embed Size (px)

Transcript

  • Alfresco Content Services 5.2

    Developer Guide

  • Contents

    Developer Guide 2

    Contents

    Developer Guide........................................................................................3Alfresco Content Services architecture............................................................................... 3

    Alfresco Content Services architecture overview........................................................ 5Access protocols........................................................................................................18Repository concepts.................................................................................................. 19Mini glossary..............................................................................................................24

    Alfresco SDK 2.2.0............................................................................................................ 28What's new?.............................................................................................................. 28Introduction to the Alfresco SDK............................................................................... 30Getting Started with the Alfresco SDK...................................................................... 35Maven Archetypes - Command Reference............................................................... 56Rapid Application Development (RAD)..................................................................... 65Advanced Topics....................................................................................................... 95Upgrading.................................................................................................................125Using the REST API Explorer................................................................................. 170Using MySQL...........................................................................................................171

  • Developer Guide

    Developer Guide 3

    Developer Guide

    The Developer Guide includes extensive guidance and reference materials to aid the developer increating applications and extensions for Alfresco.

    This Developer Guide PDF does not include the full developer documentation andAPI references. To access the complete set of documentation, see the online Alfrescodocumentation.

    There are a number of approaches to developing for Alfresco depending on what you want todo. For example, if you are writing a client application, perhaps in Ruby or Python to connect toAlfresco either on-premise, or Alfresco in the Cloud, then you would most likely use the AlfrescoREST API. If on the other hand you wanted to write a server-side extension in Java, you woulduse the Public Java API, or perhaps write a web script using Java, JavaScript and FreeMarker.Generally if you are creating extensions to Alfresco you would use the Alfresco SDK. This allowsyou to work in your IDE of choice, using technologies you already know, such as Java andMaven.

    This Developer guide attempts to lay out the various options available to you, so you can use theright approach, depending on what you want to achieve.

    Alfresco Content Services architecture

    This gives a view of the architecture of Alfresco Content Services from the developer'sperspective. At its core is a repository that provides a store for content, and a wide range ofservices that can be used by content applications to manipulate the content.

    The following diagram illustrates the idea that can be thought of as consisting of three maincomponents, Platform, User Interface (UI), and Search. These components are implemented asseparate web applications:

    The main component is called the Platform and is implemented in the alfresco.war webapplication. It provides the repository where content is stored plus all the associated contentservices. Alfresco Share provides a web client interface (that is a User Interface, UI) for therepository and is implemented as the share.war web application. Share makes it easy for users

    http://docs.alfresco.comhttp://docs.alfresco.com
  • Developer Guide

    Developer Guide 4

    to manage their sites, documents, users and so on. The search functionality is implemented ontop of Apache Solr 4 and provides the indexing of all content, which enables powerful searchfunctionality. Besides the web clients accessing the Repository via Share there are also mobileclients that will access the content via REST APIs provided by the platform.

    If we dive deeper into the platform (packaged in alfresco.war) we will see that it also supportsworkflow in the form of the embedded Activiti Workflow Engine. The platform is usually alsointegrated with a Directory Server (LDAP) to be able to sync users and groups with AlfrescoContent Services. And most installations also integrates with an SMTP server so the Platform cansend emails, such as site invitations.

    For more information about the internals of the Platform, and specifically the content repository,see the concepts section.

    Besides Share there are also many other clients that can connect to the repository, includingany CMIS-compatible client, and via the Microsoft SharePoint protocol any SharePoint client.Enterprise to Cloud Sync can synchronize content between an on-premise installation of and inthe Cloud, under user control.

    The Platform also contains numerous APIs, Services, and Protocols.

    The following diagram illustrates this extended architecture:

    Note that content metadata is stored in a relational database system such as PostgreSQL,MySQL, Oracle, and so on. The content itself is stored on the file system (or other storage systemsuch as Amazon S3).

    Alfresco provides a number of extension points to allow you to customize it. These extensionspoints have various formats, but include:

    Platform extension points and detailed architecture

    Share extension points and detailed architecture

    Share integration points and detailed architecture

    APIs

    Protocols

    Services

    The links in the list above provide further information on each of these topics.

    http://docs.alfresco.com/activiti/topics/welcome.html
  • Developer Guide

    Developer Guide 5

    Alfresco Content Services architecture overviewAt the core of the Alfresco Content Services system is a repository supported by a server thatpersists content, metadata, associations, and full text indexes. Programming interfaces supportmultiple languages and protocols upon which developers can create custom applications andsolutions. Out-of-the-box applications provide standard solutions such as document managementand records management.

    As a Java application, the system runs on virtually any system that can run Java EnterpriseEdition. At the core is the Spring platform, providing the ability to modularize functionality, suchas versioning, security, and rules. Alfresco Content Services uses scripting to simplify addingnew functionality and developing new programming interfaces. This portion of the architecture isknown as web scripts and can be used for both data and presentation services. The lightweightarchitecture is easy to download, install, and deploy.

    There are many ways to deploy, however most deployments follow a general pattern. Ultimately,Alfresco Content Services is used to implement ECM solutions, such as document managementand records management. There can also be elements of collaboration and search across thesesolutions.

    The solutions are typically split between clients and server, where clients offer users a userinterface to the solution and the server provides content management services and storage.Solutions commonly offer multiple clients against a shared server, where each client is tailored forthe environment in which it is used.

    Clients

    Alfresco Content Services offers a web-based client called Alfresco Share, built entirely withthe web script technology. Share provides content management capabilities with simple userinterfaces, tools to search and browse the repository, content such as thumbnails and associatedmetadata, previews, and a set of collaboration tools such as wikis and discussions. Share isorganized as a set of sites that can be used as a meeting place for collaboration. It's a web-basedapplication that can be run on a different server to the server that runs the repository, providingopportunities to increase scale and performance.

    Share can be deployed to its own tier separate from the content application server. It focuseson the collaboration aspects of content management and streamlining the user experience. It'simplemented using Surf and can be customized without JSF knowledge.

    Clients also exist for portals (by using JSR-168 portlets), mobile platforms, Microsoft Office,and the desktop. In addition, using the folder drive of the operating system, users can sharedocuments through a network drive. Using JLAN technology, Alfresco can look and act just like afolder drive. JLAN is the only Java server-side implementation of the CIFS protocol, letting usersinteract with Alfresco Content Services as they do any other normal file drive except the contentis now stored and managed in the content application server.

    Server

    The content application server comprises a content repository and value-added services forbuilding solutions.

    The content application server provides the following categories of services built upon the contentrepository:

    Content services (transformation, tagging, metadata extraction)

    Control services (workflow, records management, change sets)

    Collaboration services (social graph, activities, wiki)

    Clients communicate with the content application server and its services through numeroussupported protocols. HT