If you're going to be doing any development with Alfresco, you'll find that at the heart of much of the development are Web Scripts. Alfresco calls their Web Script technology "agile script-driven MVC".
Web Scripts enable very quick web application development. Instead of a single monolithic system, Web Scripts use a very focused light-weight approach for building components that can be combined and reused.
Alfresco has two types of Web Scripts:
Data Web Scripts
- Based on RESTful URLs
- Can return structured data as XML, JSON, or CSV
Presentation Web Scripts
- Renders the UI
- Can call data web scripts
There are three components to a Web Script:
- Descriptor file
- View file (Typically uses Freemarker, but can use things like XSLT and XSL-FO)
Alfresco has dashboards to see which Web Scripts are available:
eg., http://localhost:8080/alfresco/service or
Debugging Web Scripts
Set log4j.logger.org.alfresco.repo.jscript to DEBUG under WEB-INF/classes/log4j.properties
logger.log will write to catalina.out
Alfresco Webinar on Web Scripts. A high-level overview.
Alfresco Web Scripts -- PDF Document by Alfresco/LifeRay. A bit light on specifics, but great graphics.
Alfresco Web Scripts Wiki page. A good place to get started.
Web Script Examples Alfresco Wiki page. Large number and variety of cookbook examples.
Alfresco Developer Guide by Jeff Potts. Chapter 6, 'Exposing Content through RESTful APIs with Web Scripts'. Great resource. A similar version of this chapter is available here.
Best Practices and DRY. Break up Web Script files and use 'import' and configuration files.
Using 'Remote' in Web Scripts. Lets Alfresco Share Web Scripts call into Alfresco repository and external services.