Revision be4a9789
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java | ||
---|---|---|
14 | 14 |
import java.util.Set; |
15 | 15 |
|
16 | 16 |
import org.springframework.beans.factory.annotation.Autowired; |
17 |
import org.springframework.context.event.EventListener; |
|
17 |
import org.springframework.context.annotation.Scope; |
|
18 |
import org.vaadin.spring.events.annotation.EventBusListenerMethod; |
|
18 | 19 |
import org.vaadin.viritin.fields.AbstractElementCollection; |
19 | 20 |
|
21 |
import com.vaadin.spring.annotation.SpringComponent; |
|
22 |
|
|
20 | 23 |
import eu.etaxonomy.cdm.api.service.IRegistrationService; |
21 | 24 |
import eu.etaxonomy.cdm.cache.CdmTransientEntityCacher; |
22 | 25 |
import eu.etaxonomy.cdm.model.ICdmCacher; |
... | ... | |
36 | 39 |
import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory; |
37 | 40 |
import eu.etaxonomy.cdm.vaadin.component.CollectionRowItemCollection; |
38 | 41 |
import eu.etaxonomy.cdm.vaadin.event.EntityChangeEvent; |
42 |
import eu.etaxonomy.cdm.vaadin.event.EntityChangeEventFilter; |
|
39 | 43 |
import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityButtonUpdater; |
40 | 44 |
import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityReloader; |
41 | 45 |
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationTermLists; |
... | ... | |
56 | 60 |
* @since Jun 13, 2017 |
57 | 61 |
* |
58 | 62 |
*/ |
63 |
@SpringComponent |
|
64 |
@Scope("prototype") |
|
59 | 65 |
public class SpecimenTypeDesignationWorkingsetEditorPresenter |
60 | 66 |
extends AbstractEditorPresenter<SpecimenTypeDesignationWorkingSetDTO , SpecimenTypeDesignationWorkingsetPopupEditorView> |
61 | 67 |
implements CachingPresenter { |
... | ... | |
99 | 105 |
return store; |
100 | 106 |
} |
101 | 107 |
|
102 |
|
|
103 | 108 |
/** |
104 | 109 |
* Loads an existing working set from the database. This process actually involves |
105 | 110 |
* loading the Registration specified by the <code>RegistrationAndWorkingsetId.registrationId</code> and in |
... | ... | |
316 | 321 |
collectionPopupEditor.loadInEditor(collectionId); |
317 | 322 |
} |
318 | 323 |
|
319 |
@EventListener(condition = "#event.entityType == T(eu.etaxonomy.cdm.model.occurrence.Collection)") |
|
324 |
|
|
325 |
@EventBusListenerMethod(filter = EntityChangeEventFilter.OccurrenceCollectionFilter.class) |
|
320 | 326 |
public void onCollectionEvent(EntityChangeEvent event){ |
321 | 327 |
|
322 |
Collection newCollection = getRepo().getCollectionService().load(event.getEntityId(), Arrays.asList(new String[]{"$.institute"})); |
|
328 |
Collection newCollection = getRepo().getCollectionService().load( |
|
329 |
event.getEntityId(), Arrays.asList(new String[]{"$.institute"}) |
|
330 |
); |
|
323 | 331 |
cache.load(newCollection); |
324 | 332 |
|
325 | 333 |
for( CollectionRowItemCollection row : collectionPopuEditorSourceRows) { |
... | ... | |
347 | 355 |
referencePopupEditor.loadInEditor(referenceId); |
348 | 356 |
} |
349 | 357 |
|
350 |
@EventListener(condition = "#event.entityType == T(eu.etaxonomy.cdm.model.reference.Reference)")
|
|
358 |
@EventBusListenerMethod(filter = EntityChangeEventFilter.ReferenceFilter.class)
|
|
351 | 359 |
public void onReferenceEvent(EntityChangeEvent event){ |
352 | 360 |
|
353 | 361 |
Reference newRef = getRepo().getReferenceService().load(event.getEntityId(), Arrays.asList(new String[]{"$"})); |
Also available in: Unified diff
fix #7231 replacing SpringApplicationEventBus by scoped Vaadin4Spring Event Bus