Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2)

125604 jkaabimofrad: RA-933: Initial commit for ticket base authentication.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127556 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-06-02 21:26:29 +00:00
parent fb2bf792e7
commit d29575ff1b
12 changed files with 760 additions and 14 deletions

View File

@@ -29,15 +29,9 @@ import java.util.Set;
import org.alfresco.rest.framework.Api;
import org.alfresco.rest.framework.core.ResourceLocator;
import org.alfresco.rest.framework.core.ResourceWithMetadata;
import org.alfresco.rest.framework.core.exceptions.DeletedResourceException;
import org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException;
import org.alfresco.rest.framework.resource.actions.interfaces.BinaryResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
import org.alfresco.rest.framework.resource.actions.interfaces.ResourceAction;
import org.alfresco.rest.framework.resource.content.BinaryResource;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.apache.commons.lang.StringUtils;
import org.springframework.extensions.webscripts.ArgumentTypeDescription;
import org.springframework.extensions.webscripts.Container;
@@ -102,19 +96,20 @@ public class PublicApiDeclarativeRegistry extends DeclarativeRegistry
Match match = null;
HttpMethod httpMethod = HttpMethod.valueOf(method);
if (httpMethod.equals(HttpMethod.GET))
boolean isPost = httpMethod.equals(HttpMethod.POST);
if (httpMethod.equals(HttpMethod.GET) || isPost)
{
if (uri.equals(PublicApiTenantWebScriptServletRequest.NETWORKS_PATH))
if (!isPost && uri.equals(PublicApiTenantWebScriptServletRequest.NETWORKS_PATH))
{
Map<String, String> templateVars = new HashMap<String, String>();
Map<String, String> templateVars = new HashMap<>();
templateVars.put("apiScope", "public");
templateVars.put("apiVersion", "1");
templateVars.put("apiName", "networks");
match = new Match("", templateVars, "", getNetworksWebScript);
}
else if (uri.equals(PublicApiTenantWebScriptServletRequest.NETWORK_PATH))
else if (!isPost && uri.equals(PublicApiTenantWebScriptServletRequest.NETWORK_PATH))
{
Map<String, String> templateVars = new HashMap<String, String>();
Map<String, String> templateVars = new HashMap<>();
templateVars.put("apiScope", "public");
templateVars.put("apiVersion", "1");
templateVars.put("apiName", "network");
@@ -155,6 +150,10 @@ public class PublicApiDeclarativeRegistry extends DeclarativeRegistry
{
resAction = EntityResourceAction.Read.class;
}
else if (EntityResourceAction.Create.class.isAssignableFrom(rwm.getResource().getClass()))
{
resAction = EntityResourceAction.Create.class;
}
}
break;
case PROPERTY: