2.10 2.2 to 2.3 compatibility
2.10.1 DocumentTaskManager
Introduction
To make it easier to add new types of document tasks some API changes were introduced.
Deprecated / removed API
TaskSpecifications are no longer created using the create[...]TaskSpecification methods on the DocumentTaskManager:
-
createTaskSpecification(String description, String script, String scriptLanguage, boolean stopOnFirstError)
- This method is now deprecated.
- To create a task specification, simply create a TaskSpecificationImpl instance like this:
-
new TaskSpecificationImpl(String description, String action, String actionParameters, boolean stopOnFirstError)
-
// action is the equivalent of 'scriptLanguage' in the now deprecated createTaskSpecification method // actionParameters is the equivalent of 'script' in the now deprecated createTaskSpecification method // note that the order of the action and actionParameters is reversed (compared to script and scriptLanguage)
-
createSimpleActionsTaskSpecification(String description, boolean stopOnFirstError)
- This method was removed entirely. The equivalent of this method is to create a TaskSpecifcation as described above.
- action = "simple";
- actionParameters should be a string representing an XML document conformant to this schema:
<xs:element name="simpleActionsParameters">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element name="createVariant">
<xs:complexType>
<xs:attribute name="startVersion" type="xs:string"/>
<xs:attribute name="newBranch" type="xs:string"/>
<xs:attribute name="newLanguage" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="deleteVariant">
<xs:complexType/>
</xs:element>
<xs:element name="addToCollection">
<xs:complexType>
<xs:attribute name="collection" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="removeFromCollection">
<xs:complexType>
<xs:attribute name="collection" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
<xs:attribute name="validateOnSave" type="xs:boolean"/>
</xs:complexType>
</xs:element>
Using the xmlschema bindings provided by daisy-doctaskrunner-xmlschema-bindings-[daisy-version].jar should make it simple to convert existing code.
New document actions
Two document actions have been added, called "search" and "replace" respectively. They are exposed through the new "Search and replace" functionality in the wiki.
Previous