![]() | ![]() | Flows (and Forms)It is worth reading the FAQ entry on flows for some background information on why Paloose Forms and Flows differ so much from Cocoon. Like the authorisation actions it is best to describe a simple example. RequirementsConsider a site which requires an admin system of restricted pages (the access system is described in more detail on the action page). The user's data (very simplistic) will consist of:
So a typical data structure used by the login process etc would be: context://configs/adminUsers.xml <authentication>
<users>
<user>
<username>hsfr</username>
<password>xxxxxxxxxxxxxxxxxxxxxxxxxxxx</password>
<data>
<fullname>Hugh Field-Richards</fullname>
</data>
</user>
</users>
</authentication> Add User FormConsider a means of entering a new admin user to an already password protected site. First a simple form is required (the file names are for the test accessible here). I am going to look at the just the form not the surfounding content that the example consists of. First in the form we have: context://documentation/addUserTest.xml <pf:form
id="addUserTestForm"
flow="addUserTest"
continuation="{flow:continuation.id}"
session="{flow:__flowId}">
<pf:label>Enter user's details</pf:label> where
The two Paloose variables will need expanding on generation so we will need the PXTemplateTransform for this when we define the sitemap pipeline. Next we define a set of suitable fields for displaying the user entry form: <pf:input ref="username" class="usernameField">
<pf:label>User name</pf:label>
<pf:value>{flow:username}</pf:value>
<pf:hint>The user's login username</pf:hint>
<pf:violations/>
</pf:input>
<pf:input ref="fullname" class="fullnameField">
<pf:label>Full name</pf:label>
<pf:value>{flow:fullname}</pf:value>
<pf:hint>The user's full name (optional)</pf:hint>
<pf:violations/>
</pf:input>
<pf:secret ref="password" class="passwordField">
<pf:label>Password</pf:label>
<pf:value>{flow:password}</pf:value>
<pf:hint>The user's login password</pf:hint>
<pf:violations/>
</pf:secret>
<pf:secret ref="passwordCheck" class="passwordField">
<pf:label>Check password</pf:label>
<pf:value>{flow:passwordCheck}</pf:value>
<pf:hint>The user's login password again to confirm</pf:hint>
<pf:violations/>
</pf:secret> The value of each one is derived from the flow data ({flow:password} etc.). Finally we define the submit button which transmits the form to the server: <pf:submit class="button" id="next">
<pf:label>Next</pf:label>
<pf:hint>Go to optional details entry</pf:hint>
</pf:submit>
</pf:form>
The next page describes the flow script. | ![]() |


