1
votes

I'm trying to use CMF for backoffice content edition. For the purposes of local content edition, CMF works fine. But then, I want to send this data to another server using a custom data structure, one that is completely different from what PHPCR uses.

Does CMF provide any kind of API or service to query its repository? For instance, my entities are Pages which contain Sections which contain Articles that finally contain the properties "title" and "body". I want to send this structure as a JSON to another server without all the overhead present in PHPCR.

{
  pageTitle: "Home",
  sections: [
    {
      sectionTitle: "firstSection",
      articles: [
        {
          title: "Hello",
          body: "Welcome to this page"
        }
     ]
    }
  ]
}
1

1 Answers

0
votes

The CMF provides quite a few components, so I am not sure exactly which you want to use and which you want to skip.

For example for the inline editing, you could point things to a different JSON-LD capable backend.

If you want to use Sonata for administration, then it gets a bit more complicated. In theory you can create a new Jackalope transport layer that simply talks to some REST service which will enable CMF to read/write from it just like with the other Jackalope transports. In fact I have done a proof of concept once to use the Prismic.io service in exactly this way, though I only implemented the read part.

Maybe the best way to answer your question is if you could state which parts of the CMF you do want to use, rather than just say you do not want to use any of the existing PHPCR implementations.