Java Code Examples for org.springframework.extensions.webscripts.WebScriptRequest#getPathInfo()

The following examples show how to use org.springframework.extensions.webscripts.WebScriptRequest#getPathInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CMISHttpServletRequest.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
public CMISHttpServletRequest(WebScriptRequest req, String serviceName, BaseUrlGenerator baseUrlGenerator, Binding binding, Descriptor currentDescriptor,
        TenantAdminService tenantAdminService)
{
	this.req = req;
	this.serviceName = serviceName;
	this.baseUrlGenerator = baseUrlGenerator;
	this.binding = binding;

	String pathInfo = req.getPathInfo();
	WebScriptRequest baseReq = getBaseRequest(req);
	if(!pathInfo.startsWith("/cmis") && (baseReq instanceof TenantWebScriptServletRequest))
	{
		TenantWebScriptServletRequest servletReq = (TenantWebScriptServletRequest)baseReq;

		String tenant = servletReq.getTenant();
		if(tenant.equalsIgnoreCase(TenantUtil.DEFAULT_TENANT))
           {
		    String user = AuthenticationUtil.getFullyAuthenticatedUser();
               String domain = tenantAdminService.getUserDomain(user);
               if(domain == null || domain.equals(TenantService.DEFAULT_DOMAIN))
               {
                   this.networkId = tenant;
               }
               else
               {
                   this.networkId = domain;
               }
           }
		else
		{
		    this.networkId = tenant;
		}
	}

	Match match = req.getServiceMatch();
	Map<String, String> templateVars = match.getTemplateVars();

       HttpServletRequest httpReq = WebScriptServletRuntime.getHttpServletRequest(req);
	this.httpReq = httpReq;
	this.operation = templateVars.get("operation");
	this.id = templateVars.get("id");

   	addAttributes();
}