Project

General

Profile

« Previous | Next » 

Revision 51188df7

Added by Katja Luther over 7 years ago

add session to bulk editor

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java
10 10

  
11 11
package eu.etaxonomy.taxeditor.bulkeditor.input;
12 12

  
13
import java.util.ArrayList;
14
import java.util.Arrays;
13 15
import java.util.List;
16
import java.util.UUID;
14 17

  
15 18
import eu.etaxonomy.cdm.api.service.INameService;
16 19
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
......
98 101
	/** {@inheritDoc} */
99 102
	@Override
100 103
	public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {
101
		return CdmStore.getSearchManager().findNames(configurator);
104
		
105
		configurator.setPropertyPaths(getPropertyPaths());
106
		return CdmStore.getSearchManager().findNames(configurator, this.getConversation());
102 107
	}
103 108

  
104 109
	/** {@inheritDoc}
......
118 123
	/** {@inheritDoc} */
119 124
	@Override
120 125
    public TaxonNameBase save(TaxonNameBase entity) {
121
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
122
	        return CdmStore.getService(INameService.class).merge(entity, true).getMergedEntity();
123
	    } else {
124
	        CdmStore.getService(INameService.class).saveOrUpdate(entity);
125
	        return entity;
126
	    }
126
		TaxonNameBase mergedName = null;
127
		
128
		if(CdmStore.getCurrentSessionManager().isRemoting()) {
129
			mergedName =  CdmStore.getService(INameService.class).merge(entity, true).getMergedEntity();
130
	    } 
131
		
132
		return mergedName;
133
		
127 134
	}
128 135

  
129 136
	/* (non-Javadoc)
......
173 180

  
174 181
    }
175 182

  
183
    private List<String> getPropertyPaths(){
184
    	 List<String> nameBasePropertyPaths = Arrays.asList(new String[] {
185
    	 "name.descriptions",
186
         "name.typeDesignations",
187
         "name.status",
188
         "name.nomenclaturalReference.inReference",
189
         "name.taxonBases.taxonNodes",
190
         "name.relationsFromThisName",
191
         "name.relationsToThisName",
192
         "name.homotypicalGroup.typifiedNames.taxonBases.synonymRelations.synonym.name.status",
193
         "name.homotypicalGroup.typifiedNames.relationsToThisName.fromName"});
194
    	 
195
    	 return nameBasePropertyPaths;
196
    }
176 197

  
177 198
}

Also available in: Unified diff