Revision 233a8fe2
Added by Cherian Mathew over 8 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java | ||
---|---|---|
27 | 27 |
private static TaxonEditorInput instance; |
28 | 28 |
/** Constant <code>ID="bulkeditor.input.taxon"</code> */ |
29 | 29 |
public static final String ID = "bulkeditor.input.taxon"; |
30 |
|
|
31 |
|
|
32 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 | 33 |
/** |
34 | 34 |
* <p>Getter for the field <code>instance</code>.</p> |
35 | 35 |
* |
... | ... | |
39 | 39 |
if (instance == null) { |
40 | 40 |
instance = new TaxonEditorInput(); |
41 | 41 |
} |
42 |
|
|
42 |
|
|
43 | 43 |
return instance; |
44 | 44 |
} |
45 |
|
|
46 |
|
|
45 |
|
|
46 |
|
|
47 | 47 |
@Override |
48 | 48 |
public String getName() { |
49 | 49 |
return BulkEditorInputType.TAXON.label; |
... | ... | |
54 | 54 |
return getName(); |
55 | 55 |
} |
56 | 56 |
|
57 |
|
|
57 |
|
|
58 | 58 |
/** |
59 | 59 |
* <p>getID</p> |
60 | 60 |
* |
... | ... | |
63 | 63 |
public static Object getID() { |
64 | 64 |
return ID; |
65 | 65 |
} |
66 |
|
|
66 |
|
|
67 | 67 |
/* (non-Javadoc) |
68 | 68 |
* @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled() |
69 | 69 |
*/ |
... | ... | |
74 | 74 |
} |
75 | 75 |
@Override |
76 | 76 |
public boolean save(TaxonBase entity) { |
77 |
return CdmStore.getService(ITaxonService.class).saveOrUpdate(entity) != null; |
|
77 |
if(CdmStore.getCurrentSessionManager().isRemoting()) { |
|
78 |
return CdmStore.getService(ITaxonService.class).merge(entity) != null; |
|
79 |
} else { |
|
80 |
return CdmStore.getService(ITaxonService.class).saveOrUpdate(entity) != null; |
|
81 |
} |
|
78 | 82 |
} |
79 | 83 |
|
80 |
|
|
84 |
|
|
81 | 85 |
|
82 | 86 |
/** {@inheritDoc} */ |
83 | 87 |
@Override |
... | ... | |
88 | 92 |
List<TaxonBase> taxa = CdmStore.getSearchManager().findTaxa(configurator); |
89 | 93 |
List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>(); |
90 | 94 |
for (TaxonBase taxon:taxa){ |
91 |
|
|
95 |
|
|
92 | 96 |
if (taxon instanceof Taxon){ |
93 | 97 |
taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class)); |
94 | 98 |
}else{ |
... | ... | |
101 | 105 |
|
102 | 106 |
@Override |
103 | 107 |
protected TaxonBase loadEntity(UUID entityUuid) { |
104 |
List<String> propertyPaths = Arrays.asList(new String[]{});
|
|
108 |
List<String> propertyPaths = Arrays.asList(new String[]{}); |
|
105 | 109 |
return CdmStore.getService(ITaxonService.class).load(entityUuid, propertyPaths); |
106 | 110 |
} |
107 | 111 |
|
108 |
|
|
109 | 112 |
|
110 |
/** {@inheritDoc} |
|
113 |
|
|
114 |
/** {@inheritDoc} |
|
111 | 115 |
* @throws ReferencedObjectUndeletableException */ |
112 |
public boolean delete(TaxonBase entity) { |
|
116 |
@Override |
|
117 |
public boolean delete(TaxonBase entity) { |
|
113 | 118 |
return CdmStore.getService(ITaxonService.class).delete(entity) != null; |
114 | 119 |
} |
115 | 120 |
@Override |
Also available in: Unified diff
#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