Project

General

Profile

« Previous | Next » 

Revision 88df332d

Added by Katja Luther over 5 years ago

smaller changes in preferences for distribution vocabularies

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
10 10

  
11 11
import java.util.ArrayList;
12 12
import java.util.Arrays;
13
import java.util.HashSet;
14 13
import java.util.List;
15
import java.util.Set;
16 14
import java.util.UUID;
17 15

  
18 16
import org.apache.commons.lang.StringUtils;
......
26 24
import eu.etaxonomy.cdm.model.common.TermBase;
27 25
import eu.etaxonomy.cdm.model.common.TermType;
28 26
import eu.etaxonomy.cdm.model.common.TermVocabulary;
29
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
30 27
import eu.etaxonomy.taxeditor.store.CdmStore;
31 28

  
32 29
/**
......
154 151
        }
155 152
        List<TermVocabulary<DefinedTermBase>> vocs = new ArrayList<>();
156 153
        if (localPref){
157
            String vocString = PreferencesUtil.getPreferenceStore().getString(PreferencesUtil.DISTRIBUTION_VOCABULARIES);
158
            String[] arrayVocs = vocString.split(";");
159

  
160
            Set<UUID> uuidVocs = new HashSet();
161
            for (String voc: arrayVocs){
162
                if (!StringUtils.isBlank(voc)){
163
                    uuidVocs.add(UUID.fromString(voc));
164
                }
165
            }
166
            List<TermVocabulary> tempVocs = CdmStore.getService(IVocabularyService.class).find(uuidVocs);
167
            for (TermVocabulary voc: tempVocs){
168
                vocs.add(voc);
169
            }
154
            vocs = getVocabulariesFromPreference();
170 155

  
171 156
        }else{
172 157
            vocs = CdmStore.getService(IVocabularyService.class).findByTermType(
......
175 160
        setVocabularies(vocs);
176 161
    }
177 162

  
163
    protected abstract List<TermVocabulary<DefinedTermBase>> getVocabulariesFromPreference();
164

  
178 165

  
179 166
}

Also available in: Unified diff