Revision c949f813
Added by Niels Hoffmann almost 14 years ago
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java | ||
---|---|---|
9 | 9 |
*/ |
10 | 10 |
package eu.etaxonomy.taxeditor.bulkeditor.input; |
11 | 11 |
|
12 |
import java.util.Arrays; |
|
13 |
import java.util.List; |
|
14 |
import java.util.UUID; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
|
12 | 17 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
18 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
|
19 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
13 | 20 |
|
14 | 21 |
|
15 | 22 |
/** |
... | ... | |
17 | 24 |
* @created 25.06.2009 |
18 | 25 |
* @version 1.0 |
19 | 26 |
*/ |
20 |
public class ReferenceEditorInput extends BulkEditorInput { |
|
27 |
public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> { |
|
28 |
|
|
29 |
/** |
|
30 |
* |
|
31 |
*/ |
|
32 |
private static final long serialVersionUID = 3806243517765126749L; |
|
21 | 33 |
|
22 | 34 |
public static final String ID = "bulkeditor.input.reference"; |
23 | 35 |
|
... | ... | |
54 | 66 |
/** |
55 | 67 |
* @return |
56 | 68 |
*/ |
57 |
public static BulkEditorInput getInstance() { |
|
69 |
public static AbstractBulkEditorInput getInstance() {
|
|
58 | 70 |
if (instance == null) { |
59 | 71 |
instance = new ReferenceEditorInput(); |
60 | 72 |
} |
... | ... | |
79 | 91 |
} |
80 | 92 |
return super.isMarkerTypeEditingEnabled(markerType); |
81 | 93 |
} |
94 |
|
|
95 |
// Entity persistence |
|
96 |
|
|
97 |
@Override |
|
98 |
public List listEntities(IIdentifiableEntityServiceConfigurator configurator) { |
|
99 |
return CdmStore.findReferences(configurator); |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public ReferenceBase loadEntity(UUID entityUuid) { |
|
104 |
List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"}); |
|
105 |
return CdmStore.getReferenceService().load(entityUuid, propertyPaths); |
|
106 |
} |
|
107 |
|
|
108 |
public boolean delete(Object entity) { |
|
109 |
return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null; |
|
110 |
} |
|
111 |
|
|
112 |
public boolean save(Object entity) { |
|
113 |
return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null; |
|
114 |
} |
|
82 | 115 |
} |
Also available in: Unified diff
tabbed_properties branch merged into trunk completely