This patch should be applied after the following patches :
ItEr50S13AdaptacionServiciosRESTItEr49S18 : Adds class validations.
ItEr50S13AdaptacionServiciosRESTItEr49S18 : Refactoring the create way a work report line.
It is need a work report to create a work report line , and now the work report line
does not change its work report.
Updating functionality has been added to ResourceServiceREST. All data associated to a resource can be updated with the exception of the calendar field, since the updating semantics are only clearly defined for such field at this moment (what happens with the previous derived calendar: modified?, removed?, disabled?).
As part of this patch, some improvements to CriterionServiceREST implementation have also been made. In particular, updateUnvalidated methods has been added to related entities (as in ResourceServiceREST). Unlike createUnvalidated methods, such methods are used for updating, and like createUnvalidated methods, non-valid fields are allowed.
Finally, performance of GenericRESTService has been improved. Previously, validations were executed twice for each entity being imported due to previous limitations of IGenericDAO interface. Now, a new method has been added to IGenericDAO to make possible to execute validations only one time for each entity being imported.
ResourceServiceREST has been adapted to GenericRESTService. Updating functionality in ResourceServiceREST is not implemented yet.
As part of this patch, the generic infraestructure for REST services has been improved. In particular, recoverable error support has been provided. Exceptions representing recoverable errors must extend from RecoverableErrorException. To demonstrate this capability, ResourceServiceREST nows reports non-existent calendars, criterions, critetion types, and cost categories as recoverable errors.
IMPORTANT: "code" column has been added to tables of the following entitites: Resource, CriterionSatisfaction, and ResourcesCostCategoryAssignment. "code" column has been removed from Machine's table. In consequence, it is better to remove all the database when applying this patch (navaldev, navaldevtest, navalprod, and navaprodtest).
This change is compatible with the current Web user interface. The only thing you will notice is that when creating a machine, the form containing the code automatically displays a value in the code field (which, of course, can be changed by the user). Of course, the user interface should be improved to set a blank value or propose a more meaningful code to the user (probably this second option).
The service has not been adpated to GenericRESTService yet and duplicate codes in resources *being* imported are not detected yet (GenericRESTService will make this automatically).
GenericRESTService provides initial common functionality to all services. Some another generic infraestructure has been improved (IntegrationEntity, IIntegrationEntityDAO, InstanceConstraintViolationsDTO, and ConstraintViolationConverter) or simplified (IntegrationEntityDTO).
GenericRESTService does not implement all desirable features yet (e.g. recoverable errors). Please, do not use it yet.
CriterionServiceREST has been reimplemented in terms of it. Tests have also been improved.
Support for updating criterion types when importing criterion types has been added.
To update a criterion type, it is only necessary to send the modifications, and not all the state. In consequence, it is only necessary to send modified propert
ies in the criterions and the criterion type itself, and only new or modified cr
iterions need to be sent. Furthermore, any legal change in the criterion hierarchy of the criterion type is allowed.
Finally, a test case has been added to test the updating funcionality.