mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
CTLE-433: updates to support extensiv integration
This commit is contained in:
@ -73,6 +73,7 @@ import org.apache.http.HttpEntityEnclosingRequest;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpPut;
|
||||
@ -103,6 +104,11 @@ public class BaseAPIActionUtil
|
||||
|
||||
|
||||
|
||||
public enum UpdateHttpMethod
|
||||
{PUT, POST}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@ -321,8 +327,9 @@ public class BaseAPIActionUtil
|
||||
{
|
||||
try
|
||||
{
|
||||
String url = buildTableUrl(table);
|
||||
HttpPut request = new HttpPut(url);
|
||||
String paramString = buildQueryStringForUpdate(table, recordList);
|
||||
String url = buildTableUrl(table) + paramString;
|
||||
HttpEntityEnclosingRequestBase request = getUpdateMethod().equals(UpdateHttpMethod.PUT) ? new HttpPut(url) : new HttpPost(url);
|
||||
request.setEntity(recordsToEntity(table, recordList));
|
||||
|
||||
QHttpResponse response = makeRequest(table, request);
|
||||
@ -537,13 +544,23 @@ public class BaseAPIActionUtil
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** method to build up a query string for updates based on a given QFilter object
|
||||
**
|
||||
*******************************************************************************/
|
||||
protected String buildQueryStringForUpdate(QTableMetaData table, List<QRecord> recordList) throws QException
|
||||
{
|
||||
return ("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** method to build up a query string based on a given QFilter object
|
||||
**
|
||||
*******************************************************************************/
|
||||
protected String buildQueryStringForGet(QQueryFilter filter, Integer limit, Integer skip, Map<String, QFieldMetaData> fields) throws QException
|
||||
{
|
||||
// todo: reasonable default action
|
||||
return ("");
|
||||
}
|
||||
|
||||
@ -1148,4 +1165,14 @@ public class BaseAPIActionUtil
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
protected UpdateHttpMethod getUpdateMethod()
|
||||
{
|
||||
return (UpdateHttpMethod.PUT);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user