Chapter 9. How to Create a Web Script

WHAT'S IN THIS CHAPTER?

  • Understanding Web script components

  • Developing a Folder Listing Web script

  • Accessing Alfresco services

  • Debugging Web scripts

  • Creating the Knowledge Base Search Web script

In this chapter you'll discover how to create your own Web scripts. The Web Script Framework is designed with the developer in mind, aiming to make it as easy and quick as possible to create new Web scripts in order to construct a RESTful interface to the Alfresco Content Application Server.

Web scripts are implemented using lightweight scripting languages such as JavaScript and FreeMarker, so their development is not restricted to only those who know the Java language. One of the key advantages of using scripting languages is that minimal tooling is required. An example of this is that there is no need to compile or package a Web script implementation. This simplicity also removes the need for a complex development environment. In fact, Web scripts can be built using only a basic text editor or even just the Alfresco Explorer client.

Scripting also brings immediacy to the development of Web scripts by removing the painful steps of compilation and packaging. It is possible to quickly turn around implementation changes, which can be seen and tested just by refreshing your Web browser. This mode of development has become very attractive to the Alfresco community, making Web scripts a preferred approach to interacting with, integrating with, and extending Alfresco. ...

Get Professional Alfresco: Practical Solutions for Enterprise Content Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.