Difference between revisions of "Workflows/Workflow Format"

From EPrints Documentation
Jump to: navigation, search
(Redirected page to Workflow Format)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Navigate-First|Section=Workflows|Curr=Workflow Format|Next=Components}}
+
#REDIRECT [[Workflow Format]]
 
 
= Workflow Format =
 
 
 
== File Structure ==
 
 
 
The EPrints workflow file is written in XML, and follows the following structure:
 
 
 
<pre>
 
<workflow xmlns="http://eprints.org/ep3/workflow" xmlns:ep="http://eprints.org/ep3/">
 
  <flow>
 
    <stage ref="first_stage" />
 
    <stage ref="second_stage" />
 
  </flow>
 
  <stage name="first_stage">
 
    <component>...</component>
 
    ...
 
  </stage>
 
  ...
 
</workflow>
 
</pre>
 
 
The <flow> structure defines the path taken through the workflow - in this case, from first_stage to second_stage. It is straightforward to embed [[EPScript]] in the flow block (as well as throughout the workflow) to provide more complex flows. For example, to only include a certain stage for a specific EPrint type:
 
 
 
{{codesample|
 
<pre>
 
<flow>
 
  <ep:if test="type = 'thesis'">
 
    <stage ref="thesis_stage">
 
  </ep:if>
 
  ...
 
</flow>
 
</pre>
 
}}
 
 
 
The ref attribute of the <stage> element corresponds directly to the <stage>'s name attribute later in the workflow.
 
 
 
=== Stages ===
 
 
 
While the flow element contained a list of stages to handle, the stage contains a list of components to render. Again, the stage may contain [[EPScript]] to customize the components rendered. For example, the default EPrint workflow contains the following to ensure the 'presentation type' field is only visible for conference items:
 
 
 
{{codesample|
 
<pre>
 
<stage name="example_stage">
 
  <ep:if test="type = 'conference_item'">
 
  <component><field ref="pres_type" required="yes" /></component>
 
  </ep:if>
 
  ...
 
</stage>
 
</pre>
 
}}
 
 
 
Each component within a stage may have use any or none of the following attributes:
 
 
 
* type (defaults to <b>Field</b>): The type of component to use (see the [[Workflows/Components|next section]] for components bundled with EPrints 3).
 
* collapse (defaults to <b>no</b>): If yes, the component is initially collapsed. This hides the fields from the user unless they expand the component.
 
* surround (defaults to <b>Default</b>): The surround is responsible for the 'look and feel' of the component. It renders the help, title, and the container in which the component's content is placed. It may be useful to create a custom surround based on the Default surround class, or to use the None surround, which renders nothing except the component content.
 
 
 
The content of the <component> element is handled by the component itself, so may vary depending on its function. Again, the <component> content may contain EPScript to allow for dynamic configuration.
 

Latest revision as of 11:44, 19 May 2010

Redirect to: