Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Alfresco Web Scripts

You're reading from   Learning Alfresco Web Scripts Learn a powerful way to successfully implement unique integration solutions with Alfresco

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781784390600
Length 182 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ramesh Chauhan Ramesh Chauhan
Author Profile Icon Ramesh Chauhan
Ramesh Chauhan
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Familiar with Web Scripts FREE CHAPTER 2. It's Time for the First Web Script 3. Understanding the Web Script Framework 4. Building Blocks of Web Scripts 5. Invoking Web Scripts 6. Creating Java-backed Web Scripts 7. Understanding JavaScript-based Web Scripts in Detail 8. Deployment, Debugging, and Troubleshooting Web Scripts 9. Mavenizing Web Scripts 10. Extending the Web Script Framework Index

Reasons to use web scripts

It's now time to discover the answer to the next question—why web scripts? There are various alternate approaches available to interact with the Alfresco repository, such as CMIS, SOAP-based web services, and web scripts. Generally, web scripts are always chosen as a preferred option among developers and architects when it comes to interacting with the Alfresco repository from an external application. Let's take a look at the various reasons behind choosing a web script as an option instead of CMIS and SOAP-based web services.

In comparison with CMIS, web scripts are explained as follows:

  • In general, CMIS is a generic implementation, and it basically provides a common set of services to interact with any content repository. It does not attempt to incorporate the services that expose all features of each and every content repository. It basically tries to cover a basic common set of functionalities for interacting with any content repository and provide the services to access such functionalities.
  • Alfresco provides an implementation of CMIS for interacting with the Alfresco repository. Having a common set of repository functionalities exposed using CMIS implementation, it may be possible that sometimes CMIS will not do everything that you are aiming to do when working with the Alfresco repository. While with web scripts, it will be possible to do the things you are planning to implement and access the Alfresco repository as required. Hence, one of the best alternatives is to use Alfresco web scripts in this case and develop custom APIs as required, using the Alfresco web scripts.
  • Another important thing to note is, with the transaction support of web scripts, it is possible to perform a set of operations together in a web script, whereas in CMIS, there is a limitation for the transaction usage. It is possible to execute each operation individually, but it is not possible to execute a set of operations together in a single transaction as possible in web scripts.

SOAP-based web services are not preferable for the following reasons:

  • It takes a long time to develop them
  • They depend on SOAP
  • Heavier client-side requirements
  • They need to maintain the resource directory
  • Scalability is a challenge
  • They only support XML

In comparison, web scripts have the following properties:

  • There are no complex specifications
  • There is no dependency on SOAP
  • There is no need to maintain the resource directory
  • They are more scalable as there is no need to maintain session state
  • They are a lightweight implementation
  • They are simple and easy to develop
  • They support multiple formats

In a developer's opinion:

  • They can be easily developed using any text editor
  • No compilations required when using scripting language
  • No need for server restarts when using scripting language
  • No complex installations required

In essence:

  • Web scripts are a REST-based and powerful option to interact with the Alfresco repository in comparison to the traditional SOAP-based web services and CMIS alternatives
  • They provide RESTful access to the content residing in the Alfresco repository and provide uniform access to a wide range of client applications
  • They are easy to develop and provide some of the most useful features such as no server restart, no compilations, no complex installations, and no need of a specific tool to develop them
  • All these points make web scripts the most preferred choice among developers and architects when it comes to interacting with the Alfresco repository
You have been reading a chapter from
Learning Alfresco Web Scripts
Published in: Nov 2014
Publisher:
ISBN-13: 9781784390600
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime