Package org.idempiere.webservices
Class AbstractService
- java.lang.Object
-
- org.idempiere.webservices.AbstractService
-
- Direct Known Subclasses:
ModelADServiceImpl
public class AbstractService extends Object
- Author:
- Deepak Pansheriya
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.cxf.jaxrs.ext.MessageContext
jaxrsContext
protected javax.xml.ws.WebServiceContext
jaxwsContext
static String
ROLE_TYPES_WEBSERVICE
-
Constructor Summary
Constructors Constructor Description AbstractService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
authenticate(String webServiceValue, String methodValue, String serviceTypeValue, CompiereService m_cs)
Authenticate user for requested service typeprotected Object
convertToObj(String strValue, Class<?> columnClass, String colName)
protected CompiereService
getCompiereService()
protected Map<String,Object>
getRequestCtx()
Get request Ctxstatic List<IWSValidator>
getValidators(String serviceType)
retrieve web service Validatorsprotected Class<?>
getVariableType(String columnName, int displayType)
Retrieve variable data typeprotected MWebServiceType
getWebServiceType()
static String
invokeLoginValidator(org.idempiere.adInterface.x10.ADLoginRequest loginRequest, Properties ctx, MWebServiceType m_webserviceType, int time)
Invoke web Service Login Validatorstatic org.idempiere.adInterface.x10.StandardResponseDocument
invokeWSValidator(MWebServiceType m_WebServiceType, int time, PO po, org.idempiere.adInterface.x10.DataField[] fields, Trx trx, Map<String,Object> requestCtx, org.idempiere.adInterface.x10.StandardResponse resp, org.idempiere.adInterface.x10.StandardResponseDocument ret)
Invoke webservice Validatorprotected String
login(org.idempiere.adInterface.x10.ADLoginRequest loginRequest, String webService, String method, String serviceType)
Login to web Servicesprotected String
parseSQL(String sql, ArrayList<Object> sqlParas, PO po, POInfo poInfo, Map<String,Object> requestCtx)
Parse variables inside SQLprotected Object
parseVariable(String varName, PO po, POInfo poInfo, Map<String,Object> requestCtx)
Resolving context variable into objectprotected static org.idempiere.adInterface.x10.StandardResponseDocument
rollbackAndSetError(Trx trx, org.idempiere.adInterface.x10.StandardResponse resp, org.idempiere.adInterface.x10.StandardResponseDocument ret, boolean isError, String string)
Rollback and set error on standard responseprotected void
setOuputFields(org.idempiere.adInterface.x10.StandardResponse resp, MWebServiceType m_webservicetype, PO po, POInfo poInfo)
-
-
-
Field Detail
-
ROLE_TYPES_WEBSERVICE
public static final String ROLE_TYPES_WEBSERVICE
- See Also:
- Constant Field Values
-
jaxwsContext
protected javax.xml.ws.WebServiceContext jaxwsContext
-
jaxrsContext
@Context protected org.apache.cxf.jaxrs.ext.MessageContext jaxrsContext
-
-
Method Detail
-
login
protected String login(org.idempiere.adInterface.x10.ADLoginRequest loginRequest, String webService, String method, String serviceType)
Login to web Services- Parameters:
loginRequest
-webService
-method
-serviceType
-- Returns:
-
authenticate
protected String authenticate(String webServiceValue, String methodValue, String serviceTypeValue, CompiereService m_cs)
Authenticate user for requested service type- Parameters:
webServiceValue
-methodValue
-serviceTypeValue
-m_cs
-- Returns:
-
rollbackAndSetError
protected static org.idempiere.adInterface.x10.StandardResponseDocument rollbackAndSetError(Trx trx, org.idempiere.adInterface.x10.StandardResponse resp, org.idempiere.adInterface.x10.StandardResponseDocument ret, boolean isError, String string)
Rollback and set error on standard response- Parameters:
trx
-resp
-ret
-isError
-string
-- Returns:
-
getCompiereService
protected CompiereService getCompiereService()
- Returns:
- Compiere Service object for current request
-
getWebServiceType
protected MWebServiceType getWebServiceType()
- Returns:
-
setOuputFields
protected void setOuputFields(org.idempiere.adInterface.x10.StandardResponse resp, MWebServiceType m_webservicetype, PO po, POInfo poInfo)
- Parameters:
resp
-m_webservicetype
-
-
parseSQL
protected String parseSQL(String sql, ArrayList<Object> sqlParas, PO po, POInfo poInfo, Map<String,Object> requestCtx) throws AdempiereException
Parse variables inside SQL- Parameters:
sql
-sqlParas
-po
-requestCtx
-- Returns:
- Throws:
AdempiereException
-
parseVariable
protected Object parseVariable(String varName, PO po, POInfo poInfo, Map<String,Object> requestCtx)
Resolving context variable into object- Parameters:
varName
-po
-requestCtx
-- Returns:
-
convertToObj
protected Object convertToObj(String strValue, Class<?> columnClass, String colName)
- Parameters:
strValue
-columnClass
-colName
-- Returns:
-
getVariableType
protected Class<?> getVariableType(String columnName, int displayType)
Retrieve variable data type- Parameters:
columnName
-displayType
-- Returns:
-
getValidators
public static List<IWSValidator> getValidators(String serviceType)
retrieve web service Validators- Parameters:
serviceType
-- Returns:
-
invokeWSValidator
public static org.idempiere.adInterface.x10.StandardResponseDocument invokeWSValidator(MWebServiceType m_WebServiceType, int time, PO po, org.idempiere.adInterface.x10.DataField[] fields, Trx trx, Map<String,Object> requestCtx, org.idempiere.adInterface.x10.StandardResponse resp, org.idempiere.adInterface.x10.StandardResponseDocument ret)
Invoke webservice Validator- Parameters:
m_WebServiceType
-time
-po
-fields
-trx
-requestCtx
-resp
-ret
-- Returns:
-
invokeLoginValidator
public static String invokeLoginValidator(org.idempiere.adInterface.x10.ADLoginRequest loginRequest, Properties ctx, MWebServiceType m_webserviceType, int time)
Invoke web Service Login Validator- Parameters:
loginRequest
-ctx
-m_webserviceType
-time
-- Returns:
-
-