Index: src/main/java/sgf/gateway/search/provider/solr/query/PassFreeTextQueryStrategy.java =================================================================== --- src/main/java/sgf/gateway/search/provider/solr/query/PassFreeTextQueryStrategy.java (revision 0) +++ src/main/java/sgf/gateway/search/provider/solr/query/PassFreeTextQueryStrategy.java (working copy) @@ -0,0 +1,11 @@ +package sgf.gateway.search.provider.solr.query; + +/** + * Created by jcunning on 5/1/14. + */ +public class PassFreeTextQueryStrategy implements FreeTextQueryStrategy { + @Override + public String getFreeTextQuery(String string) { + return string; + } +} Index: src/main/java/sgf/gateway/web/controllers/metrics/LinkMetricsController.java =================================================================== --- src/main/java/sgf/gateway/web/controllers/metrics/LinkMetricsController.java (revision 0) +++ src/main/java/sgf/gateway/web/controllers/metrics/LinkMetricsController.java (working copy) @@ -0,0 +1,27 @@ +package sgf.gateway.web.controllers.metrics; + + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.view.RedirectView; + + +@Controller +public class LinkMetricsController { + + // Redirect so request goes thru Clickstream to collect metrics + @RequestMapping(value = "/redirect.html", method=RequestMethod.GET) + public ModelAndView redirect (@RequestParam(value="link", required=true) String link) { + + ModelAndView result = null; + + RedirectView redirectView = new RedirectView(link); + result = new ModelAndView(redirectView); + + return result; + } + +} Index: src/main/java/sgf/gateway/web/controllers/metrics/OffsiteLinkMetricsController.java =================================================================== --- src/main/java/sgf/gateway/web/controllers/metrics/OffsiteLinkMetricsController.java (revision 18675) +++ src/main/java/sgf/gateway/web/controllers/metrics/OffsiteLinkMetricsController.java (working copy) @@ -1,27 +0,0 @@ -package sgf.gateway.web.controllers.metrics; - - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.view.RedirectView; - - -@Controller -public class OffsiteLinkMetricsController { - - // Redirect so request goes thru Clickstream to collect metrics - @RequestMapping(value = "/redirect.html", method=RequestMethod.GET) - public ModelAndView redirect (@RequestParam(value="link", required=true) String link) { - - ModelAndView result = null; - - RedirectView redirectView = new RedirectView(link); - result = new ModelAndView(redirectView); - - return result; - } - -} Index: src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchCommand.java =================================================================== --- src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchCommand.java (revision 0) +++ src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchCommand.java (working copy) @@ -0,0 +1,23 @@ +package sgf.gateway.web.controllers.search; + +import org.hibernate.validator.constraints.NotBlank; +import org.springframework.util.StringUtils; + +public class AnalyticalSearchCommand { + + @NotBlank(message="A query is required.") + String queryText; + + public void setQueryText(String queryText) { + + if (StringUtils.hasText(queryText)) { + this.queryText = queryText.trim(); + } + + this.queryText = queryText; + } + + public String getQueryText() { + return queryText; + } +} Index: src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchController.java =================================================================== --- src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchController.java (revision 0) +++ src/main/java/sgf/gateway/web/controllers/search/AnalyticalSearchController.java (working copy) @@ -0,0 +1,76 @@ +package sgf.gateway.web.controllers.search; + +import java.util.HashMap; +import java.util.Map; + +import javax.validation.Valid; + +import org.apache.solr.client.solrj.SolrServerException; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +import sgf.gateway.search.api.Criteria; +import sgf.gateway.search.api.SearchQuery; +import sgf.gateway.search.api.SearchResult; +import sgf.gateway.search.core.CriteriaImpl; +import sgf.gateway.search.core.SortTargetsImpl; + +@Controller +public class AnalyticalSearchController { + + private final SearchQuery searchQuery; + + public AnalyticalSearchController(SearchQuery searchQuery) { + this.searchQuery = searchQuery; + } + + @RequestMapping(value = "/root/search/analytic.html", method = RequestMethod.GET) + public ModelAndView search() throws SolrServerException { + + ModelAndView modelAndView = new ModelAndView("/search/search-analytical"); + + return modelAndView; + } + + @RequestMapping(value = "/root/search/analytic.html", method = RequestMethod.POST) + public ModelAndView submit(@ModelAttribute("analyticalSearchForm") @Valid AnalyticalSearchCommand searchCommand, BindingResult result) throws SolrServerException { + + ModelAndView modelAndView = new ModelAndView("/search/search-analytical"); + + if (!result.hasErrors()) { + SearchResult searchResult = this.executeSearchQuery(searchCommand); + modelAndView.addObject("searchResult", searchResult); + } + + return modelAndView; + } + + @ModelAttribute("analyticalSearchForm") + public AnalyticalSearchCommand setupAnalyticalSearchCommand() { + return new AnalyticalSearchCommand(); + } + + private SearchResult executeSearchQuery(AnalyticalSearchCommand searchCommand) { + + Criteria criteria = this.createSearchCriteria(searchCommand); + SearchResult searchResult = this.searchQuery.execute(criteria); + + return searchResult; + } + + private Criteria createSearchCriteria(AnalyticalSearchCommand searchCommand) { + + CriteriaImpl criteria = new CriteriaImpl(); + + criteria.setFreeText(searchCommand.getQueryText()); + + Integer bigEnoughToReturnAll = 20000; + criteria.setResultSize(bigEnoughToReturnAll); + + return criteria; + } +} Index: src/main/resources/spring/sgf/gateway/web/controllers/metrics/metrics-controllers.xml =================================================================== --- src/main/resources/spring/sgf/gateway/web/controllers/metrics/metrics-controllers.xml (revision 18675) +++ src/main/resources/spring/sgf/gateway/web/controllers/metrics/metrics-controllers.xml (working copy) @@ -11,6 +11,6 @@ - + Index: src/main/resources/spring/sgf/gateway/web/controllers/search/search.xml =================================================================== --- src/main/resources/spring/sgf/gateway/web/controllers/search/search.xml (revision 18675) +++ src/main/resources/spring/sgf/gateway/web/controllers/search/search.xml (working copy) @@ -11,4 +11,8 @@ + + + + Index: src/main/webapp/WEB-INF/tags/cadis/dataset-summary-tab-content.tag =================================================================== --- src/main/webapp/WEB-INF/tags/cadis/dataset-summary-tab-content.tag (revision 18739) +++ src/main/webapp/WEB-INF/tags/cadis/dataset-summary-tab-content.tag (working copy) @@ -325,6 +325,7 @@ + ${result.title} @@ -332,7 +333,12 @@
- ">${result.title}
+ + + + + + ${result.title}
Index: src/main/webapp/WEB-INF/views/html/cadis/root/index.jsp =================================================================== --- src/main/webapp/WEB-INF/views/html/cadis/root/index.jsp (revision 18700) +++ src/main/webapp/WEB-INF/views/html/cadis/root/index.jsp (working copy) @@ -39,6 +39,9 @@
Search Provider
Gateway Scheduled Tasks
Index: src/main/webapp/WEB-INF/views/html/root/index.jsp =================================================================== --- src/main/webapp/WEB-INF/views/html/root/index.jsp (revision 18700) +++ src/main/webapp/WEB-INF/views/html/root/index.jsp (working copy) @@ -39,6 +39,11 @@
  • Reindex (Root Admin Only)
  • +
    Analytical Search
    + +
    Publishing