Project

General

Profile

« Previous | Next » 

Revision fda2cb06

Added by Patrick Plitzner over 7 years ago

ref #5458 Add toggle button for abbreviations to settings menu

  • extract constants for session attributes

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionTablePresenter.java
115 115

  
116 116
	public Set<DefinedTermBase> getChosenTerms() {
117 117
		VaadinSession session = VaadinSession.getCurrent();
118
		UUID termUUID = (UUID) session.getAttribute("selectedTerm");
118
		UUID termUUID = (UUID) session.getAttribute(DistributionEditorUtil.SATTR_SELECTED_VOCABULARY_UUID);
119 119
		TermVocabulary<DefinedTermBase> term = vocabularyService.load(termUUID);
120 120
		term = CdmBase.deproxy(term, TermVocabulary.class);
121 121
		return term.getTerms();
......
140 140
        return namedAreas;
141 141
	}
142 142

  
143
    public List<String> getNamedAreasLabels(boolean abbreviated){
143
    public List<String> getNamedAreasLabels(){
144 144
        Set<NamedArea> selectedAreas = getNamedAreas();
145 145
    	List<String> namedAreaTitles = new ArrayList<>();
146 146
    	for (NamedArea namedArea : selectedAreas) {
147 147
    		String title = null;
148 148
    	    Representation representation = namedArea.getRepresentation(Language.DEFAULT());
149 149
    	    if(representation!=null){
150
    	    	if(abbreviated){
150
    	    	if(DistributionEditorUtil.isAbbreviatedLabels()){
151 151
    	    		title = representation.getAbbreviatedLabel();
152 152
    	    	}
153 153
    	    	else{
......
164 164

  
165 165
	private Set<NamedArea> getTermSet(){
166 166
	    VaadinSession session = VaadinSession.getCurrent();
167
	    UUID termUUID = (UUID) session.getAttribute("selectedTerm");
167
	    UUID termUUID = (UUID) session.getAttribute(DistributionEditorUtil.SATTR_SELECTED_VOCABULARY_UUID);
168 168
	    TermVocabulary<NamedArea> vocabulary = vocabularyService.load(termUUID);
169 169
	    vocabulary = CdmBase.deproxy(vocabulary, TermVocabulary.class);
170 170
	    return vocabulary.getTermsOrderedByLabels(Language.DEFAULT());
......
213 213

  
214 214
	public TaxonNode getChosenTaxonNode() {
215 215
		VaadinSession session = VaadinSession.getCurrent();
216
		UUID taxonNodeUUID = (UUID) session.getAttribute("taxonNodeUUID");
216
		UUID taxonNodeUUID = (UUID) session.getAttribute(DistributionEditorUtil.SATTR_TAXON_NODE_UUID);
217 217
		TaxonNode classificationNode = taxonNodeService.load(taxonNodeUUID);
218 218
		return classificationNode;
219 219
	}
......
230 230
			nodeIds.add(taxonNode.getId());
231 231
		}
232 232
		Set<NamedArea> namesAreas = getNamedAreas();
233
		CdmSQLContainer container = new CdmSQLContainer(CdmQueryFactory.generateTaxonDistributionQuery(nodeIds, namesAreas, true));
233
		CdmSQLContainer container = new CdmSQLContainer(CdmQueryFactory.generateTaxonDistributionQuery(nodeIds, namesAreas));
234 234
		return container;
235 235
	}
236 236

  

Also available in: Unified diff