Merge branch 'feature/CTLE-433-cart-rover-now-extensiv-integration' into integration/sprint-26

This commit is contained in:
Tim Chamberlain
2023-06-06 11:14:58 -05:00
26 changed files with 695 additions and 128 deletions

View File

@ -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);
}
}