Book Image

Alfresco Developer Guide

Book Image

Alfresco Developer Guide

Overview of this book

Table of Contents (17 chapters)
Alfresco Developer Guide
Credits
About the Author
About the Reviewers
Preface
Index

Chapter 6. Exposing Content through a RESTful API with Web Scripts

There are many ways to interact with the repository programmatically, one of which is via Web Scripts. Then why devote an entire chapter to the Web Script Framework? Web scripts allow you to define a REST API for the content in the Alfresco repository. REST stands for Representational State Transfer. In a nutshell, REST describes an architectural style of interaction based on simple URL-based requests and responses occurring over HTTP. Rolling your own RESTful API offers a huge advantage in terms of flexibility and implementation speed over other forms of web services such as SOAP. Web scripts have quickly become the preferred integration method between the frontend and an Alfresco backend, particularly for portals and dynamic web sites.

Specifically, in this chapter you will learn how to:

  • Write web scripts that create, read, and delete data in the backend repository and return responses in HTML, XML, and JSON

  • Use both JavaScript...