Project

General

Profile

Revision 6ec42fab

ID6ec42fabc8128e379b2a96f770fdcb5c4b20b27e
Parent d98b71cb
Child c621e94f

Added by Andreas Kohlbecker over 2 years ago

ref #7648 adapting CdmVaadinConfiguration to changes in the TaxonGraphHibernateListener

View differences:

src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
42 42
import eu.etaxonomy.cdm.api.application.AbstractDataInserter;
43 43
import eu.etaxonomy.cdm.api.application.CdmRepository;
44 44
import eu.etaxonomy.cdm.api.application.DummyDataInserter;
45
import eu.etaxonomy.cdm.api.application.IRunAs;
46
import eu.etaxonomy.cdm.api.application.RunAsAdmin;
45 47
import eu.etaxonomy.cdm.api.cache.CdmCacher;
46 48
import eu.etaxonomy.cdm.api.config.ApplicationConfiguration;
47 49
import eu.etaxonomy.cdm.api.config.ApplicationConfigurationFile;
48 50
import eu.etaxonomy.cdm.api.service.idminter.RegistrationIdentifierMinter;
51
import eu.etaxonomy.cdm.api.service.taxonGraph.TaxonGraphBeforeTransactionCompleteProcess;
49 52
import eu.etaxonomy.cdm.cache.CdmTransientEntityCacher;
50 53
import eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter;
51 54
import eu.etaxonomy.cdm.persistence.hibernate.GrantedAuthorityRevokingRegistrationUpdateLister;
52
import eu.etaxonomy.cdm.persistence.hibernate.TaxonGraphHibernateListener;
55
import eu.etaxonomy.cdm.persistence.hibernate.ITaxonGraphHibernateListener;
53 56
import eu.etaxonomy.cdm.vaadin.permission.annotation.EnableAnnotationBasedAccessControl;
54 57
import eu.etaxonomy.cdm.vaadin.ui.ConceptRelationshipUI;
55 58
import eu.etaxonomy.cdm.vaadin.ui.DistributionStatusUI;
......
100 103
    private ApplicationConfiguration appConfig;
101 104

  
102 105
    @Autowired
106
    private ITaxonGraphHibernateListener taxonGraphHibernateListener;
107

  
108
    @Autowired
103 109
    private void  setTermCacher(CdmCacher termCacher){
104 110
        CdmTransientEntityCacher.setPermanentCacher(termCacher);
105 111
    }
......
170 176
        return null;
171 177
    }
172 178

  
173

  
174

  
175 179
    /**
176 180
     * this is only a quick implementation for testing,
177 181
     * TODO see also the NOTE on CdmListenerIntegrator class declaration for a prospective better solution
......
184 188
            listenerRegistry.appendListeners(EventType.POST_UPDATE, new GrantedAuthorityRevokingRegistrationUpdateLister());
185 189
            // TODO also POST_DELETE needed for GrantedAuthorityRevokingRegistrationUpdateLister?
186 190

  
187
            listenerRegistry.appendListeners(EventType.POST_UPDATE, new TaxonGraphHibernateListener());
188
            listenerRegistry.appendListeners(EventType.POST_INSERT, new TaxonGraphHibernateListener());
191
            try {
192
                taxonGraphHibernateListener.registerProcessClass(TaxonGraphBeforeTransactionCompleteProcess.class, new Object[]{new RunAsAdmin()}, new Class[]{IRunAs.class});
193
            } catch (NoSuchMethodException | SecurityException e) {
194
                // re-throw as RuntimeException as the context can not be created correctly
195
                throw new RuntimeException(e);
196
            }
189 197

  
190 198
            registrationUiHibernateEventListenersDone = true;
191 199
        }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)