You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Apache Wiki <wi...@apache.org> on 2005/05/14 23:53:32 UTC
[Lenya Wiki] Update of "UsecaseExamples" by GregorRothfuss
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.
The following page has been changed by GregorRothfuss:
http://wiki.apache.org/lenya/UsecaseExamples
The comment on the change is:
moved to lenya docs
------------------------------------------------------------------------------
- === DocumentUsecase ===
+ deleted
- The {{{org.apache.lenya.cms.usecase.DocumentUsecase}}} serves as a base class for document-related usecases.
- It provides methods to obtain the document the usecase was invoked on, to trigger the workflow of the current
- document, etc.
-
- Additionally, the current document is stored in the parameter {{{document}}}. This allows JX templates to
- access information like the document ID, area, and language.
-
- === InvokeWorkflow ===
-
- To simply invoke a workflow on a document, you can use the usecase handler {{{org.apache.lenya.cms.workflow.usecases.InvokeWorkflow}}}.
-
- This usecase handler invokes the event specified by the {{{lenya.usecase}}} request parameter on the current document. This request parameter is set using the menu item attribute {{{wf:event}}}.
-
- In the following example, we're adding a usecase {{{workflow.submit}}} with a simple confirmation screen to the publication.
- To implement a simple workflow usecase, the following steps are required:
-
- 1. Specify the usecase in your {{{<mypub>/config/usecases.xconf}}} file:
-
- {{{
- <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'mypub/workflow.submit']">
-
- <component-instance name="mypub/workflow.submit"
- logger="lenya.usecases.workflow.submit"
- class="org.apache.lenya.cms.workflow.usecases.InvokeWorkflow"/>
-
- </xconf>
- }}}
-
- 1. Add the corresponding JX template {{{<mypub>/lenya/usecases/workflow/submit.jx}}}. You can access information about the document using the {{{document}}} parameter of the usecase:
-
- {{{
- <p>
- Do you want to submit the document <jx:out value="${usecase.getParameter('document').getId()}"/>?
- </p>
- }}}
-
- 1. Add the corresponding menu item:
-
- {{{
- <item uc:usecase="workflow.submit" wf:event="submit" href="?"><i18n:text>Submit</i18n:text></item>
- }}}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org