34,79 €
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 556
Veröffentlichungsjahr: 2017
Copyright © 2017 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 authors, 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: October 2008
Second edition: February 2017
Production reference: 1220217
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78712-816-3
www.packtpub.com
Authors
Benjamin Chevallereau
Jeff Potts
Copy Editor
Safis Editing
Reviewer
Bindu Wavell
Project Coordinator
Ritika Manoj
Commissioning Editor
Amarabha Banerjee
Proofreader
Safis Editing
Acquisition Editor
Shweta Pant
Indexer
Tejal Daruwale Soni
Content Development Editor
Aditi Gour
Graphics
Jason Monteiro
Technical Editor
Anushree Arun Tendulkar
Production Coordinator
Melwyn Dsa
Benjamin Chevallereau is a French software architect, based in London, who has been working on Alfresco projects for the last 8 years and Ephesoft projects for the last 3 years. He implemented solutions for small companies and global organizations in different domains such as transport, finance, and government.
He has worked for different Alfresco-recognized partners in France, the UK, and USA, including Armedia LLC, Zaizi, Michelin / Wipro, and BlueXML. He is also one of the committers and PMC members of the Apache CMIS Chemistry project.
Jeff Potts is the founder of Metaversant Group, Inc., a consulting firm focused on content management, search, and workflow. Jeff brings over 20 years of Enterprise Content Management implementation experience to organizations of all sizes including the Fortune 500. Throughout his consulting career he has worked on a number of projects for clients across the media and entertainment, airline, consumer packaged goods, and retail sectors.
Jeff began working with and blogging about Alfresco in November of 2005. In 2006 and 2007, he published a series of Alfresco tutorials and published them on his blog, ecmarchitect.com. That work, together with other Community activity in Alfresco's forum, Wiki site, and JIRA earned him Alfresco's 2007 Community Contributor of the Year Award.
In the past, Mr. Potts has worked for Alfresco Software, Inc. as Chief Community Officer, Optaros as Senior Practice Director, and Hitachi Consulting as Vice President where he ran the ECM practice.
Bindu Wavell is the chief architect at Zia Consulting. He has been doing enterprise system integration consulting for the past 24 years. At Zia, Bindu provides guidance and mentoring around Alfresco architecture and design in addition to working hands on with customers. He develops processes and technologies to streamline onboarding new developers, delivers trainings for customer developers and provides support for implementations and delivered projects.
I would like to thank the whole team at Zia for providing an amazing environment for learning, discovery and excellence. I’d also like to thank everyone at Alfresco for delivering such a great content management platform and for continuing to focus on being the best in the industry.
For support files and downloads related to your book, please visit www.PacktPub.com.
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 [email protected] 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.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/Alfresco-One-5-x-Developers-Guide-ebook/dp/1787128164.
If you'd like to join our team of regular reviewers, you can e-mail us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products!
Alfresco is the leading open source platform for Enterprise Content Management. The evolution of the product has been quite impressive during the last 10 years. The first edition of this book has been published in 2008, and after 8 years, it really needed an update. This new book will give you some insights on the most advanced capabilities of the Alfresco platform. This book takes you through the process of customizing and extending the Alfresco engine, the out-of-the-box user interface Alfresco Share that will suit most of your requirements in terms of document collaboration. It uses a fictitious professional services company called "SomeCo" as an example. SomeCo has decided to roll out Alfresco across the enterprise. Your job is to take advantage of Alfresco's extension mechanism, workflow engine, and various APIs and SDKs to meet the requirements from SomeCo's various departments. Although many customizations can be made by editing XML and properties files, this book is focused on developers. That might mean writing Java code against the Alfresco API to implement an action or a behavior, maybe creating some server-side JavaScript to use as the controller of a RESTful web script, or perhaps implementing custom business logic in an advanced workflow. The point is that all but the most basic implementations of any ECM platform require code to be written. The goal of this book is to help you identify patterns, techniques, and specific steps that you can use to become productive on the platform more quickly. By the end of this book, you will have stepped through every aspect of the Alfresco platform. You will have performed the same types of customizations and extensions found in typical Alfresco implementations. You’ll have discovered the Mobile Alfresco SDK and creates your own mobile application. Finally, you’ll get a preview of the latest Alfresco Development Framework (ADF) based on Angular. Most importantly, when someone comes to you and asks, "How would you do this in Alfresco?", you'll have at least one answer and maybe even some source code to go with it.
Chapter 1, The Alfresco Platform, is for people new to the Alfresco platform. It walks you through the capabilities of Alfresco and gives some examples of the types of solutions that can be built on the platform. You'll also learn what tools and skills are required to implement Alfresco-based solutions.
Chapter 2, Getting Started with Alfresco, is about getting your development environment set up. Like preparing for a home improvement project, this is the trip to the hardware store to get the tools and supplies you'll need to get the job done. Throughout the book, you will be building and deploying changes. So just as in any software development project, it pays to get that process working up front. You'll also learn about the debugging tools that are available to you. The chapter includes a short and simple customization example to test out your setup.
Chapter 3, Working with Content Models, starts where all Alfresco projects should begin: defining the content model. You'll learn how to define the content model as well as how to expose the model to Alfresco Share. Once you've got it in place, you'll write some Java code that utilizes the CMIS API to test out the model. This will also be your first taste of the JavaScript API. The exercises set up the initial content model for SomeCo.
Chapter 4, Handling Content Automatically with Actions, Behaviors, Transformers, and Extractors, begins to show you the power of the repository by exposing you to some of the mechanisms or hooks that can be used to perform "hands off" operations on content. You'll learn about actions, behaviors, transformers, and metadata extractors. The exercises include implementing a rule action for SomeCo's Human Resources department to help manage HR policies, writing a custom behavior to calculate user ratings, and writing a custom metadata extractor to make Microsoft Project files indexable by SolR.
Chapter 5, Customizing Alfresco Share, takes you through Alfresco Share customizations. First, it establishes whether or not you should be customizing the user interface at all. Once that's out of the way, you learn how to add new menu or action items, how to create your own custom metadata template, how to develop new pages and dashlets, and how to define new dialogs to gather information from a user.
Chapter 6, Creating an Angular Application, shows you how to use the new Alfresco Development Framework (ADF) released in 2016. First, you start by discovering the new JavaScript library that you could include in any of your web applications. Then, you discover the new user interface implemented in AngularJS, and test all available current components. At the time of writing, this framework is only an early release and is not suitable for production. However, we are convinced that this framework will become an important component for any Alfresco developer.
Chapter 7, Exposing Content through a RESTful API with Web Scripts, focuses on the web script framework. Web scripts are an important part of the platform because they allow you to expose the repository through a RESTful API. The exercises in this chapter are about creating a set of URLs that can be called from the frontend web site to retrieve and persist user ratings of objects in the repository.
Chapter 8, Advanced Workflows, is about the embedded Activiti workflow engine, how it works and how to define your own workflows, including how to implement your own business logic. The chapter includes a comparison between the capabilities of Alfresco's simple workflow and advanced workflow so that you can decide which one is appropriate for your needs. By the end of the chapter, you will have built a workflow that SomeCo will use to review and approve Whitepapers for external publication.
Chapter 9, Amazing Extensions, shows you one of the most amazing extensions including the use of facets configured with the search manager. Then, you discover what are smart folders and how to use them. After, you create your own template for SomeCo Whitepapers. Finally, you even create your own mobile application connected to your Alfresco instance.
Chapter 10, Security, covers a variety of security-related topics. You'll learn how to define your own custom roles, and how to create users and groups with the API. Although not strictly developer-centric, you'll also learn how to configure Alfresco to authenticate and synchronize with an LDAP directory and how to implement Single Sign-On (SSO) between Alfresco and other web resources.
To work through the examples in this book, you will need:
There are other tools or libraries that you will need for certain exercises, which will be mentioned as necessary.
This book will be most useful to developers who are writing code to customize Alfresco for their organization or who are creating custom applications that sit on top of Alfresco.
This book is for Java developers, and you will get most from the book if you already work with Java, but you need not have prior experience on Alfresco. Although Alfresco makes heavy use of open source frameworks such as Spring, Hibernate, no prior experience using these is assumed or necessary.
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 are shown as follows: "Let's clarify what's an AMP file or package. An AMP file is a .zip file with the .amp extension."
A block of code will be set as follows:
{ "rating": { "average": 1.923, "count": 13 } }When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:
enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/root/.keystore" keystorePass="changeit"Any command-line input and output is written as follows:
service alfresco startNew terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "When users log in to Alfresco, the first thing that is usually displayed is the My Dashboard section."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in 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 at www.packtpub.com/authors.
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.
You can download the example code files for this book 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.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Alfresco-One-5x-Developers-GuideAlfresco-One-5x-Developers-Guide. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/AlfrescoOne5xDevelopersGuide_ColorImages.pdf.
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 could 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 to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted 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 [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.
This chapter introduces the Alfresco platform and answers the question, "What can I do with this thing?" A few examples will be provided to help answer this question from the solving business problems perspective. The chapter then skims over basic configuration and customization before introducing the advanced customization concepts covered throughout the book. The chapter concludes with a brief discussion on the different Alfresco editions that are available.
In this chapter, we will go through the following points:
Alfresco will tell you that the product is a platform for enterprise content management (ECM). But ECM is a somewhat nebulous and nefarious term. What does it really mean? It depends on who is saying it. ECM vendors usually use it as an umbrella term to describe a collection of content-centric technologies as follows:
Most people will also include collaboration, search, and occasionally, portals as well.
Practitioners have a different perspective. They will say that ECM is less about the technology and more about how you capture, organize, and share information across the entire enterprise. For them, the how is more important than the what.
What's important to know from an Alfresco perspective is that Alfresco is a platform for doing all these things.
So rather than worrying about a concise definition of ECM, let's look at a few examples to illustrate how clients are using Alfresco today, particularly in Alfresco's sweet spots such as DM and WCM.
Alfresco started its life as a document management repository with some basic services for document management. Alfresco focused on this smart area initially for two reasons. First, it allowed Alfresco to establish a strong foundation and then build upon that foundation by expanding into other areas of ECM. Second, there is a huge market for systems that can manage unstructured content (aka "documents").
The market is so big because document management is a problem for everyone. All companies generate files that benefit from the kind of features document management provides such as check-in/check-out, versioning, metadata, security, full-text search, and workflow.
Examples of classic document management are often found in insurance, manufacturing, packaged goods, or other companies with large research and development divisions. As you can imagine, companies such as these deal with thousands of documents every day. The documents are in a variety of formats and languages, and are created and leveraged by many different types of stakeholders from various parts of the company.
The critical functionality required for basic document management includes things such as:
The following diagram shows an example of high-level architecture to understand how basic document management might be implemented:
The diagram shows a single instance of Alfresco authenticating against a Directory Server(such as LDAP). Some content managers are using Alfresco Share via HTTP/S, while others are using Windows Explorer, Microsoft Office, and other thick clients to work with content via one or more protocols such as CIFS, WebDAV, FTP, or SMTP. As noted in the diagram, Alfresco stores metadata in a relational database and the actual content files on the filesystem.
Most of the techniques for customizing Alfresco for DM solutions apply to other ECM solutions such as WCM, RM, Imaging, and DAM. Of course, there are business concepts and technical implementation details specific to each that make them unique, but the details provided in this book apply to all because the specialized solutions are built as extensions to the core Alfresco repository. This books dedicates an entire chapter, Chapter 9, Amazing Extensions, to some very famous extensions as Alfresco Mobile and Alfresco Analytics.
On the surface, WCM is very similar to document management. In both cases, content owners store files in a repository. Often, the content is assigned metadata, secured, indexed for search, and routed through a workflow. The most obvious difference between DM and WCM is that the content being managed is meant specifically to be published on a website or as part of a web application. Beyond that high-level distinction, there are several other differences that make WCM worthy of separate discussion. These include:
Let's briefly look at each of these.
The majority of document management solutions deal with files generated by an office suite. Of course, there are exceptions such as various types of graphics files, CAD/CAM drawing formats, and other specialized tools. But mostly, the files are generated by a small number of different tools and an even smaller number of different software vendors.
In the case of WCM, there is a wide variety of tools involved from text editors to integrated development environments (IDEs) to graphics programs with multiple vendors in each category. This means the WCM solution needs to be very flexible in the way it integrates with authoring tools. The alternative, which is forcing authors to give up their favorite tools in favor of a standard, can be a management nightmare.
WCM does not require the separation between content's appearance on the web site and its storage. But many implementations take advantage of this principle because it makes redesigning the site easier, facilitates multichannel publishing, and enables people to author content without web skills.
To understand why this is so, think about a website that has its content and presentation of that content merged together. When it is time to redesign the site, you have to touch every single web page because every page contains presentation markup. Similarly, content authoring is limited to people with technical skills. Otherwise, there is a risk that the content owner (for example, the person writing a press release or a job posting) will inadvertently clobber the page design.
One way to address this is to separate the content (the press release copy) from the presentation of that content. A common way to do that is to store the content as presentation-independent XML. The XML can then be transformed into any presentation that's needed. A redesign is as simple as changing the presentation in a single place, and then regenerating all of the pages.
The impact of separating content from presentation is three-fold. First, assuming the content consumers aren't interested in reading raw XML, something has to be responsible for transforming the content. Depending on the implementation, it may be up to the WCM system or a frontend web application.
Second, in the case of static content, any change in the underlying content has to trigger a transformation so that the presentation will be up-to-date, keeping in mind that there may be more than one file affected by the change. For example, data from a job posting appears in the job posting detail as well as the list of job postings. If the posting and the job posting index are both static, the list has to be regenerated whenever the job posting changes.
Third, content authors lose the benefit of WYSIWYG (What You See Is What You Get) content authoring because the content doesn't immediately look the way it will as soon as it is published to the web site. The WCM system, then, has to be able to let content authors preview the content as they author it, preferably in the context of the entire site.
A document management system is a lot like a relational database in the sense that it is typically an authoritative, centralized repository. There are exceptions, but for the most part, content resides in the repository and is retrieved by the systems and applications that need it. On the other hand, a WCM system often faces a publication or deployment challenge. Files go into the repository, but must be delivered somewhere to be consumed. This might happen on a schedule, at the request of a user, as part of a workflow, or all of the above. Granted, some websites retrieve their content dynamically; but most sites have at least a subset of content that should be statically delivered to a web server.
Let's look at an example of a basic corporate website. Most companies have a mix of About Us content that probably doesn't change very often, Press releases or News sections that might get updated daily, and maybe some document-based content such as marketing slicks, product information sheets, technical specifications, and so on. There's also some content that is used to build the site such as HTML, XML, JavaScript, Flash, CSS, and image files.
It is likely that there are several different teams with several different skill sets, all collaborating to produce the site. In this example, suppose the About Us and News pages come from the marketing team, the site is built by the web team and the document-based content can come from many organizations within the company.
Alfresco WCM sits on top of the core Alfresco product to provide additional WCM-specific functionality. An important distinction between Alfresco WCM and other open source content management systems (CMS) is that Alfresco is a decoupled CMS while something such as Drupal is a coupled CMS. This means that Alfresco manages the website but does not concern itself with presentation unlike Drupal, which is both a repository and a presentation framework. This doesn't mean that Alfresco can only manage static sites. You can easily query the repository in any number of ways. It just means it is up to you to provide the frontend from the ground up.
Content-centric applications are those in which the primary purpose of the application is to process, produce, archive, collaborate on, or manage unstructured or semi-structured content.
The Alfresco Share client is an example of a content-centric application, although it is meant for a very general, all-purpose use case. When solutions are very close to basic document management, Alfresco Share can be customized as previously discussed. At some point, it makes more sense to build a separate custom application with Alfresco as the backend repository for that application.
Consider the sales process within a company, for example. Sales people create proposals. Those proposals are usually routed internally for review and approval, and then are delivered to the client. If the client accepts the proposal, a contract is drawn up and the product is delivered. The out-of-the-box Alfresco Share could be used to manage these documents, assign metadata, manage the review process through workflows, and make it all searchable. But the sales team might be even more productive if it used a purpose-built user interface. For this solution, a frontend built on top of NodeJS and Angular, a custom Spring web application, or even a custom mobile application might be a good option. Alfresco would provide the document management services. The frontend would talk to Alfresco via CMIS or RESTful services.
Another example is using Alfresco in a digitization project. More and more companies are trying to reduce the use of paper-based process for many different reasons. Alfresco can be integrated with various scanning solutions as Ephesoft via CMIS, or Kofax via the connector supported by Alfresco. Documents can be ingested and processed by the scanning solution and exported to Alfresco. Alfresco will be responsible to store, index and secure the scanned documents. Using the integrated Activiti framework, Alfresco can automatically start a process depending of the document type. If an invoice has been scanned, Alfresco will start a review process for the financial team. If it's a job application, Alfresco will start a new process for the HR team to track the different stages of this application.
As discussed previously, Alfresco provides two out-of-the-box web applications. The first one is the Alfresco repository engine. The first one provides only administration capabilities from a user interface point of view. The second one is the default web interface Alfresco Share. Many clients appreciate this separation because it gives them complete freedom with regard to how they build the frontend. Depending of your use case, you may want to use the standard Alfresco Share user interface; or including some customizations; or even build the frontend from scratch.
Alfresco Share provides many different options if you need customizations. The basic level is to configure some forms and pages to display your custom metadata. If you need further customization, you may want to customize an existing Dashlet or to develop a new one to add on the user or site dashboard. You may need to create custom actions in the use interface. If it's not enough, it's even possible to create new pages within Alfresco Share reusing the entire UI framework. Finally, if it's not sufficient, Alfresco can be integrated to any frontend using CMIS or REST API.
We'll see in one of the following chapters how Alfresco created tools to generate Angular applications from scratch:
The openness of the Alfresco repository, particularly its ability to be easily exposed as a set of services, makes Alfresco an ideal platform for content-centric applications. As the examples have shown, custom content-centric web applications use Alfresco as the backend. As a result, they have complete flexibility in frontend technology choices from portals to lower-level frameworks to no framework at all.
In this book, we'll assume we are rolling out Alfresco throughout a consulting firm. Professional services firms make great examples because they tend to generate a variety of different documents. The other reason is that document and content management is usually a big challenge, which is the core to the business. But the examples should be applicable to any business that generates a significant amount of documents.
The example firm, SomeCo, wants to leverage document and content management throughout the organization to make it easier to find important information, streamline certain business processes, and secure sensitive documents.
SomeCo's company organization is pretty standard. It consists of operations, sales, human resources, marketing, and finance/legal. Examples of the different types of content each department is concerned with are shown in the following table:
Department
Example document types
Format and process notes
Finance/legal
Client proposals for project work
Statements of work
Master services agreements
Non-disclosure agreements
Marketing
Case studies
Whitepapers
Marketing plans
Marketing slicks/promotional material
Human resources
Job postings
Resumes
Interview feedback
Offer letters
Employee profiles
/Biographies
Project reviews
Annual reviews
Sales
Forecast
Presentations
Proformas
Operations
Methodology
Utilization reports
Status reports
Examples throughout the rest of the book will show how Alfresco can be implemented and customized to meet the needs of the various organizations within SomeCo. During a real implementation, time would be spent gathering requirements, selecting the appropriate components to integrate with the solution, finalizing architecture, and structuring the project. There are plenty of other books and resources that discuss how to roll out content management across an enterprise and others that cover project methodologies. So none of that will be covered here.
Many of Alfresco's competitors (particularly in the closed-source space) have sprawling footprints composed of multiple, sometimes competing, technologies that have been acquired and integrated over time. Some have undergone massive infrastructure overhauls over the years, resulting in bizarre vestigial tails of sorts. Luckily, Alfresco doesn't suffer from these traits. On the contrary, Alfresco's architecture shows the following characteristics:
Let's look at each of these characteristics, starting with a high-level look at the Alfresco architecture.
The following diagram shows Alfresco's high-level architecture. By the time you finish this book, you'll be intimately familiar with just about every box in the diagram:
The important takeaways at this point are as follows:
The add-ons are pieces of functionality not found in the core Alfresco distribution. If you are working with the binary distribution, it means you'll have additional files to download and install on top of the base Alfresco or Share installation.
Add-ons are provided by Alfresco, third-party software vendors, and members of the Alfresco community such as partners and customers. Alfresco makes several add-on modules available such as Records Management, Google Docs, Office Services or Kofax integration. Members of the Alfresco community create and share add-on modules via the Alfresco add-Ons (https://addons.alfresco.com/), a website set up by Alfresco for that purpose. At the time of writing, this website contains 444 different add-ons compatible with Alfresco Enterprise and/or Community.
One of the reasons Alfresco has been able to create a viable offering so quickly is because it didn't start from scratch. The Alfresco engineers assembled the product from many finer-grained open source components. Why does this matter? First, instead of reinventing the wheel, they used proven components. This saved them time, but it also resulted in a more robust, more standard-based product. Second, it eases the transition for people new to the platform. If a developer already knows Spring, for example, many of the customization concepts are going to be familiar. Alfresco uses Surf, a Spring framework extension for building or extending MVC applications. And besides, as a developer, wouldn't you rather invest your time and effort in learning standard development frameworks rather than proprietary development kits?
The following table lists some of the major open source components used to build Alfresco:
Open source component
Use in Alfresco
Apache Solr (http://lucene.apache.org/solr/)
Full-text and metadata search
Hibernate (http://www.hibernate.org/)
Database persistence
FreeMarker (http://freemarker.org/)
Web script framework views, custom views in the web client, web client dashlets, email templates
Mozilla Rhino JavaScript Engine (http://www.mozilla.org/rhino/)
Web script framework controllers, server-side JavaScript, actions
OpenSymphony Quartz (http://www.quartz-scheduler.org/)
Scheduling of asynchronous processes
Spring ACEGI (http://projects.spring.io/spring-security/)
Security (authorization), roles, and permissions
Apache Axis (http://ws.apache.org/axis/)
Web services
LibreOffice (http://www.libreoffice.org/)
Conversion of office documents into PDF
Apache FOP (http://xmlgraphics.apache.org/fop/)
Transformation of XSL:FO into PDF
Apache POI (http://poi.apache.org/)
Metadata extraction from Microsoft Office files
Activiti (http://www.activiti.org/)
Advanced workflow
ImageMagick (http://www.imagemagick.org/)
Image file manipulation
GhostScript (http://www.ghostscript.com/)
Image file manipulation
Does this mean you have to be an expert in all open source components used to build Alfresco to successfully implement and customize the product? Not at all! Developers looking to contribute significant product enhancements to Alfresco or those making major, deep customizations to the product may require experience with a particular component, depending on exactly what they are trying to do. Everyone else will be able to customize and extend Alfresco using basic Java and web application development skills.
Software vendors love buzz words. As new acronyms climb the hype cycle, vendors scramble to figure out how they can at least appear to support the standard or protocol so that the prospective clients can check that box on the Request for proposal (RFP). Commercial open source vendors are still software vendors and thus are no less guilty of this practice. But because open source software is developed in the open by a community of developers, its compliance to standards tends to be more genuine. It makes more sense for an open source project to implement a standard than to go off in some new direction because it saves time. It promotes interoperability with other open source projects, and stays true to what open source is all about--freedom and choice.
Here, are the significant standards and protocols Alfresco supports:
Standard/protocol
Comment
HTTP
The main protocol used to access Alfresco content repository via for example the Alfresco REST APIs.
CMIS
CMIS is a standard allowing information sharing between different content management systems. Alfresco supports the version 1.0. and 1.1 of the CMIS standard.
FTP
Content can be contributed to the repository via FTP.
WebDAV
WebDAV is an HTTP-based protocol commonly supported by content management vendors. It is one way to make the repository look like a file system.
CIFS
CIFS allows the repository to be mounted as a shared drive by other machines. As opposed to WebDAV, systems (and people) can't tell the difference between an Alfresco repository mounted as a shared drive through CIFS and a traditional file server.
IMAP
IMAP protocol is used by any modern email clients. Directly from your client, you can connect to your Alfresco repository.
SMTP
It is possible to email content into the repository (InboundSMTP). A folder can be dedicated as an email target.
SPP
Enables Alfresco to act as a Microsoft SharePoint Server. Allows Microsoft Office users to access documents within the Alfresco repository.
Alfresco Office Services
Using Alfresco Office Services (AOS), you can access your documents directly via all Microsoft Office software. AOS replaces and improves the Microsoft SharePoint protocol available in the previous versions.
SOAP
The Alfresco Web Services API uses SOAP-based web services.
OpenSearch (http://www.opensearch.org)
Alfresco repositories can be configured as an OpenSearch data source, which allows Alfresco to participate in federated search queries.
XSLT, XSL:FO
Web form data can be transformed using XSL 1.0.
LDAP
Alfresco can authenticate against an LDAP directory or a Microsoft Active Directory server.
Alfresco offers a significant amount of functionality out of the box, but most implementers will customize it in some way. At a high level, the types of customizations typically done during an implementation can be divided into basic customizations and advanced customizations.
Many Alfresco customizations can be done without writing a single line of code. Some may be done even by end users through Alfresco Share. Others might require editing a properties file or an XML file. Let's look at some of them briefly here so that you can get an idea of what you don't have to code. Other customizations will be introduced in the Chapter 9, Amazing Extensions.
When users log in to Alfresco, the first thing that is usually displayed is the My Dashboard section. The dashboard is a user-configurable layout that contains dashlets. (If you are familiar with portals, think portal page and portlet). Users choose the layout of the dashboard (number of columns) as well as the specific dashlets they want displayed in each column.
There are a number of dashlets available out of the box, or you can develop your own and add them to the user-selectable list. Examples of out of the box dashlets include workflow-related dashlet such as My Tasks as well as content-related dashlets such as My Documents, My Sites or My Activities:
Currently most of these dashlets are Spring Surf Dashlets (http://docs.alfresco.com/5.1/concepts/dev-extensions-share-surf-dashlets.html), but they will eventually be converted to Aikau Dashlets (http://docs.alfresco.com/5.1/concepts/dev-extensions-share-aikau-dashlets.html). Aikau is the new UI framework developed by Alfresco, and available from Alfresco 4.2.Some of these existing dashlets allows you some configuration. Here are some examples:
Obviously, developing custom dashlets is probably not something you'd let your business users do; but it is still considered a basic customization. It can be complex to develop new dashlet depending if you need to develop new web script for example.
The first concept that you'll discover using Alfresco Share is the concept of site. It's a secured area in the repository where a team, a project or a suborganization can share and manage any kind of contents, including documents of course. A site includes multiple pages, depending mainly of the type of content. Alfresco Share provides the following by default:
In each site, you can configure and select only what is needed by the users.
Each Alfresco Share site contains as well a dedicated dashboard that you can entirely customize with all out-of-the-box dashlets already provided.
A rule is something that says, "When a piece of content is created, updated, or deleted, check these conditions. If these conditions are met, take these actions". Conditions may check whether a piece of content is a particular mime type, or a specific content type. They may also check whether a piece of content has a specific aspect applied, or whether the content's name property matches a particular pattern. Rules can be defined on any folder in the repository. Child folders can inherit rules from their parent.
Rule actions are repeatable operations that enable us to do things similar to those that can be done using JavaScript or Java. Out-of-the-box actions include things such as check-in content, check-out content, move an item to another folder, specialize the type of the content, add an aspect to the content, transform content from one format to another, and so on.
Configuring folders to run rule actions is something non-technical users can do through Alfresco Share. In Chapter 4, Handling Content Automatically with Actions, Behaviors, Transformers, and Extractors, you'll learn how to write your own custom rule actions using the Alfresco API.
Alfresco has two options for implementing workflow: simple workflow or advanced workflow. The good thing about simple workflows is that end users can configure them as needed without any technical skills or developer support.
Here's how it works. A user creates a rule to add simple workflow to a document when it is placed in the folder. When an item enters a folder with this type of rule applied, it will have additional UI action items available. The rule to specify the user actions and flow of the content between folders is configured in the repository action. When the step is invoked, the content can be copied or moved to another folder. It's also possible to add complexity to a simple workflow by creating rules for other folders and passing content around from location to location. For example, there might be folders called Draft, In Review, and Approved. The state of a document is determined by the folder in which it resides.
Simple workflows have obvious limitations:
The basic configuration and customizations show that there is quite a lot of tweaking and tailoring that can happen before a developer gets involved. This is a good thing. It means a good chunk of the customization requirements can be dealt with quickly. In the case of simple workflows, they can be delegated to the end users altogether! Hopefully, this leaves more time for the more advanced (and more interesting) customizations required for a successful implementation.
The advanced customizations are the customizations that are likely to require code. They are the focus of the book. To give you an idea of what's possible (and in an effort to provide an appetizer before the main meal is served), let's go over some of the areas of advanced customization.
Alfresco's out-of-the-box content model can be extended to define your own content types, content aspects, content metadata (properties), and relationships (associations). The out-of-the-box model is very generic, and defines only a minimal subset of the metadata that will probably need to be captured with the content.
For example, SomeCo might want to capture different metadata for its marketing documents than for its HR documents. Or maybe there is a set of metadata that doesn't belong to any one content type in particular, but should rather be grouped together in an aspect and attached to objects as needed. These and other content modeling concepts will be covered in Chapter 3, Working with Content Models.
