mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Web Scripts:
- move repository level web scripts to /api/... urls - fix opensearch result templates with regards to guest / format arguments - fix opensearch proxy (regression from web script runtime refactor) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5871 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -15,13 +15,12 @@
|
||||
|
||||
<!-- TODO: Find/Replace [host] with server host name -->
|
||||
<!-- TODO: Find/Replace [port] with server port number -->
|
||||
|
||||
<engine label="Remote Alfresco Repository" proxy="remote">
|
||||
<url type="application/atom+xml">
|
||||
http://[host]:[port]/alfresco/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest=true&format=atom
|
||||
http://[host]:[port]/alfresco/api/service/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest=true
|
||||
</url>
|
||||
<url type="application/rss+xml">
|
||||
http://[host]:[port]/alfresco/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest=true&format=rss
|
||||
http://[host]:[port]/alfresco/api/service/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest=true
|
||||
</url>
|
||||
</engine>
|
||||
|
||||
|
@@ -12,17 +12,17 @@
|
||||
<opensearch:startIndex>${search.startIndex}</opensearch:startIndex>
|
||||
<opensearch:itemsPerPage>${search.itemsPerPage}</opensearch:itemsPerPage>
|
||||
<opensearch:Query role="request" searchTerms="${search.searchTerms}" startPage="${search.startPage}" count="${search.itemsPerPage}" language="${search.localeId}"/>
|
||||
<link rel="alternate" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=html" type="text/html"/>
|
||||
<link rel="self" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=atom" type="application/atom+xml"/>
|
||||
<link rel="alternate" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="text/html"/>
|
||||
<link rel="self" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<#if search.startPage > 1>
|
||||
<link rel="first" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=atom" type="application/atom+xml"/>
|
||||
<link rel="previous" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=atom" type="application/atom+xml"/>
|
||||
<link rel="first" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<link rel="previous" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
</#if>
|
||||
<#if search.startPage < search.totalPages>
|
||||
<link rel="next" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=atom" type="application/atom+xml"/>
|
||||
<link rel="last" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=atom" type="application/atom+xml"/>
|
||||
<link rel="next" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<link rel="last" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
</#if>
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="${absurl(url.service)}/description.xml"/>
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="${absurl(url.serviceContext)}/api/search/keyword/description.xml"/>
|
||||
<#list search.results as row>
|
||||
<entry>
|
||||
<title>${row.name}</title>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<webscript>
|
||||
<shortname>Alfresco Keyword Search (OpenSearch Enabled)</shortname>
|
||||
<description>Execute Keyword Search against Alfresco Repository (Company Home and below)</description>
|
||||
<url format="html" template="/search/keyword.html?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="atom" template="/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="rss" template="/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="portlet" template="/search/keyword.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="html" template="/api/search/keyword.html?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="atom" template="/api/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="rss" template="/api/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<url format="portlet" template="/api/search/keyword.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<authentication>guest</authentication>
|
||||
<format default="html">any</format>
|
||||
</webscript>
|
@@ -4,7 +4,7 @@
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<title>Alfresco Keyword Search: ${search.searchTerms}</title>
|
||||
<link rel="stylesheet" href="/alfresco/css/main.css" TYPE="text/css">
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="${url.service}/description.xml" title="Alfresco Keyword Search"/>
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="${url.serviceContext}/api/search/keyword/description.xml" title="Alfresco Keyword Search"/>
|
||||
<meta name="totalResults" content="${search.totalResults}"/>
|
||||
<meta name="startIndex" content="${search.startIndex}"/>
|
||||
<meta name="itemsPerPage" content="${search.itemsPerPage}"/>
|
||||
@@ -39,15 +39,15 @@
|
||||
<br>
|
||||
<table>
|
||||
<tr>
|
||||
<td><a href="${url.service}?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}">first</a></td>
|
||||
<td><a href="${scripturl("?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}")}">first</a></td>
|
||||
<#if search.startPage > 1>
|
||||
<td><a href="${url.service}?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}">previous</a></td>
|
||||
<td><a href="${scripturl("?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}")}">previous</a></td>
|
||||
</#if>
|
||||
<td><a href="${url.service}?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}">${search.startPage}</a></td>
|
||||
<td><a href="${scripturl("?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}")}">${search.startPage}</a></td>
|
||||
<#if search.startPage < search.totalPages>
|
||||
<td><a href="${url.service}?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}">next</a></td>
|
||||
<td><a href="${scripturl("?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}")}">next</a></td>
|
||||
</#if>
|
||||
<td><a href="${url.service}?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}">last</a></td>
|
||||
<td><a href="${scripturl("?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}")}">last</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Alfresco Keyword Search: ${search.searchTerms}</title>
|
||||
<link>${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss</link>
|
||||
<link>${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}"</link>
|
||||
<description>Alfresco Keyword Search: ${search.searchTerms}</description>
|
||||
<language>${search.localeId}</language>
|
||||
<lastBuildDate>${xmldate(date)}</lastBuildDate>
|
||||
@@ -18,16 +18,16 @@
|
||||
<opensearch:startIndex>${search.startIndex}</opensearch:startIndex>
|
||||
<opensearch:itemsPerPage>${search.itemsPerPage}</opensearch:itemsPerPage>
|
||||
<opensearch:Query role="request" searchTerms="${search.searchTerms}" startPage="${search.startPage}" count="${search.itemsPerPage}" language="${search.localeId}"/>
|
||||
<atom:link rel="self" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss" type="application/atom+xml"/>
|
||||
<atom:link rel="self" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<#if search.startPage > 1>
|
||||
<atom:link rel="first" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss" type="application/atom+xml"/>
|
||||
<atom:link rel="previous" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss" type="application/atom+xml"/>
|
||||
<atom:link rel="first" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<atom:link rel="previous" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
</#if>
|
||||
<#if search.startPage < search.totalPages>
|
||||
<atom:link rel="next" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss" type="application/atom+xml"/>
|
||||
<atom:link rel="last" href="${absurl(url.service)}?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${guest?string("true","")}&format=rss" type="application/atom+xml"/>
|
||||
<atom:link rel="next" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
<atom:link rel="last" href="${absurl(scripturl("?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}")?xml)}" type="application/atom+xml"/>
|
||||
</#if>
|
||||
<atom:link rel="search" type="application/opensearchdescription+xml" href="${absurl(url.service)}/description.xml"/>
|
||||
<atom:link rel="search" type="application/opensearchdescription+xml" href="${absurl(url.serviceContext)}/api/search/keyword/description.xml"/>
|
||||
<#list search.results as row>
|
||||
<item>
|
||||
<title>${row.name}</title>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<webscript>
|
||||
<shortname>Keyword Search Description</shortname>
|
||||
<description>OpenSearch description document for Alfresco Repository keyword search</description>
|
||||
<url format="opensearchdescription" template="/search/keyword/description.xml" />
|
||||
<url format="opensearchdescription" template="/api/search/keyword/description.xml" />
|
||||
<format>argument</format>
|
||||
</webscript>
|
@@ -4,8 +4,8 @@
|
||||
<LongName>Alfresco ${server.edition} Keyword Search ${server.version}</LongName>
|
||||
<Description>Search Alfresco "company home" using keywords</Description>
|
||||
<#comment>IE takes first template from list, thus html response is listed first</#comment>
|
||||
<Url type="text/html" template="${absurl(url.serviceContext)}/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<Url type="application/atom+xml" template="${absurl(url.serviceContext)}/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom"/>
|
||||
<Url type="application/rss+xml" template="${absurl(url.serviceContext)}/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=rss"/>
|
||||
<Url type="text/html" template="${absurl(url.serviceContext)}/api/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<Url type="application/atom+xml" template="${absurl(url.serviceContext)}/api/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<Url type="application/rss+xml" template="${absurl(url.serviceContext)}/api/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}"/>
|
||||
<Image height="16" width="16" type="image/x-icon">${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</Image>
|
||||
</OpenSearchDescription>
|
@@ -1,7 +1,7 @@
|
||||
<webscript>
|
||||
<shortname>Login</shortname>
|
||||
<description>Establish a ticket</description>
|
||||
<url format="xml" template="/login?u={username}&pw={password?}"/>
|
||||
<url format="xml" template="/api/login?u={username}&pw={password?}"/>
|
||||
<authentication>none</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
@@ -1,7 +1,7 @@
|
||||
<webscript>
|
||||
<shortname>Delete Login Ticket</shortname>
|
||||
<description>Delete Login Ticket</description>
|
||||
<url format="xml" template="/login/ticket/{ticket}"/>
|
||||
<url format="xml" template="/api/login/ticket/{ticket}"/>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
@@ -1,7 +1,7 @@
|
||||
<webscript>
|
||||
<shortname>Get Login Ticket</shortname>
|
||||
<description>Get Login Ticket</description>
|
||||
<url format="xml" template="/login/ticket/{ticket}"/>
|
||||
<url format="xml" template="/api/login/ticket/{ticket}"/>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
@@ -1,6 +1,6 @@
|
||||
<webscript>
|
||||
<shortname>Search Engines</shortname>
|
||||
<description>Lists "search engines" registered with this Alfresco Repository</description>
|
||||
<url format="html" template="/search/engines?type={type?}" />
|
||||
<url format="atom" template="/search/engines?type={type?}&format=atom" />
|
||||
<url format="html" template="/api/search/engines?type={type?}" />
|
||||
<url format="atom" template="/api/search/engines.atom?type={type?}" />
|
||||
</webscript>
|
@@ -1,5 +1,5 @@
|
||||
<webscript>
|
||||
<shortname>Proxied (OpenSearch) Search</shortname>
|
||||
<description>Search engine proxy for issuing a search against a remote search engine</description>
|
||||
<url template="/search/engine/{engine}/{format}"/>
|
||||
<url template="/api/search/engine/{engine}/{format}"/>
|
||||
</webscript>
|
@@ -26,16 +26,16 @@
|
||||
|
||||
<engine label-id="current_repo" label="Alfresco Keyword Search">
|
||||
<url type="application/opensearchdescription+xml">
|
||||
/service/search/keyword/description.xml
|
||||
/service/api/search/keyword/description.xml
|
||||
</url>
|
||||
<url type="application/atom+xml">
|
||||
/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom
|
||||
/service/api/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}
|
||||
</url>
|
||||
<url type="application/rss+xml">
|
||||
/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=rss
|
||||
/service/api/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}
|
||||
</url>
|
||||
<url type="text/html">
|
||||
/service/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}
|
||||
/service/api/search/keyword?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}
|
||||
</url>
|
||||
</engine>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<proxy>
|
||||
<!-- URL of Search Engine proxy -->
|
||||
<url>/service/search/engine</url>
|
||||
<url>/service/api/search/engine</url>
|
||||
</proxy>
|
||||
|
||||
</opensearch>
|
||||
|
@@ -170,7 +170,7 @@ public class SearchProxy extends AbstractWebScript implements InitializingBean
|
||||
{
|
||||
throw new WebScriptException("Search Proxy must be executed in HTTP Servlet environment");
|
||||
}
|
||||
HttpServletResponse servletRes = ((WebScriptServletResponse)req).getHttpServletResponse();
|
||||
HttpServletResponse servletRes = ((WebScriptServletResponse)res).getHttpServletResponse();
|
||||
SearchEngineHttpProxy proxy = new SearchEngineHttpProxy(req.getServicePath() + "/" + req.getContextPath(), engine, engineUrl, servletRes);
|
||||
proxy.service();
|
||||
}
|
||||
|
Reference in New Issue
Block a user