<?xml version="1.0" encoding="ISO8859-1"?>
<!-- $Id: index.ui,v 3.1 2002-02-12 21:18:21 stolpmann Exp $ -->
<!DOCTYPE ui:application
PUBLIC "-//NPC//DTD WDIALOG 2.1//EN" "application.dtd" [
<!-- Better we would have a complete definition of all HTML-related
entities. For the moment, ad-hoc definitions do the job.
-->
<!ENTITY nbsp "<ui:special>&nbsp;</ui:special>">
]>
<ui:application start-dialog="directory">
<!-- ******************** TEMPLATES *********************** -->
<!-- The top-level layout of the pages.
Params:
page: the page to display
-->
<ui:template name="page-layout" from-caller="page">
<html>
<head><title>Directory listing application</title></head>
<body bgcolor="white">
<ui:form>
<!-- We want the whole page to be indented by 20 pixels -->
<table>
<tr>
<td width="20"> </td>
<td>$page</td>
</tr>
</table>
</ui:form>
</body>
</html>
</ui:template>
<!-- One row of the directory listing
Params:
filename, fileperms, fileowner, filegroup, filesize,
filemtime, filesymlink
-->
<ui:template name="directory-row" from-caller="int">
<tr>
<td align="left">
<tt><ui:dynamic variable="fileperms" index="$int"/></tt>
</td>
<td> </td>
<td align="left">
<ui:dynamic variable="fileowner" index="$int"/>
</td>
<td> </td>
<td align="left">
<ui:dynamic variable="filegroup" index="$int"/>
</td>
<td> </td>
<td align="right">
<ui:dynamic variable="filesize" index="$int"/>
</td>
<td> </td>
<td align="left">
<tt><ui:dynamic variable="filemtime" index="$int"/></tt>
</td>
<td> </td>
<td align="left">
<ui:dynamic variable="filename" index="$int" special="yes"/>
<ui:dynamic variable="filesymlink" index="$int" special="yes"/>
</td>
</tr>
</ui:template>
<!-- The default layout of a filename.
Params:
value
-->
<ui:template name="filename" from-caller="value">
$value
</ui:template>
<!-- The layout of filenames of directories.
Params:
value
-->
<ui:template name="filename_d" from-caller="value">
<ui:a name="goto_dir" index="$value">$value</ui:a>
</ui:template>
<!-- The layout of a symlink
Params:
value
-->
<ui:template name="symlink" from-caller="value">
-> $value
</ui:template>
<!-- ********************* OBJECTS *********************** -->
<ui:dialog name="directory" start-page="enter_path">
<!-- *** Declaration of state variables *** -->
<ui:variable name="path">
<ui:string-value>/</ui:string-value>
</ui:variable>
<!-- The path to list -->
<ui:variable name="fileperms" associative="yes" temporary="yes"/>
<ui:variable name="fileowner" associative="yes" temporary="yes"/>
<ui:variable name="filegroup" associative="yes" temporary="yes"/>
<ui:variable name="filesize" associative="yes" temporary="yes"/>
<ui:variable name="filemtime" associative="yes" temporary="yes"/>
<ui:variable name="filename" associative="yes" temporary="yes"/>
<ui:variable name="filesymlink" associative="yes" temporary="yes"/>
<!-- Properties of every file -->
<!-- *** The page enter_path *** -->
<ui:page name="enter_path">
<ui:use template="page-layout">
<ui:param name="page">
<h1>Directory Listings</h1>
Please enter the path name of the directory you want to
see.<br/>
Path name: <ui:text variable="path" size="40"/>
<ui:button name="path-ok" label="OK" goto="show_listing"/>
</ui:param>
</ui:use>
</ui:page>
<!-- *** The page show_listing *** -->
<ui:page name="show_listing">
<ui:use template="page-layout">
<ui:param name="page">
<h1>The directory <ui:dynamic variable="path"/></h1>
<table>
<!-- Here multiple instances of the template
"directory-row" are inserted.
-->
<ui:iterate variable="filename" template="directory-row">
<ui:iter-head>
<tr>
<td><b>Permissions</b></td>
<td/>
<td><b>Owner</b></td>
<td/>
<td><b>Group</b></td>
<td/>
<td align="right"><b>Size</b></td>
<td/>
<td align="right"><b>Last modified</b></td>
<td/>
<td><b>Name</b></td>
</tr>
</ui:iter-head>
</ui:iterate>
</table>
<ui:button name="enter-path" label="Change path" goto="enter_path"/>
</ui:param>
</ui:use>
</ui:page>
</ui:dialog>
</ui:application>