task_24859 #14

Merged
francesco.mangiacrapa merged 7 commits from task_24859 into master 2023-04-05 10:35:03 +02:00
5 changed files with 51 additions and 15 deletions

View File

@ -71,9 +71,12 @@ public class Default3PhaseManager extends SimpleLifeCycleManager implements Life
parameters =getInternalIndexParams(theReport.getTheRequest());
if(phase.equals(Phases.PUBLISHED))
parameters = getPublicIndexParams(theReport.getTheRequest());
if(parameters!= null)
for(IndexerPluginInterface indexer : getIndexers(theReport.getTheRequest()))
theReport = index(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
if(parameters!= null) {
//Fixed by Francesco, see #24902. Now is calling deIndex
for(IndexerPluginInterface indexer : getIndexers(theReport.getTheRequest())) {
theReport = deIndex(theReport,indexer,getPublicIndexParams(theReport.getTheRequest()));
}
}
return theReport;
}

View File

@ -3,6 +3,7 @@
## [v1.0.14-SNAPSHOT]
- Fixed deploying of multiple versions of the default-lc-managers [#24875]
- Bug fixing the 'deleteFileSet' function [#24902]
## [v1.0.13] - 2023-02-23
- Integrating new facilities and bug fixing released in the Plugins

View File

@ -807,19 +807,37 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
RegisteredFileSet fs = Serialization.convert(wrapper.getByPath(path).get(0), RegisteredFileSet.class);
log.debug("Going to delete {}", fs);
doc = triggerEvent(doc,EventExecutionRequest.Events.ON_DELETE_FILESET,new Document("force",force).append("path",path));
//Updated by Francesco. See #24902
doc = triggerEvent(doc,EventExecutionRequest.Events.ON_DELETE_FILESET,new Document("force",force).append("path",path).append("fileSetPath", path));
//reloading the document in the wrapper
wrapper = new JSONPathWrapper(doc.getTheDocument().toJson());
// Actually delete only if event was ok
if(doc.getLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK)) {
// Delete from storage
if(fs.getFolderId()!=null) {
log.info("Deleting Fileset Folder ID {} ",fs.getFolderId());
new WorkspaceManager().deleteItem(fs.getFolderId());
try {
log.info("Deleting Fileset Folder ID {} ",fs.getFolderId());
new WorkspaceManager().deleteItem(fs.getFolderId());
}catch (Exception e) {
//Updated by Francesco. See #24902
LifecycleInformation info = doc.getLifecycleInformation();
if(info==null) {
info = new LifecycleInformation();
}
info.addErrorMessage("Unable to delete the Folder ID "+fs.getFolderId()+" in the VRE Folder");
info.setLastOperationStatus(LifecycleInformation.Status.WARNING);
log.warn("Error on deleting the Folder ID {} in the VRE Folder",fs.getFolderId(), e);
}
}
log.debug("Removing FS from document [ID : ] by path {}", doc.getId(), path);
// Delete from document
wrapper.setElement(path, null);
}
//Updated by Francesco. See #24902
log.debug("Setting result on profiled document");
doc.setTheDocument(Document.parse(wrapper.getValueCTX().jsonString()));
return doc;
}

View File

@ -124,6 +124,20 @@ public class ProfiledDocuments {
}.execute().getResult();
}
/**
* Delete file set.
* the Authorization must be a VRE token
*
* @param id the id
* @param force the force
* @param path the path must be passed as text in the body
* @return the project
*/
@RequestHeaders({
@RequestHeader( name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"),
@RequestHeader( name = "Content-Type", description = "application/json")
})
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)

16
pom.xml
View File

@ -23,16 +23,16 @@
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
<!-- prod -->
<gcube-bom-version>2.0.2</gcube-bom-version>
<gcube-smartgears-bom-version>2.1.1</gcube-smartgears-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>
<!-- <gcube-bom-version>2.0.2</gcube-bom-version> -->
<!-- <gcube-smartgears-bom-version>2.1.1</gcube-smartgears-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> -->
<!--dev -->
<!-- <gcube-bom-version>2.1.0-SNAPSHOT</gcube-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> -->
<!-- <storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range> -->
<gcube-bom-version>2.1.0-SNAPSHOT</gcube-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>
<storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range>
<plugin-framework-version>1.0.3</plugin-framework-version>