Validation management (default false)
This commit is contained in:
parent
289ad99094
commit
73ca36949f
|
@ -21,6 +21,8 @@ public class Constants {
|
||||||
|
|
||||||
|
|
||||||
public static final String SIS_PLUGIN_ID="SIS/GEOTK";
|
public static final String SIS_PLUGIN_ID="SIS/GEOTK";
|
||||||
|
public static final String SIS_PLUGIN_VALIDATE_PARAMETER="VALIDATE";
|
||||||
|
|
||||||
|
|
||||||
public static class WorkspaceProperties{
|
public static class WorkspaceProperties{
|
||||||
// Folder
|
// Folder
|
||||||
|
|
|
@ -104,7 +104,11 @@ public class SynchronizationThread implements Runnable {
|
||||||
Set<PluginInvocation> invocations=null;
|
Set<PluginInvocation> invocations=null;
|
||||||
if(metadataItem==null) {
|
if(metadataItem==null) {
|
||||||
log.debug("Metadata not found, asking SIS/GEOTK for generation..");
|
log.debug("Metadata not found, asking SIS/GEOTK for generation..");
|
||||||
invocations=Collections.singleton(new PluginInvocation(Constants.SIS_PLUGIN_ID));
|
PluginInvocation inv=new PluginInvocation(Constants.SIS_PLUGIN_ID);
|
||||||
|
inv.setParameters(Collections.singletonMap(Constants.SIS_PLUGIN_VALIDATE_PARAMETER, synchConfig.getValidateMetadata()+""));
|
||||||
|
invocations=Collections.singleton(inv);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
log.info("Transferring to {} with invocations {} ",toSetDestination,invocations);
|
log.info("Transferring to {} with invocations {} ",toSetDestination,invocations);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class SynchFolderConfiguration {
|
||||||
private String remotePersistence="thredds";
|
private String remotePersistence="thredds";
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private Boolean validateMetadata=true;
|
private Boolean validateMetadata=false;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String rootFolderId;
|
private String rootFolderId;
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package org.gcube.usecases.ws.thredds;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
||||||
|
import org.gcube.common.storagehub.model.Metadata;
|
||||||
|
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||||
|
import org.gcube.usecases.ws.thredds.engine.impl.WorkspaceFolderManager;
|
||||||
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException;
|
||||||
|
|
||||||
|
public class SetValidate {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws WorkspaceInteractionException, StorageHubException {
|
||||||
|
String itemId="e4a0f901-5d8e-4b44-a947-4105d9b04a55";
|
||||||
|
String context="/pred4s/preprod/preVRE";
|
||||||
|
Boolean toSetValidate=false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TokenSetter.set(context);
|
||||||
|
|
||||||
|
WorkspaceFolderManager mng=new WorkspaceFolderManager(itemId);
|
||||||
|
|
||||||
|
FolderContainer folder=mng.getTheFolder();
|
||||||
|
Metadata meta=folder.get().getMetadata();
|
||||||
|
Map<String,Object> map=meta.getMap();
|
||||||
|
|
||||||
|
map.put(Constants.WorkspaceProperties.VALIDATE_METADATA,toSetValidate+"");
|
||||||
|
|
||||||
|
|
||||||
|
meta.setMap(map);
|
||||||
|
folder.setMetadata(meta);
|
||||||
|
System.out.println("DONE");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue