Merged V2.0 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5118 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5119 .
   - OpenSearch Proxy
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5121 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5122 .
   - Extract sample OpenSearch engine registrations into extension config file.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5125 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-13 21:21:48 +00:00
parent 2d5a480d85
commit 9067948404
14 changed files with 861 additions and 25 deletions

View File

@@ -91,6 +91,29 @@ public class APIRequest extends HttpServletRequestWrapper
return getPath() + getServletPath();
}
/**
* Gets the path extension beyond the path registered for this service
*
* e.g.
* a) service registered path = /search/engine
* b) request path = /search/engine/external
*
* => /external
*
* @return extension path
*/
public String getExtensionPath(APIService service)
{
String servicePath = service.getHttpUri();
String extensionPath = getPathInfo();
int extIdx = extensionPath.indexOf(servicePath);
if (extIdx != -1)
{
extensionPath = extensionPath.substring(extIdx + servicePath.length() + 1 /* exclude leading / */);
}
return extensionPath;
}
/**
* Gets the full request URL
*