1 package org.collectionspace.services.advancedsearch.model;
3 import java.util.ArrayList;
6 import org.collectionspace.services.collectionobject.ContentConceptList;
8 public class ContentConceptListModel {
10 public static String contentConceptListDisplayString(ContentConceptList conceptList) {
11 List<String> displayConcepts = new ArrayList<String>();
12 if(null != conceptList) {
13 List<String> concepts = conceptList.getContentConcept();
14 for (String conceptRefname : concepts) {
15 displayConcepts.add(displayNameFromRefName(conceptRefname));
19 return String.join(",", displayConcepts);
22 private static String displayNameFromRefName(String refname) {
24 // urn:cspace:core.collectionspace.org:conceptauthorities:name(concept):item:name(FooConcept1749234493809)'FooConcept'
26 // TODO: there is probably code somewhere for doing this
27 String displayName = refname;
28 if(refname.indexOf("'") < refname.lastIndexOf("'")) {
29 displayName = refname.substring(refname.indexOf("'")+1, refname.lastIndexOf("'"));