Package org.openbravo.service.rest
Class DalWebService
- java.lang.Object
-
- org.openbravo.service.rest.DalWebService
-
- All Implemented Interfaces:
OBModulePrefixRequired
,WebService
public class DalWebService extends Object implements WebService
The main Data Access Layer REST web service implementation. It covers the four REST HTTP methods: DELETE, GET, POST and PUT. This service makes heavily use of the XML converters which translate Entity instances from and to XML.- Author:
- mtaal
- See Also:
EntityXMLConverter
,XMLEntityConverter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openbravo.service.web.WebService
WebService.ChangeAction
-
-
Field Summary
Fields Modifier and Type Field Description static String
PARAMETER_EXCEL
static String
PARAMETER_FIRSTRESULT
static String
PARAMETER_INCLUDECHILDREN
static String
PARAMETER_MAXRESULT
static String
PARAMETER_NO_ACTIVE_FILTER
static String
PARAMETER_ORDERBY
static String
PARAMETER_PROPERTIES
static String
PARAMETER_WHERE
-
Constructor Summary
Constructors Constructor Description DalWebService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doChangeAction(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, WebService.ChangeAction changeAction)
protected String
doChangeActionXML(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, WebService.ChangeAction changeAction)
protected String
doCreateUpdate(XMLEntityConverter xec)
void
doDelete(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The DELETE action can work in two modes: 1) if the URL points to a single Business Object then that one is deleted, 2) if not then the posted information is assumed to be a XML String identifying the Business Objects to delete.protected String
doDeleteAction(XMLEntityConverter xec, List<BaseOBObject> processedObjects)
void
doGet(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Performs the GET REST operation.void
doPost(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The POSt action corresponds to an import (of XML) of new Business Objects.void
doPut(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The PUT action will update existing business objects using the posted xml string.protected String
importDataFromXML(org.dom4j.Document doc, WebService.ChangeAction changeAction)
-
-
-
Field Detail
-
PARAMETER_WHERE
public static final String PARAMETER_WHERE
- See Also:
- Constant Field Values
-
PARAMETER_ORDERBY
public static final String PARAMETER_ORDERBY
- See Also:
- Constant Field Values
-
PARAMETER_FIRSTRESULT
public static final String PARAMETER_FIRSTRESULT
- See Also:
- Constant Field Values
-
PARAMETER_MAXRESULT
public static final String PARAMETER_MAXRESULT
- See Also:
- Constant Field Values
-
PARAMETER_INCLUDECHILDREN
public static final String PARAMETER_INCLUDECHILDREN
- See Also:
- Constant Field Values
-
PARAMETER_EXCEL
public static final String PARAMETER_EXCEL
- See Also:
- Constant Field Values
-
PARAMETER_PROPERTIES
public static final String PARAMETER_PROPERTIES
- See Also:
- Constant Field Values
-
PARAMETER_NO_ACTIVE_FILTER
public static final String PARAMETER_NO_ACTIVE_FILTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
doGet
public void doGet(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Performs the GET REST operation. This service handles multiple types of request: the request for the XML Schema of the REST webservices, a single Business Object and a list of Business Objects is handled. The HttpRequest parameter 'template' makes it possible to process the XML result through a XSLT stylesheet.- Specified by:
doGet
in interfaceWebService
- Parameters:
path
- the HttpRequest.getPathInfo(), the part of the url after the context pathrequest
- the HttpServletRequestresponse
- the HttpServletResponse- Throws:
Exception
-
doPost
public void doPost(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The POSt action corresponds to an import (of XML) of new Business Objects.- Specified by:
doPost
in interfaceWebService
- Parameters:
path
- the HttpRequest.getPathInfo(), the part of the url after the context pathrequest
- the HttpServletRequestresponse
- the HttpServletResponse
-
doDelete
public void doDelete(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The DELETE action can work in two modes: 1) if the URL points to a single Business Object then that one is deleted, 2) if not then the posted information is assumed to be a XML String identifying the Business Objects to delete.- Specified by:
doDelete
in interfaceWebService
- Parameters:
path
- the HttpRequest.getPathInfo(), the part of the url after the context pathrequest
- the HttpServletRequestresponse
- the HttpServletResponse
-
doPut
public void doPut(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
The PUT action will update existing business objects using the posted xml string.- Specified by:
doPut
in interfaceWebService
- Parameters:
path
- the HttpRequest.getPathInfo(), the part of the url after the context pathrequest
- the HttpServletRequestresponse
- the HttpServletResponse
-
doChangeAction
protected void doChangeAction(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, WebService.ChangeAction changeAction)
-
doChangeActionXML
protected String doChangeActionXML(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, WebService.ChangeAction changeAction)
-
importDataFromXML
protected String importDataFromXML(org.dom4j.Document doc, WebService.ChangeAction changeAction)
-
doDeleteAction
protected String doDeleteAction(XMLEntityConverter xec, List<BaseOBObject> processedObjects)
-
doCreateUpdate
protected String doCreateUpdate(XMLEntityConverter xec)
-
-