reverting cdm application / controller refactoring and simply extending the CdmApplic...
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 13 Feb 2014 12:08:30 +0000 (12:08 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 13 Feb 2014 12:08:30 +0000 (12:08 +0000)
by throwing UnsupportedOperationException for methods that are not supported by remoting

16 files changed:
.gitattributes
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DerivedUnitEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/transientServices/TransientCdmRepository.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmApplicationRemoteConfiguration.java [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/httpInvokerServiceClients.xml
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remotingApplicationContext.xml
eu.etaxonomy.taxeditor.cdmlib/src/test/java/eu/etaxonomy/taxeditor/remoting/CdmApplicationRemoteControllerTest.java [deleted file]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/ExternalReferenceServiceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml

index 70efa9794554598e6f8cb0791eb65d75cec86324..34bc39866be0339f4ca42dd755f70dcfa19eb7d8 100644 (file)
@@ -334,8 +334,6 @@ eu.etaxonomy.taxeditor.cdmlib/lib/xstream-1.4.4.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/yjp-controller-api-redist-9.0.8.jar -text
 eu.etaxonomy.taxeditor.cdmlib/pom.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java -text
-eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmApplicationRemoteConfiguration.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/lazyloading/CdmLazyLoader.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java -text
@@ -344,7 +342,6 @@ eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/httpInvokerSer
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remotingApplicationContext.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_persistence_security.xml -text
 eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/remoting_services_security.xml -text
-eu.etaxonomy.taxeditor.cdmlib/src/test/java/eu/etaxonomy/taxeditor/remoting/CdmApplicationRemoteControllerTest.java -text
 eu.etaxonomy.taxeditor.cdmlib/src/test/java/eu/etaxonomy/taxeditor/remoting/RemoteLazyLoadingTest.java -text
 eu.etaxonomy.taxeditor.editor/.classpath -text
 eu.etaxonomy.taxeditor.editor/.project -text
index 9f227a4f6881b4a59f6af182042d6a84b9c2792e..f1f05d07dd3f3f246752166633e97af87f001a9f 100644 (file)
@@ -21,7 +21,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
 import eu.etaxonomy.cdm.ext.biocase.BioCaseQueryServiceWrapper;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
@@ -108,7 +108,7 @@ public class DerivedUnitEditorInput implements IEditorInput {
             InputStream resultStream = new BioCaseQueryServiceWrapper().query(query);
             Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
             TransientCdmRepository repo = 
-                       new TransientCdmRepository((ICdmApplicationDefaultConfiguration)CdmStore.getCurrentApplicationConfiguration());
+                       new TransientCdmRepository((ICdmApplicationConfiguration)CdmStore.getCurrentApplicationConfiguration());
             configurator.setCdmAppController(repo);
 
             CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
index 36cc5234578d40859de73acbbcb8b04c6a8ea99c..ff06e871fba12cdd0a01055c6134f562b3ca075b 100644 (file)
@@ -17,7 +17,7 @@ import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.TransactionStatus;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
@@ -53,9 +53,9 @@ import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator
  * @date 26.09.2013
  *
  */
-public class TransientCdmRepository implements ICdmApplicationDefaultConfiguration {
+public class TransientCdmRepository implements ICdmApplicationConfiguration {
 
-    private ICdmApplicationDefaultConfiguration defaultApplicationConfiguration;
+    private ICdmApplicationConfiguration defaultApplicationConfiguration;
     private TransientOccurenceService occurenceService;
 
     public List<SpecimenOrObservationBase> getUnits(){
@@ -65,7 +65,7 @@ public class TransientCdmRepository implements ICdmApplicationDefaultConfigurati
     /**
      * @param defaultApplicationConfiguration
      */
-    public TransientCdmRepository(ICdmApplicationDefaultConfiguration defaultApplicationConfiguration) {
+    public TransientCdmRepository(ICdmApplicationConfiguration defaultApplicationConfiguration) {
         this.defaultApplicationConfiguration = defaultApplicationConfiguration;
     }
 
index 02ee655b76a9c68cb12826a07b7997ec37f65dbe..d52adb42b09e7643999d276a9f2ba5a9f51feecc 100644 (file)
@@ -13,10 +13,13 @@ package eu.etaxonomy.cdm.api.application;
 import org.apache.log4j.Logger;\r
 import org.springframework.context.ApplicationContextAware;\r
 import org.springframework.stereotype.Component;\r
+import org.springframework.transaction.PlatformTransactionManager;\r
+import org.springframework.transaction.TransactionStatus;\r
 \r
 import eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration;\r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;\r
+import eu.etaxonomy.cdm.api.service.IDatabaseService;\r
 \r
 /**\r
  * @author a.mueller\r
@@ -28,13 +31,48 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
  * @author j.koch\r
  */\r
 @Component\r
-public class CdmApplicationRemoteConfiguration extends CdmApplicationConfiguration implements ICdmApplicationRemoteConfiguration, ApplicationContextAware {\r
+public class CdmApplicationRemoteConfiguration extends CdmApplicationDefaultConfiguration {\r
        \r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(CdmApplicationRemoteConfiguration.class);\r
 \r
        public CdmApplicationRemoteConfiguration() {\r
        }\r
+       \r
+       @Override\r
+       public IDatabaseService getDatabaseService() throws UnsupportedOperationException {\r
+               throw new UnsupportedOperationException("getDatabaseService is not implemented for CdmApplicationRemoteConfiguration");\r
+       }\r
+\r
+       \r
+    @Override\r
+    public PlatformTransactionManager getTransactionManager() throws UnsupportedOperationException {\r
+               throw new UnsupportedOperationException("getTransactionManager is not implemented for CdmApplicationRemoteConfiguration");\r
+       }\r
+\r
+\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
+     */\r
+    @Override\r
+    public TransactionStatus startTransaction() throws UnsupportedOperationException {\r
+               throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+       }\r
+\r
+\r
+    /* (non-Javadoc)\r
+     * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()\r
+     */\r
+    @Override\r
+    public TransactionStatus startTransaction(Boolean readOnly) throws UnsupportedOperationException {\r
+               throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+       }\r
+\r
+\r
+    @Override\r
+    public void commitTransaction(TransactionStatus txStatus) throws UnsupportedOperationException {\r
+               throw new UnsupportedOperationException("commitTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
+       }\r
                        \r
        @Override\r
        public ConversationHolder NewConversation() {\r
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java
deleted file mode 100644 (file)
index dd6b650..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-// $Id: CdmApplicationController.java 11680 2011-04-04 17:07:39Z a.mueller $\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
-\r
-package eu.etaxonomy.cdm.api.application;\r
-\r
-import java.util.UUID;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;\r
-import org.springframework.context.support.AbstractApplicationContext;\r
-import org.springframework.context.support.GenericApplicationContext;\r
-import org.springframework.core.io.ClassPathResource;\r
-import org.springframework.core.io.Resource;\r
-import org.springframework.security.access.PermissionEvaluator;\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.transaction.PlatformTransactionManager;\r
-//import org.springframework.transaction.PlatformTransactionManager;\r
-import org.springframework.transaction.TransactionStatus;\r
-\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.service.IAgentService;\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.IFeatureNodeService;\r
-import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
-import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;\r
-import eu.etaxonomy.cdm.api.service.IGroupService;\r
-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.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.IReferenceService;\r
-import eu.etaxonomy.cdm.api.service.IService;\r
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;\r
-import eu.etaxonomy.cdm.api.service.ITaxonService;\r
-import eu.etaxonomy.cdm.api.service.ITermService;\r
-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.common.monitor.IProgressMonitor;\r
-import eu.etaxonomy.cdm.common.monitor.NullProgressMonitor;\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
-import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @author j.koch\r
- *\r
- */\r
-public class CdmApplicationRemoteController  implements ICdmApplicationRemoteConfiguration {\r
-       private static final Logger logger = Logger.getLogger(CdmApplicationRemoteController.class);\r
-       \r
-       public static final String DEFAULT_APPLICATION_CONTEXT_RESOURCE = "/eu/etaxonomy/cdm/remotingApplicationContext.xml";\r
-       \r
-       public AbstractApplicationContext applicationContext;\r
-       private ICdmApplicationRemoteConfiguration configuration; \r
-       private Resource applicationContextResource;\r
-       private IProgressMonitor progressMonitor;\r
-       \r
-       /**\r
-        * Constructor, opens a spring ApplicationContext with defaults\r
-        */\r
-       public static CdmApplicationRemoteController NewInstance() {\r
-               logger.info("Configure CdmApplicationRemoteController with defaults");\r
-               return new CdmApplicationRemoteController(null, null);\r
-       }\r
-       \r
-       /**\r
-        * Constructor, opens a spring ApplicationContext with given application context\r
-        * @param applicationContextResource\r
-        */\r
-       public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource, IProgressMonitor progressMonitor) {\r
-               logger.info("Configure CdmApplicationRemoteController with given application context");\r
-               return new CdmApplicationRemoteController(applicationContextResource, progressMonitor);\r
-       }\r
-\r
-       /**\r
-        * Constructor, starts the application remote controller\r
-        * @param applicationContextResource\r
-        */\r
-       private CdmApplicationRemoteController(Resource applicationContextResource, IProgressMonitor progressMonitor){\r
-               logger.info("Start CdmApplicationRemoteController");\r
-               this.applicationContextResource = applicationContextResource != null ? applicationContextResource : new ClassPathResource(DEFAULT_APPLICATION_CONTEXT_RESOURCE);\r
-               this.progressMonitor = progressMonitor != null ? progressMonitor : new NullProgressMonitor();\r
-               setNewApplicationContext();\r
-       }\r
-               \r
-       /**\r
-        * Sets the application context to a new spring ApplicationContext and initializes the Controller\r
-        */\r
-       private boolean setNewApplicationContext(){\r
-               logger.info("Set new application context");\r
-               progressMonitor.beginTask("Start application context.", 6);\r
-               progressMonitor.worked(1);\r
-\r
-               GenericApplicationContext applicationContext =  new GenericApplicationContext();\r
-               \r
-               XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(applicationContext);\r
-               progressMonitor.subTask("Registering resources.");\r
-               xmlReader.loadBeanDefinitions(applicationContextResource);\r
-               progressMonitor.worked(1);\r
-                               \r
-               progressMonitor.subTask("This might take a while ...");\r
-               applicationContext.refresh();\r
-               applicationContext.start();\r
-               progressMonitor.worked(1);\r
-               \r
-               progressMonitor.subTask("Cleaning up.");\r
-               setApplicationContext(applicationContext);\r
-               progressMonitor.done();\r
-               return true;\r
-       }\r
-       \r
-       /**\r
-        * Tests if some DefinedTermsAreMissing.\r
-        * @return true, if at least one is missing, else false\r
-        */\r
-       public boolean testDefinedTermsAreMissing(){\r
-               UUID englishUuid = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");\r
-               DefinedTermBase<?> english = this.getTermService().find(englishUuid);\r
-               if ( english == null || ! english.getUuid().equals(englishUuid)){\r
-                       return true;\r
-               }else{\r
-                       return false;\r
-               }\r
-       }\r
-               \r
-       /**\r
-        * Sets a new application Context.\r
-        * @param ac\r
-        */\r
-       public void setApplicationContext(AbstractApplicationContext ac){\r
-               closeApplicationContext(); //closes old application context if necessary\r
-               applicationContext = ac;\r
-               applicationContext.registerShutdownHook();\r
-               init();\r
-       }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see java.lang.Object#finalize()\r
-        */\r
-       public void finalize(){\r
-               close();\r
-       }\r
-       \r
-       /**\r
-        * closes the application\r
-        */\r
-       public void close(){\r
-               closeApplicationContext();\r
-       }\r
-       \r
-       /**\r
-        * closes the application context\r
-        */\r
-       private void closeApplicationContext(){\r
-               if (applicationContext != null){\r
-                       logger.info("Close ApplicationContext");\r
-                       applicationContext.close();\r
-               }\r
-       }\r
-       \r
-       private void init(){\r
-               logger.info("Init " +  this.getClass().getName() + " ... ");\r
-               //if (logger.isInfoEnabled()){\r
-                       for (String beanName : applicationContext.getBeanDefinitionNames()){ \r
-                               logger.debug(beanName);}\r
-               //}\r
-               //TODO delete next row (was just for testing)\r
-               //if (logger.isInfoEnabled()){\r
-                       logger.info("Registered Beans: ");\r
-                       String[] beanNames = applicationContext.getBeanDefinitionNames();\r
-                       for (String beanName : beanNames){\r
-                               logger.info(beanName);\r
-                       }\r
-               //}\r
-               //configuration = new CdmApplicationRemoteConfiguration();\r
-               configuration = (ICdmApplicationRemoteConfiguration) applicationContext.getBean("cdmApplicationRemoteConfiguration");\r
-       }\r
-       \r
-    \r
-\r
-       /* ******  Services *********/\r
-       \r
-       public final INameService getNameService(){\r
-               return configuration.getNameService();\r
-       }\r
-\r
-       public final ITaxonService getTaxonService(){\r
-               return configuration.getTaxonService();\r
-       }\r
-       \r
-       public final IClassificationService getClassificationService(){\r
-               return configuration.getClassificationService();\r
-       }\r
-       \r
-       public final ITaxonNodeService getTaxonNodeService(){\r
-               return configuration.getTaxonNodeService();\r
-       }\r
-\r
-       public final IReferenceService getReferenceService(){\r
-               return configuration.getReferenceService();\r
-       }\r
-       \r
-       public final IAgentService getAgentService(){\r
-               return configuration.getAgentService();\r
-       }\r
-               \r
-       public final ITermService getTermService(){\r
-               return configuration.getTermService();\r
-       }\r
-\r
-       public final IDescriptionService getDescriptionService(){\r
-               return configuration.getDescriptionService();\r
-       }\r
-       \r
-       public final IOccurrenceService getOccurrenceService(){\r
-               return configuration.getOccurrenceService();\r
-       }\r
-\r
-       public final IMediaService getMediaService(){\r
-               return configuration.getMediaService();\r
-       }\r
-\r
-       public final ICommonService getCommonService(){\r
-               return configuration.getCommonService();\r
-       }\r
-       \r
-       public final ILocationService getLocationService(){\r
-               return configuration.getLocationService();\r
-       }\r
-       \r
-       public final IUserService getUserService(){\r
-               return configuration.getUserService();\r
-       }\r
-\r
-       public IGroupService getGroupService() {\r
-               return configuration.getGroupService();\r
-       }\r
-       \r
-       public final ICollectionService getCollectionService(){\r
-               return configuration.getCollectionService();\r
-       }\r
-       \r
-       public final IFeatureTreeService getFeatureTreeService(){\r
-               return configuration.getFeatureTreeService();\r
-       }\r
-       \r
-       public final IFeatureNodeService getFeatureNodeService(){\r
-               return configuration.getFeatureNodeService();\r
-       }\r
-       \r
-       public final IVocabularyService getVocabularyService(){\r
-               return configuration.getVocabularyService();\r
-       }\r
-       \r
-       public final IIdentificationKeyService getIdentificationKeyService(){\r
-               return configuration.getIdentificationKeyService();\r
-       }\r
-\r
-       public final IPolytomousKeyService getPolytomousKeyService(){\r
-               return configuration.getPolytomousKeyService();\r
-       }\r
-\r
-       public final IPolytomousKeyNodeService getPolytomousKeyNodeService(){\r
-               return configuration.getPolytomousKeyNodeService();\r
-       }\r
-       \r
-       public final IService<CdmBase> getMainService(){\r
-               return configuration.getMainService();\r
-       }\r
-       \r
-       public final IWorkingSetService getWorkingSetService(){\r
-               return configuration.getWorkingSetService();\r
-       }\r
-\r
-\r
-       @Override\r
-       public ProviderManager getAuthenticationManager() {\r
-               return configuration.getAuthenticationManager();\r
-       }\r
-\r
-\r
-\r
-       @Override\r
-       public ConversationHolder NewConversation() {\r
-               return configuration.NewConversation();\r
-       }\r
-\r
-       @Override\r
-       public Object getBean(String name) {\r
-               return configuration.getBean(name);\r
-       }\r
-\r
-       @Override\r
-       public IGrantedAuthorityService getGrantedAuthorityService() {\r
-               return configuration.getGrantedAuthorityService();\r
-       }\r
-\r
-       @Override\r
-       public ICdmPermissionEvaluator getPermissionEvaluator() {\r
-               return configuration.getPermissionEvaluator();\r
-       }\r
-\r
-       @Override\r
-       public void authenticate(String username, String password) {\r
-               configuration.authenticate(username, password);\r
-               \r
-       }\r
-\r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmApplicationRemoteConfiguration.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/ICdmApplicationRemoteConfiguration.java
deleted file mode 100644 (file)
index 576156f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package eu.etaxonomy.cdm.api.application;
-
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-
-
-public interface ICdmApplicationRemoteConfiguration extends ICdmApplicationConfiguration {
-       
-  
-}
index 3c548e32972cc2621e3a3501488c1cb0fcaa41a7..80c6994f82c4c539d69265d924de94ee517a6852 100644 (file)
@@ -7,6 +7,11 @@
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd\r
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">\r
 \r
+       <bean id="propertyConfigurer"\r
+               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
+               <property name="location" value="/eu/etaxonomy/cdm/config.properties" />\r
+       </bean>\r
+       \r
    <bean id="agentService"\r
                class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
                <property name="serviceUrl">\r
                </property>\r
        </bean>\r
 \r
-       <bean id="propertyConfigurer"\r
-               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
-               <property name="location" value="/eu/etaxonomy/cdm/config.properties" />\r
-       </bean>\r
+\r
 \r
 </beans>\r
index 3d3aa428c1511847add4f4d04899dab0000326f9..2793ca621a65f4888089fe21ee93e5d0080dac79 100644 (file)
 \r
        <import resource="classpath:/eu/etaxonomy/cdm/httpInvokerServiceClients.xml"/>\r
  \r
-       <context:component-scan base-package="eu/etaxonomy/cdm/api/application">\r
-               <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.api\.application\.CdmApplicationDefaultController"/>
-               <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.api\.application\.CdmApplicationDefaultConfiguration"/>
-       </context:component-scan>\r
-\r
+    <bean name="cdmApplicationDefaultConfiguration" class="eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration"/>\r
 \r
        <!-- EditGeoService was moved to ext. Therefore it will not be found by the default component scan.
        We added it here because the Editor needs it. However, this is only a temporary solution.
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/test/java/eu/etaxonomy/taxeditor/remoting/CdmApplicationRemoteControllerTest.java b/eu.etaxonomy.taxeditor.cdmlib/src/test/java/eu/etaxonomy/taxeditor/remoting/CdmApplicationRemoteControllerTest.java
deleted file mode 100644 (file)
index e8c04f4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package eu.etaxonomy.taxeditor.remoting;
-
-import org.junit.Test;
-
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
-
-public class CdmApplicationRemoteControllerTest {
-       
-       @Test
-       public void InitializeTest() {
-               CdmApplicationRemoteController carc = CdmApplicationRemoteController.NewInstance();
-       }
-
-}
index a4b2e90073f414ab9ac0ff062996960d7b5f64ba..680e1ab39e9bd7eb6ac101022cc823c866d3e97a 100644 (file)
@@ -21,7 +21,7 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.jdom.Element;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
@@ -56,7 +56,7 @@ public class GeneratePdfHandler extends AbstractHandler {
                        return null;
                }
                
-               configurator = PublishConfigurator.NewLocalInstance((ICdmApplicationDefaultConfiguration) CdmStore.getCurrentApplicationConfiguration());
+               configurator = PublishConfigurator.NewLocalInstance((ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration());
                
                Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInput) input);
                configurator.addSelectedTaxonNodeElements(taxonNodeElement);
index ad5259573e421ef4d515fa4ceef2c4b4d85d2162..b6e69ec3b3a4d3f38fe2c79823f4c331c99d3457 100644 (file)
@@ -39,7 +39,7 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Text;
 import org.jdom.Element;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.XMLHelper;
@@ -180,7 +180,7 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                
                text_serviceUrl.setEnabled(false);
                
-               setConfigurator(PublishConfigurator.NewLocalInstance((ICdmApplicationDefaultConfiguration) CdmStore.getCurrentApplicationConfiguration()));
+               setConfigurator(PublishConfigurator.NewLocalInstance((ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration()));
                getConfigurator().addOutputModule(getOutputModule());
                refresh();
        }
index c88f26a3c57707963f9717ff8ac4eee51928cd1b..580fb725d08f4f9179c3333875c489872bac068a 100644 (file)
@@ -19,7 +19,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.io.common.CdmDefaultExport;
 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
@@ -104,7 +104,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                                CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<IExportConfigurator>();
                                configurator.setProgressMonitor(CdmProgressMonitorAdapter
                                                .CreateSubMonitor(monitor, 80));
-                               exporter.setCdmAppController((ICdmApplicationDefaultConfiguration) applicationConfiguration);
+                               exporter.setCdmAppController((ICdmApplicationConfiguration) applicationConfiguration);
                                monitor.worked(10);
 
                                try {
index 0657e286cadbbf465eb3e60aeabf43dc37e5f78d..1496227b9d70427b3aaf552910857671a2b516ac 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
@@ -91,7 +91,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                                monitor.worked(5);
 
                                CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>();
-                               importer.setCdmAppController((ICdmApplicationDefaultConfiguration) applicationConfiguration);
+                               importer.setCdmAppController((ICdmApplicationConfiguration) applicationConfiguration);
                                monitor.worked(5);
 
                                try {
index 2cc374c0c0e76fc127b3c47726168b01bf5b9942..0d04637b3bc88534c627a87ffe2979ad31762288 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationDefaultConfiguration;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.ext.ipni.IIpniService;
 import eu.etaxonomy.cdm.ext.ipni.IpniService;
@@ -132,7 +132,7 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
        @Override
        public void widgetSelected(SelectionEvent e) {
                String query = text_query.getText();
-               List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationDefaultConfiguration) CdmStore.getCurrentApplicationConfiguration(), null);
+               List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration(), null);
                viewer.setInput(publications);
        }
 
index b964e56df4583636d8e9b4cb76e0f1ede8209f16..695456eca032d64ac745f1b5a30112ca32668d84 100644 (file)
@@ -20,14 +20,13 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.Resource;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationDefaultController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
@@ -92,14 +91,14 @@ class CdmStoreConnector extends Job {
                                        .CreateSubMonitor(monitor, 7);
                        // This is where we instantiate the application controller
                        try {
-                               //FIXME:Remoting change this to toggle remoting
+                               
                                applicationController = 
-                                               CdmApplicationDefaultController.NewInstance(applicationContextBean, 
+                                               CdmApplicationController.NewInstance(applicationContextBean, 
                                                                dataSource, 
                                                                dbSchemaValidation,
                                                                false, 
                                                                subprogressMonitor);
-                               //applicationController = CdmApplicationRemoteController.NewInstance();
+                       
                        } catch (Exception e) {
                                if(! causeIsCancelationExceptionRecursive(e)){
                                        return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + dataSource.getName(), e);
index 01a1d00df79f25e211de00778263cae69efc7876..2a879672fd11d97b76afc4ff25b2566dfedd147c 100644 (file)
@@ -9,12 +9,12 @@
 \r
   <!-- Default application context and term initializer -->\r
   <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/>
-   <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
+  <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
     <property name="omit" value="false" />
   </bean>
   \r
   <!-- Remote application context and term initializer -->\r
-<!--  <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/>-->
+  <!-- <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/> -->
 <!--  <bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer"/>-->
   \r
     \r