Project

General

Profile

Revision e1cae301

IDe1cae301e5ebc30eb08dd7115b09d07ba4384228
Parent e293181b
Child 70234a4e

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
427 427
            results = dao.findTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, authorship, rank, pageSize, pageNumber);
428 428
        }
429 429

  
430
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
430
        return new DefaultPagerImpl<>(pageNumber, Long.valueOf(numberOfResults), pageSize, results);
431 431
    }
432 432

  
433 433
    @Override
......
464 464
        if(numberOfResults > 0) { // no point checking again
465 465
            results = dao.getTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths, TaxonRelationship.Direction.relatedTo);
466 466
        }
467
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
467
        return new DefaultPagerImpl<>(pageNumber, Long.valueOf(numberOfResults), pageSize, results);
468 468
    }
469 469

  
470 470
    @Override
......
486 486
        if(numberOfResults > 0) { // no point checking again
487 487
            results = dao.getTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths, TaxonRelationship.Direction.relatedFrom);
488 488
        }
489
        return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, results);
489
        return new DefaultPagerImpl<>(pageNumber, Long.valueOf(numberOfResults), pageSize, results);
490 490
    }
491 491

  
492 492
    @Override
......
735 735
            }
736 736
        }
737 737

  
738

  
739

  
740
       return new DefaultPagerImpl<>
741
            (configurator.getPageNumber(), numberOfResults, configurator.getPageSize(), results);
738
       return new DefaultPagerImpl<> (configurator.getPageNumber(), numberOfResults, configurator.getPageSize(), results);
742 739
    }
743 740

  
744 741
    public List<UuidAndTitleCache<TaxonBase>> getTaxonUuidAndTitleCache(Integer limit, String pattern){
......
951 948
                    result.setAbort();
952 949
                    result.addException(new Exception("Taxon can't be deleted as it is related to another taxon. " +
953 950
                            "Remove taxon from all relations to other taxa prior to deletion."));
954

  
955 951
                }
956 952
            } else{
957 953
                TaxonDeletionConfigurator configRelTaxon = new TaxonDeletionConfigurator();
......
972 968
                        }
973 969
                    }
974 970
                    taxon.removeTaxonRelation(taxRel);
975

  
976 971
                }
977 972
            }
978 973

  
......
1069 1064

  
1070 1065
         if ((taxon.getTaxonNodes() == null || taxon.getTaxonNodes().size()== 0)  && result.isOk()){
1071 1066
             try{
1072
                 UUID uuid = dao.delete(taxon);
1067
                 dao.delete(taxon);
1073 1068
                 result.addDeletedObject(taxon);
1074 1069
             }catch(Exception e){
1075 1070
                 result.addException(e);
......
1080 1075
             result.addException(new Exception("The Taxon can't be deleted because it is used in a classification."));
1081 1076

  
1082 1077
         }
1083
            //TaxonName
1084
        if (config.isDeleteNameIfPossible() && result.isOk()){
1078
         //TaxonName
1079
         if (config.isDeleteNameIfPossible() && result.isOk()){
1085 1080
            DeleteResult nameResult = new DeleteResult();
1086 1081
            //remove name if possible (and required)
1087 1082
            if (name != null ){
......
1093 1088
            }else{
1094 1089
                result.includeResult(nameResult);
1095 1090
            }
1096

  
1097

  
1098
       }
1091
         }
1099 1092
       }
1100 1093

  
1101
        return result;
1094
       return result;
1102 1095

  
1103 1096
    }
1104 1097

  
......
1149 1142
    @Override
1150 1143
    @Transactional(readOnly = false)
1151 1144
    public DeleteResult delete(UUID synUUID){
1152
    	DeleteResult result = new DeleteResult();
1153 1145
    	Synonym syn = (Synonym)dao.load(synUUID);
1154

  
1155 1146
        return this.deleteSynonym(syn, null);
1156 1147
    }
1157 1148

  
......
1179 1170

  
1180 1171
        result = isDeletable(synonym.getUuid(), config);
1181 1172

  
1182

  
1183 1173
        if (result.isOk()){
1184 1174

  
1185 1175
            synonym = HibernateProxyHelper.deproxy(this.load(synonym.getUuid()), Synonym.class);
......
1224 1214

  
1225 1215
        return this.dao.findIdenticalNamesNew(propertyPath);
1226 1216
    }
1227
//
1228
//    @Override
1229
//    public String getPhylumName(TaxonName name){
1230
//        return this.dao.getPhylumName(name);
1231
//    }
1217

  
1232 1218

  
1233 1219
    @Override
1234 1220
    public Taxon findBestMatchingTaxon(String taxonName) {
......
1455 1441
            boolean highlightFragments, Integer pageSize, Integer pageNumber,
1456 1442
            List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException {
1457 1443

  
1458

  
1459 1444
        LuceneSearch luceneSearch = prepareFindByFullTextSearch(clazz, queryString, classification, includeUnpublished, languages, highlightFragments, null);
1460 1445

  
1461 1446
        // --- execute search
......
2039 2024
                topDocsResultSet, luceneSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
2040 2025

  
2041 2026
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
2042
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
2027
        return new DefaultPagerImpl<>(pageNumber, Long.valueOf(totalHits), pageSize, searchResults);
2043 2028

  
2044 2029
    }
2045 2030

  
......
2077 2062
                topDocsResultSet, multiSearch.getHighlightFields(), dao, idFieldMap, propertyPaths);
2078 2063

  
2079 2064
        int totalHits = topDocsResultSet != null ? topDocsResultSet.totalGroupCount : 0;
2080
        return new DefaultPagerImpl<>(pageNumber, totalHits, pageSize, searchResults);
2065
        return new DefaultPagerImpl<>(pageNumber, Long.valueOf(totalHits), pageSize, searchResults);
2081 2066

  
2082 2067
    }
2083 2068

  
......
3152 3137
        		result.add(new IdentifiedEntityDTO<S>((DefinedTerm)daoObj[0], (String)daoObj[1], (UUID)daoObj[2], (String)daoObj[3], null));
3153 3138
        	}
3154 3139
        }
3155
		return new DefaultPagerImpl<>(pageNumber, numberOfResults, pageSize, result);
3140
		return new DefaultPagerImpl<>(pageNumber, Long.valueOf(numberOfResults), pageSize, result);
3156 3141
	}
3157 3142

  
3158 3143
	@Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)