Repository: olingo-odata4 Updated Branches: refs/heads/master 85bebce00 -> 211e8ad57
[OLINGO-713] Minor Media Entity tutorial improvement Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/211e8ad5 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/211e8ad5 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/211e8ad5 Branch: refs/heads/master Commit: 211e8ad57fbd7e4ae28b66e6d3fb9a72d4f01255 Parents: 85bebce Author: Christian Holzer <[email protected]> Authored: Wed Oct 21 12:03:03 2015 +0200 Committer: Christian Holzer <[email protected]> Committed: Wed Oct 21 12:03:29 2015 +0200 ---------------------------------------------------------------------- .../mynamespace/service/DemoEntityProcessor.java | 13 +++++++++++++ .../mynamespace/service/DemoEntityProcessor.java | 13 +++++++++++++ 2 files changed, 26 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/211e8ad5/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java ---------------------------------------------------------------------- diff --git a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index e349182..d75dd0b 100644 --- a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -458,6 +458,19 @@ public class DemoEntityProcessor implements EntityProcessor, MediaEntityProcesso public void deleteMediaEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException, ODataLibraryException { + /* + * In this tutorial, the content of the media entity is stored in a special property. + * So no additional steps to delete the content of the media entity are necessary. + * + * A real service may store the content on the file system. So we have to take care to + * delete external files too. + * + * DELETE request to /Advertisments(ID) will be dispatched to the deleteEntity(...) method + * DELETE request to /Advertisments(ID)/$value will be dispatched to the deleteMediaEntity(...) method + * + * So it is a good idea handle deletes in a central place. + */ + deleteEntity(request, response, uriInfo); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/211e8ad5/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java ---------------------------------------------------------------------- diff --git a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 36958a8..2c7d3af 100644 --- a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -322,6 +322,19 @@ public class DemoEntityProcessor implements EntityProcessor, MediaEntityProcesso public void deleteMediaEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException, ODataLibraryException { + /* + * In this tutorial, the content of the media entity is stored in a special property. + * So no additional steps to delete the content of the media entity are necessary. + * + * A real service may store the content on the file system. So we have to take care to + * delete external files too. + * + * DELETE request to /Advertisments(ID) will be dispatched to the deleteEntity(...) method + * DELETE request to /Advertisments(ID)/$value will be dispatched to the deleteMediaEntity(...) method + * + * So it is a good idea handle deletes in a central place. + */ + deleteEntity(request, response, uriInfo); } }
