TASKPM/scripts/rest-clients/criterion-types-sample.xml
Fernando Bellas Permuy 1091ede3ca ItEr44S17CUImportacionRecursosProductivosItEr43S08: First version of migration of criterion REST service to the new semantics of POST.
IMPORTANT: CriterionType and Criterion tables must be removed because they now need "code" column with non-null values. Any row in any other table refering to CriterionType and Criterion instances must also probably be removed. In consequence, it is probably better to remove all databases (navaldev, navaldevtest, navalprod and navalprodtest).

This first version does not implement updates yet (only insertions) and does not detect repeated codes in the entities being imported (repeated codes in database are detected). "code" attribute has now been added to entities, and "num-instance" + "code" + "entity-type" attribute has been added to InstanceConstraintViolationsDTO.

This effort has been implemented creating reusable classes (to facilitate migration of the rest of services) and with a non-invasive approach (to make possible migrate each service individually and minimize the number of changes to the current code [specially testing code]).

Some existing methods/attributes in existing reusable classes (e.g. Util, InstanceConstraintViolationsDTO) have been deprecated (to support migration of services incrementally) and new ones have been implemented.

New reusables clases have been implemented: IntegrationEntity (all entities used in application integration must extend from this one), IIntegrationEntityDAO, IntegrationEntityDAO, InstanceConstraintViolationsDTOId (identifier for an instance causing a list of constraint violations), and IntegrationEntityDTO (all entity DTOs must extend from this one). Please, have a look to the JavaDoc of such classes.
2010-01-25 11:27:43 +01:00

111 lines
4.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<criterion-type-list xmlns="http://rest.ws.navalplanner.org">
<!-- Several errors: see comments -->
<criterion-type code="ct-1" name="ct-1" description="ct-1 desc"
allow-hierarchy="false"
allow-simultaneous-criterions-per-resource="true" enabled="true"
resource="RESOURCE">
<criterion-list>
<!-- Missing criterion name -->
<criterion code="ct-1-c1" active="true"/>
<criterion code="ct-1-c2" name="c2" active="true">
<!-- Criterion hierarchy is not allowed -->
<children>
<criterion code="ct-1-c2-1" name="c2-1" active="true">
<children>
<criterion code="ct-1-c2-1-1" name="c2-1-1" active="false"/>
<criterion code="ct-1-c2-1-2" name="c2-1-2" active="true"/>
</children>
</criterion>
<!-- Repeated criterion name -->
<criterion code="ct-1-c2-2" name=" C2-1 " active="true"/>
</children>
</criterion>
</criterion-list>
</criterion-type>
<!-- Missing criterion type name -->
<criterion-type code="ct-2" description="ct-2 desc" allow-hierarchy="true"
allow-simultaneous-criterions-per-resource="true" enabled="true"
resource="RESOURCE">
<criterion-list>
<criterion code="ct-2-c1" name="c1" active="true"/>
<criterion code="ct-2-c2" name="c2" active="true"/>
</criterion-list>
</criterion-type>
<!-- OK -->
<criterion-type code="ct-4" name="ct-4" description="ct-4 desc"
allow-hierarchy="true" allow-simultaneous-criterions-per-resource="true"
enabled="true" resource="RESOURCE">
<criterion-list>
<criterion code="ct-4-c1" name="c1" active="true"/>
<criterion code="ct-4-c2" name="c2" active="true">
<children>
<criterion code="ct-4-c2-1" name="c2-1" active="true">
<children>
<criterion code="ct-4-c2-1-1" name="c2-1-1" active="false"/>
<criterion code="ct-4-c2-1-2" name="c2-1-2" active="true"/>
</children>
</criterion>
<criterion code="ct-4-c2-2" name="c2-2" active="true"/>
</children>
</criterion>
</criterion-list>
</criterion-type>
<!-- Repeated criterion type name (see above) -->
<criterion-type code="ct-4b" name=" CT-4 " description="ct-4 desc"
allow-hierarchy="false"
allow-simultaneous-criterions-per-resource="false" enabled="false"
resource="WORKER"/>
<!-- Repeated criterion type name (probably a criterion type with this name
already exists in the database) -->
<criterion-type code="ct-4c" name="training" description="ct-4 desc"
allow-hierarchy="false"
allow-simultaneous-criterions-per-resource="false" enabled="false"
resource="WORKER"/>
<!-- A non-active criterion has an active subcriterion -->
<criterion-type code="ct-5" name="ct-5" description="ct-5 desc"
allow-hierarchy="true" allow-simultaneous-criterions-per-resource="true"
enabled="true" resource="RESOURCE">
<criterion-list>
<criterion code="ct-5-c1" name="c1" active="true"/>
<criterion code="ct-5-c2" name="c2" active="false">
<children>
<criterion code="ct-5-c2-1" name="c2-1" active="false"/>
<criterion code="ct-5-c2-2" name="c2-2" active="false">
<children>
<criterion code="ct-5-c2-2-1" name="c2-2-1" active="true"/>
</children>
</criterion>
</children>
</criterion>
</criterion-list>
</criterion-type>
<!-- OK -->
<criterion-type code="ct-6" name="ct-6" description="ct-6 desc"
allow-hierarchy="false"
allow-simultaneous-criterions-per-resource="false" enabled="false"
resource="WORKER"/>
<!-- Resource type does not allow enabled criteria -->
<criterion-type code="ct-7" name="ct-7" description="ct-5 desc"
allow-hierarchy="true" allow-simultaneous-criterions-per-resource="true"
enabled="false" resource="RESOURCE">
<criterion-list>
<criterion code="ct-7-c1" name="c1" active="true"/>
<criterion code="ct-7-c2" name="c2" active="false"/>
</criterion-list>
</criterion-type>
</criterion-type-list>