@Test public void testGetAnnotationPage() { String query = "comment"; String motivation = null; String date = null; String user = null; String queryString = "http: String page = null; long totalHits = 20; searchQueryUtils.setUpBuilder(totalHits, client); Parameters params = new Parameters(query, motivation, date, user); ServiceResponse<Map<String, Object>> response = impl.getAnnotationPage(params, queryString, page, null, null); assertNotEquals(ServiceResponse.Status.NOT_FOUND,response.getStatus()); }
@Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type) { String[] annoSearchArray = this.getAnnotationsPage(parameters, queryString, true, page, within, type); if(annoSearchArray.length == 0){ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } PageParameters pagingParameters = this.getPageParameters(); List<W3CAnnotation> annotationList = annotationUtils.getW3CAnnotations(annoSearchArray); Map<String, Object> annoMap = annotationUtils.createAnnotationPage(queryString, annotationList, true, pagingParameters, (int)this.getTotalHits(), false); if(null != annoMap && !annoMap.isEmpty()){ return new ServiceResponse<>(Status.OK, annoMap); }else{ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } }
W3CAnnotationSearchServiceImpl extends AnnotationSearchServiceImpl implements W3CAnnotationSearchService { @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type) { String[] annoSearchArray = this.getAnnotationsPage(parameters, queryString, true, page, within, type); if(annoSearchArray.length == 0){ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } PageParameters pagingParameters = this.getPageParameters(); List<W3CAnnotation> annotationList = annotationUtils.getW3CAnnotations(annoSearchArray); Map<String, Object> annoMap = annotationUtils.createAnnotationPage(queryString, annotationList, true, pagingParameters, (int)this.getTotalHits(), false); if(null != annoMap && !annoMap.isEmpty()){ return new ServiceResponse<>(Status.OK, annoMap); }else{ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } } }
W3CAnnotationSearchServiceImpl extends AnnotationSearchServiceImpl implements W3CAnnotationSearchService { @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type) { String[] annoSearchArray = this.getAnnotationsPage(parameters, queryString, true, page, within, type); if(annoSearchArray.length == 0){ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } PageParameters pagingParameters = this.getPageParameters(); List<W3CAnnotation> annotationList = annotationUtils.getW3CAnnotations(annoSearchArray); Map<String, Object> annoMap = annotationUtils.createAnnotationPage(queryString, annotationList, true, pagingParameters, (int)this.getTotalHits(), false); if(null != annoMap && !annoMap.isEmpty()){ return new ServiceResponse<>(Status.OK, annoMap); }else{ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } } @Autowired  W3CAnnotationSearchServiceImpl(AnnotationUtils annotationUtils,ElasticsearchTemplate template,  TextSearchService textSearchService, CacheManager cacheManager); }
W3CAnnotationSearchServiceImpl extends AnnotationSearchServiceImpl implements W3CAnnotationSearchService { @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type) { String[] annoSearchArray = this.getAnnotationsPage(parameters, queryString, true, page, within, type); if(annoSearchArray.length == 0){ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } PageParameters pagingParameters = this.getPageParameters(); List<W3CAnnotation> annotationList = annotationUtils.getW3CAnnotations(annoSearchArray); Map<String, Object> annoMap = annotationUtils.createAnnotationPage(queryString, annotationList, true, pagingParameters, (int)this.getTotalHits(), false); if(null != annoMap && !annoMap.isEmpty()){ return new ServiceResponse<>(Status.OK, annoMap); }else{ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } } @Autowired  W3CAnnotationSearchServiceImpl(AnnotationUtils annotationUtils,ElasticsearchTemplate template,  TextSearchService textSearchService, CacheManager cacheManager); @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type); }
W3CAnnotationSearchServiceImpl extends AnnotationSearchServiceImpl implements W3CAnnotationSearchService { @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type) { String[] annoSearchArray = this.getAnnotationsPage(parameters, queryString, true, page, within, type); if(annoSearchArray.length == 0){ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } PageParameters pagingParameters = this.getPageParameters(); List<W3CAnnotation> annotationList = annotationUtils.getW3CAnnotations(annoSearchArray); Map<String, Object> annoMap = annotationUtils.createAnnotationPage(queryString, annotationList, true, pagingParameters, (int)this.getTotalHits(), false); if(null != annoMap && !annoMap.isEmpty()){ return new ServiceResponse<>(Status.OK, annoMap); }else{ Map <String, Object> emptyMap = annotationUtils.returnEmptyResultSet(queryString,true, new PageParameters(),false); return new ServiceResponse<>(Status.OK,emptyMap); } } @Autowired  W3CAnnotationSearchServiceImpl(AnnotationUtils annotationUtils,ElasticsearchTemplate template,  TextSearchService textSearchService, CacheManager cacheManager); @Override @Cacheable(value = "w3cAnnotationSearchPagingCache", key = "#queryString" ) @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE) ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, String type); static final String W3C_ANNOTATION_SERVICE_NAME; }