With a complete Folder Listing web script implementation, you can register and test your web script.
-
Register the web script with SkyVault Community Edition:
- In your browser, enter: http://localhost:8080/alfresco/service/index
- If prompted, log in with the user name admin and password admin.
-
Click Refresh Web Scripts on the Web Scripts Home page.
The Web Script Framework find all web scripts and registers them with SkyVault Community Edition. When there is a problem registering a web script, the index provides a list of web scripts that failed registration along with the reason for the failure.
-
Perform your first test:
- In your browser, enter: http://localhost:8080/alfresco/service/dir/Company%20Home
- If you see the contents of the Company Home folder listed, your web script is working.
-
Check the verbose flag:
- In your browser, enter: http://localhost:8080/alfresco/service/dir/Company%20Home?verbose=true
- If you see the contents of the Company Home folder listed in verbose form, your web script is working.
-
Check the error handling of a folder that does not exist:
- In your browser, enter: http://localhost:8080/alfresco/service/dir/doesnotexist
- If you see an error page detailing a 404 status response, your web script is working.
When testing status response codes, it is useful to test with the cURL client to access to the status code sent on the HTTP response. For example, to repeat the 'folder does not exist' test with cURL, type the following in your command line:
curl -uadmin:admin -v "http://localhost:8080/alfresco/service/dir/doesnotexist"The returned response is similar to the following where the 404 status code is explicitly logged:
* About to connect() to localhost port 8080 (#0) * Trying ::1... connected * Connected to localhost (::1) port 8080 (#0) * Server auth using Basic with user 'admin' > GET /alfresco/service/dir/doesnotexist HTTP/1.1 > Authorization: Basic YWRtaW46YWRtaW4= > Host: localhost:8080 > Accept: */* > < HTTP/1.1 404 Not Found < Server: Apache-Coyote/1.1 < Cache-Control: no-cache < Pragma: no-cache < Content-Type: text/html;charset=UTF-8 < Content-Length: 1487 < Date: Tue, 26 Jan 2010 10:28:28 GMT