Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Web Scripts
Web Scripts Framework
Back to 2.1 RESTful API.
NOTE: This document describes features to be found in Alfresco v2.1. (Newer versions: v3)
The framework for supporting Web Scripts provides some configuration points. These are described below.
Alfresco is a secure server requiring authenticated access.
The Web Script framework defers authentication to a plug-in Authenticator. By default, Basic HTTP Authentication is activated. See Web Script Runtimes for information on how to change the authentication mechanism in each runtime.
Other forms of authentication will also be considered:
(id: webscripts.authenticator.basic)
This authenticator supports HTTP Basic Authentication. The authorisation header must contain either:
For restricted environments that do not allow the setting of HTTP Request Headers, a ticket may be passed via the URL argument 'alf_ticket' or 'ticket'.
(id: webscripts.authenticator.webclient)
This authenticator relies on the authentication mechanism configured into the Alfresco Web Client. If login is required, a redirect to the Alfresco Web Client login page is made.
(id: webscripts.authenticator.jsr168)
This authenticator relies on the user name setup by the JSR-168 runtime. It assumes the user has already been authenticated by the Portal. The Alfresco Repository executes in the context of the Portal user.
(id: webscripts.authenticator.jsr168.webclient)
This authenticator ensures that the Alfresco Web Client user context is kept in sync with the Portal user. This allows Web Scripts that depend on Alfresco Web Client functionality to be used within the Portal.
Web Scripts framework logging is controlled by the following log4j entry:
log4j.logger.org.alfresco.web.scripts=debug
All Web Script URLs support the format argument for specifying the response type.
Formats available 'out-of-the-box' are:
e.g.
GET http://<host>:<port>/service/search/keyword?q=alfresco&format=atom
GET http://<host>:<port>/service/search/keyword.atom?q=alfresco</b>
New response formats may be supported by declaring a 'Format Map' Spring Bean as follows where format short names are mapped to mimetypes
<bean parent='webscripts.formatmap'>
<property name='formats'>
<props>
<prop key='wav'>audio/x-wav</prop>
</props>
</property>
</bean>
Multiple beans may be declared.
A custom 'Format Map' may be provided for a given user agent
<bean parent='webscripts.formatmap'>
<property name='agent'><value>MSIE</value></property>
<property name='formats'>
<props>
<prop key='atom'>text/xml</prop>
</props>
</property>
</bean>
Valid agent values are (currently):
To execute Web Scripts behind a firewall or proxy, you must first provide your public Web Server address, so that any links generated by Web Scripts refer back to the public server.
This is achieved by editing (or providing a custom):
web-client-config.xml
and providing the host details in the following:
<config evaluator='string-compare' condition='Server'>
<server>
<scheme>http</scheme>
<hostname>anexample</hostname>
<port>8080</port>
</server>
</config>
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.