- @Override
- public void merge() {
- if(CdmStore.getCurrentSessionManager().isRemoting()) {
- CdmApplicationState.getCurrentAppConfig().getOccurrenceService().merge(new ArrayList(getRootEntities()), true);
- }
-
- }
-
- @Override
- public Map<Object, List<String>> getPropertyPathsMap() {
- List<String> specimenPropertyPaths = Arrays.asList(new String[] {
- "descriptions",
- "derivationEvents.derivates",
- "annotations",
- "markers",
- "credits",
- "extensions",
- "rights",
- "sources"
- });
- Map<Object, List<String>> specimenPropertyPathMap =
- new HashMap<Object, List<String>>();
- specimenPropertyPathMap.put(SpecimenOrObservationBase.class,specimenPropertyPaths);
- return specimenPropertyPathMap;
- }
-
- public void updateRootEntities(Collection<UUID> derivateUuids) {
- this.derivateEntities = new HashSet<SpecimenOrObservationBase<?>>();
- this.rootEntities = new HashSet<SpecimenOrObservationBase<?>>();
- for (UUID uuid : derivateUuids) {
- SpecimenOrObservationBase<?> derivate = CdmStore.getService(IOccurrenceService.class).load(uuid, SPECIMEN_INIT_STRATEGY);
- derivateEntities.add(derivate);
- if(derivate instanceof FieldUnit){
- rootEntities.add(derivate);
- }
- else if(derivate instanceof DerivedUnit){
- SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
- if(topMostDerivate!=null){
- rootEntities.add(topMostDerivate);
- }
- }
- }
- if(rootEntities.isEmpty()){
- rootEntities = derivateEntities;
- }
- }
-