Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Back to Web Scripts.
A: Web scripts are activated with simple URL calls, You need some knowledge of JavaScript and FreeMarker templates. You do not need to know Java or .NET programming. (FreeMarker is a rendering engine that allows you to define rendering templates, and format the script outputs.)
The Web Script framework for constructing REST-style interfaces will simplify mashups. For example, content that is authored and managed within Alf can be mashed up with applications such as Google map. So map data can be working in conjunction with Alfresco-managed content.
A: Web scripts is the enabling technology for many of the new capabilities in Alfresco 2.1.
If you look in the latest version of Alfresco, you will see new dashlets such as:
All these dashlets were built using the core web scripts capability. The dashlets use Ajax UI capabilities, such as dynamic preview.
In addition, Alfresco's v2.1 OpenSearch has been rehosted as a series of web scripts.
A: By using web scripts, you can access Alfresco from within Alfresco, from within your own applications, and from within third-party applications.
Currently, Alfresco can be accessed from:
A: Web scripts are called using simple URLs. This means that they are cross-platform, and cross-language. You are not locked in to any programming language or development environment.
A: You do not need to do anything special. Any web scripts that you create are automatically available as JSR-168-compliant portlets. Simply use them within a JSR-168-compliant portlet environment.
A: Web scripts provide massive scalability using web-oriented architecture.
A: Simply upload your scripts to an Alfresco space (or create them inline), then use 1-click registration. As a bonus, you do not need to restart the Alfresco server.
A: The Alfresco server includes a built-in server-side JavaScript debugger to enable single-stepping, variable inspection, and arbitrary script execution.
A: Alfresco provides examples at:
Company Home > Data Dictionary > Web Scripts > Examples
and
Company Home > Data Dictionary > Web Scripts > org > alfresco > sample
A: If it is a GET Url, enter the script's URL in your web browser address bar in one of the following ways:
If it is a POST, PUT or DELETE URL then you will need to call it from a framework that can submit these HTTP messages.
A: The web script framework performs content negotiation to determine which format to return data.
By default the content negotiation is 'any' which means that the required content-type may be declared via the URI extension. This is what is causing problems.
In the script's description specify
<format default='json'>argument</format>
You are probably using script code along the lines of
status.setCode(status.STATUS_CREATED, 'New Thing created');
This setCode method has an implicit redirect to the return status formatting template which, by default, does not have a 201 format so uses the existing error return template.
Use the following code in your script instead
status.code = status.STATUS_CREATED
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.