Book Image

Alfresco 3 Cookbook

Book Image

Alfresco 3 Cookbook

Overview of this book

Alfresco is the renowned and multiple award winning open source Enterprise content management system which allows you to build, design, and implement your very own ECM solutions.You have read a number of tutorials, blogs, and books on Alfresco. Now you're in the real world, trying to use Alfresco, but you’re running into problems with it. This is the book you want. Packed full of solutions that can be instantly applied, this cookbook with its practical based recipes and minimal explanation meets that demand.This Alfresco 3 cookbook boasts a comprehensive selection of recipes covering everything from the basics to the advanced. The book has recipes for quickly installing Alfresco in Windows and Linux and helping you use custom content model, rules, and search. There is also a collection of recipes focused on creating Scripts, Freemarker templates, Web Scripts, and new workflow definitions. Steps to integrate Alfresco with other systems like MS-Office are also included. You will be able to use Alfresco’s File and Email servers. Finally, step-by-step recipes are presented to create an Alfresco build environment and compile the source code. This Alfresco 3 Cookbook is perfect for developers looking to start working on Alfresco quickly, gain complete understanding, write custom implementations, and achieve expertise very easily.
Table of Contents (21 chapters)
Alfresco 3 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Add/Change contents of a document


Now as we are aware of mostly used JavaScript APIs, Alfresco objects, and syntaxes, let’s explore some example JavaScript. In the following example scripts, you will be able to witness the APIs and functionalities we discussed earlier in this chapter.

Getting ready

We will store the JavaScript files in the Company Home>Data Dictionary>Scripts>Cookbook folder (this folder does not exist in your repository and create this folder).

And will run the sample scripts against a document—Test_JS_API.txt in the folder Company Home>InfoAxon>Chapter 8. I have uploaded this text file with a simple line of text: A sample Document created to investigate in JavaScript API. and used our custom content type iabook:Product.

Note

We are running the sample scripts by this method, since this is one of the easiest ways to explore the scripts. However, you can also run your scripts via space rules. Later on, we will learn the most useful and prolific way of using JavaScripts...