import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
//description2 has to also be a TaxonDescription
TaxonDescription taxonDescription1 = (TaxonDescription)description1;
TaxonDescription taxonDescription2 = (TaxonDescription)description2;
- boolean isComputed1 = taxonDescription1.getMarkers().stream()
- .anyMatch(marker -> marker.getMarkerType().equals(MarkerType.COMPUTED()));
- boolean isComputed2 = taxonDescription2.getMarkers().stream()
- .anyMatch(marker -> marker.getMarkerType().equals(MarkerType.COMPUTED()));
+ boolean isComputed1 = taxonDescription1.getTypes().stream()
+ .anyMatch(type -> type.equals(DescriptionType.AGGREGATED));
+ boolean isComputed2 = taxonDescription2.getTypes().stream()
+ .anyMatch(type -> type.equals(DescriptionType.AGGREGATED));
if(isComputed1){
if(!isComputed2){
return -1;
import java.util.stream.Collectors;
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
-import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.QuantitativeData;
}
public static boolean isDefaultTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){
- return hasMarker(taxonRowWrapperDTO, MarkerType.TO_BE_CHECKED());
+ return hasType(taxonRowWrapperDTO, DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION);
}
public static boolean isAggregatedTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){
- return hasMarker(taxonRowWrapperDTO, MarkerType.COMPUTED());
+ return hasType(taxonRowWrapperDTO, DescriptionType.AGGREGATED);
}
public static boolean isLiteratureTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){
- return hasMarker(taxonRowWrapperDTO, MarkerType.IN_BIBLIOGRAPHY());
+ return hasType(taxonRowWrapperDTO, DescriptionType.SECONDARY_DATA);
}
- private static boolean hasMarker(TaxonRowWrapperDTO taxonRowWrapperDTO, MarkerType markerType){
- return taxonRowWrapperDTO.getDescription().getMarkers().stream()
- .anyMatch(marker->marker.getMarkerType().equals(markerType));
+ private static boolean hasType(TaxonRowWrapperDTO taxonRowWrapperDTO, DescriptionType descriptionType){
+ return taxonRowWrapperDTO.getDescription().getTypes().stream()
+ .anyMatch(type->type.equals(descriptionType));
}
}
import org.eclipse.jface.viewers.IStructuredSelection;
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
-import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
public class CreateDefaultTaxonDescriptionHandler extends CreateTaxonDescriptionHandler{
@Override
- protected boolean getMarkerFlag() {
- return true;
- }
-
- @Override
- protected MarkerType getMarkerType() {
- //FIXME #7957 Use actual marker type when implemented
- return MarkerType.TO_BE_CHECKED();
+ protected DescriptionType getDescriptionType() {
+ return DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION;
}
@Override
TaxonNodeDto taxonNodeDto = (TaxonNodeDto) selection.getFirstElement();
TaxonDescription defaultTaxonDescription = CdmStore.getService(IDescriptiveDataSetService.class)
- .findTaxonDescriptionByMarkerType(descriptiveDataSet.getUuid(), taxonNodeDto.getUuid(), getMarkerType());
+ .findTaxonDescriptionByDescriptionType(descriptiveDataSet.getUuid(), taxonNodeDto.getUuid(), getDescriptionType());
canExecute = defaultTaxonDescription==null;
menuItem.setVisible(canExecute);
}
*/
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler;
-import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
/**
* @author pplitzner
public class CreateLiteratureTaxonDescriptionHandler extends CreateTaxonDescriptionHandler{
@Override
- protected boolean getMarkerFlag() {
- return true;
- }
-
- @Override
- protected MarkerType getMarkerType() {
- return MarkerType.IN_BIBLIOGRAPHY();
+ protected DescriptionType getDescriptionType() {
+ return DescriptionType.SECONDARY_DATA;
}
}
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
-import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
DescriptiveDataSet descriptiveDataSet = matrixPart.getDescriptiveDataSet();
TaxonNodeDto node = (TaxonNodeDto) matrixPart.getSelection().getFirstElement();
TaxonRowWrapperDTO taxonRowWrapperDTO = CdmStore.getService(IDescriptiveDataSetService.class)
- .createTaxonDescription(descriptiveDataSet.getUuid(), node.getUuid(), getMarkerType(), getMarkerFlag());
+ .createTaxonDescription(descriptiveDataSet.getUuid(), node.getUuid(), getDescriptionType());
matrixPart.getMatrix().getCdmEntitiySession().load(taxonRowWrapperDTO.getDescription(), true);
matrixPart.getMatrix().getDescriptions().add(taxonRowWrapperDTO);
}
- protected abstract boolean getMarkerFlag();
-
-
- protected abstract MarkerType getMarkerType();
+ protected abstract DescriptionType getDescriptionType();
@CanExecute
public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,