Merged DEV (5.0.0.BF) to HEAD (5.0/Cloud)

85527: ACE-2355 : Can't access sites' of Cloud networks other than 'alfresco.com' on Android mobile device with Alfresco mobile app
   Added repositoryId as an url parameter for CMIS requests.
   85721: ACE-2355 : Can't access sites' of Cloud networks other than 'alfresco.com' on Android mobile device with Alfresco mobile app
   Implemented a test to simulate the issue.
   85759: ACE-2355 : Can't access sites' of Cloud networks other than 'alfresco.com' on Android mobile device with Alfresco mobile app
   Extended the test to use both 1.0 and 1.1 end points.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85766 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alex Mukha
2014-09-26 08:30:15 +00:00
parent 827140a35d
commit 10f1d71f6e
2 changed files with 48 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2012 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -74,6 +74,7 @@ public class PublicApiHttpClient
private static final String BASE_URL = "{0}://{1}:{2}{3}{4}{5}/{6}/{7}/versions/1";
private static final String PUBLICAPI_CMIS_SERVICE_URL = "{0}://{1}:{2}{3}{4}cmis/versions/{5}/{6}";
private static final String PUBLICAPI_CMIS_URL = "{0}://{1}:{2}{3}{4}{5}/{6}/cmis/versions/{7}/{8}";
private static final String PUBLICAPI_CMIS_URL_SUFFIX = "{0}/{1}/cmis/versions/{2}/{3}";
private static final String ATOM_PUB_URL = "{0}://{1}:{2}{3}cmisatom";
private String scheme = "http";
@@ -163,6 +164,22 @@ public class PublicApiHttpClient
return url.toString();
}
public String getPublicApiCmisUrlSuffix(String networkId, Binding binding, String version, String operation)
{
StringBuilder url = new StringBuilder();
url.append(MessageFormat.format(PUBLICAPI_CMIS_URL_SUFFIX,
new Object[] {networkId, "public", version, binding.toString().toLowerCase()}));
if(operation != null)
{
url.append("/");
url.append(operation);
}
return url.toString();
}
public void setHost(String host)
{