Building a Hello World web script is the best way to gain an understanding of
the Web Script Framework. This example is simple enough to build and execute within a few
minutes.
The Hello World web script consists of one web script description document and one
FreeMarker response template, both created via SkyVault Explorer.
-
Log in to SkyVault Explorer.
- Type http://localhost:8080/SkyVault in the web browser.
- If prompted, log in with the user name admin and password admin.
- Navigate to Company Home > Data Dictionary > Web Scripts Extensions.
-
Create a web script description document for the Hello World example.
- In the Create menu, click Create Content.
- Enter hello.get.desc.xml as the web script name in the Name field.
- In the Content Type list, select XML.
- Click Next.
-
Enter the following in the Enter Content box:
<webscript> <shortname>Hello</shortname> <description>Polite greeting</description> <url>/hello</url> </webscript>
- Click Next.
- Click Finish.
- Click OK.
-
Create a web script response template to render the Hello World greeting.
- In the Create menu, click Create Content.
- Enter hello.get.html.ftl as the template name in the Name field.
- In the Content Type list, select Plain Text.
- Click Next.
- Type Hello World in the Enter Content box.
- Click Next.
- Click Finish.
- Click OK.
-
Register the Hello World web script with SkyVault.
- Type http://localhost:8080/alfresco/service/index in the web browser.
- If prompted, log in with the user name admin and password admin.
- Click Refresh Web Scripts.
A message indicates there is one additional web script.
-
Type http://localhost:8080/alfresco/service/hello in the web browser
to test the new web script.
A Hello World message is displayed, indicating your web script is working.