ref #3658 remove nomenclatural code from datasources
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 13 Oct 2016 12:26:33 +0000 (14:26 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 10 Nov 2016 12:50:43 +0000 (13:50 +0100)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacherConnectionProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceCredentialsWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceH2WizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceMySQLWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourcePostgreSQLServerWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewerComparator.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmRemoteSourceTest.java

index 0a5797a..097c3b4 100644 (file)
@@ -5,7 +5,6 @@ import javax.sql.DataSource;
 import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl;
 
 import eu.etaxonomy.cdm.database.CdmDataSource;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 
 /**
  * This is a very preliminary class to get the model cache running. Need to better understand how 
index 53f0775..9197d55 100644 (file)
@@ -29,10 +29,8 @@ import eu.etaxonomy.cdm.database.CdmDataSource;
 import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
 import eu.etaxonomy.cdm.database.DataSourceNotFoundException;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.taxeditor.model.MementoHelper;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
 import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
 import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
@@ -173,7 +171,7 @@ public class CdmDataSourceRepository{
         */
        public static ICdmDataSource createDefaultH2DataSource() {
            ICdmDataSource h2DataSource = CdmDataSource.NewH2EmbeddedInstance(
-                       DEFAULT_DATASOURCE_NAME, "sa", "", PreferencesUtil.getPreferredNomenclaturalCode(true));
+                       DEFAULT_DATASOURCE_NAME, "sa", "");
         save(h2DataSource.getName(), h2DataSource);
         return h2DataSource;
        }
@@ -186,15 +184,15 @@ public class CdmDataSourceRepository{
         */
        public static boolean setCurrentCdmSource(ICdmSource cdmSource) {
                currentCdmSource = cdmSource;
-               NomenclaturalCode dataSourceNomenclaturalCode = cdmSource.getNomenclaturalCode();
-               NomenclaturalCode applicationNomenclaturalCode = PreferencesUtil.getPreferredNomenclaturalCode(true);
-
-               if( dataSourceNomenclaturalCode != null && ! dataSourceNomenclaturalCode.equals(applicationNomenclaturalCode)){
-                       PreferencesUtil.setPreferredNomenclaturalCode(dataSourceNomenclaturalCode, true);
-                       MessagingUtils.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
-                                       "loaded has a different nomenclatural code than the one stored in Preferences. " +
-                                       "The nomenclatural code was changed in the application.");
-               }
+//             NomenclaturalCode dataSourceNomenclaturalCode = cdmSource.getNomenclaturalCode();
+//             NomenclaturalCode applicationNomenclaturalCode = PreferencesUtil.getPreferredNomenclaturalCode(true);
+//
+//             if( dataSourceNomenclaturalCode != null && ! dataSourceNomenclaturalCode.equals(applicationNomenclaturalCode)){
+//                     PreferencesUtil.setPreferredNomenclaturalCode(dataSourceNomenclaturalCode, true);
+//                     MessagingUtils.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
+//                                     "loaded has a different nomenclatural code than the one stored in Preferences. " +
+//                                     "The nomenclatural code was changed in the application.");
+//             }
                return true;
        }
 
index b225e77..f56cb22 100644 (file)
@@ -29,12 +29,8 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.database.CdmDataSource;
-import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
-import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 
 /**
@@ -54,7 +50,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
 
        protected Group authenticationGroup;
        protected Group locationGroup;
-       protected Group nomenclaturalCodeGroup;
 
        protected Composite composite;
 
@@ -65,8 +60,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
        protected String username;
        protected String password;
 
-       protected NomenclaturalCode nomenclaturalCode;
-
        CdmDataSourceWizard.Mode mode;
 
        /**
@@ -98,9 +91,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                }
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
     public void createControl(Composite parent) {
@@ -140,9 +130,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                // create the authentication input fields
                createAuthenticationForm();
 
-               // create nomenclatural code combo
-               createNomenclaturalCodeForm();
-
                // Create composite for buttons
                Composite buttonComposite = new Composite(composite, SWT.NONE);
                buttonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
@@ -157,9 +144,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
 
                // Test connection when button is pressed
                testButton.addSelectionListener(new SelectionAdapter() {
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                testDbConfiguration();
@@ -192,7 +176,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                text_databaseName = new Text(authenticationGroup, SWT.BORDER);
                text_databaseName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 
-
                // Create username label
                Label usernameLabel = new Label(authenticationGroup, SWT.NONE);
                usernameLabel.setText("User Name:");
@@ -201,7 +184,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                text_username = new Text(authenticationGroup, SWT.BORDER);
                text_username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 
-
                // Create password label
                Label passwordLabel = new Label(authenticationGroup, SWT.NONE);
                passwordLabel.setText("Password:");
@@ -251,31 +233,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                text_username.removeModifyListener(this);
                text_password.removeModifyListener(this);
        }
-       /**
-        * Create a radio button group to select a nomenclatural code from
-        */
-       private void createNomenclaturalCodeForm() {
-               nomenclaturalCodeGroup = new Group(composite , SWT.NONE);
-               nomenclaturalCodeGroup.setLayout(new GridLayout());
-
-               nomenclaturalCode = dataSource != null ? dataSource.getNomenclaturalCode() : PreferencesUtil.getPreferredNomenclaturalCode(true);
-
-               for (final NomenclaturalCode code : NomenclaturalCodeHelper.getSupportedCodes()) {
-                       Button button = new Button(nomenclaturalCodeGroup, SWT.RADIO);
-                       button.setText(NomenclaturalCodeHelper.getDescription(code));
-                       button.setData(code);
-                       if (nomenclaturalCode != null) {
-                               button.setSelection(nomenclaturalCode.equals(code));
-                       }
-                       button.addSelectionListener(new SelectionAdapter() {
-                               @Override
-                public void widgetSelected(SelectionEvent e) {
-                                       nomenclaturalCode = (NomenclaturalCode) e.widget.getData();
-                                       modifyText(null);
-                               }
-                       });
-               }
-       }
 
        public void testDbConfiguration(){
                testDbConfiguration(false);
@@ -345,9 +302,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                password = text_password.getText();
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.wizard.WizardPage#getNextPage()
-        */
        /** {@inheritDoc} */
        @Override
        public IWizardPage getNextPage() {
@@ -386,9 +340,6 @@ public abstract class CdmDataSourceCredentialsWizardPage extends WizardPage impl
                return name;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.swto.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
-        */
        /** {@inheritDoc} */
        @Override
     public void modifyText(ModifyEvent e) {
index 0d9ed6b..9fbb5ac 100644 (file)
@@ -18,7 +18,6 @@ import eu.etaxonomy.cdm.database.ICdmDataSource;
  *
  * @author n.hoffmann
  * @created 19.05.2009
- * @version 1.0
  */
 public class CdmDataSourceH2WizardPage extends CdmDataSourceCredentialsWizardPage {
        
@@ -44,27 +43,18 @@ public class CdmDataSourceH2WizardPage extends CdmDataSourceCredentialsWizardPag
                setTitle("Enter credentials for embedded H2 database");         
        }
        
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.CdmDataSourceCredentialsWizardPage#createDatabaseForm()
-        */
        /** {@inheritDoc} */
        @Override
        public void createDatabaseForm() {
                // no more fields needed for embedded H2
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.CdmDataSourceCredentialsWizardPage#updateLocation()
-        */
        /** {@inheritDoc} */
        @Override
        public void updateLocation() {
                // nothing to do, no location data provided
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#updateDataSource()
-        */
        /** {@inheritDoc} */
        @Override
        public void updateDataSource() {                
@@ -73,20 +63,15 @@ public class CdmDataSourceH2WizardPage extends CdmDataSourceCredentialsWizardPag
                if(dataSource == null) {
                        setDataSource(CdmDataSource.NewH2EmbeddedInstance(database, 
                                         username, 
-                                        password, 
-                                        nomenclaturalCode));
+                                        password));
                } else {
                        dataSource.setName(name);
                        dataSource.setDatabase(database);
                        dataSource.setUsername(username);
                        dataSource.setPassword(password);
-                       dataSource.setNomenclaturalCode(nomenclaturalCode);
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#checkPageComplete()
-        */
        /** {@inheritDoc} */
        @Override
        public void checkPageComplete() {
index 23d486b..2ca55cd 100644 (file)
@@ -26,7 +26,6 @@ import eu.etaxonomy.cdm.database.ICdmDataSource;
  *
  * @author n.hoffmann
  * @created 19.05.2009
- * @version 1.0
  */
 public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizardPage {
        
@@ -65,9 +64,6 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
 
        }
        
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.CdmDataSourceCredentialsWizardPage#createDatabaseForm()
-        */
        /** {@inheritDoc} */
        @Override
        public void createDatabaseForm() {
@@ -99,9 +95,6 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
                
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.CdmDataSourceCredentialsWizardPage#updateLocation()
-        */
        /** {@inheritDoc} */
        @Override
        public void updateLocation() {
@@ -116,9 +109,6 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#updateDataSource()
-        */
        /** {@inheritDoc} */
        @Override
        public void updateDataSource() {        
@@ -129,8 +119,7 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
                                        database,
                                        port,
                                        username,
-                                       password,
-                                       nomenclaturalCode));
+                                       password));
                } else {
                        dataSource.setName(name);
                        dataSource.setServer(server);
@@ -138,13 +127,9 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
                        dataSource.setPort(port);
                        dataSource.setUsername(username);
                        dataSource.setPassword(password);
-                       dataSource.setNomenclaturalCode(nomenclaturalCode);
                }
        }
        
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#checkPageComplete()
-        */
        /** {@inheritDoc} */
        @Override
        public void checkPageComplete() {
@@ -162,9 +147,6 @@ public class CdmDataSourceMySQLWizardPage extends CdmDataSourceCredentialsWizard
                super.checkPageComplete();
        }
        
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#init()
-        */
        /** {@inheritDoc} */
        @Override
        public void init() {
index c7f8435..0269bb0 100644 (file)
@@ -15,7 +15,6 @@ import eu.etaxonomy.cdm.database.ICdmDataSource;
 
 /**
  * @author n.hoffmann
- *
  */
 public class CdmDataSourcePostgreSQLServerWizardPage extends
                CdmDataSourceCredentialsWizardPage {
@@ -48,9 +47,6 @@ public class CdmDataSourcePostgreSQLServerWizardPage extends
 
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#createDatabaseForm()
-        */
        @Override
        public void createDatabaseForm() {
                // Create group composite for location data 
@@ -81,9 +77,6 @@ public class CdmDataSourcePostgreSQLServerWizardPage extends
                
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#updateLocation()
-        */
        @Override
        public void updateLocation() {
                server = text_server.getText();
@@ -97,9 +90,6 @@ public class CdmDataSourcePostgreSQLServerWizardPage extends
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#updateDataSource()
-        */
        @Override
        public void updateDataSource() {
 
@@ -111,8 +101,7 @@ public class CdmDataSourcePostgreSQLServerWizardPage extends
                                        database,
                                        port,
                                        username,
-                                       password, 
-                                       nomenclaturalCode));
+                                       password));
                } else {
                        dataSource.setName(name);
                        dataSource.setServer(server);
@@ -120,13 +109,9 @@ public class CdmDataSourcePostgreSQLServerWizardPage extends
                        dataSource.setPort(port);
                        dataSource.setUsername(username);
                        dataSource.setPassword(password);
-                       dataSource.setNomenclaturalCode(nomenclaturalCode);
                }
        }
        
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceCredentialsWizardPage#init()
-        */
        /** {@inheritDoc} */
        @Override
        public void init() {
index e367dd1..0a586c2 100644 (file)
@@ -26,14 +26,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  * @author n.hoffmann
  * @created 14.04.2009
- * @version 1.0
  */
 public class CdmDataSourceLabelProvider extends LabelProvider implements ITableLabelProvider {
        
-       /*
-        * (non-Javadoc)
-        * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
-        */
        /** {@inheritDoc} */
        public Image getColumnImage(Object element, int columnIndex) {
                if(columnIndex == 0){
@@ -47,10 +42,6 @@ public class CdmDataSourceLabelProvider extends LabelProvider implements ITableL
                return null;
        }
 
-       /*
-        * (non-Javadoc)
-        * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
-        */
        /** {@inheritDoc} */
        public String getColumnText(Object element, int columnIndex) {
                CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) element;
@@ -80,11 +71,7 @@ public class CdmDataSourceLabelProvider extends LabelProvider implements ITableL
                                } else {
                                        return DatabaseTypeEnum.MySQL.getName();
                                }
-                       case 6:
-                               if (dataSource.getNomenclaturalCode() == null) {
-                                       return "";
-                               }
-                               return dataSource.getNomenclaturalCode().name();
+                       //TODO 6 was nomenclatural code, do we need to change following numbers?
                        case 7:
                                return container.getMetaData(MetaDataPropertyName.DB_CREATE_DATE);
                        case 8:
index 3207029..d82b2ec 100644 (file)
@@ -57,27 +57,18 @@ public class CdmDataSourceViewPart extends ViewPart{
     private static final Logger logger = Logger.getLogger(CdmDataSourceViewPart.class);
 
        private class ContextListener extends ContextListenerAdapter{
-               /* (non-Javadoc)
-                * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
                        viewer.refresh();
                }
 
-               /* (non-Javadoc)
-                * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
                        viewer.refresh();
                }
 
-               /* (non-Javadoc)
-                * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                public void contextStart(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
@@ -97,9 +88,6 @@ public class CdmDataSourceViewPart extends ViewPart{
                        this.cdmSources = cdmSources;
                }
 
-               /* (non-Javadoc)
-                * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                public IStatus run(final IProgressMonitor monitor) {
                        try{
@@ -260,10 +248,6 @@ public class CdmDataSourceViewPart extends ViewPart{
                viewer.getControl().setFocus();
        }
 
-
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
-        */
        /** {@inheritDoc} */
        @Override
        public void showBusy(boolean busy) {
index caa811c..5cadc48 100644 (file)
@@ -16,12 +16,10 @@ import org.eclipse.jface.viewers.ViewerComparator;
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 
 /**
  * @author n.hoffmann
  * @created Dec 8, 2010
- * @version 1.0
  */
 public class CdmDataSourceViewerComparator extends ViewerComparator {
 
@@ -45,9 +43,6 @@ public class CdmDataSourceViewerComparator extends ViewerComparator {
                }
        }
        
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
-        */
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
                CdmMetaDataAwareDataSourceContainer d1 = (CdmMetaDataAwareDataSourceContainer) e1;
@@ -59,27 +54,20 @@ public class CdmDataSourceViewerComparator extends ViewerComparator {
                int result = 0;
                
                switch (propertyIndex) {
-                       case 10:
+                       case 9:
                                result = d1.getMetaData(MetaDataPropertyName.DB_CREATE_NOTE).compareTo(d2.getMetaData(MetaDataPropertyName.DB_CREATE_NOTE));
                                break;
-                       case 9:
+                       case 8:
                                // is compatible
                                break;  
-                       case 8:
-                               result = d1.getMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION).compareTo(d2.getMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION));
-                               break;
                        case 7:
-                               result = d1.getMetaData(MetaDataPropertyName.DB_CREATE_DATE).compareTo(d2.getMetaData(MetaDataPropertyName.DB_CREATE_DATE));
+                               result = d1.getMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION).compareTo(d2.getMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION));
                                break;
                        case 6:
-                               // is running
+                               result = d1.getMetaData(MetaDataPropertyName.DB_CREATE_DATE).compareTo(d2.getMetaData(MetaDataPropertyName.DB_CREATE_DATE));
                                break;
                        case 5:
-                               NomenclaturalCode code1 = d1.getCdmSource().getNomenclaturalCode();
-                               NomenclaturalCode code2 = d2.getCdmSource().getNomenclaturalCode();
-                               if (code1 != null && code2 != null) {
-                                       result = code1.compareTo(code2);
-                               }
+                               // is running
                                break;
                        case 4:
                                if(cs1 instanceof ICdmDataSource && cs2 instanceof ICdmDataSource) {
index 18dfb3b..734c919 100644 (file)
@@ -28,7 +28,6 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
 import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
 import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
 import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
@@ -66,7 +65,6 @@ public abstract class BaseRemotingTest extends ThreadedTest {
                     host,
                     httpPort,
                     contextPath,
-                    NomenclaturalCode.ICNAFP,
                     user,
                     password);
         } catch (Exception e) {
@@ -88,12 +86,12 @@ public abstract class BaseRemotingTest extends ThreadedTest {
     }
 
 
-    public static void initializeController(String sourceName, String host, int port, String contextPath, NomenclaturalCode ncode, String username, String password) {
+    public static void initializeController(String sourceName, String host, int port, String contextPath, String username, String password) {
 
         if(CdmApplicationState.getCurrentAppConfig() != null) {
             return;
         }
-        cdmRemoteSource = CdmRemoteSource.NewInstance(sourceName, host, port, contextPath, ncode);
+        cdmRemoteSource = CdmRemoteSource.NewInstance(sourceName, host, port, contextPath);
         CdmApplicationRemoteController remoteApplicationController =
                 CdmApplicationRemoteController.NewInstance(cdmRemoteSource,
                         null,
index 945d5c6..5aad2cd 100644 (file)
@@ -14,7 +14,6 @@ import org.junit.Test;
 import org.springframework.remoting.RemoteAccessException;
 
 import eu.etaxonomy.cdm.config.CdmSourceException;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.taxeditor.lazyloading.RemotePersistentCollectionTest;
 import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
 
@@ -29,8 +28,7 @@ public class CdmRemoteSourceTest extends BaseRemotingTest {
                CdmRemoteSource inactiveCrs = CdmRemoteSource.NewInstance(sourceName,
                        host,
                        808080,
-                       contextPath,
-                       NomenclaturalCode.ICNAFP);
+                       contextPath);
                try {
                        String dbSchemaVersion = inactiveCrs.getDbSchemaVersion();
                        Assert.fail("getDbSchemaVersion() on inactive cdm server should have thrown RemoteAccessException");
@@ -66,8 +64,7 @@ public class CdmRemoteSourceTest extends BaseRemotingTest {
                CdmRemoteSource activeCrs = CdmRemoteSource.NewInstance(sourceName,
                        host,
                        httpPort,
-                       contextPath,
-                NomenclaturalCode.ICNAFP);
+                       contextPath);
                String dbSchemaVersion = "";
                try {
                        dbSchemaVersion = activeCrs.getDbSchemaVersion();