-
Log in to SkyVault Explorer:
- Open a web browser and enter the URL: http://localhost:8080/SkyVault
- If prompted, log in with the user name admin and password admin.
- Navigate to Company Home > Data Dictionary > Web Scripts Extensions > org > example.
-
Create a web script response template for your Folder Listing example:
- In the Create menu, click Create Content.
- Enter the name for the web script in the Name field, such as: dir.get.html.ftl
- In the Content Type list, select Plain Text.
- Click Next.
-
Type the following in the Enter Content box:
<html> <head> <title>Folder ${folder.displayPath}/${folder.name}</title> </head> <body> <p>SkyVault ${server.edition} Edition v${server.version} : dir</p> <p>Contents of folder ${folder.displayPath}/${folder.name}</p> <table> <#list folder.children as child> <tr> <td><#if child.isContainer>d</#if></td> <#if verbose> <td>${child.properties.modifier}</td> <td><#if child.isDocument> ${child.properties.content.size}</#if></td> <td>${child.properties.modified?date}</td> </#if> <td>${child.name}</td> </tr> </#list> </table> </body> </html>
- Click Next, click Finish, and then click OK.
The component script file name dir.get.html.ftl, adheres to the naming convention defined by the Web Script Framework. All response template file names must end with .ftl. The <web script id> identifies the web script and must be the same as the web script ID defined in the file name of the associated web script description document. The <http method> specifies which HTTP method will initiate the web script and again must be the same as the associated web script description document. The format rendered by the response template is represented by <format>, the Web Script Framework abbreviation for a MIME type.
- /org/example/dir.get.desc.xml
- /org/example/dir.get.js
- /org/example/dir.get.html.ftl The Web Script Framework knows that all of these files are related to the same web script as they share web script package, web script ID, and HTTP method.