File tree Expand file tree Collapse file tree 5 files changed +137
-3
lines changed
Bundle/EzPublishRestBundle/Resources/config
Output/ValueObjectVisitor
Tests/Output/ValueObjectVisitor Expand file tree Collapse file tree 5 files changed +137
-3
lines changed Original file line number Diff line number Diff line change @@ -230,12 +230,23 @@ ezpublish_rest_createView:
230
230
_controller : ezpublish_rest.controller.content:createView
231
231
methods : [POST]
232
232
233
- # @todo this doesn't actually exist. Must generate a 404.
234
- ezpublish_rest_loadView :
235
- path : /content/views/{viewId}
233
+ ezpublish_rest_listView :
234
+ path : /content/views
235
+ defaults :
236
+ _controller : ezpublish_rest.controller.content:listView
237
+ methods : [GET]
238
+
239
+ ezpublish_rest_getView :
240
+ path : /content/views/{viewId}
241
+ defaults :
242
+ _controller : ezpublish_rest.controller.content:getView
243
+ methods : [GET]
236
244
237
245
ezpublish_rest_loadViewResults :
238
246
path : /content/views/{viewId}/results
247
+ defaults :
248
+ _controller : ezpublish_rest.controller.content:loadViewResults
249
+ methods : [GET]
239
250
240
251
# Object states
241
252
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ parameters:
9
9
ezpublish_rest.output.value_object_visitor.BadRequestException.class : eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\BadRequestException
10
10
ezpublish_rest.output.value_object_visitor.ForbiddenException.class : eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\ForbiddenException
11
11
ezpublish_rest.output.value_object_visitor.Exception.class : eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\Exception
12
+ ezpublish_rest.output.value_object_visitor.NotImplementedException.class : eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\NotImplementedException
12
13
13
14
# Section
14
15
ezpublish_rest.output.value_object_visitor.SectionList.class : eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\SectionList
@@ -168,6 +169,13 @@ services:
168
169
tags :
169
170
- { name: ezpublish_rest.output.value_object_visitor, type: eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException }
170
171
172
+ ezpublish_rest.output.value_object_visitor.NotImplementedException :
173
+ parent : ezpublish_rest.output.value_object_visitor.base
174
+ class : %ezpublish_rest.output.value_object_visitor.NotImplementedException.class%
175
+ arguments : [ true ]
176
+ tags :
177
+ - { name: ezpublish_rest.output.value_object_visitor, type: eZ\Publish\API\Repository\Exceptions\NotImplementedException }
178
+
171
179
ezpublish_rest.output.value_object_visitor.Exception :
172
180
parent : ezpublish_rest.output.value_object_visitor.base
173
181
class : %ezpublish_rest.output.value_object_visitor.Exception.class%
Original file line number Diff line number Diff line change 19
19
use eZ \Publish \API \Repository \Exceptions \NotFoundException ;
20
20
use eZ \Publish \API \Repository \Exceptions \ContentFieldValidationException ;
21
21
use eZ \Publish \API \Repository \Exceptions \ContentValidationException ;
22
+ use eZ \Publish \API \Repository \Exceptions \NotImplementedException ;
22
23
use eZ \Publish \Core \REST \Server \Exceptions \ForbiddenException ;
23
24
use eZ \Publish \Core \REST \Server \Exceptions \BadRequestException ;
24
25
@@ -760,4 +761,34 @@ public function createView()
760
761
)
761
762
);
762
763
}
764
+
765
+ /**
766
+ * List content views
767
+ *
768
+ * @return NotImplementedException;
769
+ */
770
+ public function listView ()
771
+ {
772
+ return new NotImplementedException ( 'ezpublish_rest.controller.content:listView ' );
773
+ }
774
+
775
+ /**
776
+ * Get a content view
777
+ *
778
+ * @return NotImplementedException;
779
+ */
780
+ public function getView ()
781
+ {
782
+ return new NotImplementedException ( 'ezpublish_rest.controller.content:getView ' );
783
+ }
784
+
785
+ /**
786
+ * Get a content view results
787
+ *
788
+ * @return NotImplementedException;
789
+ */
790
+ public function loadViewResults ()
791
+ {
792
+ return new NotImplementedException ( 'ezpublish_rest.controller.content:loadViewResults ' );
793
+ }
763
794
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * File containing the NotImplementedException ValueObjectVisitor class
4
+ *
5
+ * @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
6
+ * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
7
+ * @version //autogentag//
8
+ */
9
+
10
+ namespace eZ \Publish \Core \REST \Server \Output \ValueObjectVisitor ;
11
+
12
+ /**
13
+ * NotImplementedException value object visitor
14
+ */
15
+ class NotImplementedException extends Exception
16
+ {
17
+ /**
18
+ * Returns HTTP status code
19
+ *
20
+ * @return int
21
+ */
22
+ protected function getStatus ()
23
+ {
24
+ return 501 ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * File containing a test class
4
+ *
5
+ * @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
6
+ * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
7
+ * @version //autogentag//
8
+ */
9
+
10
+ namespace eZ \Publish \Core \REST \Server \Tests \Output \ValueObjectVisitor ;
11
+
12
+ use eZ \Publish \API \Repository \Exceptions \NotImplementedException ;
13
+ use eZ \Publish \Core \REST \Server \Output \ValueObjectVisitor ;
14
+ use eZ \Publish \Core \REST \Common ;
15
+
16
+ class NotImplementedExceptionTest extends ExceptionTest
17
+ {
18
+ /**
19
+ * Get expected status code
20
+ *
21
+ * @return int
22
+ */
23
+ protected function getExpectedStatusCode ()
24
+ {
25
+ return 501 ;
26
+ }
27
+
28
+ /**
29
+ * Get expected message
30
+ *
31
+ * @return string
32
+ */
33
+ protected function getExpectedMessage ()
34
+ {
35
+ return "Not Implemented " ;
36
+ }
37
+
38
+ /**
39
+ * Gets the exception
40
+ *
41
+ * @return \Exception
42
+ */
43
+ protected function getException ()
44
+ {
45
+ return new NotImplementedException ( "Test " );
46
+
47
+ }
48
+
49
+ /**
50
+ * Gets the exception visitor
51
+ *
52
+ * @return \eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\NotImplementedException
53
+ */
54
+ protected function internalGetVisitor ()
55
+ {
56
+ return new ValueObjectVisitor \NotImplementedException ;
57
+ }
58
+ }
You can’t perform that action at this time.
0 commit comments