merging from trunk
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 11 Apr 2013 14:44:57 +0000 (14:44 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 11 Apr 2013 14:44:57 +0000 (14:44 +0000)
26 files changed:
.gitattributes
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeAcceptedTaxonToSynonymHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultLabelProvider.java
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/icons/orphaned.gif [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/CdmAuthorityTableDropTargetListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java [new file with mode: 0644]

index 0da7b50588e80a4be18fe83e0516dd17469dc8e1..23bcf1e9d8693e34158667413c6d2b81db73a830 100644 (file)
@@ -354,6 +354,9 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonE
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/ViewerConfiguration.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SaveAllHandler.java -text
@@ -852,6 +855,7 @@ eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigatio
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodePropertyTester.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java -text
@@ -996,6 +1000,7 @@ eu.etaxonomy.taxeditor.store/icons/new_child.gif -text
 eu.etaxonomy.taxeditor.store/icons/newprj_wiz.gif -text
 eu.etaxonomy.taxeditor.store/icons/nominval_nud_no_bg.gif -text
 eu.etaxonomy.taxeditor.store/icons/open.gif -text
+eu.etaxonomy.taxeditor.store/icons/orphaned.gif -text
 eu.etaxonomy.taxeditor.store/icons/orthovariant.gif -text
 eu.etaxonomy.taxeditor.store/icons/orthovariant_no_bg.gif -text
 eu.etaxonomy.taxeditor.store/icons/pic_not_found.PNG -text
@@ -1060,6 +1065,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wiz
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceSQLServerWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceTypeSelectionWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceWizard.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/CdmAuthorityTableDropTargetListener.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ISecuredEditor.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/UsageTermCollection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java -text
@@ -1295,6 +1302,11 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Tex
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ToggleableTextElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/IOpenUrlEnabled.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlContentProvider.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlLabelProvider.java -text
index 378729b3541c080a2db6257680d886c29f9c2e3a..7c59ac5871bfba47eea27db5162f4a0b6a7145a7 100644 (file)
@@ -12,10 +12,13 @@ package eu.etaxonomy.taxeditor.bulkeditor.command;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 
+import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
 
 /**
  * <p>BulkEditorPropertyTester class.</p>
@@ -28,6 +31,7 @@ public class BulkEditorPropertyTester extends PropertyTester {
        private static final Logger logger = Logger
                        .getLogger(BulkEditorPropertyTester.class);
 
+       private static final String GROUP = "isGroup";
        /* (non-Javadoc)
         * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
         */
@@ -35,11 +39,15 @@ public class BulkEditorPropertyTester extends PropertyTester {
        public boolean test(Object receiver, String property, Object[] args,
                        Object expectedValue) {
                BulkEditor bulkEditor = (BulkEditor) receiver;
+                       
                if ("isMergingEnabled".equals(property)) {                      
                        IEditorInput input = bulkEditor.getEditorInput();
                        if (input instanceof AbstractBulkEditorInput) {
                                return ((AbstractBulkEditorInput) input).isMergingEnabled();
-                       }
+                       }                       
+               }
+               if(GROUP.equals(property)){
+                       return isGroup(bulkEditor);
                }
 //             if (("isPublishFlagEditingEnabled").equals(property)) {
 //                     IEditorInput input = bulkEditor.getEditorInput();
@@ -49,4 +57,9 @@ public class BulkEditorPropertyTester extends PropertyTester {
 //             }
                return false;
        }
+       
+       private boolean isGroup(BulkEditor bulkEditor) {
+               IEditorInput input = bulkEditor.getEditorInput();
+               return (input instanceof GroupEditorInput) ? true : false;
+       }
 }
index 50630f4aab8d218fc93db9328a5e2a8a958b8306..c2d0d4d3059b6e0cfc728f39a919c323e7f7a460 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.7-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.3-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-3.9.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/poi-3.9-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>\r
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT.jar"/>\r
-       <classpathentry kind="output" path="bin"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/opencsv-1.8.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/poi-3.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>
+       <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index 47c71a35fec927c5c61d598491c49e6ebac23fe0..dece78af052770ff988dbacbeac255f72a3ed6ec 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.key.polytomous.list"
             name="Polytomous Key List Editor">
       </editor>
+      <editor
+            class="eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor"
+            default="false"
+            id="eu.etaxonomy.taxeditor.editor.group.authority"
+            name="Cdm Authority Editor">
+      </editor>
    </extension>
       <extension
             point="org.eclipse.ui.views">
                commandId="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
                label="Change Accepted Taxon to Synonym"
                style="push">
-            <visibleWhen
+            <!--visibleWhen
                   checkEnabled="true">
                <reference
                      definitionId="isAcceptedAndHasNoHomotypicSynonyms">
                </reference>
-            </visibleWhen>
+            </visibleWhen-->
          </command>
          <menu
                label="Change To">
                style="push">
          </command>
       </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:#BulkEditorContext?before=taxeditor-bulkeditor.separator1">
+         <command
+               commandId="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
+               label="Edit Authorities"
+               style="push">
+            <visibleWhen>
+               <reference
+                     definitionId="isGroup">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
             name="Open Related Concept">
       </command>
+      <category
+            id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
+            name="-- Group">
+      </category>
+      <command
+            categoryId="eu.etaxonomy.taxeditor.bulkeditor.group.category"
+            defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
+            id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
+            name="Edit CDM Authorities">
+      </command>
    </extension>
    <extension
          point="org.eclipse.core.expressions.definitions">
             </test>
          </with>
       </definition>
+      <definition
+            id="isGroup">
+         <with
+               variable="activeEditor">
+            <test
+                  property="taxeditor-bulkeditor.propertyTester.isGroup">
+            </test>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
             properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery"
             type="org.eclipse.jface.viewers.TreeSelection">
       </propertyTester>
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"
+            id="taxeditor-bulkeditor.PropertyTester"
+            namespace="taxeditor-bulkeditor.propertyTester"
+            properties="isGroup"
+            type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
+      </propertyTester>
    </extension>
    <extension
          point="org.eclipse.ui.bindings">   
index 222bf2c60890352ea1fd390835eceeafa3645e9a..df7875ca6d99b8a571f90d0ba61dd54934d3e66a 100644 (file)
@@ -26,6 +26,8 @@ import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
@@ -73,6 +75,11 @@ public class EditorUtil extends AbstractUtility {
                        throws PartInitException {
                open(input, KeyEditor.ID);
        }
+       
+       public static void open(CdmAuthorityEditorInput input)
+                       throws PartInitException {
+               open(input, CdmAuthorityEditor.ID);
+       }
 
        /**
         * Taxon Editors may be opened by supplying a taxon node uuid. Session gets
@@ -317,4 +324,10 @@ public class EditorUtil extends AbstractUtility {
                                .NewInstance(polytomousKeyUuid);
                open(input);
        }
+       
+       public static void openCdmAuthorities(UUID groupUuid)
+                       throws Exception {
+               CdmAuthorityEditorInput input = CdmAuthorityEditorInput.NewInstance(groupUuid);
+               open(input);
+       }
 }
index 65403941dd6a7d7ba04c7f491a9fc887098e7607..6db78f03df6db3863012bada0fca6d41e774b62c 100644 (file)
@@ -108,8 +108,10 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        TaxonEditorInput input = null;
        
        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
-       
-       if(taxonBase.isInstanceOf(Taxon.class)){
+       if(taxonBase.isOrphaned()) {
+               EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
+       }
+       else if(taxonBase.isInstanceOf(Taxon.class)){
                Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
                
                if (taxon.isMisapplication()){
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java
new file mode 100644 (file)
index 0000000..0d95276
--- /dev/null
@@ -0,0 +1,168 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.group.authority;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.swt.layout.FillLayout;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeViewer;
+
+/**
+ * Editor responsible for editing authorities related to a particular {@link Group} entity.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityEditor extends EditorPart implements IConversationEnabled, IDirtyMarkableSelectionProvider {
+
+       public static final String ID = "eu.etaxonomy.taxeditor.editor.group.authority"; //$NON-NLS-1$
+
+       private boolean dirty;
+       private ConversationHolder conversation;
+       private CdmAuthorityCompositeViewer viewer;
+       
+       public CdmAuthorityEditor() {                   
+               
+       }
+
+       /**
+        * Create contents of the editor part.
+        * @param parent
+        */
+       @Override
+       public void createPartControl(Composite parent) {
+               Composite container = new Composite(parent, SWT.NONE);
+               container.setLayout(new FillLayout(SWT.HORIZONTAL));
+               
+               this.viewer = new CdmAuthorityCompositeViewer(container, this,((CdmAuthorityEditorInput) getEditorInput()).getGroup());
+
+               conversation = ((CdmAuthorityEditorInput) getEditorInput()).getConversationHolder();
+               setPartName(getEditorInput().getName());                        
+
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+        */
+       @Override
+       public void setFocus() {
+       
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+        */
+       @Override
+       public void doSave(IProgressMonitor monitor) {
+               try {
+                       monitor.beginTask("Saving CDM Authority Editor", 1);
+                       getConversationHolder().commit(true);                   
+                       dirty = false;
+                       firePropertyChange(PROP_DIRTY);
+                       monitor.worked(1);
+               } finally {
+                       monitor.done();
+                       viewer.save();
+               }
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+        */
+       @Override
+       public void doSaveAs() {
+               // Do the Save As operation
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+        */
+       @Override
+       public void init(IEditorSite site, IEditorInput input)
+                       throws PartInitException {
+               setSite(site);
+               setInput(input);
+       }       
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.EditorPart#isDirty()
+        */
+       @Override
+       public boolean isDirty() {
+               return dirty;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+        */
+       @Override
+       public boolean isSaveAsAllowed() {
+               return false;
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+        */
+       @Override
+       public void update(CdmDataChangeMap changeEvents) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(java.lang.Object)
+        */
+       @Override
+       public void changed(Object element) {
+               //FIXME : should be optimised to split changes into adding / removing authorities 
+               //        vs updating authorites
+               dirty=true;
+               firePropertyChange(PROP_DIRTY);
+               // if the change has happened on the group then refresh the table
+               if(element instanceof Group) {
+                       
+                       //FIXME: activating (setting focus) on the editor happens on every change
+                       //       This should be changed to only when the drop is successful
+                       getSite().getPage().activate(this);
+               }
+               
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+        */
+       @Override
+       public ConversationHolder getConversationHolder() {
+               return conversation;
+       }
+       
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
+        */
+       @Override
+       public void dispose() {
+               conversation.unregisterForDataStoreChanges(this);
+               conversation.close();
+               super.dispose();
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java
new file mode 100644 (file)
index 0000000..0e2553a
--- /dev/null
@@ -0,0 +1,141 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.group.authority;
+
+import java.util.UUID;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Editor input for the {@link CdmAuthorityEditor}.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabled {
+       private ConversationHolder conversation;
+       private Group group;
+       
+       protected CdmAuthorityEditorInput(ConversationHolder conversation, Group group) {
+               this.conversation = conversation;
+               this.group = group;
+               
+       }
+       
+       /**
+        * Creates a new instance of the input for a given group.
+        * 
+        * @param groupUuid
+        * @return
+        * @throws Exception
+        */
+       public static CdmAuthorityEditorInput NewInstance(UUID groupUuid) throws Exception{
+               ConversationHolder conversation = CdmStore.createConversation();
+               Group group = CdmStore.getService(IGroupService.class).load(groupUuid, null);                   
+               return new CdmAuthorityEditorInput(conversation, group);
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+        */
+       @Override
+       public Object getAdapter(Class adapter) {
+               if (adapter == Group.class) {
+                       return this.group;
+               }               
+               
+               return null;
+       }
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+        */
+       @Override
+       public void update(CdmDataChangeMap changeEvents) {
+               // TODO Auto-generated method stub
+               
+       }
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+        */
+       @Override
+       public ConversationHolder getConversationHolder() {
+               return this.conversation;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#exists()
+        */
+       @Override
+       public boolean exists() {
+               return group != null;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+        */
+       @Override
+       public ImageDescriptor getImageDescriptor() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#getName()
+        */
+       @Override
+       public String getName() {
+               return group.getName();
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#getPersistable()
+        */
+       @Override
+       public IPersistableElement getPersistable() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#getToolTipText()
+        */
+       @Override
+       public String getToolTipText() {
+               return getName();
+       }       
+       
+       /* (non-Javadoc)
+        * @see java.lang.Object#equals(java.lang.Object)
+        */
+       @Override
+       public boolean equals(Object object) {
+               if (object instanceof CdmAuthorityEditorInput
+                               && getGroup() != null
+                               && getGroup().equals(((CdmAuthorityEditorInput) object).getGroup())
+               ){
+                       return true;
+               }
+               return super.equals(object);
+       }
+       
+       /**
+        * Getter method for group member.
+        * 
+        * @return
+        */
+       public Group getGroup() {
+               return this.group;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java
new file mode 100644 (file)
index 0000000..3d1940a
--- /dev/null
@@ -0,0 +1,88 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.group.authority.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
+import eu.etaxonomy.taxeditor.model.LineSelection;
+
+
+/**
+ * Handler which opens an instance of the {@link CdmAuthorityEditor} for a particluar group.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class EditCdmAuthoritiesHandler  extends AbstractHandler {
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       @Override
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               BulkEditor editor = (BulkEditor) EditorUtil.getActiveEditor();
+               
+               ISelection selection = editor.getSite().getSelectionProvider().getSelection(); 
+               if(selection instanceof LineSelection){
+                  
+                       final LineSelection lineSelection = (LineSelection) selection;
+                       
+                       Job job = new Job("Opening Cdm Authorities"){
+
+                               @Override
+                               protected IStatus run(IProgressMonitor monitor) {
+                                       monitor.beginTask("Opening Cdm Authorities", lineSelection.size());
+                                       
+                                       for(final Object selectedObject : lineSelection.toArray()){
+                                               if(selectedObject instanceof Group){
+                                                       
+                                                       Display.getDefault().asyncExec(new Runnable(){
+
+                                                               @Override
+                                                               public void run() {                                                                 
+                                                                       try {
+                                                                               EditorUtil.openCdmAuthorities(((Group)selectedObject).getUuid());
+                                                                       } catch (Exception e) {
+                                                                               EditorUtil.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
+                                                                       }
+                                                               }
+                                                               
+                                                       });
+                                                       monitor.worked(1);
+                                               }
+                                       }
+                                       monitor.done();
+                                       return Status.OK_STATUS;
+                               }
+                               
+                       };
+                       
+                       job.setPriority(Job.SHORT);
+                       job.schedule();                 
+                       
+               }
+               return null;
+       }
+
+}
+
index 5fbed53059c8fd4d0dacf2bd8d805cad3f200091..e67171560099bf670e115849a818eab07ecaeb84 100644 (file)
@@ -9,6 +9,7 @@
 
 package eu.etaxonomy.taxeditor.editor.name.container;
 
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -454,8 +455,25 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                return enableFreetext;
        }
 
+       /**
+        * Checks whether there are more than one, non-orphaned taxon bases   
+        * attached to the taxon name
+        * 
+        * @return
+        */
        private boolean isNameUsedMultipleTimes() {
-               if (getName().getTaxonBases().size() > 1) {
+               
+               Set<TaxonBase> taxonBases = getName().getTaxonBases();
+               Iterator<TaxonBase> tbItr = taxonBases.iterator();
+               int nonOrphanedTaxonBaseCount = taxonBases.size();
+               
+               while(tbItr.hasNext()) {
+                       TaxonBase tb = tbItr.next(); 
+                       if(tb.isOrphaned()) {
+                               nonOrphanedTaxonBaseCount--;
+                       }
+               }
+               if(nonOrphanedTaxonBaseCount > 1) {
                        return true;
                }
                return false;
index a3d7e894c031c79ef805c3731335a5f8117146be..b12451058fc564976a9af67ae16065fc7970c12a 100644 (file)
@@ -57,7 +57,12 @@ public class ChangeAcceptedTaxonToSynonymHandler extends AbstractHandler
                // Choose new accepted taxon    
                List<UUID> excludeTaxa = new ArrayList<UUID>();
                excludeTaxa.add(oldAcceptedTaxonNode.getUuid());
-               TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Choose the accepted taxon", excludeTaxa, null, null);
+               TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), 
+                               editor.getConversationHolder(), 
+                               "Choose the accepted taxon", 
+                               excludeTaxa, 
+                               null, 
+                               oldAcceptedTaxonNode.getClassification());                      
 
                if (newAcceptedTaxonNode == null) {
                        return null;
index de323cf1343571111dc70bb9de1fbc3f1742af33..fa39cab531a7475977055a068e3e35e49c88d1bb 100644 (file)
@@ -79,6 +79,7 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                        newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, taxon, true, true, null, null);
                } catch (HomotypicalGroupChangeException e) {
                        EditorUtil.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
+                       return postExecute(null);
                }
                monitor.worked(20);
                
index aae8baea7bdaf2c1ed1d6b4fe85c674f333474f8..ea92e5a527891636011a7ab62a21cc5f42ccc407 100644 (file)
             </property>
          </options>
       </viewer-->
+      <dragAssistant
+               class="eu.etaxonomy.taxeditor.navigation.navigator.dnd.TaxonNavigatorDragAdapterAssistant"
+               viewerId="eu.etaxonomy.taxeditor.navigation.navigator">
+      </dragAssistant>
    </extension>
    <extension
          point="org.eclipse.ui.navigator.linkHelper">
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java
new file mode 100644 (file)
index 0000000..34ed650
--- /dev/null
@@ -0,0 +1,41 @@
+package eu.etaxonomy.taxeditor.navigation.navigator.dnd;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.ui.navigator.CommonDragAdapterAssistant;
+
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+
+public class TaxonNavigatorDragAdapterAssistant extends
+               CommonDragAdapterAssistant {
+
+       @Override
+       public Transfer[] getSupportedTransferTypes() {
+               return new Transfer[] { TaxonNodeTransfer.getInstance() };
+       }
+
+       @Override
+       public boolean setDragData(DragSourceEvent event,
+                       IStructuredSelection selection) {
+               boolean setDataSuccess = false;
+               List<TaxonNode> taxonNodes = new ArrayList<TaxonNode>();
+               for (Object object : selection.toList()){
+                       if(object instanceof TaxonNode){
+                               taxonNodes.add(((TaxonNode) object));
+                               setDataSuccess = true;
+                       }
+                       
+               }
+               if (TaxonNodeTransfer.getInstance().isSupportedType(
+                               event.dataType)) {
+                       event.data = taxonNodes.toArray(new TaxonNode[taxonNodes.size()]);
+               }
+               return setDataSuccess;
+       }
+
+}
index 754611f35ae73017796b04d121d15addb4a0c0de..070687e404d7760f6884886484542c884a2f366d 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
 
+import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -23,6 +24,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>SearchResultLabelProvider class.</p>
@@ -95,6 +97,9 @@ public class SearchResultLabelProvider extends ColumnLabelProvider implements IL
 //                             return ImageResources.getImage(ImageResources.MISAPPLIED_NAME_ICON);
 //                     }else{
                        if(type == Taxon.class){
+                               if(((UuidAndTitleCache) element).getIsOrphaned()) {
+                                       return ImageResources.getImage(ImageResources.ORPHANED_TAXON);
+                               }
                                return ImageResources.getImage(ImageResources.BLACK_SQUARE_ICON);
                        }else if(type == Synonym.class){
                                return ImageResources.getImage(ImageResources.HETEROTYPIC_SYN_ICON);
index 110934d453caa69ec559aec9dea919db16a8f0d3..5c6fd5a5b4b2a6f26eb540238d9929cf60c33950 100644 (file)
@@ -9,6 +9,7 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.cdm.database,
  eu.etaxonomy.taxeditor.datasource,
  eu.etaxonomy.taxeditor.datasource.wizard,
+ eu.etaxonomy.taxeditor.dnd.transfer,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.definedterm,
  eu.etaxonomy.taxeditor.featuretree,
@@ -33,6 +34,7 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.ui.dialog,
  eu.etaxonomy.taxeditor.ui.dialog.selection,
  eu.etaxonomy.taxeditor.ui.element,
+ eu.etaxonomy.taxeditor.ui.group.grantedauthority,
  eu.etaxonomy.taxeditor.ui.section,
  eu.etaxonomy.taxeditor.ui.section.agent,
  eu.etaxonomy.taxeditor.ui.section.classification,
@@ -64,6 +66,7 @@ Import-Package: org.eclipse.core.commands,
  org.eclipse.jface.preference,
  org.eclipse.jface.resource,
  org.eclipse.jface.viewers,
+ org.eclipse.nebula.widgets.compositetable,
  org.eclipse.swt,
  org.eclipse.swt.graphics,
  org.eclipse.swt.widgets,
diff --git a/eu.etaxonomy.taxeditor.store/icons/orphaned.gif b/eu.etaxonomy.taxeditor.store/icons/orphaned.gif
new file mode 100644 (file)
index 0000000..c4df26e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/orphaned.gif differ
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/CdmAuthorityTableDropTargetListener.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/CdmAuthorityTableDropTargetListener.java
new file mode 100644 (file)
index 0000000..5612ab4
--- /dev/null
@@ -0,0 +1,93 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.dnd;
+
+import java.awt.Cursor;
+import java.util.EnumSet;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityComposite;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeViewer;
+
+/**
+ * Drop listener for the {@link CdmAuthorityComposite}.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityTableDropTargetListener implements DropTargetListener {
+
+       private CdmAuthorityCompositeViewer viewer;
+       
+       
+       public CdmAuthorityTableDropTargetListener(CdmAuthorityCompositeViewer viewer) {
+               this.viewer = viewer;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void dragEnter(DropTargetEvent event) {                          
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#dragLeave(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void dragLeave(DropTargetEvent arg0) {
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void dragOperationChanged(DropTargetEvent arg0) {
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void dragOver(DropTargetEvent arg0) {
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void drop(DropTargetEvent dtevent) {
+               if(TaxonNodeTransfer.getInstance().isSupportedType(dtevent.currentDataType)) {
+                       Object[] selectedCdmBases = (Object[])dtevent.data;
+                       
+                       for (Object cdmBase : selectedCdmBases){
+                               if(CdmBase.class.isAssignableFrom(cdmBase.getClass()) ) {
+                                       viewer.addCdmAuthority((CdmBase)cdmBase);                                       
+                               }
+                       }
+               }               
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DropTargetListener#dropAccept(org.eclipse.swt.dnd.DropTargetEvent)
+        */
+       @Override
+       public void dropAccept(DropTargetEvent arg0) {
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java
new file mode 100644 (file)
index 0000000..528cb40
--- /dev/null
@@ -0,0 +1,62 @@
+
+//$Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.dnd.transfer;
+
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.CdmObjectTransfer;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Drag / Drop Transfer object for Taxon Node 
+ * 
+ * @author c.mathew
+ * @created Mar 25, 2013
+ */
+public class TaxonNodeTransfer extends CdmObjectTransfer<TaxonNode> {
+
+       private static TaxonNodeTransfer instance = new TaxonNodeTransfer();
+       private static final String TYPE_NAME = "taxonNode-transfer-format";
+       private static final int TYPEID = registerType(TYPE_NAME);
+       
+       public static synchronized TaxonNodeTransfer getInstance(){
+               return instance;
+       }
+       
+       private TaxonNodeTransfer(){}
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.Transfer#getTypeIds()
+        */
+       @Override
+       protected int[] getTypeIds() {
+               return new int[] { TYPEID };
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.Transfer#getTypeNames()
+        */
+       @Override
+       protected String[] getTypeNames() {
+               return new String[] { TYPE_NAME };
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.model.CdmObjectTransfer#loadElement(java.util.UUID)
+        */
+       @Override
+       public TaxonNode loadElement(UUID uuid) {
+               return CdmStore.getService(ITaxonNodeService.class).load(uuid, null);
+       }
+}
\ No newline at end of file
index 86c3c30170da90db3b9f42caa3b8472915aba7a7..f06ac99b7cfa65d205f249851831312c6a907d91 100644 (file)
@@ -122,6 +122,8 @@ public class ImageResources {
        public static final String TWO_PRONGED_EQUAL = "2_pronged_equal";
        /** Constant <code>MISAPPLIED_NAME="misapplied_name"</code> */
        public static final String MISAPPLIED_NAME = "misapplied_name";
+       /** Constant <code>ORPHANED_TAXON="orphaned_taxon"</code> */
+       public static final String ORPHANED_TAXON = "orphaned_taxon";
        /** Constant <code>EXPAND_ALL="expand_all"</code> */
        public static final String EXPAND_ALL = "expand_all";
        /** Constant <code>COLLAPSE_ALL="collapse_all"</code> */
@@ -290,7 +292,9 @@ public class ImageResources {
                registerImage(registry, TWO_PRONGED_EQUAL, 
                                "2_pronged_equal_small.GIF");           
                registerImage(registry, MISAPPLIED_NAME, 
-                               "ma_12x12.gif");                
+                               "ma_12x12.gif");        
+               registerImage(registry, ORPHANED_TAXON, 
+                               "orphaned.gif");        
                registerImage(registry, EXPAND_ALL, 
                                "expandAll.jpg");
                registerImage(registry, COLLAPSE_ALL, 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java
new file mode 100644 (file)
index 0000000..228a42c
--- /dev/null
@@ -0,0 +1,200 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.RowLayout;
+
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+
+
+/**
+ * Widget for editing {@link Operation} objects, consisting of 4 checkboxes for CREATE, UPDATE, READ, DELETE operations.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CRUDOperationChooser extends Composite {
+       
+       private Button createCheckButton;
+       private Button readCheckButton;
+       private Button deleteCheckButton;
+       private Button updateCheckButton;
+       
+       private CdmAuthorityRow caRow;
+       private GrantedAuthorityImpl grantedAuthorityI;
+       private CdmAuthority cdmAuthority;
+       private CdmAuthorityCompositeViewer viewer;
+       
+       /**
+        * Create the composite.
+        * @param parent
+        * @param style
+        */
+       public CRUDOperationChooser(final CdmAuthorityRow parent, int style) {
+               super(parent, style);
+               setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+               RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL);
+               rowLayout.justify = true;
+               setLayout(rowLayout);
+               
+               
+               this.caRow = parent;
+               createCheckButton = new Button(this, SWT.CHECK);
+               createCheckButton.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
+               createCheckButton.addMouseListener(new MouseAdapter() {
+                       @Override
+                       public void mouseUp(MouseEvent arg0) {
+                               if(cdmAuthority.getOperation() != null) {
+                                       if(createCheckButton.getSelection()) {
+                                               cdmAuthority.getOperation().add(CRUD.CREATE);
+                                       } else {
+                                               cdmAuthority.getOperation().remove(CRUD.CREATE);
+                                       }
+                                       if(viewer != null) {
+                                               viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+                                               parent.setDirty(true);
+                                       }
+                                       
+                               }
+                       }
+               });
+               createCheckButton.setText("C");
+               
+               readCheckButton = new Button(this, SWT.CHECK);
+               readCheckButton.addMouseTrackListener(new MouseTrackAdapter() {
+                       @Override
+                       public void mouseHover(MouseEvent arg0) {
+                       }
+               });
+               readCheckButton.addMouseListener(new MouseAdapter() {
+                       @Override
+                       public void mouseUp(MouseEvent arg0) {
+                               if(cdmAuthority.getOperation() != null) {
+                                       if(readCheckButton.getSelection()) {
+                                               cdmAuthority.getOperation().add(CRUD.READ);
+                                       } else {
+                                               cdmAuthority.getOperation().remove(CRUD.READ);
+                                       }
+                                       if(viewer != null) {
+                                               viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+                                               parent.setDirty(true);
+                                       }
+                                       
+                               }
+                                       
+                       }
+               });
+               readCheckButton.setText("R");
+               
+               deleteCheckButton = new Button(this, SWT.CHECK);
+               deleteCheckButton.addMouseListener(new MouseAdapter() {
+                       @Override
+                       public void mouseUp(MouseEvent arg0) {
+                               if(cdmAuthority.getOperation() != null) {
+                                       if(deleteCheckButton.getSelection()) {
+                                               cdmAuthority.getOperation().add(CRUD.DELETE);
+                                       } else {
+                                               cdmAuthority.getOperation().remove(CRUD.DELETE);
+                                       }
+                                       if(viewer != null) {
+                                               viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+                                               parent.setDirty(true);
+                                       }
+                                       
+                               }
+                       }
+               });
+               deleteCheckButton.setText("D");
+               
+               updateCheckButton = new Button(this, SWT.CHECK);
+               updateCheckButton.addMouseListener(new MouseAdapter() {
+                       @Override
+                       public void mouseUp(MouseEvent arg0) {
+                               if(cdmAuthority.getOperation() != null) {
+                                       if(updateCheckButton.getSelection()) {
+                                               cdmAuthority.getOperation().add(CRUD.UPDATE);
+                                       } else {
+                                               cdmAuthority.getOperation().remove(CRUD.UPDATE);
+                                       }
+                                       if(viewer != null) {
+                                               viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+                                               parent.setDirty(true);
+                                       }
+                                       
+                               }
+                       }
+               });
+               updateCheckButton.setText("U");
+               updateView();
+       }
+
+       
+       @Override
+       protected void checkSubclass() {
+               // Disable the check that prevents subclassing of SWT components
+       }
+       
+       /**
+        * Set viewer, CDM Authority and corresponding GrantedAuthorityImpl object
+        * 
+        * @param viewer
+        * @param grantedAuthorityI
+        * @param cdmAuthority
+        */
+       public void setAuthority(CdmAuthorityCompositeViewer viewer, 
+                       GrantedAuthorityImpl grantedAuthorityI,
+                       CdmAuthority cdmAuthority) {
+               this.grantedAuthorityI = grantedAuthorityI;
+               this.cdmAuthority = cdmAuthority;
+               this.viewer = viewer;
+               updateView();
+       }
+       
+
+       
+       /**
+        * Update widget state.
+        */
+       private void updateView() {
+               createCheckButton.setSelection(false);
+               readCheckButton.setSelection(false);
+               deleteCheckButton.setSelection(false);
+               updateCheckButton.setSelection(false);
+               
+               
+               if(cdmAuthority!= null && cdmAuthority.getOperation() != null) {
+                       if(cdmAuthority.getOperation().contains(CRUD.CREATE)) {
+                               createCheckButton.setSelection(true);
+                       }
+                       if(cdmAuthority.getOperation().contains(CRUD.READ)) {
+                               readCheckButton.setSelection(true);
+                       }
+                       if(cdmAuthority.getOperation().contains(CRUD.DELETE)) {
+                               deleteCheckButton.setSelection(true);
+                       }
+                       if(cdmAuthority.getOperation().contains(CRUD.UPDATE)) {
+                               updateCheckButton.setSelection(true);
+                       }
+
+               }
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java
new file mode 100644 (file)
index 0000000..cc4210f
--- /dev/null
@@ -0,0 +1,123 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
+
+import org.eclipse.nebula.widgets.compositetable.CompositeTable;
+import org.eclipse.nebula.widgets.compositetable.IRowContentProvider;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+
+import eu.etaxonomy.taxeditor.dnd.CdmAuthorityTableDropTargetListener;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.layout.GridData;
+
+/**
+ * Composite class which consists of a {@link CompositeTable} built specifically
+ * for creating / editing CDM Authority objects
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class CdmAuthorityComposite extends Composite {
+
+       private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+       private CompositeTable table;
+       
+       private int numOfInitialCdmAuthorities;
+
+       private Label lblDragEntityInto;
+       
+       private CdmAuthorityCompositeViewer viewer;
+       
+
+       /**
+        * Creates the composite using the given parent, style and associated viewer.
+        * 
+        * @param parent composite to use as parent of this composite
+        * @param style 
+        * @param viewer viewer representing the model
+        */
+       public CdmAuthorityComposite(Composite parent, int style, final CdmAuthorityCompositeViewer viewer) {
+               super(parent, style);
+               addDisposeListener(new DisposeListener() {
+                       public void widgetDisposed(DisposeEvent e) {
+                               toolkit.dispose();
+                       }
+               });
+               
+               this.viewer = viewer;
+                               
+               numOfInitialCdmAuthorities = viewer.getCdmAuthorities().size();
+               setLayout(new GridLayout(1, false));
+           Transfer[] transfers = new Transfer[] { TaxonNodeTransfer.getInstance() };     
+           
+           toolkit.adapt(this);
+               toolkit.paintBordersFor(this);          
+
+               lblDragEntityInto = new Label(this, SWT.NONE);
+               toolkit.adapt(lblDragEntityInto, true, true);
+               lblDragEntityInto.setText("Drag Entity into table to add ...");
+               table = new CompositeTable(this, SWT.BORDER);
+               GridData gd_table = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+               gd_table.widthHint = 750;
+               gd_table.heightHint = 400;
+               table.setLayoutData(gd_table);
+               new CdmAuthorityTableHeader(table, SWT.NULL); 
+               CdmAuthorityRow cdmAuthorityRow = new CdmAuthorityRow(table, SWT.NULL);
+               
+               table.setRunTime(true);
+               table.setNumRowsInCollection(numOfInitialCdmAuthorities);
+               table.setLinesVisible(true); 
+               
+               DropTarget dropTarget = new DropTarget(table, DND.DROP_MOVE);
+               dropTarget.setTransfer(transfers);
+               dropTarget.addDropListener(new CdmAuthorityTableDropTargetListener(viewer));
+               
+               
+               table.addRowContentProvider(new IRowContentProvider() {
+                       public void refresh(CompositeTable sender, int currentObjectOffset, Control rowControl) {
+                               CdmAuthorityRow row = (CdmAuthorityRow) rowControl;             
+                               // add the newly created authority objects first and then the already existing ones.
+                               // this ensures the newly 'dragged' in objects always remain at the top
+                               if(currentObjectOffset < viewer.getNewCdmAuthorities().size()) {                        
+                                       row.setRowCdmAuthority(viewer, 
+                                                       viewer.getNewCdmAuthorities().get(currentObjectOffset), 
+                                                       true);
+                               } else {
+                                       row.setRowCdmAuthority(viewer, 
+                                                       viewer.getCdmAuthorities().get(currentObjectOffset - viewer.getNewCdmAuthorities().size()), 
+                                                       false);
+                               }                                                                               
+                       }
+               });
+       }       
+
+       /**
+        * Refreshes the table with underlying data
+        */
+       public void refresh() {                 
+               numOfInitialCdmAuthorities = viewer.getNewCdmAuthorities().size() + viewer.getCdmAuthorities().size();                              
+           table.setNumRowsInCollection(numOfInitialCdmAuthorities);     
+           table.refreshAllRows();
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java
new file mode 100644 (file)
index 0000000..701b739
--- /dev/null
@@ -0,0 +1,267 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.ContentViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.springframework.security.core.GrantedAuthority;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+
+
+
+/**
+ * Viewer class for the {@link CdmAuthorityComposite} used in the editing of CDM Authorities.
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+
+/**
+ * @author cmathew
+ * @date Apr 5, 2013
+ *
+ */
+
+//FIXME:move warning dialogs to the table class
+public class CdmAuthorityCompositeViewer extends ContentViewer {
+       
+       private IDirtyMarkableSelectionProvider dirtyMarkerEditor;      
+       private CdmAuthorityComposite cdmAuthorityComposite;
+       private Group group;
+       /**
+        * List which contains already existing authority objects.
+        */
+       private List<GrantedAuthorityImpl> cdmAuthorities;
+       /**
+        * List which contains newly added (unsaved) authority objects.
+        * Used to make sure that new authority objects are always added 
+        * to the top of the table.
+        */
+       private List<GrantedAuthorityImpl> newCdmAuthorities;
+       
+       
+       /**
+        * Creates a viewer with a {@link CdmAuthorityComposite} table, {@link Group} object as input 
+        * 
+        * @param composite parent of generated {@link CdmAuthorityComposite}
+        * @param dirtyMarkerEditor provider to mark as dirty
+        * @param group input data object
+        */
+       public CdmAuthorityCompositeViewer(Composite composite,
+                       IDirtyMarkableSelectionProvider dirtyMarkerEditor, 
+                       Group group) {
+               this.dirtyMarkerEditor = dirtyMarkerEditor;
+               this.group = group;
+               newCdmAuthorities = new ArrayList<GrantedAuthorityImpl>();              
+               updateAuthorities();
+               this.cdmAuthorityComposite = new CdmAuthorityComposite(composite, SWT.NONE, this);
+       }
+
+       /**
+        * Gets the {@link CdmAuthorityComposite}
+        * 
+        * @return {@link CdmAuthorityComposite} generated by this viewer
+        */
+       public CdmAuthorityComposite getCdmAuthorityComposite() {
+               return cdmAuthorityComposite;
+       }
+       
+       
+       /**
+        * Retrieves the {@link GrantedAuthorityImpl} objects of the group attached to this viewer
+        * creates a sub-list of only {@link CdmAuthority} objects.
+        * 
+        * @return list of {@link CdmAuthority} objects belonging to the input group
+        */
+       public List<GrantedAuthorityImpl> updateAuthorities()  {
+               // get all granted authorities
+               Set<GrantedAuthority> grantedAuthorities = group.getGrantedAuthorities();
+               cdmAuthorities = new ArrayList<GrantedAuthorityImpl>(); 
+               
+               Iterator<GrantedAuthority> itr = grantedAuthorities.iterator();         
+               while (itr.hasNext()) {
+                       GrantedAuthority grantedAuthority = itr.next();
+                       try {
+                               
+                               if(grantedAuthority != null && grantedAuthority instanceof GrantedAuthorityImpl) {                      
+                                       // create a cdm authority from a granted authority
+                                       // this could fail in which case an exception is thrown
+                                       CdmAuthority cdmAuthority = CdmAuthority.fromGrantedAuthority(grantedAuthority);
+                                       cdmAuthorities.add((GrantedAuthorityImpl)grantedAuthority);                             
+                               }
+                       } catch (Exception e) {
+                               // not a CdmAuthority                           
+                               //e.printStackTrace();
+                       }                       
+               }
+               return cdmAuthorities;
+       }
+       
+       /**
+        * Adds a new {@link CdmAuthority} to the group attached to this viewer
+        * based on the input {@link CdmBase} object.
+        * 
+        * @param cb {@link CdmBase} object used to construct the cdm authority
+        */
+       public void addCdmAuthority(CdmBase cb) {
+               // Default permission is to READ
+               EnumSet<CRUD> defaultOperation = EnumSet.noneOf(CRUD.class);
+               defaultOperation.add(CRUD.READ);
+               CdmAuthority cdma = new CdmAuthority(cb, defaultOperation, cb.getUuid());
+               GrantedAuthorityImpl gai;
+               try {
+                       // create a granted authrity from a cdm authority 
+                       gai = cdma.asNewGrantedAuthority();
+               } catch (Exception e) {                 
+                       StoreUtil.warningDialog("Parsing Error", this, "Could not parse authority string");
+                       return;
+               }
+               //FIXME : this contains call will allow users to add authorities which differ only in CRUD operation choice.
+               //        need to have a comparator which only checks permission class and uuid
+               if(cdmAuthorities.contains(gai)) {
+                       StoreUtil.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
+               } else {                                                                
+                       group.addGrantedAuthority(gai);
+                       newCdmAuthorities.add(gai);                             
+                       dirtyMarkerEditor.changed(group);               
+                       cdmAuthorityComposite.refresh();
+               }
+       }
+       
+       /**
+        * Removes the given {@link GrantedAuthorityImpl} object from the list of
+        * granted authorities belonging to the group attached to this viewer.
+        * 
+        * @param gai {@link GrantedAuthorityImpl} object to remove
+        */
+       public void removeCdmAuthority(GrantedAuthorityImpl gai) {
+               if(cdmAuthorities.contains(gai)) {
+                       group.removeGrantedAuthority(gai);
+                       newCdmAuthorities.remove(gai);
+                       cdmAuthorities.remove(gai);
+                       dirtyMarkerEditor.changed(group);       
+                       cdmAuthorityComposite.refresh();
+               } else {
+                       StoreUtil.warningDialog("Unknown CDM Authority", this, "Chosen CDM Authority does not exist in  current group");
+               }
+       }
+       
+       /**
+        * Updates an existing {@link GrantedAuthorityImpl} object using a {@link CdmAuthority} object.
+        * 
+        * @param grantedAuthorityI to update.
+        * @param cdmAuthority to use in updating the granted authority object.
+        */
+       public void updateGrantedAuthority(GrantedAuthorityImpl grantedAuthorityI, CdmAuthority cdmAuthority) {
+               if(grantedAuthorityI.getAuthority().equals(cdmAuthority.getAuthority())) {
+                       
+               } else {
+                       try {
+                               // since granted authority is just a wrapper object around a string
+                               // we can't really 'update' the granted authority.
+                               // so we first add the new authority (hope no exception) is thrown
+                               // and then remove the old one.
+                               group.addGrantedAuthority(cdmAuthority.asNewGrantedAuthority());
+                               group.removeGrantedAuthority(grantedAuthorityI);
+                               dirtyMarkerEditor.changed(grantedAuthorityI);                           
+                       } catch(Exception e) {
+                               // Not a CDM Authority
+                               //e.printStackTrace();
+                       }
+               }               
+       }
+       
+       /**
+        * @return list of existing cdm authority objects
+        */
+       public List<GrantedAuthorityImpl> getCdmAuthorities() {
+               return cdmAuthorities;
+       }
+       
+       /**
+        * @return list of newly added cdm authority objects
+        */
+       public List<GrantedAuthorityImpl> getNewCdmAuthorities() {
+               return newCdmAuthorities;
+       }
+       
+
+       /**
+        * Empty the list of newly create autrity objects
+        */
+       public void clearNewCdmAuthorities() {
+               newCdmAuthorities.clear();
+       }
+
+       
+       /**
+        * 
+        * 
+        */
+       public void save() {
+               clearNewCdmAuthorities();               
+               refresh();
+               
+       }       
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.Viewer#getControl()
+        */
+       @Override
+       public Control getControl() {
+               return cdmAuthorityComposite;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.Viewer#getSelection()
+        */
+       @Override
+       public ISelection getSelection() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.Viewer#refresh()
+        */
+       @Override
+       public void refresh() {
+               updateAuthorities();
+               cdmAuthorityComposite.refresh();
+               
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
+        */
+       @Override
+       public void setSelection(ISelection selection, boolean reveal) {
+               // TODO Auto-generated method stub
+               
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java
new file mode 100644 (file)
index 0000000..9d545f0
--- /dev/null
@@ -0,0 +1,166 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridData;
+
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+
+
+/**
+ * Row widget for editing a single CDM Authority
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityRow extends Composite {
+
+       private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+       private Label lblEntity;
+       private Label lblUuid;
+       private CRUDOperationChooser operationChooser;
+       private Button btnDelete;
+       
+       private GrantedAuthorityImpl grantedAuthorityI;
+       private Label lblDirtyFlag;
+       
+       private CdmAuthorityCompositeViewer cdmaModel;
+       
+       /**
+        * Create the composite, made up of 5 elements :
+        * 1. '*' or depending on whether the row is being edited 
+        * 2. Classname of entity (e.g. TAXONNODE) 
+        * 3. Uuid of entity 
+        * 4. CRUD operations edit widget (this is essentially 4 checkboxes to select the 4 possible operations) 
+        * 5. Delete button (to delete the row) 
+        * 
+        * @param parent
+        * @param style
+        */
+       public CdmAuthorityRow(Composite parent, int style) {
+               super(parent, SWT.NONE);
+               addDisposeListener(new DisposeListener() {
+                       public void widgetDisposed(DisposeEvent e) {
+                               toolkit.dispose();
+                       }
+               });
+               toolkit.adapt(this);
+               toolkit.paintBordersFor(this);
+               setLayout(new GridLayout(5, false));
+               
+
+               
+               lblDirtyFlag = new Label(this, SWT.NONE);
+               lblDirtyFlag.setAlignment(SWT.CENTER);
+               GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+               gd_lblDirtyFlag.widthHint = 15;
+               lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
+               toolkit.adapt(lblDirtyFlag, true, true);
+               lblDirtyFlag.setText("*");
+               
+               lblEntity = new Label(this, SWT.BORDER);
+               GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblEntity.heightHint = 30;
+               gd_lblEntity.widthHint = 200;
+               lblEntity.setLayoutData(gd_lblEntity);
+               lblEntity.setAlignment(SWT.CENTER);
+               toolkit.adapt(lblEntity, true, true);
+               lblEntity.setText("Entity");
+               
+               lblUuid = new Label(this, SWT.BORDER);
+               GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblUuid.heightHint = 30;
+               gd_lblUuid.widthHint = 270;
+               lblUuid.setLayoutData(gd_lblUuid);
+               lblUuid.setAlignment(SWT.CENTER);
+               toolkit.adapt(lblUuid, true, true);
+               lblUuid.setText("Uuid");
+               
+               operationChooser = new CRUDOperationChooser(this, SWT.BORDER);
+               operationChooser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
+               toolkit.adapt(operationChooser);
+               toolkit.paintBordersFor(operationChooser);
+               
+               btnDelete = new Button(this, SWT.NONE);
+
+               btnDelete.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
+               btnDelete.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
+               btnDelete.addMouseListener(new MouseAdapter() {
+                       @Override
+                       public void mouseUp(MouseEvent arg0) {
+                               if(cdmaModel != null) {
+                                       cdmaModel.removeCdmAuthority(grantedAuthorityI);
+                               }
+                       }
+               });             
+               
+               toolkit.adapt(btnDelete, true, true);
+
+       }
+
+       /**
+        * Sets the dirty flag for this row
+        * 
+        * @param isDirty
+        */
+       public void setDirty(boolean isDirty) {
+               if(isDirty) {
+                       lblDirtyFlag.setText("*");
+               } else {
+                       lblDirtyFlag.setText(" ");
+               }
+       }
+       
+       /**
+        * Create a {@link CdmAuthority} from a {@link GrantedAuthorityImpl} and create a row from it.
+        * 
+        * @param cdmaModel
+        * @param grantedAuthorityI
+        * @param isDirty
+        */
+       public void setRowCdmAuthority(CdmAuthorityCompositeViewer cdmaModel, GrantedAuthorityImpl grantedAuthorityI, boolean isDirty) {
+               this.grantedAuthorityI = grantedAuthorityI;             
+               this.cdmaModel = cdmaModel;
+               
+               try {
+                       CdmAuthority cdmAuthority = CdmAuthority.fromGrantedAuthority(grantedAuthorityI);
+
+                       setDirty(isDirty);
+
+                       String entityStr = (cdmAuthority.getPermissionClass() == null)?"":cdmAuthority.getPermissionClass().toString();
+                       lblEntity.setText(entityStr);
+                       String uuidStr = (cdmAuthority.getTargetUUID() == null)?"":cdmAuthority.getTargetUUID().toString();
+                       lblUuid.setText(uuidStr);
+
+                       operationChooser.setAuthority(cdmaModel, grantedAuthorityI, cdmAuthority);                              
+                       
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java
new file mode 100644 (file)
index 0000000..a47133b
--- /dev/null
@@ -0,0 +1,89 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.custom.CLabel;
+
+/**
+ * Table header widget for {@link CdmAuthorityComposite}
+ * 
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityTableHeader extends Composite {
+
+       private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+       /**
+        * Create the composite, with 5 header fields.
+        * 
+        * @param parent
+        * @param style
+        */
+       public CdmAuthorityTableHeader(Composite parent, int style) {
+               super(parent, SWT.NONE);
+               addDisposeListener(new DisposeListener() {
+                       public void widgetDisposed(DisposeEvent e) {
+                               toolkit.dispose();
+                       }
+               });
+               toolkit.adapt(this);
+               toolkit.paintBordersFor(this);
+               setLayout(new GridLayout(4, false));
+               
+               Label lblDirtyFlag = new Label(this, SWT.NONE);
+               GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+               gd_lblDirtyFlag.widthHint = 15;
+               lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
+               
+               toolkit.adapt(lblDirtyFlag, true, true);
+               
+               CLabel lblEntity = new CLabel(this, SWT.NONE);
+               lblEntity.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+               lblEntity.setAlignment(SWT.CENTER);
+               GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblEntity.widthHint = 200;
+               lblEntity.setLayoutData(gd_lblEntity);
+               toolkit.adapt(lblEntity);
+               toolkit.paintBordersFor(lblEntity);
+               lblEntity.setText("ENTITY");
+               
+               CLabel lblUuid = new CLabel(this, SWT.NONE);
+               lblUuid.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+               lblUuid.setAlignment(SWT.CENTER);
+               GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblUuid.widthHint = 270;
+               lblUuid.setLayoutData(gd_lblUuid);
+               toolkit.adapt(lblUuid);
+               toolkit.paintBordersFor(lblUuid);
+               lblUuid.setText("UUID");
+               
+               CLabel lblOperation = new CLabel(this, SWT.NONE);
+               lblOperation.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+               lblOperation.setAlignment(SWT.CENTER);
+               GridData gd_lblOperation = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblOperation.widthHint = 150;
+               lblOperation.setLayoutData(gd_lblOperation);
+               toolkit.adapt(lblOperation);
+               toolkit.paintBordersFor(lblOperation);
+               lblOperation.setText("OPERATION");
+
+       }
+
+}