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 ...

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.