commit f39ffce04eba9bd04c39327c0f8c2fd46dac4985
parent 7808efee98fb0bffd72522eab55fb92c97cecad9
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 22 Jul 2015 00:00:48 +0200
Implemented getImage for the footprint image
Diffstat:
3 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/app/config/config.yml b/app/config/config.yml
@@ -166,11 +166,29 @@ services:
arguments:
- { groups: [ "default" ] }
+ resource.footprint_image.item_operation.custom_get:
+ class: "Dunglas\ApiBundle\Api\Operation\Operation"
+ public: false
+ factory: [ "@api.operation_factory", "createItemOperation" ]
+ arguments:
+ - "@resource.footprint_image" # Resource
+ - [ "GET" ] # Methods
+ - "/footprint_images/{id}/getImage" # Path
+ - "PartKeeprFootprintBundle:FootprintImage:getImage" # Controller
+ - "FootprintImageGetImage" # Route name
+ - # Context (will be present in Hydra documentation)
+ "@type": "hydra:Operation"
+ "hydra:title": "A custom operation"
+ "returns": "xmls:string"
+
+
resource.footprint_image:
parent: "api.resource"
arguments: [ "PartKeepr\FootprintBundle\Entity\FootprintImage" ]
tags: [ { name: "api.resource" } ]
calls:
+ - method: "initItemOperations"
+ arguments: [ [ "@resource.footprint_image.item_operation.custom_get" ] ]
- method: "initFilters"
arguments: [ [ "@doctrine_reflection_service.search_filter" ] ]
- method: "initNormalizationContext"
diff --git a/app/config/partkeepr.yml b/app/config/partkeepr.yml
@@ -5,4 +5,5 @@ partkeepr:
temp: %kernel.root_dir%/../data/temp/
tempfile: %kernel.root_dir%/../data/files/Temporary/
footprintattachment: %kernel.root_dir%/../data/files/FootprintAttachment/
+ footprint: %kernel.root_dir%/../data/images/footprint/
mimetype_icons: %kernel.root_dir%/../src/PartKeepr/MimetypeIconsBundle/Resources/public/images/mimes/
\ No newline at end of file
diff --git a/src/PartKeepr/FootprintBundle/Controller/FootprintImageController.php b/src/PartKeepr/FootprintBundle/Controller/FootprintImageController.php
@@ -0,0 +1,15 @@
+<?php
+namespace PartKeepr\FootprintBundle\Controller;
+
+use PartKeepr\ImageBundle\Controller\ImageController;
+
+class FootprintImageController extends ImageController
+{
+ /**
+ * @inheritdoc
+ */
+ protected function getEntityClass()
+ {
+ return "PartKeepr\\FootprintBundle\\Entity\\FootprintImage";
+ }
+}