]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
9cf87ccaf7c23ce1c3a5a14f1cb417dfeb9898ea
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.advancedsearch.model;
2
3 import java.util.List;
4
5 import org.collectionspace.services.collectionobject.BriefDescriptionList;
6
7 public class BriefDescriptionListModel {
8         private static int DESCRIPTION_LENGTH = 55;
9         public static String briefDescriptionListToDisplayString(BriefDescriptionList bdList) {
10                 List<String> bds = bdList.getBriefDescription();
11                 String returnString = "";
12                 // "Display first 55 (?) characters..." from https://docs.google.com/spreadsheets/d/103jyxa2oCtt8U0IQ25xsOyIxqwKvPNXlcCtcjGlT5tQ/edit?gid=0#gid=0
13                 // FIXME the above business logic is inadequate because there are numerous brief descriptions
14                 if(null != bds) {
15                         if(!bds.isEmpty()) {
16                                 // get the 1st 55 characters of the 1st defined brief description if there is one
17                                 if(null != bds.get(0)) {
18                                         int length = bds.get(0).length();
19                                         returnString = bds.get(0).substring(0, (length >= DESCRIPTION_LENGTH) ? DESCRIPTION_LENGTH : length);
20                                 }
21                                 
22                         }
23                 }
24                 return returnString;
25         }
26 }