Project

General

Profile

« Previous | Next » 

Revision 233a8fe2

Added by Cherian Mathew almost 9 years ago

#5012 Adding remoting session and updating save methods for Bulk Editor

Replace properties file with xml file

#5012 updates for making Bulk Editor remoting capable

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10 10

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

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

  
17 15
import eu.etaxonomy.cdm.api.service.IGroupService;
18 16
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
......
30 28
public class GroupEditorInput extends AbstractBulkEditorInput<Group> {
31 29

  
32 30
	public static final String ID = "bulkeditor.input.group";
33
	
31

  
34 32
	private static GroupEditorInput instance;
35
	
33

  
36 34
	/**
37 35
	 * @return the instance
38 36
	 */
......
42 40
		}
43 41
		return instance;
44 42
	}
45
	
43

  
46 44
	/* (non-Javadoc)
47 45
	 * @see org.eclipse.ui.IEditorInput#getName()
48 46
	 */
......
64 62
	 */
65 63
	@Override
66 64
	public boolean save(Group entity) {
67
		return CdmStore.getService(IGroupService.class).saveOrUpdate(entity) != null;
65
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
66
	        return CdmStore.getService(IGroupService.class).merge(entity) != null;
67
	    } else {
68
	        return CdmStore.getService(IGroupService.class).saveOrUpdate(entity) != null;
69
	    }
68 70
	}
69 71

  
70 72
	/* (non-Javadoc)
......
86 88

  
87 89
	/* (non-Javadoc)
88 90
	 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
89
	 
91

  
90 92
	@Override
91 93
	protected Group loadEntity(UUID entityUuid) {
92
		List<String> propertyPaths = Arrays.asList(new String[]{}); 
94
		List<String> propertyPaths = Arrays.asList(new String[]{});
93 95
		return CdmStore.getService(IGroupService.class).load(entityUuid, propertyPaths);
94 96
	}
95 97
*/
......
100 102
	protected IEntityCreator<Group> createEntityCreator() {
101 103
		return new GroupCreator();
102 104
	}
103
	
105

  
104 106
	/* (non-Javadoc)
105 107
	 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase)
106 108
	 */
......
109 111
		return entity.getName();
110 112
	}
111 113

  
112
	
114

  
113 115

  
114 116
}

Also available in: Unified diff