Usecases
Introduction
Usecases are sequences of pages that are orthogonal to the website, i.e. they can be executed without leaving the current URI. They are mainly used to execute CMS functions, e.g., to publish a page. Usecases are specified by
- a name and
- a set of steps .
A usecase is executed using the request parameters lenya.usecase
and
lenya.step
.
Matching Usecases
To match a usecase in a sitemap, the WildcardRequestParameterMatcher
is used on the lenya.usecase
and lenya.step
request
parameters. The predefined matchers have the types usecase
and
step
. A simple example of a usecase pipeline would be:
<map:match type="usecase" pattern="publish"> <!-- confirmation screen --> <map:match type="step" pattern="showscreen"> <map:generate type="serverpages" src="content/publishing/publish-screen.xsp"/> <map:transform src="xslt/publishing/publish-screen.xsl"/> <map:serialize/> </map:match> <!-- call publish task --> <map:match type="step" pattern="publish"> <map:act type="task"> <map:parameter name="publication-id" value="{../../1}"/> <map:parameter name="task-id" value="{request-param:task-id}"/> <map:redirect-to uri="{request:requestURI}" session="true"/> </map:act> </map:match> </map:match>
The Usecase Sitemap
The main usecase sitemap supports a set of generic usecases.
It is located at lenya/usecase.xmap
.
To implement your publication-specific usecases or to override a generic
usecase, just add a usecase.xmap
sitemap to your publication directory. The Lenya usecase sitemap looks for it
and mounts it before the generic usecases are matched.
Overview of use cases
The following use cases are known:
Use case |
lenya.usecase=
|
lenya.step=
|
Comment |
---|---|---|---|
Reject Approval | reject | showscreen | Confirm to reject a document from approval. |
reject | |||
Submit for Approval | submit | showscreen | Confirm to submit a document to approval. |
submit | |||
Archive | archive | showscreen | Confirm to archive a document. |
archive | |||
Checkin | checkin | showscreen | Confirm the checkin of this document |
checkin | |||
Checkout | checkout | showscreen | Confirm the checkout of this document |
checkout | |||
Copy | copy | showscreen | Confirm to copy a document. (The document is held in a clipboard until it is pasted again) |
copy | |||
Create | create | showscreen | Show a form allowing to specify the parameters for creation of a document |
create | Create the document | ||
Cut | cut | showscreen | Confirm to cut a document. (The document is held in a clipboard until it is pasted again) |
cut | |||
Deactivate | deactivate | showscreen | Confirm to deactivate a document. |
deactivate | |||
Delete | delete | showscreen | Confirm to delete a document. |
delete | |||
Logout | logout | showscreen | Confirm the logout |
Paste | paste | showscreen | Confirm to paste a document. (The document which is held in a clipboard until is pasted) |
paste | |||
Publish | publish | showscreen | Confirm the publication of this document |
publish | Publish this document | ||
Asset upload | aset | showscreen | Show a form allowing to specify the parameters for uploading of an asset |
upload | Upload the asset | ||
insert | Insert an already uploaded asset | ||
upload-and-insert | Upload and insert an asset | ||
remove | Remove a previously uploaded asset | ||
Rename | rename | showscreen | Confirm to rename a document. |
rename | |||
Rollback | rollback | showscreen | Show a list of all versions of this document |
view | View a particular version of this document | ||
rollback | Roll back to a particular version of this document | ||
Schedule | schedule | showscreen | Show a list of all task scheduled for this document |
add | Add a new task | ||
modify | Modify an existing task | ||
delete | Delete an existing task | ||
Edit | |||
Administration | userAddUser | Add a user | |
userDeleteUser | Show a form for adding users | ||
userChangeProfile | Change the profile of a user | ||
userChangePasswordUser | Change the password as a user | ||
userChangePasswordAdmin | Change the password as an administrator | ||
userChangeGroups | Change the group affiliation of a user | ||
iprangeAddIPRange | Add an IP range | ||
iprangeDeleteIPRange | Delete an IP range | ||
iprangeChangeProfile | Change the profile of an IP range | ||
iprangeChangeGroups | Change the group affiliation of an IP range | ||
groupAddGroup | Add a group | ||
groupDeleteGroup | Delete a group | ||
groupChangeProfile | Change the profile of a group | ||
groupChangeMembers | Change the members of a group | ||
View Logs | view-logs | overview | Show the logfile list for this publication |
log | Show a single logfile |
Use cases
Resource upload
lenya.usecase=upload
lenya.step=
|
additional parameters | sample value |
---|---|---|
showscreen | xpath | /NewsML/body.content/block[1]/*[1] |
insertBefore [optional] | true | |
upload | documentid | |
xpath | ||
insertBefore [optional] | ||
uploadFile | ||
identifier [optional] | ||
All Dublin core identifiers are also accepted |
Create
lenya.usecase=create
lenya.step=
|
additional parameters | sample value |
---|---|---|
showscreen | parentid | /dossiers/2003 |
doctype | Dossier | |
create | parentid | |
childid | ||
doctype |
Rollback
lenya.usecase=rollback
lenya.step=
|
additional parameters | sample value |
---|---|---|
showscreen | ||
view | version |
View Logs
lenya.usecase=view-logs
lenya.step=
|
additional parameters | sample value |
---|---|---|
overview | ||
log | logfile | 2003-05-13-18-34-00-314.xml |
Usecases versus FlowScript
The usecase concept in Lenya 1.2 is inferior to FlowScript. Lenya 2.0-dev contains a simple Usecase Framework for writing usecases based on flow, JX templates, and Java classes for business logic.