@@ -754,43 +754,17 @@ public String getDescriptionHtmlEscaped() {
754
754
return MarkupChecker .escapeHtml (getDescription ());
755
755
}
756
756
757
- public List <String []> getDatasetContacts (){
758
- List <String []> retList = new ArrayList <>();
759
- for (DatasetField dsf : this .getDatasetFields ()) {
760
- Boolean addContributor = true ;
761
- String contributorName = "" ;
762
- String contributorAffiliation = "" ;
763
- if (dsf .getDatasetFieldType ().getName ().equals (DatasetFieldConstant .datasetContact )) {
764
- for (DatasetFieldCompoundValue authorValue : dsf .getDatasetFieldCompoundValues ()) {
765
- for (DatasetField subField : authorValue .getChildDatasetFields ()) {
766
- if (subField .getDatasetFieldType ().getName ().equals (DatasetFieldConstant .datasetContactName )) {
767
- if (subField .isEmptyForDisplay ()) {
768
- addContributor = false ;
769
- }
770
- contributorName = subField .getDisplayValue ();
771
- }
772
- if (subField .getDatasetFieldType ().getName ().equals (DatasetFieldConstant .datasetContactAffiliation )) {
773
- contributorAffiliation = subField .getDisplayValue ();
774
- }
775
-
776
- }
777
- if (addContributor ) {
778
- String [] datasetContributor = new String [] {contributorName , contributorAffiliation };
779
- retList .add (datasetContributor );
780
- }
781
- }
782
- }
783
- }
784
- return retList ;
757
+ public List <String []> getDatasetContacts () {
758
+ boolean getDisplayValues = true ;
759
+ return getDatasetContacts (getDisplayValues );
785
760
}
786
761
787
762
/**
788
- * This method is the same as getDatasetContacts above but the actual value
789
- * is returned for affiliation instead of the "display" value, which as of
790
- * this writing wraps the value in parentheses.
763
+ * @param getDisplayValues Instead of the retrieving pristine value in the
764
+ * database, run the value through special formatting.
791
765
*/
792
- public List <String []> getDatasetContactsNonDisplay ( ) {
793
- List <String []> retList = new ArrayList <>();
766
+ public List <String []> getDatasetContacts ( boolean getDisplayValues ) {
767
+ List <String []> retList = new ArrayList <>();
794
768
for (DatasetField dsf : this .getDatasetFields ()) {
795
769
Boolean addContributor = true ;
796
770
String contributorName = "" ;
@@ -802,21 +776,22 @@ public List<String[]> getDatasetContactsNonDisplay() {
802
776
if (subField .isEmptyForDisplay ()) {
803
777
addContributor = false ;
804
778
}
779
+ // There is no use case yet for getting the non-display value for contributorName.
805
780
contributorName = subField .getDisplayValue ();
806
781
}
807
782
if (subField .getDatasetFieldType ().getName ().equals (DatasetFieldConstant .datasetContactAffiliation )) {
808
- contributorAffiliation = subField .getValue ();
783
+ contributorAffiliation = getDisplayValues ? subField . getDisplayValue () : subField .getValue ();
809
784
}
810
785
811
786
}
812
787
if (addContributor ) {
813
- String [] datasetContributor = new String []{contributorName , contributorAffiliation };
788
+ String [] datasetContributor = new String [] {contributorName , contributorAffiliation };
814
789
retList .add (datasetContributor );
815
790
}
816
791
}
817
792
}
818
- }
819
- return retList ;
793
+ }
794
+ return retList ;
820
795
}
821
796
822
797
public List <String []> getDatasetProducers (){
0 commit comments