-
Notifications
You must be signed in to change notification settings - Fork 15
Support REST, not just GET #6
Comments
+1. I think we need:
Moving is the trickiest, as you cannot move a PHPCR resource to a Doctrine ORM branch. Or move Doctrine ORM entities to ORM branches of different types. PHPCR resources may have child restrictions etc. So we need to add information about what are valid and invalid parents for each node/type, if the node can be renamed, deleted, etc. Or maybe we could just delegate these operations to the layer below the resource system, but then the APIs would not be gauranteed to be consistent. Not sure how much of this could be implemented in the Puli API /cc @webmozart |
|
what about create / update? also not the job of this bundle? i would assume FOSRestBundle handles most of that already... |
yeah, creating a new resource would involve creating a new instance of the thing the resource represents, which is surely out of the scope of this bundle. (at the limit we could imagine some super abstract CRUD system for resources with mapping and everything, but well, thats crazy for now). Users can map their own REST endpoints using the HateOasBundle, and the serializer will pick that up here. |
I imagine the we would depend on a specific key for the URL being present in the response, e.g. |
for create i would suggest requests like `POST /api/repo_phpcr/cms/content/collection" or "PUT /api/repo_phpcr/cms/content/collection/name" (explicit). And i think we need some information about the resource to create, maybe an own header equal to the content-type? |
the CreateBundle solves this problem with json-ld requests that specify what to create. as far as i remember, we however leak information to the frontend as the exact document class is specified. editing is a lot easier, as you can just load the document in question and see what is there. the paths should be the same as for GET but with different methods. |
I would call the links described by @dantleech HATEOAS :-) And @dbu no, the paths can't be the same for all methods (except we stroke the word REST from this bundle). The create path should be on a kind of a collection of resources, while edit/delete goes on the resource itself. You can, if you know the correct position of the resource, create by a PUT request. That spoken, even a collection should be a resource that i can fetch by that bundle. doing that i would get a create route too - as a kind of "add buttton". In general we should provide schemas of a document's fields in a nice format, maybe not RAML. I recognized the ALPS specification some weeks ago and think that can be the right tool, cause customers of the api will get a detailed information for each format AAANND can create Forms out of the information => create-bundle/frontendenditing. So i created #29 for that. |
you are correct max, we can't have the same url for creating and editing. i think one philosophy confusion we have with this topic is that PHPCR is a tree structured database, while REST with its resource orientation is essentially thinking in relational database terms. the question for us is if we want to talk to "class" oriented paths to read data in a relational model and specify the paths in the repository somehow, or if we want to use paths that reflect the PHPCR tree structure and need to specify the classes of the documents somehow. create bundle is doing more of a RPC style thing, sending both class and repository path to a fixed URL. what we are currently adding to the cmf routing would help with a PHPCR oriented model. ResourceRestBundle probably takes the relational model. |
There is also an third way of reaching the content: on an api defined by their routes (content-bundle). |
# This is the 1st commit message: DevKit updates # This is the commit message #2: improvements to get the tests running # This is the commit message #3: try to call unit tests only # This is the commit message #4: DevKit updates # This is the commit message #5: add correct cache/log path to gitignor # This is the commit message #6: DevKit updates # This is the commit message #7: DevKit updates # This is the commit message #8: DevKit updates # This is the commit message #9: DevKit updates # This is the commit message #10: DevKit updates # This is the commit message #11: DevKit updates # This is the commit message #12: restriction on sebastion/exporter # This is the commit message #13: fix composer.json # This is the commit message #14: use higher versions # This is the commit message #15: use higher version # This is the commit message #16: DevKit updates # This is the commit message #17: DevKit updates # This is the commit message #18: DevKit updates # This is the commit message #19: try verbose # This is the commit message #20: try testdox # This is the commit message #21: try makefile change # This is the commit message #22: try travis # This is the commit message #23: back # This is the commit message #24: restrict sebastianbergmann/environment # This is the commit message #25: restrict sebastianbergmann/environment # This is the commit message #26: try to turn around # This is the commit message #27: support symfony 3.4, new testing app folder structure # This is the commit message #28: support symfony 3.4, new testing app folder structure # This is the commit message #29: use caret operator for symfony-cmf/resource-bundle
* # This is a combination of 29 commits. # This is the 1st commit message: DevKit updates # This is the commit message #2: improvements to get the tests running # This is the commit message #3: try to call unit tests only # This is the commit message #4: DevKit updates # This is the commit message #5: add correct cache/log path to gitignor # This is the commit message #6: DevKit updates # This is the commit message #7: DevKit updates # This is the commit message #8: DevKit updates # This is the commit message #9: DevKit updates # This is the commit message #10: DevKit updates # This is the commit message #11: DevKit updates # This is the commit message #12: restriction on sebastion/exporter # This is the commit message #13: fix composer.json # This is the commit message #14: use higher versions # This is the commit message #15: use higher version # This is the commit message #16: DevKit updates # This is the commit message #17: DevKit updates # This is the commit message #18: DevKit updates # This is the commit message #19: try verbose # This is the commit message #20: try testdox # This is the commit message #21: try makefile change # This is the commit message #22: try travis # This is the commit message #23: back # This is the commit message #24: restrict sebastianbergmann/environment # This is the commit message #25: restrict sebastianbergmann/environment # This is the commit message #26: try to turn around # This is the commit message #27: support symfony 3.4, new testing app folder structure # This is the commit message #28: support symfony 3.4, new testing app folder structure # This is the commit message #29: use caret operator for symfony-cmf/resource-bundle * merge conflicts DevKit updates for master branch (#59) * DevKit updates * DevKit updates * merge conflicts fixes due to StyleCI fix symfony component version * re add packages after merging
The ResourceRestBundle is now just a ResourceGetBundle. In order for it to be usable with the TreeBrowserBundle, it has to support move, write and delete actions.
The text was updated successfully, but these errors were encountered: