REST based CRUD with Oracle ADF Business Components
By Shay Shmeltzer-Oracle on Nov 16, 2015
A key new feature in Oracle ADF 12.2.1 is the ability to expose ADF Business Components through REST/JSON interfaces.
REST/JSON is the preferred interface for many client side UI technologies to access remote backend services - as examples both Oracle JET and Oracle MAF leverage REST as the way to access data from remote servers.
Oracle ADF makes it very simple to expose your existing business components as REST services - all through a declarative set of dialogs.
Once you published the service interface for a view object, you should be able to do the full set of CRUD operation on that object through different REST action:
GET - will do a Read
POST - will do a Create
PATCH - will do an Update
DELETE - will do a Delete
One thing that you'll want to verify is that when you are passing JSON data back into the REST interface you specify in the header that:
Content-Type is application/vnd.oracle.adf.resourceitem+json
otherwise you'll get an error along the lines of:
oracle.adf.internal.model.rest.core.exception.CannotParseContentException: The content type is not a ADFm REST entity. Content-Type: text/plain
In the video below I show very quickly how to expose a REST interface and then how to invoke all the CRUD operations directly from the chrome app "Postman".
Read more about exposing Oracle ADF BC as REST in the documentation.