Search in sources :

Example 1 with DefaultProgressMonitor

use of eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor in project cdmlib by cybertaxonomy.

the class TestScriptService method aggregateDDS.

private void aggregateDDS(CdmApplicationController app) {
    System.out.println("find dds");
    DescriptiveDataSet dds = app.getDescriptiveDataSetService().find(21);
    UUID facciniaSubtreeUuid = UUID.fromString("cf0bc346-a203-4ad7-ad25-477098361db6");
    UUID arenarioAdamssubtreeUuid = UUID.fromString("0215e668-0a65-42cd-85e0-d97ce78e758b");
    TaxonNodeFilter filter = TaxonNodeFilter.NewSubtreeInstance(arenarioAdamssubtreeUuid);
    filter.setIncludeUnpublished(true);
    DefaultProgressMonitor monitor = DefaultProgressMonitor.NewInstance();
    StructuredDescriptionAggregationConfiguration config = StructuredDescriptionAggregationConfiguration.NewInstance(filter, monitor);
    config.setDatasetUuid(dds.getUuid());
    config.setAggregationMode(AggregationMode.byWithinTaxonAndToParent());
    config.setAdaptBatchSize(false);
    UpdateResult result = config.getTaskInstance().invoke(config, app);
    System.out.println(result);
// app.getLongRunningTasksService().invoke(config);
}
Also used : TaxonNodeFilter(eu.etaxonomy.cdm.filter.TaxonNodeFilter) DescriptiveDataSet(eu.etaxonomy.cdm.model.description.DescriptiveDataSet) StructuredDescriptionAggregationConfiguration(eu.etaxonomy.cdm.api.service.description.StructuredDescriptionAggregationConfiguration) DefaultProgressMonitor(eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor) UUID(java.util.UUID) UpdateResult(eu.etaxonomy.cdm.api.service.UpdateResult)

Example 2 with DefaultProgressMonitor

use of eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor in project cdmlib by cybertaxonomy.

the class TestScriptService method aggregateDistribution.

private void aggregateDistribution(CdmApplicationController app) {
    System.out.println("agg distr");
    DefaultProgressMonitor monitor = DefaultProgressMonitor.NewInstance();
    UUID descriptaceaeUuid = UUID.fromString("5a37c47c-347c-49f8-88ba-2720b194dfb9");
    TaxonNodeFilter filter = TaxonNodeFilter.NewSubtreeInstance(descriptaceaeUuid);
    filter.setIncludeUnpublished(true);
    List<AggregationMode> aggregationModes = AggregationMode.byToParent();
    TermTree<PresenceAbsenceTerm> statusOrder = null;
    List<UUID> superAreas = new ArrayList<>();
    DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(aggregationModes, superAreas, filter, statusOrder, monitor);
    config.setAdaptBatchSize(false);
    UpdateResult result = config.getTaskInstance().invoke(config, app);
    System.out.println(result);
}
Also used : TaxonNodeFilter(eu.etaxonomy.cdm.filter.TaxonNodeFilter) AggregationMode(eu.etaxonomy.cdm.api.service.description.AggregationMode) ArrayList(java.util.ArrayList) DistributionAggregationConfiguration(eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration) DefaultProgressMonitor(eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor) PresenceAbsenceTerm(eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm) UUID(java.util.UUID) UpdateResult(eu.etaxonomy.cdm.api.service.UpdateResult)

Aggregations

UpdateResult (eu.etaxonomy.cdm.api.service.UpdateResult)2 DefaultProgressMonitor (eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor)2 TaxonNodeFilter (eu.etaxonomy.cdm.filter.TaxonNodeFilter)2 UUID (java.util.UUID)2 AggregationMode (eu.etaxonomy.cdm.api.service.description.AggregationMode)1 DistributionAggregationConfiguration (eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration)1 StructuredDescriptionAggregationConfiguration (eu.etaxonomy.cdm.api.service.description.StructuredDescriptionAggregationConfiguration)1 DescriptiveDataSet (eu.etaxonomy.cdm.model.description.DescriptiveDataSet)1 PresenceAbsenceTerm (eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm)1 ArrayList (java.util.ArrayList)1