fix #8958: add additional rows to reference bulk editor
authorKatja Luther <k.luther@bgbm.org>
Wed, 29 Apr 2020 12:02:06 +0000 (14:02 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 29 Apr 2020 12:02:06 +0000 (14:02 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java

index 26a5a6a2f3813fcf414c3d3fbd4ec5c1cdc56285..cb593ae739f34d387161e06df014b261e10ceb04 100644 (file)
@@ -42,6 +42,9 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
        private static final String PROPERTY_PROTECT_NOMENCLATURAL_CACHE = "Protect Nomencl. Cache";
        private static final String PROPERTY_TITLE = "Title";
        private static final String PROPERTY_NOMENCLAT_TITLE = "Nomencl. Title";
+       private static final String PROPERTY_URI = "URI";
+       private static final String PROPERTY_JOURNAL = "Journal";
+       private static final String PROPERTY_PUBLICATION_YEAR = "Publication Year";
 
        private static ReferenceEditorInput instance;
 
@@ -56,6 +59,9 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
         propertyKeysInternal.add(PROPERTY_PROTECT_NOMENCLATURAL_CACHE);
         propertyKeysInternal.add(PROPERTY_TITLE);
         propertyKeysInternal.add(PROPERTY_NOMENCLAT_TITLE);
+        propertyKeysInternal.add(PROPERTY_PUBLICATION_YEAR);
+        propertyKeysInternal.add(PROPERTY_JOURNAL);
+        propertyKeysInternal.add(PROPERTY_URI);
         return propertyKeysInternal;
     }
 
@@ -73,6 +79,28 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
         else if(property.equals(PROPERTY_NOMENCLAT_TITLE)){
             return cdmBase.getAbbrevTitle();
         }
+        else if(property.equals(PROPERTY_PUBLICATION_YEAR)){
+            if (cdmBase.getDatePublished() != null){
+                return cdmBase.getDatePublished().getYear();
+            }else {
+                return null;
+            }
+        }
+        else if(property.equals(PROPERTY_JOURNAL)){
+            if (cdmBase.getInReference() != null){
+                return cdmBase.getInReference().getTitleCache();
+            }else{
+                return null;
+            }
+
+        }
+        else if(property.equals(PROPERTY_URI)){
+            if (cdmBase.getUri() != null){
+                return cdmBase.getUri().toString();
+            }else{
+                return null;
+            }
+        }
         return super.getPropertyValue(cdmBase, property);
     }