Search in sources :

Example 1 with EdmxReference

use of org.apache.olingo.commons.api.edmx.EdmxReference in project cxf by apache.

the class JaxrsODataService method service.

@GET
@Path("{id:.*}")
public Response service(@Context HttpServletRequest req, @Context HttpServletResponse resp) {
    String requestMapping = req.getContextPath() + req.getServletPath() + "/DemoService.svc";
    req.setAttribute("requestMapping", requestMapping);
    // create odata handler and configure it with EdmProvider and Processor
    OData odata = OData.newInstance();
    ServiceMetadata edm = odata.createServiceMetadata(new DemoEdmProvider(), new ArrayList<EdmxReference>());
    ODataHttpHandler handler = odata.createHandler(edm);
    handler.register(new DemoEntityCollectionProcessor());
    // let the handler do the work
    handler.process(req, resp);
    return Response.ok().build();
}
Also used : OData(org.apache.olingo.server.api.OData) ServiceMetadata(org.apache.olingo.server.api.ServiceMetadata) EdmxReference(org.apache.olingo.commons.api.edmx.EdmxReference) ODataHttpHandler(org.apache.olingo.server.api.ODataHttpHandler) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 EdmxReference (org.apache.olingo.commons.api.edmx.EdmxReference)1 OData (org.apache.olingo.server.api.OData)1 ODataHttpHandler (org.apache.olingo.server.api.ODataHttpHandler)1 ServiceMetadata (org.apache.olingo.server.api.ServiceMetadata)1