Revision 5b9c1d33
Added by Andreas Kohlbecker over 5 years ago
src/main/java/eu/etaxonomy/cdm/service/CdmFilterablePagingProviderFactory.java | ||
---|---|---|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.Arrays; |
13 | 13 |
import java.util.List; |
14 |
import java.util.Set; |
|
14 | 15 |
|
15 | 16 |
import org.springframework.beans.factory.annotation.Autowired; |
16 | 17 |
import org.springframework.beans.factory.annotation.Qualifier; |
... | ... | |
53 | 54 |
CdmFilterablePagingProvider<Reference,Reference> pagingProvider = new CdmFilterablePagingProvider<Reference, Reference>( |
54 | 55 |
repo.getReferenceService(), MatchMode.ANYWHERE, referenceOrderHints); |
55 | 56 |
|
56 |
List<ReferenceType> inRefTypes = new ArrayList<>(); |
|
57 |
if(subReferenceType != null && !subReferenceType.equals(ReferenceType.Generic)){ |
|
58 |
if(subReferenceType.isArticle()){ |
|
59 |
inRefTypes.add(ReferenceType.Journal); |
|
60 |
} else if (subReferenceType == ReferenceType.BookSection) { |
|
61 |
inRefTypes.add(ReferenceType.Book); |
|
62 |
} else if (subReferenceType.isBook()) { |
|
63 |
inRefTypes.add(ReferenceType.PrintSeries); |
|
64 |
} else if (subReferenceType == ReferenceType.InProceedings) { |
|
65 |
inRefTypes.add(ReferenceType.Proceedings); |
|
66 |
} else if (subReferenceType == ReferenceType.Section) { |
|
67 |
inRefTypes.add(ReferenceType.Article); |
|
68 |
inRefTypes.add(ReferenceType.Book); |
|
69 |
inRefTypes.add(ReferenceType.Thesis); |
|
70 |
inRefTypes.add(ReferenceType.Patent); |
|
71 |
inRefTypes.add(ReferenceType.Report); |
|
72 |
inRefTypes.add(ReferenceType.WebPage); |
|
73 |
} |
|
74 |
} |
|
57 |
Set<ReferenceType> inRefTypes = subReferenceType.inReferenceContraints(subReferenceType); |
|
58 |
|
|
75 | 59 |
if(!inRefTypes.isEmpty()){ |
76 | 60 |
inRefTypes.add(ReferenceType.Generic); // generic references and those with missing type are always valid |
77 | 61 |
inRefTypes.add(null); |
Also available in: Unified diff
ref #7481 moving inReference constraints to cdmlib-model