O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Alfresco One 5.x Developer's Guide - second edition

Book Description

Discover what it means to be an expert developer by exploring the latest features available to you in Alfresco One 5.x

About This Book

  • Create reliable and secure enterprise apps with the latest Alfresco One 5.x platform
  • Explore all the latest Alfresco One 5.x APIs such as the CMIS API, Alfresco One API, and the integrated RESTful API to get more out of your enterprise apps
  • Unleash the power of the latest JavaScript engine and the JavaScript API for Alfresco to customize your existing apps for the Alfresco 5 platform

Who This Book Is For

If you're an enterprise app developer who wants to create custom applications with Alfresco, then this book is for you. Previous knowledge with Alfresco would be helpful but is not necessary.

What You Will Learn

  • Create and manage a custom content model
  • Configure the Alfresco Share user interface
  • Build a new AngularJS 2.0 application
  • Create business process definitions using Activiti Designer
  • Discover the most common extensions provided by Alfresco
  • Configure Alfresco to authenticate against LDAP, including & chaining" LDAP with Alfresco authentication
  • Get familiar with the latest features of Alfresco Mobile SDK, Smart Search, and the new Angular framework

In Detail

Do you want to create more reliable and secure solutions for enterprise apps? Alfresco One 5.x is your gateway to developing the best industry-standard enterprise apps and this book will help you to become a pro with Alfresco One 5.x development. This book will help you create a complete fully featured app for your organization and while you create that perfect app, you will explore and implement the new and intriguing features of Alfresco.

The book starts with an introduction to the Alfresco platform and you'll see how to configure and customize it. You will learn how to work with the content in a content management system and how you can extend it to your own use case. Next, you will find out how to work with Alfresco Share, an all-purpose user interface for general document management, and customize it. Moving on, you write web scripts that create, read, and delete data in the back-end repository. Further on from that, you'll work with a set of tools that Alfresco provides; to generate a basic AnglularJS application supporting use cases, to name a few authentication, document list, document view. Finally, you'll learn how to develop your own Alfresco Mobile app and understand how Smart Folders and Search manager work.

By the end of the book, you'll know how to configure Alfresco to authenticate against LDAP, be able to set up Single Sign-On (SSO), and work with Alfresco's security services.

Style and approach

This book takes a step-by-step practical tutorial-style approach helping you create a complete enterprise app using Alfresco.

Downloading the example code for this book. 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 code file.

Table of Contents

  1. Alfresco One 5.x Developer’s Guide - Second Edition
    1. Alfresco One 5.x Developer’s Guide - Second Edition
    2. Credits
    3. About the Authors
    4. About the Reviewer
    5. www.PacktPub.com
      1. Why subscribe?
    6. Customer Feedback
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. The Alfresco Platform
      1. Alfresco in the real world
        1. Basic document management
        2. Web content management
          1. Content authoring tools
          2. Separation of presentation from content
          3. Systematic publication or deployment
          4. Alfresco WCM example
        3. Custom content-centric applications
      2. Example used throughout this book
      3. Alfresco architecture
        1. High-level architecture
          1. Add-ons
        2. Open source components
        3. Major standards and protocols supported
      4. Customizing Alfresco
        1. Basic customization
          1. Dashlets
          2. Custom site configuration
          3. Rules and actions
          4. Simple workflow
        2. Advanced customization
          1. Examples of advanced customizations
          2. Extend the content model
          3. Perform automatic operations on content
          4. Customize Alfresco Share
          5. Create a RESTful API
          6. Streamline complex business processes with advanced workflows
          7. Integrate with other systems
      5. Dusting off your toolbox
      6. Understanding Alfresco's editions
        1. Significant feature differences
        2. What's used in this book
      7. Summary
    9. 2. Getting Started with Alfresco
      1. Introduction to the Alfresco SDK
        1. Maven archetypes
        2. Install prerequisites
          1. Spring Loaded
          2. JDK
          3. Maven
        3. Install STS
      2. Create your first application
        1. Rapid application development
        2. Traditional approach
        3. Install Alfresco
          1. Download Alfresco
          2. Create your virtual machine
          3. Deploy your modules
          4. Check that your modules are installed
          5. Extending Alfresco
        4. Understanding the extension mechanism
          1. Standard Java web application files
          2. Framework files
            1. Spring configuration files
            2. Alfresco configuration files
            3. Solution-specific files
            4. Avoid Modifying Alfresco Code and Configuration
      3. Troubleshooting
        1. Log4j
        2. Step-by-step - debugging from within Eclipse
        3. Node browser
      4. Starting over
      5. Summary
    10. 3. Working with Content Models
      1. Defining SomeCo's content model
        1. Step-by-step - starting the custom content model with custom types
          1. Types
          2. Properties and property types
          3. Constraints
        2. Step-by-step - adding properties to types
        3. Step-by-step - relating types with associations
          1. Associations
        4. Step-by-step - adding aspects to the content model
          1. Aspects
        5. Step-by-step - finishing up the model
      2. Manage property indexing
      3. Modeling summary
        1. Custom behavior
      4. Modeling best practices
        1. Out-of-the-box models
      5. Configuring the UI
        1. Step-by-step - configure Share forms
        2. Step-by-step - adding types and aspects to Alfresco Share dropdowns
        3. Step-by-step - externalizing display labels
          1. Setting up additional locales
        4. Step-by-step - adding properties and types to advanced search
      6. Working with content programmatically
        1. Step-by-step - creating content with JavaScript
          1. Knowing when to save documents
          2. Using JavaScript for batch manipulation
          3. Writing content to the content property
        2. Creating content with CMIS
          1. Step-by-step - run CmisClientClass to create content
        3. Creating associations
        4. Searching for content
        5. Deleting content
      7. Model manager
      8. Summary
    11. 4. Handling Content Automatically with Actions, Behaviors, Transformers, and Extractors
      1. Encapsulating content operations in actions
        1. Step-by-step - creating a basic action
        2. Hiding the action from end users
        3. Creating actions that require user-specified parameters
          1. Step-by-step - creating an action configurable in Alfresco Share
        4. Specifying parameters when code executes an action
      2. Binding logic to custom types with behaviors
        1. Step-by-step - writing a simple behavior in Java
        2. Binding to multiple types/aspects
        3. Frequency
        4. Figuring out to which policies to bind
        5. Step-by-step - writing a simple behavior in JavaScript
        6. Binding behavior to child types
          1. Step-by-step - writing a user ratings calculator
          2. Step-by-step - testing the new rating behavior
        7. Handling deleted ratings
      3. Extracting metadata from files
        1. Customizing metadata extractors
          1. Step-by-step - customizing the metadata mapping
        2. Overriding the default mapping
        3. Leveraging out-of-the-box metadata extractors
      4. Transforming content from one format to another
        1. Step-by-step - writing a custom transformer
      5. Summary
    12. 5. Customizing Alfresco Share
      1. Knowing when to customize Alfresco Share and when to write your own
      2. Adding new menu items
        1. Step-by-step - adding a simple menu item
      3. Adding new action items
        1. Step-by-step - adding an action item to set the web flag
        2. Restricting the action item by permission
      4. Writing action evaluators to show/hide UI actions
        1. Step-by-step - evaluating whether or not to show the set web flag actions
      5. Changing how Share renders forms
        1. Step-by-step - using a text area field
        2. Step-by-step - changing the Status field on the Details page to display as a Stoplight indicator
        3. Overriding and customizing components
      6. How to use indicators
        1. Step-by-step - creating indicators for the status indicator
      7. How to create metadata template
        1. Step-by-step - create a metadata template for Operations document
      8. Creating custom dialogs
        1. Step-by-step - creating a dialog to publish Whitepapers
      9. Creating custom dashlets
        1. Step-by-step - creating a dashlet listing Whitepapers
        2. Step-by-step - adding filters to your Dashlet
      10. Create custom pages
        1. Step-by-step - create a new page to list all Webable documents
      11. Summary
    13. 6. Creating an Angular Application
      1. Understanding the framework
        1. Components
        2. Prepare your environments
        3. Step-by-step – creating the new virtual machine
      2. Creating your first JavaScript application
        1. Step-by-step – develop your first custom UI using the JavaScript API
      3. Creating your first Angular web application
        1. Step-by-step - installing all prerequisites
        2. Step-by-step - creating your first Angular application
        3. Step-by-step - running the Alfresco demo shell
      4. Summary
    14. 7. Exposing Content through a RESTful API with Web Scripts
      1. Introducing the Web Script Framework
        1. Step-by-step - Hello World web script
        2. What just happened?
        3. Following the Model-View-Controller pattern
        4. Adding controller logic
        5. Configuring the Web Script Framework
          1. Specifying the HTTP method
          2. Specifying arguments
          3. Specifying the response format
        6. Deploying web scripts
        7. Building solutions with the Web Script Framework
      2. Planning the SomeCo whitepapers and ratings API
      3. Retrieving data with web scripts
        1. Step-by-step - writing a web script to list whitepapers
        2. Debugging
        3. Fast facts
        4. Organizing web scripts
        5. Overriding web scripts
        6. Choosing a URL
        7. Choosing between the repository and the classpath
        8. Step-by-step - retrieving the rating for a whitepaper
        9. Specifying optional arguments
        10. Handling errors
      4. Writing Java-backed web scripts
        1. Step-by-step - writing a Java-backed web script to handle ratings posts
        2. Using the correct ID for Web Script Beans
        3. Using both Java and JavaScript for controller logic
      5. Wiring a web script to UI widgets
        1. Step-by-step - using a widget to post ratings
        2. Implementing the delete ratings link
        3. Adding the web script calls to SomeCo's whitepaper web page
        4. Making other types of content rateable
        5. Dealing with the cross-domain scripting limitation
      6. Handling form data
        1. Step-by-step - implementing a form-based Hello World
        2. Step-by-step - using file upload in a multipart request
      7. Advanced web scripts
        1. Dealing with web script authentication
        2. Controlling web script cache
      8. Summary
    15. 8. Advanced Workflow
      1. What is a workflow?
        1. Workflow options
          1. Roll your own
          2. Standalone engines
          3. Embedded workflow engines
      2. Creating process definitions
        1. Step-by-step - creating a Hello World process definition
      3. Using the Activiti graphical process designer
        1. Step-by-Step - using Activiti process designer to create processes
          1. Tokens
          2. Node types
          3. Versioning process definitions
          4. Using alternative deployment methods
      4. Wiring a process to the Alfresco UI
        1. Step-by-step - grabbing the Hello World argument from the user
          1. Understanding workflow-specific content models
      5. Assigning tasks to users and groups
        1. Step-by-step - creating the initial Whitepaper submission workflow
        2. Controlling what actions can be taken from the Task Management dialog
        3. Enabling the Workflow Initiator to Select Users and Groups
        4. Step-by-step - use dynamic user assignment
      6. Adding Logic to Workflows with Listeners and Process Variables
        1. Storing Data in Process Variables
        2. Step-by-step - adding logic to the Whitepaper submission workflow
        3. Getting access to the content in the workflow
        4. Using multi-instances
      7. Using the Activiti API
        1. Step-by-step - implementing third-party review
        2. Making the third-party review more robust
      8. Using timers
        1. Step-by-step - adding a timer to the third-party review
      9. Debugging workflows
      10. Comparing Alfresco workflow options
      11. Summary
    16. 9. Amazing Extensions
      1. Configure and use the search manager
      2. Configure and use the Smart Folders
        1. Step-by-step - create your own Smart Folder template
      3. Alfresco mobile
        1. Step-by-step - import and run the Alfresco Sample UI
        2. Step-by-step - create SomeCo mobile application
      4. Summary
    17. 10. Security
      1. Authenticating and synchronizing with LDAP
        1. Step-by-step - setting up a local OpenLDAP server
        2. Step-by-step - configuring Alfresco to authenticate against LDAP
        3. Step-by-step - configuring chaining
      2. Setting up Single Sign-On (SSO)
        1. Step-by-step - implementing SSO
          1. Logging Out
        2. Step-by-step - configuring CAS to use LDAP for authentication
      3. Working with security services
        1. Securing the admin user
        2. Granting additional users admin rights
        3. Creating users and Groups Programmatically
          1. Step-by-step - creating users and groups through the Java services
        4. Understanding permission definitions
          1. Permission groups
          2. Permissions
          3. Permission sets
          4. Step-by-step - setting up a publisher custom role
          5. Global Permissions
          6. Mapping Permissions to Methods
      4. Summary