Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Alfresco CMIS
Alfresco CMIS
Alfresco CMIS
Ebook557 pages3 hours

Alfresco CMIS

Rating: 0 out of 5 stars

()

Read preview

About this ebook

The book will show readers how to use Alfresco’’s implementation of CMIS through a tutorialbased approach. It also has plenty of examples to help illustrate the concepts that you will learn.

If you are a developer who wants to learn how to build applications that talk to content management servers in a standard way using CMIS, this book is ideal for you. It will be helpful if you have a bit of programming experience, although it is not necessary.
LanguageEnglish
Release dateMar 25, 2014
ISBN9781782163534
Alfresco CMIS
Author

Martin Bergljung

Martin Bergljung is a Principal ECM Architect at Ixxus, a UK platinum Alfresco partner. He has over 20 years of experience in the IT sector, where he has worked with the Java platform since 1997. Martin began working with Alfresco in 2007 developing an email management extension for Alfresco called OpsMailmanager. In 2009 he started doing Alfresco consulting projects and has worked with customers such as Virgin Money, ITF, Unibet, and BNP Paribas.

Related to Alfresco CMIS

Related ebooks

Programming For You

View More

Related articles

Reviews for Alfresco CMIS

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Alfresco CMIS - Martin Bergljung

    Table of Contents

    Alfresco CMIS

    Credits

    About the Author

    About the Reviewers

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    Why Subscribe?

    Free Access for Packt account holders

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Errata

    Piracy

    Questions

    1. Getting Started with CMIS

    Understanding CMIS

    Commercial products and companies supporting CMIS

    The benefits of using CMIS

    CMIS use cases

    Repository to Repository (R2R)

    Application to Repository (A2R)

    Application to Multiple Repositories (A2MR)

    An overview of the CMIS standard

    The domain model (object model)

    Services

    Query language

    Protocol bindings

    RESTful AtomPub binding

    Web Service binding

    RESTful Browser binding (CMIS 1.1)

    Summary

    2. Basic CMIS Operations

    Setting up a CMIS server

    Installing your own CMIS server

    Using cmis.alfresco.com

    Setting up a tool to make HTTP requests

    Authenticating with the repository

    Getting repository information

    Repository information via the AtomPub binding

    Repository information via the Browser binding

    Listing the children of the root folder

    Listing the children of the root folder with the AtomPub binding

    Listing the children of the root folder with the Browser binding

    Optional parameters when listing the children of a folder

    Optional parameters when listing the children of a folder with the AtomPub binding

    Optional parameters when listing the children of a folder with the Browser binding

    Listing available types and subtypes

    Listing the types and subtypes with the AtomPub binding

    Listing the types and subtypes with the Browser binding

    Getting metadata and content

    Getting metadata and content with the AtomPub binding

    Getting metadata and content with the Browser binding

    Creating, updating, and deleting content

    Creating folders

    Creating a folder with the AtomPub binding

    Creating a folder with the Browser binding

    Creating documents

    Creating a document with the AtomPub binding

    Creating a document with the Browser binding

    Updating folders and documents

    Updating a document with the AtomPub binding

    Updating a document with the Browser binding

    Deleting a folder or a document

    Deleting a folder or document with the AtomPub binding

    Deleting a folder or document with the Browser binding

    Summary

    3. Advanced CMIS Operations

    Version management with check out and check in

    Version management with the AtomPub binding

    Checking out a document with the AtomPub binding

    Cancelling the check out with the AtomPub binding

    Updating the physical contents of the checked-out document with the AtomPub binding

    Checking in a document with the AtomPub binding

    Version management with the Browser binding

    Checking out a document with the Browser binding

    Cancelling the check out with the Browser binding

    Updating the physical content of the checked-out document with the Browser binding

    Checking in a document with the Browser binding

    Managing permissions for documents and folders

    Access control list capabilities

    Access control concepts

    Supported permissions

    Allowable actions and permission mapping

    Managing permissions with the AtomPub binding

    Managing permissions with the Browser binding

    Managing relationships between objects

    Creating and reading relationships with the AtomPub binding

    Creating and reading relationships with the Browser binding

    Searching

    Searching with the AtomPub binding

    Searching with the Browser binding

    CMIS query examples

    A word on transactions

    Summary

    4. Alfresco and CMIS

    Timeline

    Architecture/stack

    Alfresco content model mapping to the CMIS object model

    Repository capabilities

    Type mappings

    Property mappings

    Object path's explanation

    Versioning

    Access control

    Change log

    Renditions

    Search

    Support for Alfresco-specific features

    Aspects

    Tags

    Categories

    Summary

    5. Accessing a CMIS Server with a Java Client

    Setting up a build environment

    Connecting and setting up a session with the repository

    Connecting to a repository by ID

    Getting repository information

    Listing the children of the root/top folder

    Optional parameters when listing the children of a folder

    Listing available types and subtypes

    Creating, updating, and deleting content

    Creating folders

    Creating documents

    Updating folders and documents

    Deleting a document, folder, or folder tree

    Getting the content for a document

    Copying and moving folders and documents

    Working with Alfresco aspects

    Using secondary types to manage aspects

    Adding aspects when creating an object

    Adding aspects to an existing object

    Reading aspects

    The Alfresco OpenCMIS extension to manage aspects

    Adding aspects when creating an object

    Adding aspects to an existing object

    Reading aspects

    Version management with check out and check in

    Checking out a document

    Updating the content of the checked-out document and then checking it in

    Managing permissions for documents and folders

    Managing relationships between objects

    Searching

    Summary

    6. Accessing a CMIS Server Using Scripting Languages

    Using CMIS in JavaScript and web application pages

    Solving the same origin policy problem

    Using jQuery

    Using CMIS in Groovy scripts

    Using CMIS in Spring Surf Web Scripts

    Setting up a build project for Spring Surf with CMIS

    Updating the Spring Surf project so that CMIS can be used

    Updating the home page to display repository info via CMIS

    Updating the home page to display text from a file in the repository

    Using CMIS calls in Alfresco Share extensions

    Summary

    7. System Integration with CMIS

    Integrating Drupal with a CMS server

    The CMIS API module

    Displaying a CMS repository file link on a Drupal page

    The CMIS Views module

    Displaying a CMS repository folder on a Drupal page

    Displaying a result from a CMIS query on a Drupal page

    Synchronizing the CMS content with Drupal content

    Enterprise integration with CMIS

    Moving a file from a folder into a CMS server using Mule

    Getting a document from a CMS server via Mule

    Talking to Alfresco in the Cloud via CMIS

    Setting up an account

    Registering a client application

    Setting up a development project

    Authorizing the client application

    Making CMIS calls

    Summary

    Index

    Alfresco CMIS


    Alfresco CMIS

    Copyright © 2014 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: March 2014

    Production Reference: 1180314

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-78216-352-7

    www.packtpub.com

    Cover Image by Veronika Bergljung (<vbergljung@yahoo.com>)

    Credits

    Author

    Martin Bergljung

    Reviewers

    Robin Bramley (Ixxus)

    Karol Bryd

    Nicolas Raoul

    Barb Mosher Zinck

    Acquisition Editors

    Subho Gupta

    Content Development Editor

    Priyanka S

    Technical Editors

    Pankaj Kadam

    Adrian Raposo

    Copy Editors

    Tanvi Gaitonde

    Dipti Kapadia

    Kirti Pai

    Project Coordinator

    Akash Poojary

    Proofreaders

    Simran Bhogal

    Maria Gould

    Indexers

    Mehreen Deshmukh

    Tejal Soni

    Graphics

    Ronak Dhruv

    Abhinash Sahu

    Production Coordinator

    Nilesh Bambardekar

    Cover Work

    Nilesh Bambardekar

    About the Author

    Martin Bergljung is a Principal ECM Architect at Ixxus, a UK Platinum Alfresco partner. He has over 25 years of experience in the IT sector, where he has worked with the Java platform since 1997.

    Martin began working with Alfresco in 2007, developing an e-mail management extension for Alfresco called OpsMailmanager. In 2009, he started working on Alfresco consulting projects and has worked with customers such as Pearson, World Wildlife Fund, International Financial Data Services, NHS, VHI Healthcare, Virgin Money, Unibet, BPN Paribas, University of Westminster, Aker Oilfield Services, and Amnesty International.

    He is a frequent speaker and has delivered talks at Alfresco conferences in London, Berlin, and Barcelona. He is also the author of Alfresco 3 Business Solutions, Packt Publishing.

    I would like to thank Sumeet Sawant, Priyanka Shah, and Subho Gupta at Packt Publishing for suggesting the project and getting it on track.

    My thanks also goes to Sherin Padayatty and Michelle Quadros, my Project Coordinators, who were always pushing me to deliver the next chapter. Thanks to the entire Packt Publishing team for working so diligently to help bring out a high-quality product.

    Thanks to all the book reviewers who gave me invaluable feedback during the whole project. Specifically, I would like to thank Robin Bramely, my colleague at Ixxus, who gave me invaluable feedback, tips, and ideas throughout the book writing process, thanks!

    I must also thank the talented team of developers who created the Alfresco open source product. It opens up a new way for everyone that wants to build any kind of ECM business solution.

    And finally, I would like to thank Paul Samuel and Justin Haynes at Ixxus for supporting my book project.

    About the Reviewers

    Robin Bramley is an experienced Alfresco practitioner, having taken Version 0.6 to bits in 2005 and been using, extending, implementing, integrating, and scaling it ever since. He was the Technical Manager at the first UK Alfresco Gold partner where he built the original IMAP interface to Alfresco and is now the Chief Scientific Officer and Chief Architect at Ixxus, a global Alfresco Platinum partner.

    Robin has architected many distributed systems over the past 15 years, ranging from Swaps Trading Platform to Insurance Contract Management and a global Alfresco-based DAM system. Robin has presented at various international conferences and meetups in London; he also writes for GroovyMag, including an article on CMIS integration with Alfresco that NASA wanted the source code for.

    I'd like to thank my wife for her patience while I've been glued to my laptop in the evenings!

    Karol Bryd has been working with ECM technologies since 2005, first with Documentum and then with Alfresco since 2008. He has worked on numerous ECM-related projects mainly in the Pharmaceuticals sector, performing all manner of roles from Developer to Technical Consultant to Development Manager.

    He was a technical architect at Generis (http://www.generiscorp.com) for CARA, one of the first products to fully utilize Alfresco and CMIS technologies, and subsequently, supported its deployment at major corporations. He is also the author of the Alfresco extension Stamper (http://stamper.metasys.pl) for securing and watermarking PDF content in Alfresco.

    Currently, he holds the position of Documentum Expert at F. Hoffmann-La Roche, where he is working on Documentum projects that help manage large amounts of business-critical electronic documentation.

    Nicolas Raoul is an ECM consultant at Aegif in Tokyo. After obtaining a Master's degree from the French Ecole Nationale d'Ingenieurs, he worked in 13 countries, successfully designing distributed architectures for the French National Library or the Schengen Information System.

    Back when CMIS was still in its draft stage, he created CmisSync, a CMIS synchronization client that allows Alfresco users to work faster even when they are offline. Enjoying a strong open source community, CmisSync helps organizations combine the user friendliness and mobility of cloud storage with the security and customizability of their CMIS server, be it on-premise or in private/public clouds.

    As an ECM architect, he helped Alfresco design their certification program in 2009. He has been writing open source software since the age of 16. In his free time, he created AnkiDroid, a flashcards app with a million users, and other popular programs.

    Barb Mosher Zinck is a freelance writer and VP, Editorial for CMSWire (SimplerMedia Group Inc). She has over 10 years of experience as an IT solutions architect, focused on designing and supporting web-based applications.

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    You might want to visit www.PacktPub.com for support files and downloads related to your book.

    Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.

    At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

    http://PacktLib.PacktPub.com

    Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

    Why Subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print and bookmark content

    On demand and accessible via web browser

    Free Access for Packt account holders

    If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

    This book is dedicated to my sons Bruce, Thor, and Francisco and to my wife Veronika.

    Preface

    Content Management Servers (CMS), both proprietary and open source, have been around for a very long time, but there has not been a standard way of talking to them until recently. The Content Management Interoperability Services (CMIS) standard provides both an application programming interface and a search language (based on SQL-92). Today, most of the CMS systems out there support the CMIS standard.

    Alfresco CMIS is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you take advantage of the real power of CMIS and give you a good foundation in using it via HTTP/XML, Java, or scripting.

    This practical companion will get you up to speed on CMIS in no time.

    What this book covers

    Chapter 1, Getting Started with CMIS, starts off with an introduction to the CMIS standard to quickly get you up-to-date on the service API, object model, and query language.

    Chapter 2, Basic CMIS Operations, shows you how to add, update, delete, and search for content using HTTP and XML/JSON.

    Chapter 3, Advanced CMIS Operations, teaches you how to version content, set permissions for content, and create relationships between content items using HTTP and XML/JSON.

    Chapter 4, Alfresco and CMIS, covers specifics around the Alfresco content management server's implementation of CMIS, such as how to handle aspects, tags, and categories.

    Chapter 5, Accessing a CMIS Server with a Java Client, introduces the Apache Chemistry project and the OpenCMIS Java library, which is an abstraction on top of the standard HTTP and XML/JSON protocol bindings.

    Chapter 6, Accessing a CMIS Server Using Scripting Languages, shows how scripting languages such as JavaScript and Groovy can be used to talk to content management servers via the CMIS standard.

    Chapter 7, System Integration with CMIS, looks at how CMIS can be used for enterprise application integration. With specific examples of how to integrate Drupal with content management servers, connect Enterprise Service Bus (ESB) with one or more content management servers, and talk to the Alfresco Cloud service.

    What you need for this book

    For all the chapters except the first one, you will need access to a content management server that supports CMIS, such as Alfresco. In case of Alfresco, you can use an online service available at http://cmis.alfresco.com or install the Alfresco community version from http://downloads.alfresco.com (it is recommended to have your own local server, so you have control of the content and availability).

    For Chapter 2, Basic CMIS Operations, and Chapter 3, Advanced CMIS Operations, it's good to install a tool such as curl that can be used to make HTTP calls. Chapter 5, Accessing a CMIS Server with a Java Client, will require JDK and Maven installed. Chapter 6, Accessing a CMIS Server from Scripting Languages, requires the installation of jQuery and Groovy.

    Who this book is for

    This book is great for developers who want to learn how to build applications that talk to content management servers in a standard way using CMIS. It will be helpful to have a bit of programming experience, but it is not necessary for the first two chapters. The OpenCMIS chapter and Alfresco Cloud section will assume some basic knowledge of Java.

    Conventions

    In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

    Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: If we take Documentum as an example, its generic content type is named dm_document and not cm:content.

    A block of code is set as follows:

        http://localhost:8080/alfresco/cmisatom/f0ebcfb4-ca9f-4991-bda8-9465f4f11527/types>

        types

        text>Types Collection

       

    When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    objectbypath

    application/atom+xml;type=entry

    Any command-line input or output is written as follows:

    $ curl http://localhost:8080/alfresco/service/api/login?u=admin&pw=admin 1.0 encoding=UTF-8?> TICKET_39ea5e46e83a6d6e43845182f4254f9de50402fb

    New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: clicking the Next button moves you to the next screen.

    Note

    Warnings or important notes appear in a box like this.

    Tip

    Tips and tricks appear like this.

    Reader feedback

    Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

    To send us general feedback, simply send an e-mail to <feedback@packtpub.com>, and mention the book title via the subject of your message.

    If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

    Customer support

    Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

    Downloading the example code

    You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

    Errata

    Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

    Piracy

    Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

    Please contact us at <copyright@packtpub.com> with a link to the suspected pirated material.

    We appreciate your help in protecting our authors, and our ability to bring you valuable content.

    Questions

    You can contact us at <questions@packtpub.com> if you are having a problem with any aspect of the book, and we will do our best to address it.

    Chapter 1. Getting Started with CMIS

    Content Management Interoperability Services (CMIS) is a new interface to talk to Content Management Systems (CMS) in a standard way. This chapter will introduce you to the CMIS standard, explain why it is important, and see how it came about. We will cover the different parts of the CMIS standard, the benefits of using it, and some example use cases for CMIS.

    Understanding CMIS

    CMIS is an effort toward standardization and is managed by the Organization for the Advancement of Structured Information Standards (OASIS) body. The latest version is 1.1 (http://docs.oasis-open.org/cmis/CMIS/v1.1/CMIS-v1.1.html), which was approved in May 2013. Version 1.0 specifies most of the functionalities and is quite developed being approved in May 2010. Some content servers might not yet support Version 1.1, so we will point out

    Enjoying the preview?
    Page 1 of 1