2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.preference
;
11 import java
.util
.ArrayList
;
12 import java
.util
.Collection
;
13 import java
.util
.List
;
14 import java
.util
.UUID
;
16 import org
.apache
.commons
.lang3
.StringUtils
;
18 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
19 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermDto
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 public class GeneralTermPreferencePage
extends AbstractGeneralTermPreference
<TermDto
> {
29 public GeneralTermPreferencePage(String title
) {
32 public GeneralTermPreferencePage() {
37 protected List
<TermDto
> getTermsFromStringValues(List
<String
> listValue
) {
38 Collection
<TermDto
> termlist
= new ArrayList
<>();
39 ITermService termService
= CdmStore
.getService(ITermService
.class);
40 List
<UUID
> uuidList
= new ArrayList();
41 for (String s
: listValue
) {
42 if (!StringUtils
.isBlank(s
)){
43 UUID uuid
= UUID
.fromString(s
);
47 if (!uuidList
.isEmpty()){
48 termlist
= termService
.findByUUIDsAsDto(uuidList
);
51 if (listValue
== null || listValue
.isEmpty() ){
52 termlist
= termService
.findByTitleAsDto("", type
);
56 return new ArrayList(termlist
);