apache > lenya
 

The UsecaseDocument Module

Introduction

The usecasedocument module provides a resource type which allows to include usecases as documents. Typical usage scenarios are forms on web pages, for instance search forms or contact forms. In contrast to usual usecases which refer to the browser locale for i18n, the document's language is used.

For more information on usecases, please refer to the usecase framework documentation.

XML Format

The XML of a usecasedocument document looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<usecase xmlns="http://apache.org/lenya/usecase/1.0" name="contactform.sendMessage"/>

Creating Usecase-Based Documents

To create a usecase document, you can invoke the site.create usecase with an additional usecase parameter:

<item uc:usecase="usecasedocument.create" href="?usecase=contactform.sendMessage">
  <i18n:text>New Contact Form</i18n:text>
</item>

The creator class will take care that the usecase name is stored in the created document.