diff --git a/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java b/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java index 0740b53..574467a 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java +++ b/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java @@ -18,8 +18,8 @@ import org.gcube.application.geoportalcommon.config.CSVReader; import org.gcube.application.geoportalcommon.config.CSVRow; import org.gcube.application.geoportalcommon.config.FileUtil; import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile; -import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM; import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole; +import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM; import org.gcube.application.geoportalcommon.shared.config.RoleRights; import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE; import org.gcube.application.geoportalcommon.shared.exception.ApplicationProfileNotFoundException; diff --git a/src/main/java/org/gcube/application/geoportalcommon/geoportal/ProjectsCaller.java b/src/main/java/org/gcube/application/geoportalcommon/geoportal/ProjectsCaller.java index 9e6eb13..181ddc8 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/geoportal/ProjectsCaller.java +++ b/src/main/java/org/gcube/application/geoportalcommon/geoportal/ProjectsCaller.java @@ -23,6 +23,7 @@ import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedReq import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedRequest.Direction; import org.gcube.application.geoportal.common.model.rest.QueryRequest.PagedRequest; import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest; +import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest; import org.gcube.application.geoportal.common.rest.Projects; import org.gcube.application.geoportal.common.utils.FileSets; import org.gcube.application.geoportal.common.utils.StorageUtils; @@ -234,13 +235,13 @@ public class ProjectsCaller { } /** - * Gets the phases. + * Gets the phases into document store collection. * * @param profileID the profile ID - * @return the phases + * @return the phases into document store collection * @throws Exception the exception */ - public PhaseDV[] getPhases(String profileID) throws Exception { + public PhaseDV[] getPhasesIntoDocumentStoreCollection(String profileID) throws Exception { LOG.info("getPhases called for profileID: {}", profileID); Projects client = (Projects) getClient(profileID); Configuration config = client.getConfiguration(); @@ -267,9 +268,30 @@ public class ProjectsCaller { return null; } + /** + * Perform step. + * + * @param profileID the profile ID + * @param projectID the project ID + * @param stepID the step ID + * @param options the options + * @return the project + * @throws Exception the exception + */ + public Project performStep(String profileID, String projectID, String stepID, Document options) throws Exception { + LOG.info("performStep called for profileID: {}, projectID: {}", profileID, projectID); + Projects client = (Projects) getClient(profileID); + StepExecutionRequest request = new StepExecutionRequest(projectID, options); + Project project = client.performStep(projectID, request); + + LOG.info("performStep returning project ID: " + project.getId()); + return project; + } + /** * Delete project. * + * @param profileID the profile ID * @param projectID the project ID * @param force the force * @throws RemoteException the remote exception @@ -361,7 +383,8 @@ public class ProjectsCaller { for (ItemFieldDV itemField : orderByFields) { if (itemField.getJsonFields() != null) { for (String jsonFieldPath : itemField.getJsonFields()) { - //String fieldFullPath = String.format("%s.%s", itemField.getProjection(), field); + // String fieldFullPath = String.format("%s.%s", itemField.getProjection(), + // field); orderingFields.add(jsonFieldPath); } } @@ -443,16 +466,15 @@ public class ProjectsCaller { } - //REMOVING DIRTY DOCUMENTS + // REMOVING DIRTY DOCUMENTS /* - BasicDBObject bsValid_Document = new BasicDBObject(); - bsValid_Document.append("$exists", true); - bsValid_Document.append("$ne", null); - query.append("_theDocument", bsValid_Document); - - BasicDBObject bsValidLfc = new BasicDBObject(); - bsValidLfc.append("$ne", null); - query.append("_lifecycleInformation._phase", bsValidLfc);*/ + * BasicDBObject bsValid_Document = new BasicDBObject(); + * bsValid_Document.append("$exists", true); bsValid_Document.append("$ne", + * null); query.append("_theDocument", bsValid_Document); + * + * BasicDBObject bsValidLfc = new BasicDBObject(); bsValidLfc.append("$ne", + * null); query.append("_lifecycleInformation._phase", bsValidLfc); + */ // BasicDBObject bsDocumentExists = new BasicDBObject(); // bsDocumentExists.append("$exists", false);