OpenSearch:

- cosmetic changes as suggested by marketing eyes

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4958 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-01-29 15:22:19 +00:00
parent d232397358
commit 200ff43d6e
17 changed files with 184 additions and 138 deletions

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:alf="http://www.alfresco.org">
<ShortName>Alfresco Keyword Search</ShortName>
<LongName>Alfresco ${agent.edition} Keyword Search ${agent.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="${request.servicePath}/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}"/>
<Url type="application/atom+xml" template="${request.servicePath}/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=atom"/>
<Url type="application/rss+xml" template="${request.servicePath}/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=rss"/>
<Image height="16" width="16" type="image/x-icon">${request.path}/images/logo/AlfrescoLogo16.ico</Image>
</OpenSearchDescription>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/">
<generator version="${agent.version}">Alfresco (${agent.edition})</generator>
<title>Alfresco Search: ${search.searchTerms}</title>
<title>Alfresco Keyword Search: ${search.searchTerms}</title>
<updated>${xmldate(date)}</updated>
<icon>${absurl("/images/logo/AlfrescoLogo16.ico")}</icon>
<author>
@@ -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="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=html" type="text/html"/>
<link rel="self" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="alternate" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=html" type="text/html"/>
<link rel="self" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<#if search.startPage &gt; 1>
<link rel="first" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=1&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="previous" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage - 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="first" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=1&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="previous" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage - 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<#if search.startPage &lt; search.totalPages>
<link rel="next" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage + 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="last" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.totalPages}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="next" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage + 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<link rel="last" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.totalPages}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<link rel="search" type="application/opensearchdescription+xml" href="${request.servicePath}/search/text/textsearchdescription.xml"/>
<link rel="search" type="application/opensearchdescription+xml" href="${request.servicePath}/search/keywordsearchdescription.xml"/>
<#list search.results as row>
<entry>
<title>${row.name}</title>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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="${request.servicePath}/search/keywordsearchdescription.xml" title="Alfresco Keyword Search"/>
<meta name="totalResults" content="${search.totalResults}"/>
<meta name="startIndex" content="${search.startIndex}"/>
<meta name="itemsPerPage" content="${search.itemsPerPage}"/>
</head>
<body>
<table>
<tr>
<td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
<td><nobr><span class="mainTitle">Alfresco Keyword Search</span></nobr></td>
</tr>
</table>
<br>
<table>
<tr>
<td>Results <b>${search.startIndex}</b> - <b>${search.startIndex + search.totalPageItems - 1}</b> of <b>${search.totalResults}</b> for <b>${search.searchTerms}</b> visible to user <b>${request.authenticatedUsername!"unknown"}.</b></td>
</tr>
</table>
<br>
<table>
<#list search.results as row>
<tr>
<td><img src="${absurl(row.icon16)}"/></td><td><a href="${absurl(row.url)}">${row.name}</a></td>
</tr>
<#if row.properties.description?? == true>
<tr>
<td></td>
<td>${row.properties.description}</td>
</tr>
</#if>
</#list>
</table>
<br>
<table>
<tr>
<td><a href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">first</a></td>
<#if search.startPage &gt; 1>
<td><a href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">previous</a></td>
</#if>
<td><a href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">${search.startPage}</a></td>
<#if search.startPage &lt; search.totalPages>
<td><a href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">next</a></td>
</#if>
<td><a href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">last</a></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}</link>
<description>Alfresco Keyword Search: ${search.searchTerms}</description>
<language>${search.localeId}</language>
<lastBuildDate>${xmldate(date)}</lastBuildDate>
<pubDate>${xmldate(date)}</pubDate>
<generator>Alfresco ${agent.edition} v${agent.version}</generator>
<image>
<title>Alfresco Search: ${search.searchTerms}</title>
<width>16</width>
<height>16</height>
<url>${absurl("/images/logo/AlfrescoLogo16.ico")}</url>
</image>
<opensearch:totalResults>${search.totalResults}</opensearch:totalResults>
<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="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<#if search.startPage &gt; 1>
<atom:link rel="first" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=1&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<atom:link rel="previous" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage - 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<#if search.startPage &lt; search.totalPages>
<atom:link rel="next" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.startPage + 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<atom:link rel="last" href="${request.servicePath}/search/keyword?q=${search.searchTerms?url}&amp;p=${search.totalPages}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<atom:link rel="search" type="application/opensearchdescription+xml" href="${request.servicePath}/search/keywordsearchdescription.xml"/>
<#list search.results as row>
<item>
<title>${row.name}</title>
<link>${absurl(row.url)}</link>
<description>${row.properties.description!""}</description>
<pubDate>${xmldate(row.properties.modified)}</pubDate>
<guid isPermaLink="false">${row.id}</guid>
</item>
</#list>
</channel>
</rss>

View File

@@ -2,7 +2,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<title>Search Engines registered with Alfresco</title>
<link rel="stylesheet" href="/alfresco/css/main.css" TYPE="text/css">
<title>Alfresco Registered Search Engines</title>
<#list engines as engine>
<#if engine.urlType == "description">
<link rel="search" type="${engine.type}" href="${absurl(engine.url)}" title="${engine.label}">
@@ -10,13 +11,22 @@
</#list>
</head>
<body>
<h2>Search Engines registered with Alfresco</h2>
<ul>
<table>
<tr>
<td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
<td><nobr><span class="mainTitle">Alfresco Registered Search Engines</span></nobr></td>
</tr>
</table>
<br>
<table border="0" cellpadding="4">
<tr align="left"><td><b>Engine<td><b>URL Type<td><b>Response Format</tr>
<#list engines as engine>
<li>
<a href="${absurl(engine.url)}">${engine.label}</a> (<#if engine.urlType == "description">OpenSearch Description<#else>Template URL</#if> - ${engine.type})
</li>
<tr align="left">
<td><a href="${absurl(engine.url)}">${engine.label}</a>
<td><#if engine.urlType == "description">OpenSearch Description<#else>Template URL</#if>
<td>${engine.type}
</tr>
</#list>
</ul>
</table>
</body>
</html>

View File

@@ -3,15 +3,20 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<title>Alfresco Web APIs</title>
<link rel="stylesheet" href="/alfresco/css/main.css" TYPE="text/css">
</head>
<body>
<h2>Alfresco Web APIs</h2>
Alfresco ${agent.edition} v${agent.version}<br>
<br>
${services?size} services - <a href="http://wiki.alfresco.com/wiki/REST">Online documentation.</a><br>
<table>
<tr>
<td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
<td><nobr><span class="mainTitle">Alfresco Web APIs</span></nobr></td>
</tr>
<tr><td><td>Alfresco ${agent.edition} v${agent.version}
<tr><td><td>${services?size} services - <a href="http://wiki.alfresco.com/wiki/REST">Online documentation</a>.
</table>
<br>
<table border="0" cellpadding="4">
<tr align="left"><th>Name<th>Method<th>URL<th>Authentication<th>Default Format</tr>
<tr align="left"><td><b>Name<td><b>Method<td><b>URL<td><b>Authentication<td><b>Default Format</tr>
<#list services as service>
<tr><td>${service.name}<td>${service.httpMethod}<td><a href="${request.servicePath}${service.httpUri}">${service.httpUri}</a><td>${service.requiredAuthentication}<td>${service.defaultFormat}</tr>
<tr><td colspan="5">&nbsp;&nbsp;[${service.description}]</tr>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:alf="http://www.alfresco.org">
<ShortName>Alfresco Text Search</ShortName>
<LongName>Alfresco ${agent.edition} Text Search ${agent.version}</LongName>
<Description>Search Alfresco "company home" using text keywords</Description>
<#comment>IE takes first template from list, thus html response is listed first</#comment>
<Url type="text/html" template="${request.servicePath}/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}"/>
<Url type="application/atom+xml" template="${request.servicePath}/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=atom"/>
<Url type="application/rss+xml" template="${request.servicePath}/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=rss"/>
<Image height="16" width="16" type="image/x-icon">${request.path}/images/logo/AlfrescoLogo16.ico</Image>
</OpenSearchDescription>

View File

@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<title>Alfresco Text Search: ${search.searchTerms}</title>
<link rel="search" type="application/opensearchdescription+xml" href="${request.servicePath}/search/text/textsearchdescription.xml" title="Alfresco Text Search"/>
<meta name="totalResults" content="${search.totalResults}"/>
<meta name="startIndex" content="${search.startIndex}"/>
<meta name="itemsPerPage" content="${search.itemsPerPage}"/>
</head>
<body>
<h2>Alfresco Text Search</h2>
Results <b>${search.startIndex}</b> - <b>${search.startIndex + search.totalPageItems - 1}</b> of <b>${search.totalResults}</b> for <b>${search.searchTerms}</b> visible to user <b>${request.authenticatedUsername!"unknown"}.</b>
<ul>
<#list search.results as row>
<li>
<img src="${absurl(row.icon16)}"/>
<a href="${absurl(row.url)}">${row.name}</a>
<div>
${row.properties.description!""}
</div>
</li>
</#list>
</ul>
<a href="${request.servicePath}/search/text?q=${search.searchTerms?url}&p=1&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">first</a>
<#if search.startPage &gt; 1>
<a href="${request.servicePath}/search/text?q=${search.searchTerms?url}&p=${search.startPage - 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">previous</a>
</#if>
<a href="${request.servicePath}/search/text?q=${search.searchTerms?url}&p=${search.startPage}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">${search.startPage}</a>
<#if search.startPage &lt; search.totalPages>
<a href="${request.servicePath}/search/text?q=${search.searchTerms?url}&p=${search.startPage + 1}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">next</a>
</#if>
<a href="${request.servicePath}/search/text?q=${search.searchTerms?url}&p=${search.totalPages}&c=${search.itemsPerPage}&l=${search.localeId}&guest=${request.guest?string("true","")}">last</a>
</body>
</html>

View File

@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Alfresco Search: ${search.searchTerms}</title>
<link>${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}</link>
<description>Alfresco Search: ${search.searchTerms}</description>
<language>${search.localeId}</language>
<lastBuildDate>${xmldate(date)}</lastBuildDate>
<pubDate>${xmldate(date)}</pubDate>
<generator>Alfresco ${agent.edition} v${agent.version}</generator>
<image>
<title>Alfresco Search: ${search.searchTerms}</title>
<width>16</width>
<height>16</height>
<url>${absurl("/images/logo/AlfrescoLogo16.ico")}</url>
</image>
<opensearch:totalResults>${search.totalResults}</opensearch:totalResults>
<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="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<#if search.startPage &gt; 1>
<atom:link rel="first" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=1&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<atom:link rel="previous" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage - 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<#if search.startPage &lt; search.totalPages>
<atom:link rel="next" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.startPage + 1}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
<atom:link rel="last" href="${request.servicePath}/search/text?q=${search.searchTerms?url}&amp;p=${search.totalPages}&amp;c=${search.itemsPerPage}&amp;l=${search.localeId}&amp;guest=${request.guest?string("true","")}&amp;format=${request.format}" type="application/atom+xml"/>
</#if>
<atom:link rel="search" type="application/opensearchdescription+xml" href="${request.servicePath}/search/text/textsearchdescription.xml"/>
<#list search.results as row>
<item>
<title>${row.name}</title>
<link>${absurl(row.url)}</link>
<description>${row.properties.description!""}</description>
<pubDate>${xmldate(row.properties.modified)}</pubDate>
<guid isPermaLink="false">${row.id}</guid>
</item>
</#list>
</channel>
</rss>

View File

@@ -139,14 +139,14 @@
<property name="configService" ref="web.api.Config" />
</bean>
<!-- Alfresco Web Client Text Search Description (OpenSearch) -->
<bean id="web.api.TextSearchDescription" class="org.alfresco.web.api.services.TextSearchDescription" parent="web.api.APITemplateService">
<property name="httpUri" value="/search/textsearchdescription.xml" />
<!-- Alfresco Web Client Keyword Search Description (OpenSearch) -->
<bean id="web.api.KeywordSearchDescription" class="org.alfresco.web.api.services.KeywordSearchDescription" parent="web.api.APITemplateService">
<property name="httpUri" value="/search/keywordsearchdescription.xml" />
</bean>
<!-- Alfresco Web Client Text Search (OpenSearch) -->
<bean id="web.api.TextSearch" class="org.alfresco.web.api.services.TextSearch" parent="web.api.APITemplateService">
<property name="httpUri" value="/search/text" />
<!-- Alfresco Web Client Keyword Search (OpenSearch) -->
<bean id="web.api.KeywordSearch" class="org.alfresco.web.api.services.KeywordSearch" parent="web.api.APITemplateService">
<property name="httpUri" value="/search/keyword" />
<property name="searchService" ref="SearchService" />
</bean>

View File

@@ -22,18 +22,18 @@
<config evaluator="string-compare" condition="OpenSearch">
<opensearch>
<engines>
<engine label-id="current_repo">
<engine label-id="current_repo" label="Alfresco Keyword Search">
<url type="application/opensearchdescription+xml">
/service/search/textsearchdescription.xml
/service/search/keywordsearchdescription.xml
</url>
<url type="application/atom+xml">
/service/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=atom
/service/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=atom
</url>
<url type="application/rss+xml">
/service/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=rss
/service/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}&amp;format=rss
</url>
<url type="text/html">
/service/search/text?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}
/service/search/keyword?q={searchTerms}&amp;p={startPage?}&amp;c={count?}&amp;l={language?}&amp;guest={alf:guest?}
</url>
</engine>
</engines>

View File

@@ -21,10 +21,10 @@ import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.web.app.servlet.BaseServlet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
@@ -36,7 +36,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
*
* @author davidc
*/
public class APIServlet extends BaseServlet
public class APIServlet extends HttpServlet
{
private static final long serialVersionUID = 4209892938069597860L;

View File

@@ -22,6 +22,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.repository.TemplateException;
import org.alfresco.web.api.APIException;
import org.alfresco.web.api.APIRequest;
@@ -114,8 +115,12 @@ public abstract class APIServiceTemplateImpl extends APIServiceImpl
/**
* Simple test that can be executed outside of web context
*/
/*package*/ void test(String format)
/*package*/ void test(final String format)
throws IOException
{
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
{
public Object doWork()
{
// create test model
Map<String, Object> model = createTestModel();
@@ -125,6 +130,10 @@ public abstract class APIServiceTemplateImpl extends APIServiceImpl
PrintWriter writer = new PrintWriter(rendition);
renderTemplate(null, format, model, writer);
System.out.println(rendition.toString());
return null;
}
}, AuthenticationUtil.getSystemUserName());
}
}

View File

@@ -43,14 +43,14 @@ import org.apache.commons.logging.LogFactory;
/**
* Alfresco Text (simple) Search Service
* Alfresco Keyword (simple) Search Service
*
* @author davidc
*/
public class TextSearch extends APIServiceTemplateImpl
public class KeywordSearch extends APIServiceTemplateImpl
{
// Logger
private static final Log logger = LogFactory.getLog(TextSearch.class);
private static final Log logger = LogFactory.getLog(KeywordSearch.class);
// search parameters
// TODO: allow configuration of search store
@@ -409,7 +409,7 @@ public class TextSearch extends APIServiceTemplateImpl
public static void main(String[] args)
throws Exception
{
TextSearch service = (TextSearch)APIServiceImpl.getMethod("web.api.TextSearch");
KeywordSearch service = (KeywordSearch)APIServiceImpl.getMethod("web.api.KeywordSearch");
service.test(APIResponse.HTML_FORMAT);
}

View File

@@ -25,11 +25,11 @@ import org.alfresco.web.api.APIRequest.RequiredAuthentication;
/**
* Provide OpenSearch Description for an Alfresco Text (simple) Search
* Provide OpenSearch Description for an Alfresco Keyword (simple) Search
*
* @author davidc
*/
public class TextSearchDescription extends APIServiceTemplateImpl
public class KeywordSearchDescription extends APIServiceTemplateImpl
{
/* (non-Javadoc)
@@ -79,7 +79,7 @@ public class TextSearchDescription extends APIServiceTemplateImpl
public static void main(String[] args)
throws Exception
{
TextSearchDescription service = (TextSearchDescription)APIServiceImpl.getMethod("web.api.TextSearchDescription");
KeywordSearchDescription service = (KeywordSearchDescription)APIServiceImpl.getMethod("web.api.KeywordSearchDescription");
service.test(APIResponse.OPENSEARCH_DESCRIPTION_FORMAT);
}

View File

@@ -145,8 +145,11 @@ public class SearchEngines extends APIServiceTemplateImpl
if (labelId != null && labelId.length() > 0)
{
String i18nLabel = I18NUtil.getMessage(labelId);
if (i18nLabel == null && label == null)
{
label = (i18nLabel == null) ? "$$" + labelId + "$$" : i18nLabel;
}
}
urls.add(new UrlTemplate(label, type, url));
}