mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added XML format to OpenSearch service
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4811 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,7 +31,8 @@ public class APIResponse extends HttpServletResponseWrapper
|
|||||||
|
|
||||||
public static final String HTML_TYPE = "text/html";
|
public static final String HTML_TYPE = "text/html";
|
||||||
public static final String OPEN_SEARCH_DESCRIPTION_TYPE = "application/opensearchdescription+xml";
|
public static final String OPEN_SEARCH_DESCRIPTION_TYPE = "application/opensearchdescription+xml";
|
||||||
public static final String ATOM_TYPE = "application/atom+xml";
|
public static final String ATOM_TYPE = "application/atom+xml";
|
||||||
|
public static final String XML_TYPE = "text/xml";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct
|
* Construct
|
||||||
|
@@ -162,6 +162,11 @@ public class TextSearch extends APIServiceImpl
|
|||||||
contentType = APIResponse.ATOM_TYPE;
|
contentType = APIResponse.ATOM_TYPE;
|
||||||
template = ATOM_TEMPLATE;
|
template = ATOM_TEMPLATE;
|
||||||
}
|
}
|
||||||
|
else if (format.equals("xml"))
|
||||||
|
{
|
||||||
|
contentType = APIResponse.XML_TYPE;
|
||||||
|
template = ATOM_TEMPLATE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> model = createTemplateModel(req, res);
|
Map<String, Object> model = createTemplateModel(req, res);
|
||||||
|
@@ -68,6 +68,7 @@ public class TextSearchDescription extends APIServiceImpl
|
|||||||
" <LongName>Alfresco ${agent.edition} Text Search ${agent.version}</LongName>\n" +
|
" <LongName>Alfresco ${agent.edition} Text Search ${agent.version}</LongName>\n" +
|
||||||
" <Description>Search Alfresco \"company home\" using text keywords</Description>\n" +
|
" <Description>Search Alfresco \"company home\" using text keywords</Description>\n" +
|
||||||
" <Url type=\"application/atom+xml\" template=\"${request.servicePath}/search/text?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom\"/>\n" +
|
" <Url type=\"application/atom+xml\" template=\"${request.servicePath}/search/text?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=atom\"/>\n" +
|
||||||
|
" <Url type=\"text/xml\" template=\"${request.servicePath}/search/text?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}&format=xml\"/>\n" +
|
||||||
" <Url type=\"text/html\" template=\"${request.servicePath}/search/text?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}\"/>\n" +
|
" <Url type=\"text/html\" template=\"${request.servicePath}/search/text?q={searchTerms}&p={startPage?}&c={count?}&l={language?}&guest={alf:guest?}\"/>\n" +
|
||||||
" <Image height=\"16\" width=\"16\" type=\"image/x-icon\">${request.path}/images/logo/AlfrescoLogo16.ico</Image>\n" +
|
" <Image height=\"16\" width=\"16\" type=\"image/x-icon\">${request.path}/images/logo/AlfrescoLogo16.ico</Image>\n" +
|
||||||
"</OpenSearchDescription>";
|
"</OpenSearchDescription>";
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/alfresco/service/search/text?q=alfresco tutorial&format=atom">Search for 'alfresco tutorial' (ATOM response)</a></li>
|
<li><a href="/alfresco/service/search/text?q=alfresco tutorial&format=atom">Search for 'alfresco tutorial' (ATOM response)</a></li>
|
||||||
|
<li><a href="/alfresco/service/search/text?q=alfresco tutorial&format=xml">Search for 'alfresco tutorial' (XML response)</a></li>
|
||||||
<li><a href="/alfresco/service/search/text?q=alfresco tutorial">Search for 'alfresco tutorial' (HTML response)</a></li>
|
<li><a href="/alfresco/service/search/text?q=alfresco tutorial">Search for 'alfresco tutorial' (HTML response)</a></li>
|
||||||
<ul>
|
<ul>
|
||||||
</body>
|
</body>
|
||||||
|
Reference in New Issue
Block a user