Project

General

Profile

Revision 5a92c416

ID5a92c4162fedd1e805ee71b4de9bcbd65ad65774
Parent 521a868a
Child 4132369c

Added by Andreas Kohlbecker over 3 years ago

ref #7364 filtering references by isbn to limit to nomenclatural codes only

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
77 77

  
78 78
    private static final Logger logger = Logger.getLogger(TaxonNameEditorPresenter.class);
79 79

  
80
    private CdmFilterablePagingProvider<Reference, Reference> referencePagingProvider;
80
    private CdmFilterablePagingProvider<Reference, Reference> nomReferencePagingProvider;
81 81

  
82 82
    private Reference publishedUnit;
83 83

  
......
113 113
        getView().getExBasionymAuthorshipField().setFilterablePersonPagingProvider(personPagingProvider, this);
114 114

  
115 115
        getView().getNomReferenceCombobox().getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Reference>());
116
        referencePagingProvider = pagingProviderFactory.referencePagingProvider();
117
        referencePagingProvider.setInitStrategy(REFERENCE_INIT_STRATEGY);
118
        getView().getNomReferenceCombobox().loadFrom(referencePagingProvider, referencePagingProvider, referencePagingProvider.getPageSize());
116
        nomReferencePagingProvider = pagingProviderFactory.referencePagingProvider();
117
        nomReferencePagingProvider.setInitStrategy(REFERENCE_INIT_STRATEGY);
118
        getView().getNomReferenceCombobox().loadFrom(nomReferencePagingProvider, nomReferencePagingProvider, nomReferencePagingProvider.getPageSize());
119 119
        getView().getNomReferenceCombobox().getSelect().addValueChangeListener(new ToOneRelatedEntityButtonUpdater<Reference>(getView().getNomReferenceCombobox()));
120 120
        getView().getNomReferenceCombobox().getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<>(getView().getNomReferenceCombobox(), this));
121 121

  
......
134 134
        getView().getValidationField().getValidatedNameComboBox().loadFrom(basionymPagingProvider, basionymPagingProvider, basionymPagingProvider.getPageSize());
135 135
        getView().getValidationField().getValidatedNameComboBox().getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<>(getView().getValidationField().getValidatedNameComboBox(), this));
136 136

  
137

  
137
        getView().getNomReferenceCombobox().getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Reference>());
138
        CdmFilterablePagingProvider<Reference, Reference> icbnCodesPagingProvider = pagingProviderFactory.referencePagingProvider();
139
        icbnCodesPagingProvider.setInitStrategy(REFERENCE_INIT_STRATEGY);
140
        // @formatter:off
141
        // TODO use markers on references instead of isbn. The marker type MarkerType.NOMENCLATURAL_RELEVANT() has already prepared (#7466)
142
        icbnCodesPagingProvider.getCriteria().add(Restrictions.in("isbn", new String[]{
143
                "3-904144-22-7",     // Saint Louis Code
144
                "3-906166-48-1",     // Vienna Code
145
                "978-3-87429-425-6", // Melbourne Code
146
                "978-3-946583-16-5", // Shenzhen Code
147
                "0-85301-006-4"      // ICZN 1999
148
                                     // ICNB
149
                }));
150
        // @formatter:on
138 151
        getView().getValidationField().getCitatonComboBox().getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Reference>());
139
        getView().getValidationField().getCitatonComboBox().loadFrom(referencePagingProvider, referencePagingProvider, referencePagingProvider.getPageSize());
152
        getView().getValidationField().getCitatonComboBox().loadFrom(icbnCodesPagingProvider, icbnCodesPagingProvider, icbnCodesPagingProvider.getPageSize());
140 153
        getView().getValidationField().getCitatonComboBox().getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<>(getView().getValidationField().getCitatonComboBox(), this));
141

  
142 154
    }
143 155

  
144 156
    /**
......
198 210
                    publishedUnit = nomRef.getInReference();
199 211
                }
200 212
                // reduce available references to those which are sections of the publishedUnit and the publishedUnit itself
201
                // referencePagingProvider
202
                referencePagingProvider.getCriteria().add(Restrictions.or(
213
                // nomReferencePagingProvider
214
                nomReferencePagingProvider.getCriteria().add(Restrictions.or(
203 215
                        Restrictions.and(Restrictions.eq("inReference", publishedUnit), Restrictions.eq("type", ReferenceType.Section)),
204 216
                        Restrictions.idEq(publishedUnit.getId())
205 217
                        )

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)