Skip to content

ItEr77S13AllowDeleteOrderElements

Jeroen Baten edited this page Mar 9, 2018 · 1 revision

TWiki> LibrePlan Web>ItEr77S13AllowDeleteOrderElements (06 Nov 2012, ManuelRego)EditAttach

Story summary Allow Delete Order Elements From Web Services
Iteration ItEr77Week34To44
FEA ItEr77S13AllowDeleteOrderElements
Story Lead  
Next Story  
Passed acceptance test No

Acceptance Criteria

Additional Specification Comments

Implementation Notes

The delete operation has been implemented, but some problems appeared.

The main problem was related with removing all the data depending on the OrderElement) to be removed: =TaskElement, TaskSource, assignments and also the data related with scenarios.

The final solution was to use directly OrderModel which delegates the saving in SaveCommand and now everything seems to work properly. Some special stuff that was done:

  • It was needed to set as non-lazy the association between an OrderElement and its parent
  • We make optional the param Desktop in OrderModel.initEdit, as we were calling it from the web service
  • We need to create a new method OrderElement.detachFromParent in order to set parent to null and avoid problems removing the element (and removing the parents too). Another option could be to change the mapping between OrderElement and its parent in order to set it as cascade="none", however it could cause other unexpected errors in other parts of the application so it doesn't seem a good idea to be done at this moment.

A new script to test the new service has been included into examples folder (scripts/rest-clients/). The new script is called remove-order-element.sh and it'll receive the code of the element to be removed as parameter.

Finally, a new DTO called ErrorDTO has been created, to show the error message if it's not possible to remove the OrderElement because it (or any of its children) has been already used in a timesheet or a expenses sheet. In this case the server returns the status code 403 FORBIDDEN.

-- ManuelRego - 06 Nov 2012

 

Delay Causes

Final or Pending Considerations

 

Commits

%RPSHOWGITCOMMITS%

Tasks in this story

Tasks Est Spent To do Risk Reviewer Developer Task Name Start Date Est End Date End Date
Task 7 8 0 Low ManuelRego ManuelRego Add delete operation for order elements from web services      

Copyright (c) by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Clone this wiki locally