Understanding when to use a web script
Having understood what a web script is and the reasons for using web scripts, let's now understand when to use web scripts. When working with Alfresco, it is important to know in which scenarios web scripts can be used. Web scripts allow you to build custom URI-identified and HTTP-accessible Content Management Web services to access the Alfresco content repository, and hence they can be used in various kinds of implementations to build useful business solutions with Alfresco content management systems.
In development projects:
You can use web scripts to develop business implementations integrating Alfresco with external applications
You can develop customized web scripts as per your business requirement
You can leverage on the out-of-the-box web scripts available in Alfresco wherever they fit in your custom implementation
In support projects:
Web scripts could be your savior when you are working on a support or maintenance project to maintain the live system for your customers that is built on Alfresco and has millions of records.
You might come across a range of issues, for example, updating existing content to fix some data issues, deleting some unneeded content, getting the required content matching with the criteria specified by the business team, and so on. Web scripts can be used in such scenarios to serve these purposes.
On a live production system, it is not possible to restart the server, and restarting a server could impact the business of a customer. Consider a scenario where you need to fix some critical issues on a production system and you are looking for an option to have the issue fixed without restarting the server. The powerful feature of web scripts to interact with the Alfresco repository without restarting the server will help you in this case, and you can fix some critical issues using web scripts to provide a good content management experience to the business users.
In general, web scripts can be used in all kinds of solutions, such as:
Integrating Alfresco with external applications that can communicate with Alfresco using HTTP
Developing JSR-168 portlets to build up UI services
Developing data services
Providing feeds for repository content
Alfresco integration with Office
Developing Facebook applications
Building UI components in Alfresco SURF