feature_24570 #11
|
@ -1,5 +1,8 @@
|
||||||
# Changelog for org.gcube.application.cms.concessioni-lifecycle
|
# Changelog for org.gcube.application.cms.concessioni-lifecycle
|
||||||
|
|
||||||
|
## [v1.0.4-SNAPSHOT] - 2023-03-03
|
||||||
|
- [#24702] Fixed the default-lc-managers dependency
|
||||||
|
|
||||||
## [v1.0.3] - 2023-01-10
|
## [v1.0.3] - 2023-01-10
|
||||||
- Pom updates
|
- Pom updates
|
||||||
- Fixes default access
|
- Fixes default access
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>concessioni-lifecycle</artifactId>
|
<artifactId>concessioni-lifecycle</artifactId>
|
||||||
<version>1.0.3</version>
|
<version>1.0.4-SNAPSHOT</version>
|
||||||
<name>GNA Concessioni Lifecycle</name>
|
<name>GNA Concessioni Lifecycle</name>
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
<artifactId>default-lc-managers</artifactId>
|
<artifactId>default-lc-managers</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
# Changelog for org.gcube.application.cms.ckan-plugin
|
# Changelog for org.gcube.application.cms.ckan-plugin
|
||||||
|
|
||||||
|
## [v1.1.1-SNAPSHOT] - 2023-02-23
|
||||||
|
|
||||||
|
- [#24570] Integrated the UnPublish operation
|
||||||
|
|
||||||
## [v1.0.1] - 2023-01-10
|
## [v1.0.1] - 2023-01-10
|
||||||
- Pom updates
|
- Pom updates
|
||||||
|
|
||||||
- ## [v1.0.0] - 2022-02-24
|
## [v1.0.0] - 2022-02-24
|
||||||
- First release
|
- First release
|
||||||
|
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>default-lc-managers</artifactId>
|
<artifactId>default-lc-managers</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.1.1-SNAPSHOT</version>
|
||||||
<name>gCube CMS - Default LC Managers</name>
|
<name>gCube CMS - Default LC Managers</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,22 @@
|
||||||
package org.gcube.application.cms.plugins.implementations;
|
package org.gcube.application.cms.plugins.implementations;
|
||||||
|
|
||||||
import lombok.Setter;
|
import java.util.HashMap;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.application.cms.implementations.ProjectAccess;
|
import org.gcube.application.cms.implementations.ProjectAccess;
|
||||||
import org.gcube.application.cms.implementations.utils.UserUtils;
|
import org.gcube.application.cms.implementations.utils.UserUtils;
|
||||||
import org.gcube.application.cms.plugins.LifecycleManager;
|
import org.gcube.application.cms.plugins.LifecycleManager;
|
||||||
import org.gcube.application.cms.plugins.PluginManagerInterface;
|
import org.gcube.application.cms.plugins.PluginManagerInterface;
|
||||||
import org.gcube.application.cms.plugins.faults.*;
|
import org.gcube.application.cms.plugins.faults.EventException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.MaterializationException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.ShutDownException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.StepException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.UnrecognizedEventException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.UnrecognizedStepException;
|
||||||
import org.gcube.application.cms.plugins.implementations.executions.GuardedEventManager;
|
import org.gcube.application.cms.plugins.implementations.executions.GuardedEventManager;
|
||||||
import org.gcube.application.cms.plugins.implementations.executions.GuardedStepExecution;
|
import org.gcube.application.cms.plugins.implementations.executions.GuardedStepExecution;
|
||||||
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||||
|
@ -25,10 +35,9 @@ import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.plugins.PluginDescriptor;
|
import org.gcube.application.geoportal.common.model.plugins.PluginDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.utils.ContextUtils;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import lombok.Setter;
|
||||||
import java.util.Map;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class AbstractLifeCycleManager extends AbstractPlugin implements LifecycleManager {
|
public abstract class AbstractLifeCycleManager extends AbstractPlugin implements LifecycleManager {
|
||||||
|
@ -118,7 +127,12 @@ public abstract class AbstractLifeCycleManager extends AbstractPlugin implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StepExecutionReport performStep(StepExecutionRequest request) throws StepException, InvalidPluginRequestException, InvalidProfileException, ConfigurationException, InsufficientPrivileges {
|
public StepExecutionReport performStep(StepExecutionRequest request) throws StepException, InvalidPluginRequestException, InvalidProfileException, ConfigurationException, InsufficientPrivileges {
|
||||||
log.info("Serving Request {}",request);
|
log.info("Serving Request - caller {}, ucd id {}, document id {}, step {}",
|
||||||
|
request.getCaller(),
|
||||||
|
request.getUseCaseDescriptor().getId(),
|
||||||
|
request.getDocument().getId(),
|
||||||
|
request.getStep());
|
||||||
|
log.debug("Serving Request full log {}",request);
|
||||||
|
|
||||||
log.debug("Checking is STEP {} is supported by {}",request.getStep(),DESCRIPTOR.getId());
|
log.debug("Checking is STEP {} is supported by {}",request.getStep(),DESCRIPTOR.getId());
|
||||||
if(!registeredSteps.containsKey(request.getStep()))
|
if(!registeredSteps.containsKey(request.getStep()))
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package org.gcube.application.cms.plugins.implementations;
|
package org.gcube.application.cms.plugins.implementations;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.application.cms.plugins.Plugin;
|
import org.gcube.application.cms.plugins.Plugin;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public abstract class AbstractPlugin implements Plugin {
|
public abstract class AbstractPlugin implements Plugin {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.gcube.application.cms.plugins.implementations;
|
package org.gcube.application.cms.plugins.implementations;
|
||||||
|
|
||||||
import com.vdurmont.semver4j.Semver;
|
import java.util.Collections;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
||||||
import org.gcube.application.cms.plugins.LifecycleManager;
|
import org.gcube.application.cms.plugins.LifecycleManager;
|
||||||
|
@ -13,33 +13,39 @@ import org.gcube.application.cms.plugins.implementations.executions.GuardedStepE
|
||||||
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
||||||
|
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||||
import org.gcube.application.geoportal.common.model.configuration.Configuration;
|
import org.gcube.application.geoportal.common.model.configuration.Configuration;
|
||||||
import org.gcube.application.geoportal.common.model.configuration.Index;
|
import org.gcube.application.geoportal.common.model.configuration.Index;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.utils.Files;
|
import org.gcube.application.geoportal.common.utils.Files;
|
||||||
|
|
||||||
import java.util.Collections;
|
import com.vdurmont.semver4j.Semver;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Default3PhaseManager extends SimpleLifeCycleManager implements LifecycleManager {
|
public class Default3PhaseManager extends SimpleLifeCycleManager implements LifecycleManager {
|
||||||
|
|
||||||
protected static class Phases {
|
protected static class Phases {
|
||||||
public static final String PENDING_APPROVAL="Pending Approval";
|
public static final String PENDING_APPROVAL="Pending Approval";
|
||||||
public static final String PUBLISHED="Published";
|
public static final String PUBLISHED=SimpleLifeCycleManager.Phases.PUBLISHED;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class STEPS{
|
public static final class STEPS{
|
||||||
public static final OperationDescriptor SUBMIT=new OperationDescriptor("SUBMIT-FOR-REVIEW","Submits the Draft for reviewing");
|
public static final OperationDescriptor SUBMIT=new OperationDescriptor("SUBMIT-FOR-REVIEW","Submits the Draft for reviewing");
|
||||||
public static final OperationDescriptor REJECT=new OperationDescriptor("REJECT-DRAFT","Rejects the submitted Draft");
|
public static final OperationDescriptor REJECT=new OperationDescriptor("REJECT-DRAFT","Rejects the submitted Draft");
|
||||||
public static final OperationDescriptor APPROVE=new OperationDescriptor("APPROVE-SUBMITTED","Approves the submitted Draft");
|
public static final OperationDescriptor APPROVE=new OperationDescriptor("APPROVE-SUBMITTED","Approves the submitted Draft");
|
||||||
|
public static final OperationDescriptor UNPUBLISH = new OperationDescriptor("UNPUBLISH","UnPublish the project. DeMaterialize and DeIndex the project");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
SUBMIT.setAppliableToPhases(Collections.singletonList(LifecycleInformation.CommonPhases.DRAFT_PHASE));
|
SUBMIT.setAppliableToPhases(Collections.singletonList(LifecycleInformation.CommonPhases.DRAFT_PHASE));
|
||||||
REJECT.setAppliableToPhases(Collections.singletonList(Phases.PENDING_APPROVAL));
|
REJECT.setAppliableToPhases(Collections.singletonList(Phases.PENDING_APPROVAL));
|
||||||
APPROVE.setAppliableToPhases(Collections.singletonList(Phases.PENDING_APPROVAL));
|
APPROVE.setAppliableToPhases(Collections.singletonList(Phases.PENDING_APPROVAL));
|
||||||
|
UNPUBLISH.setAppliableToPhases(Collections.singletonList(Phases.PUBLISHED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +98,9 @@ public class Default3PhaseManager extends SimpleLifeCycleManager implements Life
|
||||||
return executeReject(theReport);
|
return executeReject(theReport);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Updated by Francesco
|
||||||
|
setStep(d3PhaseUnPublishStep());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Default3PhaseManager() {
|
public Default3PhaseManager() {
|
||||||
|
@ -101,6 +110,40 @@ public class Default3PhaseManager extends SimpleLifeCycleManager implements Life
|
||||||
DESCRIPTOR.setLabel("Default 3-Phase");
|
DESCRIPTOR.setLabel("Default 3-Phase");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Updated by Francesco. DeIndexing (only) from PublicIndex and InternalIndex (GIS-CENTROIDS plugin with 'public' and "internal" flag)
|
||||||
|
protected GuardedStepExecution d3PhaseUnPublishStep() {
|
||||||
|
|
||||||
|
return new GuardedStepExecution(STEPS.UNPUBLISH) {
|
||||||
|
@Override
|
||||||
|
protected StepExecutionReport run() throws Exception {
|
||||||
|
log.info( STEPS.UNPUBLISH+ " running...");
|
||||||
|
//DeMaterialize
|
||||||
|
JSONPathWrapper wrapper = new JSONPathWrapper(theReport.getTheRequest().getDocument().getTheDocument().toJson());
|
||||||
|
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){
|
||||||
|
log.info("Requesting dematerialization for {} ",s);
|
||||||
|
for(MaterializationPlugin mat : getMaterializers(theReport.getTheRequest()))
|
||||||
|
theReport = deMaterialize(theReport,mat,new Document("fileSetPath",s));
|
||||||
|
if(!theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//DeIndex
|
||||||
|
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK)) {
|
||||||
|
for(IndexerPluginInterface indexer : getIndexers(theReport.getTheRequest())) {
|
||||||
|
log.info("Requesting deindexing for {} ",indexer.getDescriptor());
|
||||||
|
theReport = deIndex(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
|
||||||
|
theReport = deIndex(theReport,indexer,getInternalIndexParams(theReport.getTheRequest()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
|
theReport.getToSetLifecycleInformation().setPhase(LifecycleInformation.CommonPhases.DRAFT_PHASE);
|
||||||
|
|
||||||
|
|
||||||
|
return theReport;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Configuration getCurrentConfiguration(BaseRequest req) throws ConfigurationException {
|
public Configuration getCurrentConfiguration(BaseRequest req) throws ConfigurationException {
|
||||||
|
@ -123,6 +166,8 @@ public class Default3PhaseManager extends SimpleLifeCycleManager implements Life
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected Document getInternalIndexParams(BaseRequest req){
|
protected Document getInternalIndexParams(BaseRequest req){
|
||||||
Document callParameters = new Document();
|
Document callParameters = new Document();
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,23 @@
|
||||||
package org.gcube.application.cms.plugins.implementations;
|
package org.gcube.application.cms.plugins.implementations;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import java.util.HashMap;
|
||||||
import lombok.*;
|
import java.util.List;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.gcube.application.cms.serialization.Serialization;
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ToString
|
@ToString
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package org.gcube.application.cms.plugins.implementations;
|
package org.gcube.application.cms.plugins.implementations;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
||||||
import org.gcube.application.cms.plugins.LifecycleManager;
|
import org.gcube.application.cms.plugins.LifecycleManager;
|
||||||
|
@ -10,7 +13,12 @@ import org.gcube.application.cms.plugins.faults.IndexingException;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.plugins.faults.MaterializationException;
|
import org.gcube.application.cms.plugins.faults.MaterializationException;
|
||||||
import org.gcube.application.cms.plugins.implementations.executions.GuardedStepExecution;
|
import org.gcube.application.cms.plugins.implementations.executions.GuardedStepExecution;
|
||||||
import org.gcube.application.cms.plugins.reports.*;
|
import org.gcube.application.cms.plugins.reports.DocumentHandlingReport;
|
||||||
|
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||||
|
import org.gcube.application.cms.plugins.reports.IndexDocumentReport;
|
||||||
|
import org.gcube.application.cms.plugins.reports.MaterializationReport;
|
||||||
|
import org.gcube.application.cms.plugins.reports.Report;
|
||||||
|
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
||||||
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
||||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||||
|
@ -28,9 +36,7 @@ import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDec
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
import org.gcube.application.geoportal.common.utils.Files;
|
import org.gcube.application.geoportal.common.utils.Files;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements LifecycleManager {
|
public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements LifecycleManager {
|
||||||
|
@ -42,13 +48,21 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
|
||||||
DESCRIPTOR.setId(PLUGIN_ID);
|
DESCRIPTOR.setId(PLUGIN_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Updated by Francesco
|
||||||
|
protected static class Phases {
|
||||||
|
public static final String PUBLISHED="Published";
|
||||||
|
public static final String UNPUBLISHED="UnPublished";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Updated by Francesco
|
||||||
private static class Steps {
|
private static class Steps {
|
||||||
public static final OperationDescriptor PUBLISH = new OperationDescriptor("PUBLISH","Materialize & index project");
|
public static final OperationDescriptor PUBLISH = new OperationDescriptor("PUBLISH","Materialize & index project");
|
||||||
|
public static final OperationDescriptor UNPUBLISH = new OperationDescriptor("UNPUBLISH","UnPublish the project. DeMaterialize and DeIndex the project");
|
||||||
|
|
||||||
static{
|
static{
|
||||||
PUBLISH.setAppliableToPhases(Collections.singletonList(LifecycleInformation.CommonPhases.DRAFT_PHASE));
|
PUBLISH.setAppliableToPhases(Collections.singletonList(LifecycleInformation.CommonPhases.DRAFT_PHASE));
|
||||||
|
UNPUBLISH.setAppliableToPhases(Collections.singletonList(Phases.PUBLISHED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,11 +126,43 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
|
||||||
theReport = index(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
|
theReport = index(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
|
||||||
// setPhase
|
// setPhase
|
||||||
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
theReport.getToSetLifecycleInformation().setPhase("PUBLISHED");
|
//TODO CHANGED THE SET PHASE ID
|
||||||
|
//theReport.getToSetLifecycleInformation().setPhase("PUBLISHED");
|
||||||
|
theReport.getToSetLifecycleInformation().setPhase(Phases.PUBLISHED);
|
||||||
}
|
}
|
||||||
return theReport;
|
return theReport;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Updated by Francesco. DeIndexing (only) from PublicIndexParams (GIS-CENTROIDS plugin with 'public' flag)
|
||||||
|
setStep(new GuardedStepExecution(Steps.UNPUBLISH) {
|
||||||
|
@Override
|
||||||
|
protected StepExecutionReport run() throws Exception {
|
||||||
|
log.info(Steps.UNPUBLISH+ " running...");
|
||||||
|
//DeMaterialize
|
||||||
|
JSONPathWrapper wrapper = new JSONPathWrapper(theReport.getTheRequest().getDocument().getTheDocument().toJson());
|
||||||
|
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){
|
||||||
|
log.info("Requesting dematerialization for {} ",s);
|
||||||
|
for(MaterializationPlugin mat : getMaterializers(theReport.getTheRequest()))
|
||||||
|
theReport = deMaterialize(theReport,mat,new Document("fileSetPath",s));
|
||||||
|
if(!theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//DeIndex
|
||||||
|
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK)) {
|
||||||
|
for(IndexerPluginInterface indexer : getIndexers(theReport.getTheRequest())) {
|
||||||
|
log.info("Requesting deindexing for {} ",indexer.getDescriptor());
|
||||||
|
theReport = deIndex(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(theReport.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
|
theReport.getToSetLifecycleInformation().setPhase(LifecycleInformation.CommonPhases.DRAFT_PHASE);
|
||||||
|
|
||||||
|
|
||||||
|
return theReport;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void blockNonDraft(EventExecutionReport report) throws InvalidPluginRequestException {
|
protected void blockNonDraft(EventExecutionReport report) throws InvalidPluginRequestException {
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package org.gcube.application.cms.plugins.implementations.executions;
|
package org.gcube.application.cms.plugins.implementations.executions;
|
||||||
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||||
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class GuardedEventManager extends GuardedExecution<EventExecutionRequest,EventExecutionReport>{
|
public abstract class GuardedEventManager extends GuardedExecution<EventExecutionRequest,EventExecutionReport>{
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package org.gcube.application.cms.plugins.implementations.executions;
|
package org.gcube.application.cms.plugins.implementations.executions;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
||||||
import org.gcube.application.cms.plugins.faults.StepException;
|
import org.gcube.application.cms.plugins.faults.StepException;
|
||||||
import org.gcube.application.cms.plugins.reports.DocumentHandlingReport;
|
import org.gcube.application.cms.plugins.reports.DocumentHandlingReport;
|
||||||
|
@ -12,6 +8,11 @@ import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -28,14 +29,14 @@ public abstract class GuardedExecution<R extends BaseExecutionRequest,T extends
|
||||||
|
|
||||||
protected T theReport;
|
protected T theReport;
|
||||||
|
|
||||||
protected void checks() throws ConfigurationException, InsufficientPrivileges {
|
protected void checks() throws ConfigurationException, InsufficientPrivileges, StepException {
|
||||||
if(theReport.getTheRequest()==null) throw new RuntimeException("Unexpected state : request cannot be null");
|
if(theReport.getTheRequest()==null) throw new RuntimeException("Unexpected state : request cannot be null");
|
||||||
|
|
||||||
// Check document phase
|
// Check document phase
|
||||||
if(op.getAppliableToPhases()!=null&&!op.getAppliableToPhases().isEmpty()) {
|
if(op.getAppliableToPhases()!=null&&!op.getAppliableToPhases().isEmpty()) {
|
||||||
String currentPhase = theReport.getTheRequest().getDocument().getLifecycleInformation().getPhase();
|
String currentPhase = theReport.getTheRequest().getDocument().getLifecycleInformation().getPhase();
|
||||||
if(!op.getAppliableToPhases().contains(currentPhase))
|
if(!op.getAppliableToPhases().contains(currentPhase))
|
||||||
new StepException("Document must be in one of the following phases : "+ op.getAppliableToPhases());
|
throw new StepException("Document must be in one of the following phases : "+ op.getAppliableToPhases());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
package org.gcube.application.cms.plugins.implementations.executions;
|
package org.gcube.application.cms.plugins.implementations.executions;
|
||||||
|
|
||||||
import org.gcube.application.cms.plugins.implementations.RoleManager;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
||||||
|
import org.gcube.application.cms.plugins.faults.StepException;
|
||||||
|
import org.gcube.application.cms.plugins.implementations.RoleManager;
|
||||||
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||||
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
public abstract class GuardedStepExecution extends GuardedExecution<StepExecutionRequest, StepExecutionReport>{
|
public abstract class GuardedStepExecution extends GuardedExecution<StepExecutionRequest, StepExecutionReport>{
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ public abstract class GuardedStepExecution extends GuardedExecution<StepExecutio
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checks() throws ConfigurationException, InsufficientPrivileges {
|
protected void checks() throws ConfigurationException, InsufficientPrivileges, StepException {
|
||||||
super.checks();
|
super.checks();
|
||||||
RoleManager r = new RoleManager(config);
|
RoleManager r = new RoleManager(config);
|
||||||
if(!r.canInvokeStep(theReport.getTheRequest().getStep(),theReport.getTheRequest().getCaller()))
|
if(!r.canInvokeStep(theReport.getTheRequest().getStep(),theReport.getTheRequest().getCaller()))
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package org.gcube.application.cms.plugins;
|
package org.gcube.application.cms.plugins;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.faults.StepException;
|
||||||
|
import org.gcube.application.cms.plugins.implementations.Default3PhaseManager;
|
||||||
|
import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
|
|
||||||
public class SimpleLifecycleTests {
|
public class SimpleLifecycleTests {
|
||||||
|
|
||||||
// NB cannot use test commons, need to separate modules
|
// NB cannot use test commons, need to separate modules
|
||||||
|
@ -21,4 +25,26 @@ public class SimpleLifecycleTests {
|
||||||
// manager.performStep()
|
// manager.performStep()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
System.out.println("Check start");
|
||||||
|
OperationDescriptor op = Default3PhaseManager.STEPS.APPROVE;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Check document phase
|
||||||
|
if (op.getAppliableToPhases() != null && !op.getAppliableToPhases().isEmpty()) {
|
||||||
|
String currentPhase = "Pending Approval";
|
||||||
|
if (!op.getAppliableToPhases().contains(currentPhase)) {
|
||||||
|
System.out.println("check KO");
|
||||||
|
throw new StepException(
|
||||||
|
"Document must be in one of the following phases : " + op.getAppliableToPhases());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("check OK");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Changelog for org.gcube.application.geoportal-service
|
# Changelog for org.gcube.application.geoportal-service
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.0.13-SNAPSHOT] - 2023-02-23
|
||||||
|
- Update version to next snapshot
|
||||||
|
|
||||||
## [v1.0.12] - 2023-01-10
|
## [v1.0.12] - 2023-01-10
|
||||||
- Refactored UserUtils into framework plugin
|
- Refactored UserUtils into framework plugin
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.application</groupId>
|
<groupId>org.gcube.application</groupId>
|
||||||
<artifactId>geoportal-service</artifactId>
|
<artifactId>geoportal-service</artifactId>
|
||||||
<version>1.0.12</version>
|
<version>1.0.13-SNAPSHOT</version>
|
||||||
<name>Geoportal Service</name>
|
<name>Geoportal Service</name>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: white;
|
background: white;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-fixed-top {
|
.navbar-fixed-top {
|
|
@ -1,5 +1,8 @@
|
||||||
# Changelog for org.gcube.application.cms.notifications-plugins
|
# Changelog for org.gcube.application.cms.notifications-plugins
|
||||||
|
|
||||||
|
## [v1.0.3-SNAPSHOT] - 2023-03-03
|
||||||
|
- [#24702] Fixed the default-lc-managers dependency
|
||||||
|
|
||||||
## [v1.0.2] - 2023-01-10
|
## [v1.0.2] - 2023-01-10
|
||||||
- Pom updates
|
- Pom updates
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>notifications-plugins</artifactId>
|
<artifactId>notifications-plugins</artifactId>
|
||||||
<version>1.0.2</version>
|
<version>1.0.3-SNAPSHOT</version>
|
||||||
<name>gCube CMS - Notifications Plugins</name>
|
<name>gCube CMS - Notifications Plugins</name>
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
<artifactId>default-lc-managers</artifactId>
|
<artifactId>default-lc-managers</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
|
21
pom.xml
21
pom.xml
|
@ -1,4 +1,5 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
|
@ -22,16 +23,16 @@
|
||||||
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
|
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
|
||||||
|
|
||||||
<!-- prod -->
|
<!-- prod -->
|
||||||
<gcube-bom-version>2.0.2</gcube-bom-version>
|
<!-- <gcube-bom-version>2.0.2</gcube-bom-version> -->
|
||||||
<gcube-smartgears-bom-version>2.1.1</gcube-smartgears-bom-version>
|
<!-- <gcube-smartgears-bom-version>2.1.1</gcube-smartgears-bom-version> -->
|
||||||
<gcube-portal-bom-version>3.6.3</gcube-portal-bom-version>
|
<!-- <gcube-portal-bom-version>3.6.3</gcube-portal-bom-version> -->
|
||||||
<storagehub-version-range>[1.0.0,2.0.0-SNAPSHOT)</storagehub-version-range>
|
<!-- <storagehub-version-range>[1.0.0,2.0.0-SNAPSHOT)</storagehub-version-range> -->
|
||||||
|
|
||||||
<!--dev -->
|
<!--dev -->
|
||||||
<!-- <gcube-bom-version>2.1.0-SNAPSHOT</gcube-bom-version>-->
|
<gcube-bom-version>2.1.0-SNAPSHOT</gcube-bom-version>
|
||||||
<!-- <gcube-smartgears-bom-version>2.2.0-SNAPSHOT</gcube-smartgears-bom-version>-->
|
<gcube-smartgears-bom-version>2.2.0-SNAPSHOT</gcube-smartgears-bom-version>
|
||||||
<!-- <gcube-portal-bom-version>3.7.0-SNAPSHOT</gcube-portal-bom-version>-->
|
<gcube-portal-bom-version>3.7.0-SNAPSHOT</gcube-portal-bom-version>
|
||||||
<!-- <storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range>-->
|
<storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range>
|
||||||
|
|
||||||
|
|
||||||
<plugin-framework-version>1.0.3</plugin-framework-version>
|
<plugin-framework-version>1.0.3</plugin-framework-version>
|
||||||
|
@ -164,7 +165,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- CUSTOM : CONCESSIONI-->
|
<!-- CUSTOM : CONCESSIONI -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog for org.gcube.application.cms.sdi-plugins
|
# Changelog for org.gcube.application.cms.sdi-plugins
|
||||||
|
|
||||||
|
## [v1.0.4-SNAPSHOT] - 2023-03-02
|
||||||
|
- Fixed the import from joda-time to java.time
|
||||||
|
- [#24702] Fixed the default-lc-managers dependency
|
||||||
|
|
||||||
## [v1.0.3] - 2023-01-24
|
## [v1.0.3] - 2023-01-24
|
||||||
- Fixes [#24476](https://support.d4science.org/issues/24476)
|
- Fixes [#24476](https://support.d4science.org/issues/24476)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>sdi-plugins</artifactId>
|
<artifactId>sdi-plugins</artifactId>
|
||||||
<version>1.0.3</version>
|
<version>1.0.4-SNAPSHOT</version>
|
||||||
<name>gCube CMS - SDI Plugins</name>
|
<name>gCube CMS - SDI Plugins</name>
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
<artifactId>default-lc-managers</artifactId>
|
<artifactId>default-lc-managers</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
package org.gcube.application.cms.sdi;
|
package org.gcube.application.cms.sdi;
|
||||||
|
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.cms.implementations.ISInterface;
|
import org.gcube.application.cms.implementations.ISInterface;
|
||||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
||||||
|
@ -8,24 +14,14 @@ import org.gcube.application.cms.sdi.engine.PostgisTable;
|
||||||
import org.gcube.application.cms.sdi.engine.SDIManagerWrapper;
|
import org.gcube.application.cms.sdi.engine.SDIManagerWrapper;
|
||||||
import org.gcube.application.cms.sdi.faults.SDIInteractionException;
|
import org.gcube.application.cms.sdi.faults.SDIInteractionException;
|
||||||
import org.gcube.application.cms.sdi.model.MappingObject;
|
import org.gcube.application.cms.sdi.model.MappingObject;
|
||||||
import org.gcube.application.cms.sdi.plugins.SDIIndexerPlugin;
|
|
||||||
import org.gcube.application.cms.tests.TestProfiles;
|
import org.gcube.application.cms.tests.TestProfiles;
|
||||||
import org.gcube.application.cms.tests.model.BasicTests;
|
import org.gcube.application.cms.tests.model.BasicTests;
|
||||||
import org.gcube.application.cms.tests.plugins.BasicPluginTest;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.joda.time.Instant;
|
|
||||||
import org.joda.time.format.DateTimeFormatter;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
public class LayerCreationTest extends BasicTests {
|
public class LayerCreationTest extends BasicTests {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.application.cms.sdi.plugins;
|
package org.gcube.application.cms.sdi.plugins;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.gcube.application.cms.serialization.Serialization;
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.document.filesets.sdi.GCubeSDILayer;
|
import org.gcube.application.geoportal.common.model.document.filesets.sdi.GCubeSDILayer;
|
||||||
import org.gcube.application.geoportal.common.model.document.identification.SpatialReference;
|
import org.gcube.application.geoportal.common.model.document.identification.SpatialReference;
|
||||||
|
@ -9,8 +11,6 @@ import org.geojson.LngLatAlt;
|
||||||
import org.geojson.Point;
|
import org.geojson.Point;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class GeoJSONTests {
|
public class GeoJSONTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
package org.gcube.application.cms.sdi.plugins;
|
package org.gcube.application.cms.sdi.plugins;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import static junit.framework.TestCase.assertEquals;
|
||||||
|
import static junit.framework.TestCase.assertNotNull;
|
||||||
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
||||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||||
|
@ -25,10 +31,7 @@ import org.gcube.application.geoportal.common.utils.Files;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
|
||||||
import static junit.framework.TestCase.*;
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
public class IndexerTest extends BasicPluginTest {
|
public class IndexerTest extends BasicPluginTest {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package org.gcube.application.cms.sdi.plugins;
|
package org.gcube.application.cms.sdi.plugins;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||||
import org.gcube.application.cms.plugins.reports.MaterializationReport;
|
import org.gcube.application.cms.plugins.reports.MaterializationReport;
|
||||||
|
@ -20,11 +25,7 @@ import org.gcube.application.geoportal.common.utils.Files;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
public class MaterializerTests extends BasicPluginTest {
|
public class MaterializerTests extends BasicPluginTest {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue