mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126483 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122594 jvonka: REST api fwk: pass through query params for DELETE method - also update REST api test fwk RA-837 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126827 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -62,6 +62,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
{
|
||||
String entityId = req.getServiceMatch().getTemplateVars().get(ResourceLocator.ENTITY_ID);
|
||||
String relationshipId = req.getServiceMatch().getTemplateVars().get(ResourceLocator.RELATIONSHIP_ID);
|
||||
final Params.RecognizedParams params = ResourceWebScriptHelper.getRecognizedParams(req);
|
||||
|
||||
switch (resourceMeta.getType())
|
||||
{
|
||||
@@ -72,7 +73,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
}
|
||||
else
|
||||
{
|
||||
return Params.valueOf(entityId, relationshipId, req);
|
||||
return Params.valueOf(params, entityId, relationshipId, req);
|
||||
|
||||
}
|
||||
case RELATIONSHIP:
|
||||
@@ -83,7 +84,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
}
|
||||
else
|
||||
{
|
||||
return Params.valueOf(entityId, relationshipId, req);
|
||||
return Params.valueOf(params, entityId, relationshipId, req);
|
||||
}
|
||||
case PROPERTY:
|
||||
final String resourceName = req.getServiceMatch().getTemplateVars().get(ResourceLocator.RELATIONSHIP_RESOURCE);
|
||||
@@ -93,11 +94,11 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
{
|
||||
if (StringUtils.isNotBlank(propertyName))
|
||||
{
|
||||
return Params.valueOf(entityId, relationshipId, null, null, propertyName, null, null, req);
|
||||
return Params.valueOf(entityId, relationshipId, null, null, propertyName, params, null, req);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Params.valueOf(entityId, null, null, null, resourceName, null, null, req);
|
||||
return Params.valueOf(entityId, null, null, null, resourceName, params, null, req);
|
||||
}
|
||||
}
|
||||
//Fall through to unsupported.
|
||||
|
@@ -201,10 +201,15 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
}
|
||||
|
||||
protected HttpResponse delete(String url, String runAsUser, String entityId, int expectedStatus) throws Exception
|
||||
{
|
||||
return delete(url, runAsUser, entityId, null, expectedStatus);
|
||||
}
|
||||
|
||||
protected HttpResponse delete(String url, String runAsUser, String entityId, Map<String, String> params, int expectedStatus) throws Exception
|
||||
{
|
||||
publicApiClient.setRequestContext(new RequestContext(runAsUser));
|
||||
|
||||
HttpResponse response = publicApiClient.delete(getScope(), url, entityId, null, null);
|
||||
HttpResponse response = publicApiClient.delete(getScope(), 1, url, entityId, null, null, params);
|
||||
checkStatus(expectedStatus, response.getStatusCode());
|
||||
|
||||
return response;
|
||||
|
@@ -577,7 +577,12 @@ public class PublicApiClient
|
||||
|
||||
public HttpResponse delete(String scope, String entityCollectionName, Object entityId, String relationCollectionName, Object relationshipEntityId) throws IOException
|
||||
{
|
||||
HttpResponse response = client.delete(getRequestContext(), scope, entityCollectionName, entityId, relationCollectionName, relationshipEntityId);
|
||||
return delete(scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, null);
|
||||
}
|
||||
|
||||
public HttpResponse delete(String scope, int version, String entityCollectionName, Object entityId, String relationCollectionName, Object relationshipEntityId, Map<String, String> params) throws IOException
|
||||
{
|
||||
HttpResponse response = client.delete(getRequestContext(), scope, version, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, params);
|
||||
|
||||
logger.debug(response.toString());
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.api.tests.client;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
@@ -552,14 +551,14 @@ public class PublicApiHttpClient
|
||||
public HttpResponse delete(final RequestContext rq, final String scope, final String entityCollectionName, final Object entityId,
|
||||
final String relationCollectionName, final Object relationshipEntityId) throws IOException
|
||||
{
|
||||
return delete(rq, scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId);
|
||||
return delete(rq, scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, null);
|
||||
}
|
||||
|
||||
public HttpResponse delete(final RequestContext rq, final String scope, final int version, final String entityCollectionName, final Object entityId,
|
||||
final String relationCollectionName, final Object relationshipEntityId) throws IOException
|
||||
final String relationCollectionName, final Object relationshipEntityId, final Map<String, String> params) throws IOException
|
||||
{
|
||||
RestApiEndpoint endpoint = new RestApiEndpoint(rq.getNetworkId(), scope, version, entityCollectionName, entityId, relationCollectionName,
|
||||
relationshipEntityId, null);
|
||||
relationshipEntityId, params);
|
||||
String url = endpoint.getUrl();
|
||||
|
||||
DeleteMethod req = new DeleteMethod(url);
|
||||
|
Reference in New Issue
Block a user