Book Image

Alfresco One 5.x Developer's Guide - Second Edition

By : Benjamin Chevallereau, Jeff Potts
Book Image

Alfresco One 5.x Developer's Guide - Second Edition

By: Benjamin Chevallereau, Jeff Potts

Overview of this book

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.
Table of Contents (17 chapters)
Alfresco One 5.x Developer’s Guide - Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Writing Java-backed web scripts


You now have a web script that returns all whitepapers, and a web script that returns the rating summary for a specific whitepaper. The next step is to implement a web script that supports the POST method so that people can submit new ratings.

Like all web scripts, the web script that creates ratings will run as the user executing the script. In this case, you are appending guest=true to the URL, but we will use the runAs property in the web script descriptor to run the code using the username admin. Another way to handle this would be to set the web script's minimum authentication level to User, give named users (or one or more groups) write access to the whitepapers folder, and make website users authenticated. But SomeCo doesn't want to set up user accounts for every user who might rate content. Any user ought to be able to rate content whether or not he or she can authenticate with Alfresco as a named user. So, we'll use the runAs option. In this example...