O'Reilly logo

Professional Alfresco: Practical Solutions for Enterprise Content Management by Kevin Roast, Michael G. Uzquiano, Michael Farman, John Newton, David Caruana

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

Appendix D. Repository JavaScript API Reference

The Alfresco Repository JavaScript API lets you develop JavaScript (ECMAScript) 1.6–compatible files to access, modify, and create Alfresco repository objects, such as nodes, aspects, and properties.

OBJECT-ORIENTED LEVEL APIs

This appendix details the Alfresco JavaScript API for JavaScript files that execute in the Alfresco Web client and for Web scripts that execute JavaScript within the repository.

You can use scripts to perform various functions, such as:

  • Finding nodes

  • Performing searches

  • Walking node hierarchies

  • Modifying the value of properties, aspects, and associations

  • Transforming and manipulating content

  • Processing WCM Web projects and AVM objects

  • Creating groups, people, and modify permissions

  • Creating new files, folders, or nodes

  • Copying, moving, and deleting nodes

  • Creating, modifying, and removing child and target associations between nodes

  • Including (or importing) other scripts

Note

Web applications built on the Alfresco Surf platform use Web scripts, but they do not execute directly within the context of an Alfresco repository. Instead, they execute within a remote presentation tier (for example, an entirely new Web application running on a separate Web tier).

For information about the API available to JavaScript-based Web scripts on the presentation tier, see Online Appendix B.

SCRIPT FILES

Script files can be stored on the classpath (for example, in alfresco/extension/myscripts) or in a repository store. Scripts are generally stored ...

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

Start Free Trial

No credit card required