/** * <code>GET /{repository}/search</code> - Exposes links to the individual search resources exposed by the backing * repository. * * @param resourceInformation * @return */ @ResponseBody @RequestMapping(value = BASE_MAPPING, method = RequestMethod.GET) public RepositorySearchesResource listSearches(RootResourceInformation resourceInformation) { verifySearchesExposed(resourceInformation); Links queryMethodLinks = entityLinks.linksToSearchResources(resourceInformation.getDomainType()); if (queryMethodLinks.isEmpty()) { throw new ResourceNotFoundException(); } RepositorySearchesResource result = new RepositorySearchesResource(resourceInformation.getDomainType()); result.add(queryMethodLinks); result.add(getDefaultSelfLink()); return result; }
/** * <code>GET /{repository}/search</code> - Exposes links to the individual search resources exposed by the backing * repository. * * @param resourceInformation * @return */ @ResponseBody @RequestMapping(value = BASE_MAPPING, method = RequestMethod.GET) public RepositorySearchesResource listSearches(RootResourceInformation resourceInformation) { verifySearchesExposed(resourceInformation); Links queryMethodLinks = entityLinks.linksToSearchResources(resourceInformation.getDomainType()); if (queryMethodLinks.isEmpty()) { throw new ResourceNotFoundException(); } RepositorySearchesResource result = new RepositorySearchesResource(resourceInformation.getDomainType()); result.add(queryMethodLinks); result.add(getDefaultSelfLink()); return result; }
final String search = repositorySearchesResource.getId().getHref(); final Link customLink = new Link(search + "/customFind{?param1,param2,page,size,sort}").withRel("customFind"); repositorySearchesResource.add(customLink); return repositorySearchesResource;