mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Merge branch 'feature/CTLE-433-cart-rover-now-extensiv-integration' into integration/sprint-26
This commit is contained in:
@ -75,6 +75,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;
|
||||
@ -105,6 +106,11 @@ public class BaseAPIActionUtil
|
||||
|
||||
|
||||
|
||||
public enum UpdateHttpMethod
|
||||
{PUT, POST}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@ -334,8 +340,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);
|
||||
@ -560,14 +567,24 @@ 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 (null);
|
||||
return ("");
|
||||
}
|
||||
|
||||
|
||||
@ -1225,4 +1242,14 @@ public class BaseAPIActionUtil
|
||||
{
|
||||
return (20);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
protected UpdateHttpMethod getUpdateMethod()
|
||||
{
|
||||
return (UpdateHttpMethod.PUT);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user