Add IEventBaseService to application controller #5403
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / application / CdmApplicationDefaultConfiguration.java
index ab750f3da2dfad496d4b1d6bdae31d993c61556f..08804043cfc85526ae06bd04a929f9f829010e1d 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$\r
 /**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
+ * Copyright (C) 2007 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
 \r
 package eu.etaxonomy.cdm.api.application;\r
 \r
@@ -18,9 +18,12 @@ import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.context.ApplicationContext;\r
 import org.springframework.context.ApplicationContextAware;\r
-import org.springframework.orm.hibernate4.HibernateTransactionManager;\r
-import org.springframework.security.access.PermissionEvaluator;\r
+import org.springframework.orm.hibernate5.HibernateTransactionManager;\r
 import org.springframework.security.authentication.ProviderManager;\r
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;\r
+import org.springframework.security.core.Authentication;\r
+import org.springframework.security.core.context.SecurityContext;\r
+import org.springframework.security.core.context.SecurityContextHolder;\r
 import org.springframework.stereotype.Component;\r
 import org.springframework.transaction.PlatformTransactionManager;\r
 import org.springframework.transaction.TransactionDefinition;\r
@@ -29,11 +32,15 @@ import org.springframework.transaction.support.DefaultTransactionDefinition;
 \r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.api.service.IAnnotationService;\r
 import eu.etaxonomy.cdm.api.service.IClassificationService;\r
 import eu.etaxonomy.cdm.api.service.ICollectionService;\r
 import eu.etaxonomy.cdm.api.service.ICommonService;\r
 import eu.etaxonomy.cdm.api.service.IDatabaseService;\r
 import eu.etaxonomy.cdm.api.service.IDescriptionService;\r
+import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;\r
+import eu.etaxonomy.cdm.api.service.IEntityValidationService;\r
+import eu.etaxonomy.cdm.api.service.IEventBaseService;\r
 import eu.etaxonomy.cdm.api.service.IFeatureNodeService;\r
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
 import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;\r
@@ -41,10 +48,12 @@ import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.IIdentificationKeyService;\r
 import eu.etaxonomy.cdm.api.service.ILocationService;\r
 import eu.etaxonomy.cdm.api.service.IMediaService;\r
+import eu.etaxonomy.cdm.api.service.IMetadataService;\r
 import eu.etaxonomy.cdm.api.service.INameService;\r
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;\r
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;\r
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;\r
+import eu.etaxonomy.cdm.api.service.IProgressMonitorService;\r
 import eu.etaxonomy.cdm.api.service.IReferenceService;\r
 import eu.etaxonomy.cdm.api.service.IService;\r
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;\r
@@ -53,7 +62,11 @@ import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IUserService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
 import eu.etaxonomy.cdm.api.service.IWorkingSetService;\r
+import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;\r
+import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;\r
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;\r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;\r
 \r
 /**\r
  * @author a.mueller\r
@@ -62,367 +75,393 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
  */\r
 @Component\r
 public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfiguration, ApplicationContextAware {\r
-    private static final Logger logger = Logger.getLogger(CdmApplicationDefaultConfiguration.class);\r
-\r
-    protected ApplicationContext applicationContext;\r
+       private static final Logger logger = Logger.getLogger(CdmApplicationDefaultConfiguration.class);\r
 \r
+       protected ApplicationContext applicationContext;\r
 \r
-    @Autowired\r
+       @Autowired\r
     //@Qualifier("nameService")\r
-    private INameService nameService;\r
-    @Autowired\r
-    //@Qualifier("taxonService")\r
-    private ITaxonService taxonService;\r
-    @Autowired\r
-    //@Qualifier("classificationService")\r
-    private IClassificationService classificationService;\r
-    @Autowired\r
-    //@Qualifier("referenceService")\r
-    private IReferenceService referenceService;\r
-    @Autowired\r
-    //@Qualifier("agentService")\r
-    private IAgentService agentService;\r
-    @Autowired\r
-    //@Qualifier("databaseService")\r
-    private IDatabaseService databaseService;\r
-    @Autowired\r
-    //@Qualifier("termService")\r
-    private ITermService termService;\r
-    @Autowired\r
-    private HibernateTransactionManager transactionManager;\r
-    @Autowired\r
-    //@Qualifier("descriptionService")\r
-    private IDescriptionService descriptionService;\r
-    @Autowired\r
-    //@Qualifier("occurrenceService")\r
-    private IOccurrenceService occurrenceService;\r
+    private IAnnotationService annotationService;\r
+\r
+       @Autowired\r
+       //@Qualifier("nameService")\r
+       private INameService nameService;\r
+       @Autowired\r
+       //@Qualifier("taxonService")\r
+       private ITaxonService taxonService;\r
+       @Autowired\r
+       //@Qualifier("classificationService")\r
+       private IClassificationService classificationService;\r
+       @Autowired\r
+       //@Qualifier("referenceService")\r
+       private IReferenceService referenceService;\r
+       @Autowired\r
+       //@Qualifier("agentService")\r
+       private IAgentService agentService;\r
+       @Autowired\r
+       //@Qualifier("databaseService")\r
+       private IDatabaseService databaseService;\r
+       @Autowired\r
+       //@Qualifier("termService")\r
+       private ITermService termService;\r
+       //@Autowired\r
+       private HibernateTransactionManager transactionManager;\r
+       @Autowired\r
+       //@Qualifier("descriptionService")\r
+       private IDescriptionService descriptionService;\r
+       @Autowired\r
+       //@Qualifier("occurrenceService")\r
+       private IOccurrenceService occurrenceService;\r
+       @Autowired\r
+       //@Qualifier("primerService")\r
+       private IPrimerService primerService;\r
+       @Autowired\r
+       //@Qualifier("amplificationService")\r
+       private IAmplificationService amplificationService;\r
+       @Autowired\r
+       //@Qualifier("sequenceService")\r
+       private ISequenceService sequenceService;\r
+       @Autowired\r
+       //@Qualifier("eventBaseService")\r
+       private IEventBaseService eventBaseService;\r
+       @Autowired\r
+       //@Qualifier("mediaService")\r
+       private IMediaService mediaService;\r
     @Autowired\r
     //@Qualifier("mediaService")\r
-    private IMediaService mediaService;\r
-    @Autowired\r
-    //@Qualifier("commonService")\r
-    private ICommonService commonService;\r
-    @Autowired\r
-    private ILocationService locationService;\r
-    @Autowired\r
-    private SessionFactory sessionFactory;\r
-    @Autowired\r
-    private DataSource dataSource;\r
-    @Autowired\r
-    private ProviderManager authenticationManager;\r
-    @Autowired\r
-    private IUserService userService;\r
-    @Autowired\r
-    private IGrantedAuthorityService grantedAuthorityService;\r
-    @Autowired\r
-    private IGroupService groupService;\r
-    @Autowired\r
-    private ICollectionService collectionService;\r
-    @Autowired\r
-    private IFeatureTreeService featureTreeService;\r
-    @Autowired\r
-    private IFeatureNodeService featureNodeService;\r
-    @Autowired\r
-    private IVocabularyService vocabularyService;\r
-    @Autowired\r
-    private ITaxonNodeService taxonNodeService;\r
-    @Autowired\r
-    private IIdentificationKeyService identificationKeyService;\r
-    @Autowired\r
-    private IPolytomousKeyService polytomousKeyService;\r
-    @Autowired\r
-    private IPolytomousKeyNodeService polytomousKeyNodeService;\r
-    @Autowired\r
-    private PermissionEvaluator permissionEvaluator;\r
-\r
-\r
-//     @Autowired\r
-    //@Qualifier("mainService")\r
-    private IService<CdmBase> mainService;\r
-\r
-    @Autowired\r
-    private IWorkingSetService workingSetService;\r
+    private IMetadataService metadataService;\r
+       @Autowired\r
+       //@Qualifier("commonService")\r
+       private ICommonService commonService;\r
+       @Autowired\r
+       private ILocationService locationService;\r
+       //@Autowired\r
+       private SessionFactory sessionFactory;\r
+       //@Autowired\r
+       private DataSource dataSource;\r
+       @Autowired\r
+       private ProviderManager authenticationManager;\r
+       @Autowired\r
+       private IUserService userService;\r
+       @Autowired\r
+       private IGrantedAuthorityService grantedAuthorityService;\r
+       @Autowired\r
+       private IGroupService groupService;\r
+       @Autowired\r
+       private ICollectionService collectionService;\r
+       @Autowired\r
+       private IFeatureTreeService featureTreeService;\r
+       @Autowired\r
+       private IFeatureNodeService featureNodeService;\r
+       @Autowired\r
+       private IVocabularyService vocabularyService;\r
+       @Autowired\r
+       private ITaxonNodeService taxonNodeService;\r
+       @Autowired\r
+       private IIdentificationKeyService identificationKeyService;\r
+       @Autowired\r
+       private IPolytomousKeyService polytomousKeyService;\r
+       @Autowired\r
+       private IPolytomousKeyNodeService polytomousKeyNodeService;\r
+       @Autowired\r
+       private IProgressMonitorService progressMonitorService;\r
+       @Autowired\r
+       private IEntityValidationService entityValidationService;\r
+       @Autowired\r
+       private IEntityConstraintViolationService entityConstraintViolationService;\r
+       @Autowired\r
+       private ICdmPermissionEvaluator permissionEvaluator;\r
+\r
+       //      @Autowired\r
+       //@Qualifier("mainService")\r
+       private IService<CdmBase> mainService;\r
+\r
+       @Autowired\r
+       private IWorkingSetService workingSetService;\r
+\r
+\r
+       //********************** CONSTRUCTOR *********************************************************/\r
+\r
+       /**\r
+        * Constructor\r
+        */\r
+       protected CdmApplicationDefaultConfiguration(){}\r
+\r
+\r
+       // ****************************** APPLICATION CONTEXT *************************************************/\r
+\r
+       @Override\r
+       public void setApplicationContext(ApplicationContext applicationContext) throws BeansException{\r
+               this.applicationContext = applicationContext;\r
+       }\r
+\r
+       // ****************************** GETTER *************************************************/\r
+\r
+       @Override\r
+       public final Object getBean(String name){\r
+           return this.applicationContext.getBean(name);\r
+       }\r
+\r
+       @Override\r
+       public IAnnotationService getAnnotationService(){\r
+           return this.annotationService;\r
+       }\r
+\r
+       @Override\r
+       public IAgentService getAgentService(){\r
+               return this.agentService;\r
+       }\r
+\r
+       @Override\r
+       public IDatabaseService getDatabaseService(){\r
+               return this.databaseService;\r
+       }\r
+\r
+\r
+       @Autowired\r
+       public void setDataSource(DataSource dataSource){\r
+               this.dataSource = dataSource;\r
+       }\r
+\r
+       @Override\r
+       public INameService getNameService(){\r
+               return this.nameService;\r
+       }\r
+\r
+       @Override\r
+       public IReferenceService getReferenceService(){\r
+               return this.referenceService;\r
+       }\r
+\r
+       @Autowired\r
+       public void setSessionFactory(SessionFactory sessionFactory){\r
+               this.sessionFactory = sessionFactory;\r
+       }\r
+\r
+       @Override\r
+       public ITaxonService getTaxonService(){\r
+               return this.taxonService;\r
+       }\r
+\r
+       @Override\r
+       public IClassificationService getClassificationService(){\r
+               return this.classificationService;\r
+       }\r
+\r
+       @Override\r
+       public ITaxonNodeService getTaxonNodeService(){\r
+               return this.taxonNodeService;\r
+       }\r
+\r
+       @Override\r
+       public IDescriptionService getDescriptionService(){\r
+               return this.descriptionService;\r
+       }\r
+\r
+       @Override\r
+       public IOccurrenceService getOccurrenceService(){\r
+               return this.occurrenceService;\r
+       }\r
+\r
+       @Override\r
+       public IPrimerService getPrimerService(){\r
+               return this.primerService;\r
+       }\r
+\r
+       @Override\r
+       public IAmplificationService getAmplificationService(){\r
+               return this.amplificationService;\r
+       }\r
+\r
+       @Override\r
+       public ISequenceService getSequenceService(){\r
+               return this.sequenceService;\r
+       }\r
 \r
-//********************** CONSTRUCTOR *********************************************************/\r
+       @Override\r
+       public IEventBaseService getEventBaseService() {\r
+           return this.eventBaseService;\r
+       }\r
+\r
+       @Override\r
+       public IMediaService getMediaService(){\r
+               return this.mediaService;\r
+       }\r
 \r
     /**\r
-     * Constructor\r
-     */\r
-    protected CdmApplicationDefaultConfiguration() {\r
-    }\r
-\r
-// ****************************** APPLICATION CONTEXT *************************************************/\r
-\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)\r
-     */\r
-    public void setApplicationContext(ApplicationContext applicationContext)\r
-            throws BeansException {\r
-        this.applicationContext = applicationContext;\r
-    }\r
-\r
-// ****************************** GETTER *************************************************/\r
-\r
-\r
-    public final Object getBean(String name){\r
-        return this.applicationContext.getBean(name);\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAgentService()\r
-     */\r
-    public IAgentService getAgentService() {\r
-        return this.agentService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDatabaseService()\r
-     */\r
-    public IDatabaseService getDatabaseService() {\r
-        return this.databaseService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getNameService()\r
-     */\r
-    public INameService getNameService() {\r
-        return this.nameService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getReferenceService()\r
-     */\r
-    public IReferenceService getReferenceService() {\r
-        return this.referenceService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService()\r
-     */\r
-    public ITaxonService getTaxonService() {\r
-        return this.taxonService;\r
-    }\r
-\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getClassificationService()\r
-     */\r
-    public IClassificationService getClassificationService() {\r
-        return this.classificationService;\r
-    }\r
-\r
-    public ITaxonNodeService getTaxonNodeService(){\r
-        return this.taxonNodeService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getDescriptionService()\r
-     */\r
-    public IDescriptionService getDescriptionService(){\r
-        return this.descriptionService;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getOccurrenceService()\r
-     */\r
-    public IOccurrenceService getOccurrenceService(){\r
-        return this.occurrenceService;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getMediaService()\r
-     */\r
-    public IMediaService getMediaService(){\r
-        return this.mediaService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTermService()\r
-     */\r
-    public ITermService getTermService() {\r
-        return this.termService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()\r
-     */\r
-    public ICommonService getCommonService(){\r
-        return this.commonService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getLocationService()\r
-     */\r
-    public ILocationService getLocationService() {\r
-        return this.locationService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService()\r
-     */\r
-    public IUserService getUserService() {\r
-        return this.userService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getUserService()\r
-     */\r
-    public IGrantedAuthorityService getGrantedAuthorityService() {\r
-        return this.grantedAuthorityService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCommonService()\r
-     */\r
-    public IService<CdmBase> getMainService(){\r
-        return this.mainService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTransactionManager()\r
-     */\r
-    public PlatformTransactionManager getTransactionManager() {\r
-        return this.transactionManager;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager()\r
-     */\r
-    public ProviderManager getAuthenticationManager() {\r
-        return this.authenticationManager;\r
-    }\r
-\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#NewConversation()\r
-     */\r
-    public ConversationHolder NewConversation() {\r
-        // TODO make this a prototype\r
-        return new ConversationHolder(dataSource, sessionFactory, transactionManager);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getCollectionService()\r
-     */\r
-    public ICollectionService getCollectionService() {\r
-        return collectionService;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureTreeService()\r
-     */\r
-    public IFeatureTreeService getFeatureTreeService() {\r
-        return featureTreeService;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getFeatureNodeService()\r
-     */\r
-    public IFeatureNodeService getFeatureNodeService(){\r
-        return featureNodeService;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getVocabularyService()\r
-     */\r
-    public IVocabularyService getVocabularyService() {\r
-        return vocabularyService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getIdentificationKeyService()\r
-     */\r
-    public IIdentificationKeyService getIdentificationKeyService(){\r
-        return identificationKeyService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPolytomousKeyService()\r
-     */\r
-    public IPolytomousKeyService getPolytomousKeyService(){\r
-        return polytomousKeyService;\r
-    }\r
-\r
-    public IPolytomousKeyNodeService getPolytomousKeyNodeService(){\r
-        return polytomousKeyNodeService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getWorkingSetService()\r
-     */\r
-    @Override\r
-    public IWorkingSetService getWorkingSetService() {\r
-        return workingSetService;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getGroupService()\r
+     * {@inheritDoc}\r
      */\r
     @Override\r
-    public IGroupService getGroupService() {\r
-        return groupService;\r
-    }\r
-\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getPermissionEvaluator()\r
-     */\r
-    public PermissionEvaluator getPermissionEvaluator() {\r
-        return permissionEvaluator;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
-     */\r
-    @Override\r
-    public TransactionStatus startTransaction() {\r
-        return startTransaction(false);\r
-    }\r
+    public IMetadataService getMetadataService() {\r
+        return this.metadataService;\r
+    }\r
+\r
+       @Override\r
+       public ITermService getTermService(){\r
+               return this.termService;\r
+       }\r
+\r
+       @Override\r
+       public ICommonService getCommonService(){\r
+               return this.commonService;\r
+       }\r
+\r
+       @Override\r
+       public ILocationService getLocationService(){\r
+               return this.locationService;\r
+       }\r
+\r
+       @Override\r
+       public IUserService getUserService(){\r
+               return this.userService;\r
+       }\r
+\r
+       @Override\r
+       public IGrantedAuthorityService getGrantedAuthorityService(){\r
+               return this.grantedAuthorityService;\r
+       }\r
+\r
+       @Override\r
+       public IService<CdmBase> getMainService(){\r
+               return this.mainService;\r
+       }\r
+\r
+       @Override\r
+       public PlatformTransactionManager getTransactionManager(){\r
+               return this.transactionManager;\r
+       }\r
+\r
+\r
+       @Autowired\r
+       public void setTransactionManager(PlatformTransactionManager transactionManager){\r
+               this.transactionManager = (HibernateTransactionManager) transactionManager;\r
+       }\r
+\r
+       @Override\r
+       public ProviderManager getAuthenticationManager(){\r
+               return this.authenticationManager;\r
+       }\r
+\r
+       @Override\r
+       public ConversationHolder NewConversation(){\r
+               // TODO make this a prototype\r
+               return new ConversationHolder(dataSource, sessionFactory, transactionManager);\r
+       }\r
+\r
+       @Override\r
+       public ICollectionService getCollectionService(){\r
+               return collectionService;\r
+       }\r
+\r
+       @Override\r
+       public IFeatureTreeService getFeatureTreeService(){\r
+               return featureTreeService;\r
+       }\r
+\r
+       @Override\r
+       public IFeatureNodeService getFeatureNodeService(){\r
+               return featureNodeService;\r
+       }\r
+\r
+       @Override\r
+       public IVocabularyService getVocabularyService(){\r
+               return vocabularyService;\r
+       }\r
+\r
+       @Override\r
+       public IIdentificationKeyService getIdentificationKeyService(){\r
+               return identificationKeyService;\r
+       }\r
+\r
+       @Override\r
+       public IPolytomousKeyService getPolytomousKeyService(){\r
+               return polytomousKeyService;\r
+       }\r
+\r
+\r
+       @Override\r
+       public IPolytomousKeyNodeService getPolytomousKeyNodeService(){\r
+               return polytomousKeyNodeService;\r
+       }\r
 \r
-\r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
+    /**\r
+     * {@inheritDoc}\r
      */\r
     @Override\r
-    public TransactionStatus startTransaction(Boolean readOnly) {\r
-\r
-        PlatformTransactionManager txManager = getTransactionManager();\r
-\r
-        DefaultTransactionDefinition defaultTxDef = new DefaultTransactionDefinition();\r
-        defaultTxDef.setReadOnly(readOnly);\r
-        TransactionDefinition txDef = defaultTxDef;\r
-\r
-        // Log some transaction-related debug information.\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("Transaction name = " + txDef.getName());\r
-            logger.debug("Transaction facets:");\r
-            logger.debug("Propagation behavior = " + txDef.getPropagationBehavior());\r
-            logger.debug("Isolation level = " + txDef.getIsolationLevel());\r
-            logger.debug("Timeout = " + txDef.getTimeout());\r
-            logger.debug("Read Only = " + txDef.isReadOnly());\r
-            // org.springframework.orm.hibernate4.HibernateTransactionManager\r
-            // provides more transaction/session-related debug information.\r
-        }\r
-\r
-        TransactionStatus txStatus = txManager.getTransaction(txDef);\r
-        return txStatus;\r
-    }\r
-\r
-\r
-    public void commitTransaction(TransactionStatus txStatus){\r
-        PlatformTransactionManager txManager = getTransactionManager();\r
-        txManager.commit(txStatus);\r
-        return;\r
-    }\r
-\r
-\r
-\r
+    public IProgressMonitorService getProgressMonitorService() {\r
+        return progressMonitorService;\r
+    }\r
+\r
+       @Override\r
+       public IWorkingSetService getWorkingSetService(){\r
+               return workingSetService;\r
+       }\r
+\r
+       @Override\r
+       public IGroupService getGroupService(){\r
+               return groupService;\r
+       }\r
+\r
+\r
+       @Override\r
+       public IEntityValidationService getEntityValidationService(){\r
+               return entityValidationService;\r
+       }\r
+\r
+\r
+       @Override\r
+       public IEntityConstraintViolationService getEntityConstraintViolationService(){\r
+               return entityConstraintViolationService;\r
+       }\r
+\r
+       @Override\r
+       public ICdmPermissionEvaluator getPermissionEvaluator(){\r
+               return permissionEvaluator;\r
+       }\r
+\r
+       @Override\r
+       public TransactionStatus startTransaction(){\r
+               return startTransaction(false);\r
+       }\r
+\r
+       @Override\r
+       public TransactionStatus startTransaction(Boolean readOnly){\r
+\r
+               PlatformTransactionManager txManager = getTransactionManager();\r
+\r
+               DefaultTransactionDefinition defaultTxDef = new DefaultTransactionDefinition();\r
+               defaultTxDef.setReadOnly(readOnly);\r
+               TransactionDefinition txDef = defaultTxDef;\r
+\r
+               // Log some transaction-related debug information.\r
+               if (logger.isDebugEnabled()) {\r
+                       logger.debug("Transaction name = " + txDef.getName());\r
+                       logger.debug("Transaction facets:");\r
+                       logger.debug("Propagation behavior = " + txDef.getPropagationBehavior());\r
+                       logger.debug("Isolation level = " + txDef.getIsolationLevel());\r
+                       logger.debug("Timeout = " + txDef.getTimeout());\r
+                       logger.debug("Read Only = " + txDef.isReadOnly());\r
+                       // org.springframework.orm.hibernate5.HibernateTransactionManager\r
+                       // provides more transaction/session-related debug information.\r
+               }\r
+\r
+               TransactionStatus txStatus = txManager.getTransaction(txDef);\r
+               return txStatus;\r
+       }\r
+\r
+\r
+       @Override\r
+       public void commitTransaction(TransactionStatus txStatus){\r
+               PlatformTransactionManager txManager = getTransactionManager();\r
+               txManager.commit(txStatus);\r
+               return;\r
+       }\r
+\r
+       @Override\r
+       public void authenticate(String username, String password){\r
+               UsernamePasswordAuthenticationToken tokenForUser = new UsernamePasswordAuthenticationToken(username, password);\r
+               Authentication authentication = this.getAuthenticationManager().authenticate(tokenForUser);\r
+               SecurityContext context = SecurityContextHolder.getContext();\r
+               context.setAuthentication(authentication);\r
+       }\r
 }\r