Merged DEV\EXTENSIONS to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4865 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4866 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4872 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4884 .
   Dave and Gavin's search work


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4899 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-01-23 12:09:27 +00:00
parent 2d184a6b13
commit 9c17a38488
51 changed files with 9993 additions and 6442 deletions

View File

@@ -89,6 +89,16 @@ public class APIRequest extends HttpServletRequestWrapper
{
return getPath() + getServletPath();
}
/**
* Gets the full request URL
*
* @return request url e.g. http://localhost:port/alfresco/service/text?searchTerms=dsfsdf
*/
public String getUrl()
{
return getScheme() + "://" + getServerName() + ":" + getServerPort() + getPathInfo() + (getQueryString() != null ? "?" + getQueryString() : "");
}
/**
* Gets the currently authenticated username
@@ -120,5 +130,25 @@ public class APIRequest extends HttpServletRequestWrapper
String format = getParameter("format");
return (format == null || format.length() == 0) ? "" : format;
}
/**
* Get User Agent
*
* TODO: Expand on known agents
*
* @return MSIE / Firefox
*/
public String getAgent()
{
String userAgent = getHeader("user-agent");
if (userAgent.indexOf("Firefox/") != -1)
{
return "Firefox";
}
else if (userAgent.indexOf("MSIE") != -1)
{
return "MSIE";
}
return null;
}
}