E-book details

Alfresco 3 Web Services. Build Alfresco applications using Web Services, WebScripts and CMIS

Alfresco 3 Web Services. Build Alfresco applications using Web Services, WebScripts and CMIS

Alfresco.com, Piergiorgio Lucidi, Ugo Cei

Ebook
Alfresco 3 is the leading open source enterprise content management system that offers powerful features for interacting with the content in its repository from outside the system. These include the support for the Content Management Interoperability Services (CMIS) implementation, reusable web scripts, and a Web Services API.

This is the first book to show you how to use Web Services in Alfresco. Packed with examples, you'll learn how to build applications using Alfresco remote APIs based on SOAP and REST. You'll see how to use different APIs and bindings such as WebServices, WebScripts, and CMIS.

Alfresco 3 Web Services starts off by showing you the services exposed by the Alfresco Web Services API, and how the API fits into the Alfresco software architecture.You learn to develop your application firstly by setting up and testing your Java development environment using the Alfresco SDK in Eclipse IDE and secondly by associating the Alfresco source code and Javadocs in Eclipse.With the help of real world practical examples, you learn how to do things like create, sort, and call Web Scripts, and invoke remote calls to Alfresco repository. To get the most from the Web Services API, you need to know about the basics of the Content Manipulation Language (CML), and the book takes you through this.Examples such as the bookshop application show you how to sign in, change user sessions, get, remove and change public and private associated contents, manage a cart for your e-commerce application, and so on.Next, by implementing a Microsoft .NET application using the Alfresco Web Services API, you see how to perform operations against the repository from your .NET application.The book provides you with REST and SOAP concepts, their comparison, basics of the FreeMarker language, Atom Publishing Protocol, JavaScript controllers, and the Apache Chemistry project.By the end of this book, you will be able to put together your knowledge about CMIS and the Apache Chemistry toolkit to develop a complete working application that uses Alfresco, via CMIS, as a back-end storage. Last but not the least, this book also covers the WebServices security profiles— the best practices for Web Services to promote better interoperability.
  • Alfresco 3 Web Services
    • Table of Contents
    • Alfresco 3 Web Services
    • Credits
    • About the Authors
    • About the Reviewers
    • Preface
      • What this book covers
      • What you need for this book
      • Who this book is for
      • Conventions
      • Reader feedback
      • Customer support
        • Errata
        • Piracy
        • Questions
    • 1. Introducing the SOAP Web Services API
      • Web Services
        • Web Services in Alfresco
        • Introducing SOAP
          • SOAP vs. REST
          • The format of SOAP messages
          • The Web Services Description Language
      • Using Alfresco Web Services
        • Using the Alfresco Web Services client SDK
        • Setting up the Alfresco SDK
        • Testing the Web Services client
      • Summary
    • 2. Creating and Modifying Content
      • The Content Manipulation Language (CML)
        • Setting up the Java classpath
          • Using the precompiled client
          • Using third-party frameworks
      • Authentication
        • Setting the endpoint address with a properties file
        • Setting the endpoint address programmatically
      • Performing operations on nodes
        • Creating nodes
        • Creating content
          • Creating content using the content service
        • Removing nodes
        • Moving nodes
        • Copying nodes
      • Associations
        • Adding child nodes
        • Removing child nodes
      • Versioning
        • Updating nodes without versioning
        • Getting the version history
      • Aspects
        • Adding aspects
        • Removing aspects
      • Searching the repository
        • Performing Lucene queries
        • Querying associated nodes
          • Association
        • Querying child nodes
        • Querying parent nodes
      • Summary
    • 3. Collaboration and Administration
      • Creating collaborative content
        • Performing a check-out
        • Check-in
          • Check-in with versioning
          • Check-inimporting external content
        • Cancelling a check-out
      • Managing versioning explicitly
        • Creating a new version
        • Deleting all the versions
        • Getting the version history
        • Reverting a version
      • Managing locking explicitly
        • Locking
        • Unlocking
        • Getting the lock status
      • Classification and categories
        • Getting classifications
        • Describing a classification
        • Getting categories
        • Adding categories
        • Getting child categories
      • Authorization
        • Setting owners
        • Adding permissions
        • Creating authorities
        • Managing actions
          • Getting action definitions
        • Default actions
          • Getting an action definition
          • Executing actions
          • Saving actions
          • Getting actions
          • Removing actions
      • Managing rules
        • Default Conditions
        • Adding rules
      • Managing users
        • Adding users
        • Deleting users
        • Updating users
        • Changing passwords
        • Getting user information
        • Searching users
      • Summary
    • 4. A Complete Example
      • Setting up the project
      • The Bookshop model
        • Sign in page
        • Home page
        • Configure the bookshop repository
        • Book details page
        • Getting book properties
        • Checking the cart space
        • Getting all the associated reviews
      • Adding a book to the cart
        • Checking if the cart space exists
        • Creating the cart space
        • Adding a book in the cart
      • Cart page
        • Removing a book from the cart
        • Adding a review
      • Managing reviews page
        • Accepting reviews
        • Rejecting reviews
      • Changing user details
      • Summary
    • 5. Using the Alfresco Web Services from .NET
      • Setting up the project
        • Testing the .NET sample client
      • Searching the repository
      • Performing operations
        • Authentication
        • CRUD operations
          • Creating nodes
          • Creating content
            • Creating content using CML
            • Creating content using ContentService
          • Updating nodes
            • Updating nodes without versioning
            • Updating nodes with versioning
          • Copying nodes
          • Moving nodes
          • Removing nodes
      • Managing child associations
        • Adding child nodes
        • Removing child nodes
      • Summary
    • 6. Introducing the Web Scripts Framework
      • A lightweight alternative to SOAP Web Services
      • REST concepts
        • Constraints
        • Resources
        • Representations
        • REST in practice
          • Use URLs to identify resources
          • Use HTTP methods properly
            • GET
            • PUT
            • DELETE
            • POST
        • Avoiding tight coupling
        • Use hyperlinks to drive the application state
      • Your first Web Script
        • Components of a Web Script
        • Creating your first Web Script
        • Invoking your first Web Script
        • Adding a controller
      • The Model-View-Controller pattern
      • URL matching
      • Authentication
        • Run as
        • The Login service
      • Transactions
      • Requesting a specific format
        • Status
      • Configuring Web Scripts
      • Cache control
      • Deployment
      • Summary
    • 7. Templating with FreeMarker
      • FreeMarker concepts
      • Variable interpolation
        • FreeMarker expressions
          • Scalars
            • Strings
            • Booleans
            • Numbers
            • Dates
          • Containers
            • Hashes
            • Sequences
            • Collections
          • Operators
            • String operators
              • Concatenation and interpolation
              • Getting a single character
            • Sequence operators
              • Concatenation
              • Slicing
            • Hash operators
            • Arithmetical operators
            • Comparison operators
            • Logical operators
          • Missing values
            • Specifying default values
            • Testing for missing values
          • Built-ins
            • Built-ins for strings
              • html, xhtml, xml
              • js_string
              • url
              • trim
            • Built-ins for dates
              • string
              • date, time, datetime
      • Directives
        • Assign
        • If
        • List
        • Include
        • Macro
          • Nested content
          • Macros with parameters
      • Comments
      • Using FreeMarker in Web Scripts
        • The TemplateNode API
          • Searching
            • childrenByXPath
            • childByNamePath
            • childrenByLuceneSearch
            • childrenBySavedSearch
      • A simple example
      • Generating an Atom Categories Document
        • Atom
        • The Alfresco Bookshop
        • Categories in Atom
        • Categories in Alfresco
        • Creating the Web Script
          • The descriptor
          • The controller
          • The template
          • Using the Web Script
        • Categories as JSON
      • Summary
    • 8. Writing a Web Script Controller in JavaScript and Java
      • Providing a Web Script with a JavaScript controller
      • Root objects
      • General scripting techniques
        • Importing scripts
        • Logging
        • Debugging
      • Searching the repository
        • Performing a simple Lucene search
          • A primer on Lucene query syntax
            • Fields in the Alfresco index
          • Sorting results
      • The ScriptNode API
        • Properties of nodes
          • Writing properties
        • Navigating the repository
        • Performing operations on nodes
          • Creating new nodes
          • Deleting nodes
          • Copying and moving nodes
        • Manipulating content
      • A step-by-step exampleposting reviews
        • Requirements
        • The protocol
        • Representations
        • Implementing the first version
          • Extending the content model
          • Configuring the Alfresco Explorer
          • Creating the Web Script descriptor
          • Creating the controller
            • Finding the book
            • Creating the review
            • Setting the reviews properties
            • Returning the response
          • Creating the template
          • Testing the Web Script
        • Using Atom
          • Anatomy of an Atom entry
          • A controller that accepts Atom entries
        • Checking for duplicate reviews
          • Finding duplicates
          • The revised controller
      • Writing Web Scripts in Java
        • Types of Java-backed Web Scripts
          • Declarative Web Scripts
            • Wiring the class to the Web Script
        • Posting reviews: The Java version
      • Summary
    • 9. Putting it All Together
      • The Atom Publishing Protocol
        • A bit of history
          • Enter AtomPub
        • AtomPub concepts
          • Resources and entries
            • Extensions
          • Collections and feeds
            • Paging
        • The Service Document
        • Creating resources
          • Entry and media resources
        • Updating resources
        • Deleting resources
      • Listing books by category
        • Service URI
        • Response format
        • Implementing the service
          • The descriptor
          • The controller
          • The template
        • Testing the service
          • Using curl
          • A simple Java client
            • Installing Abdera
      • Creating a new book
        • Service URI
        • Request format
        • Implementing the service
          • The descriptor
          • The controller
          • The template
        • Uploading content
          • The descriptor
          • The controller
          • The template
        • Testing the service
          • Using curl
          • A simple Java client
            • Initial set-up
            • Generating a random ISBN
            • Setting up the entry
            • Submitting the entry
            • Uploading the content
      • Updating an existing book
        • The implementation
        • Testing with curl
        • Dealing with concurrent edits
          • Implementation
        • The Java client
      • Deleting a book
        • Testing deletion
      • Summary
    • 10. Overview of CMIS
      • A bit of history
        • A word of warning
      • Objectives of CMIS
        • What CMIS does not include
      • CMIS vs. JCR
      • The CMIS domain model
        • Objects
          • Documents
            • Content streams
          • Folders
          • Relationships
          • Policies
          • Custom object types
        • Properties
      • Services
        • Repository Services
        • Navigation Services
        • Object Services
        • Multi-filing Services
        • Discovery Services
        • Versioning Services
        • Relationship Services
        • Policy Services
        • ACL Services
      • Capabilities
        • Navigation capabilities
        • Object capabilities
        • Filing capabilities
        • Versioning capabilities
        • Query capabilities
        • ACL capabilities
        • Capabilities supported by Alfresco
      • Protocol bindings
        • The AtomPub binding
        • The Web Services binding
      • CMIS in action
        • CMIS-enabled servers
          • Alfresco
            • Hosted CMIS AtomPub TCK
            • The CMIS implementation in Alfresco
          • Nuxeo
          • eXo
          • KnowledgeTree
          • Sense/Net
          • The closed-source world
        • Client toolkits
          • Apache Chemistry and OpenCMIS
          • Drupal
      • Summary
    • 11. The CMIS AtomPub Binding
      • The CMIS AtomPub binding
        • Authenticating
        • Getting the Service Document
          • Collections
          • Repository info and URI templates
        • Navigating the repository
        • Reading entries
        • Reading type information
        • Creating new objects
          • Creating a new folder
          • Creating a new document
        • Updating a document's metadata
        • Deleting a document
        • Performing a search
          • Paging search results
          • Queries
            • Relational view
            • Statement syntax
            • Full-text search
      • Summary
    • 12. Developing a CMIS Client using Apache Chemistry
      • Introducing Apache Chemistry
        • Chemistry, OpenCMIS, and the Alfresco TCK
      • Downloading and installing Chemistry
        • Building Chemistry
        • Importing Chemistry into Eclipse
      • The modules of the Chemistry client API
        • The main client classes
      • Setting up a connection
        • Setting up a connection with AtomPub
        • Setting up a connection with Web Services
      • Code samples
        • Listing the server's capabilities
        • Listing repository types
        • Getting a type definition
        • Listing the root folder
        • Creating a new folder
        • Creating a new text document
        • Uploading a binary document
        • Reading a document's content
        • Updating properties
        • Deleting a document
        • Searching
        • Listing relationships
      • Summary
    • 13. The Web Services Binding
      • Getting at the WSDLs
        • Setting up the client project
        • Declaring the CMIS client bean
      • Some necessary pieces: WS-Security and WS-I Basic Profile
      • Browsing the repository
      • Inspecting objects
      • Acting upon objects
        • Creating a new text document
        • Creating a new folder
        • Updating a text document
        • Updating properties
        • Deleting a document
        • Searching a document
      • Summary
    • 14. A Complete CMIS Client Application
      • CMISWikia CMIS-based wiki
        • Requirements
        • Software building blocks
          • The Google Web Toolkit
          • The Mylyn WikiText parser
      • Building and running CMISWiki
      • The user interface
      • Implementation
        • Client-side code
          • The GWT UiBinder
          • Links and the browser history
        • Server-side code
        • Implementation of use cases
          • Creating a new page
          • Loading an existing page
          • Uploading an image
          • Displaying an image
          • Searching
      • Summary
    • A. The CMIS Query Language
      • The relational view projection
        • Hierarchy of types and the relational view
      • Results of queries
      • Grammar of queries
        • The SELECT clause
        • The FROM clause
          • Joins
        • The WHERE clause
        • Comparison operators
        • Testing multi-valued properties
        • Full-text search using CONTAINS
          • The IN_FOLDER predicate
          • The IN_TREE predicate
        • The ORDER BY clause
      • Escaping special characters
    • Index
  • Title: Alfresco 3 Web Services. Build Alfresco applications using Web Services, WebScripts and CMIS
  • Author: Alfresco.com, Piergiorgio Lucidi, Ugo Cei
  • Original title: Alfresco 3 Web Services. Build Alfresco applications using Web Services, WebScripts and CMIS
  • ISBN: 9781849511537, 9781849511537
  • Date of issue: 2010-08-18
  • Format: Ebook
  • Item ID: e_3d2o
  • Publisher: Packt Publishing