Merge pull request #5 from vivo-project/feature/search-download

Added a new field email to IndividualSearchResults and a modification of...
This commit is contained in:
Jim Blake 2013-06-28 12:16:01 -07:00
commit cb757d82da
4 changed files with 45 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

View file

@ -0,0 +1,9 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#assign today = .now >
<#assign todayDate = today?date>
Results from ${siteName} for ${querytext} on ${todayDate}
Name, Title, Email, URI, VIVO Profile URL
<#list individuals as individual>
"${individual.name}",<#if individual.preferredTitle?has_content>"${individual.preferredTitle}"</#if>,<#if individual.email?has_content>"${individual.email}"</#if>,"${individual.uri}","${individual.profileUrl}"
</#list>

View file

@ -0,0 +1,28 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<str name="q">${querytext?xml}</str>
<#if nextPage??>
<str name="nextPage">${nextPage?xml}</str>
</#if>
</lst>
<result name="response" numFound="${hitCount}" start="${startIndex}" >
<#list individuals as individual>
<doc>
<str name="uri">${individual.uri?xml}</str>
<str name="name">${individual.name?xml}</str>
<#if individual.preferredTitle?has_content>
<str name="title">${individual.preferredTitle?xml}</str>
</#if>
<#if individual.email?has_content>
<str name="email">"${individual.email}"</str>
</#if>
<str name="vivo-url">${individual.profileUrl?xml}"</str>
</doc>
</#list>
</result>
</response>

View file

@ -16,12 +16,19 @@ public class IndividualSearchResult extends BaseIndividualSearchResult {
public IndividualSearchResult(Individual individual, VitroRequest vreq) {
super(individual, vreq);
log.info("Called Individual Search Result");
}
/* Access methods for templates */
public String getPreferredTitle() {
log.info("Called get Title");
return individual.getDataValue(CORE + "preferredTitle");
}
public String getEmail() {
log.info("Called get Email");
return individual.getDataValue(CORE + "email");
}
}