integrated new bean StepPerformedResultDV
This commit is contained in:
parent
140856db03
commit
63816fe648
|
@ -119,6 +119,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -261,6 +264,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -403,6 +409,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -545,6 +554,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -639,6 +651,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -667,9 +682,9 @@
|
|||
<dependent-module archiveName="uri-resolver-manager-1.8.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/uri-resolver-manager/uri-resolver-manager">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="geoportal-common-1.0.14-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-common/geoportal-common">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -932,6 +947,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1074,6 +1092,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1216,6 +1237,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,8 +21,9 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.BasicLifecycleInformationDV.Status;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
|
@ -257,7 +258,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: "+caught.getMessage();
|
||||
String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: "
|
||||
+ caught.getMessage();
|
||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||
alert.setClose(false);
|
||||
try {
|
||||
|
@ -329,7 +331,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
if(caught instanceof ProjectNotFoundException) {
|
||||
if (caught instanceof ProjectNotFoundException) {
|
||||
Modal errorModal = new Modal(true, true);
|
||||
errorModal.setCloseVisible(true);
|
||||
errorModal.setTitle("Oops...");
|
||||
|
@ -343,8 +345,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
errorPanelMsg.add(erroMessage);
|
||||
errorModal.add(errorPanelMsg);
|
||||
errorModal.show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Window.alert("Error " + caught.getMessage());
|
||||
}
|
||||
|
||||
|
@ -1365,8 +1366,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
modal.add(modalContainerPanel);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps(
|
||||
resultDocumentDV.getProfileID(), resultDocumentDV.getId(),stvp.getOptionalMessage(),
|
||||
wActionOnItem.getAction(), new AsyncCallback<ProjectDV>() {
|
||||
resultDocumentDV.getProfileID(), resultDocumentDV.getId(),
|
||||
stvp.getOptionalMessage(), wActionOnItem.getAction(),
|
||||
new AsyncCallback<StepPerformedResultDV>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -1382,7 +1384,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(final ProjectDV result) {
|
||||
public void onSuccess(final StepPerformedResultDV result) {
|
||||
modal.setTitle("Step/s performed");
|
||||
modal.setCloseVisible(true);
|
||||
try {
|
||||
|
@ -1396,22 +1398,50 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
String stepsToString = "";
|
||||
for (String step : wActionOnItem.getAction().getCallSteps()) {
|
||||
stepsToString += step + ", ";
|
||||
stepsToString += step + " ";
|
||||
}
|
||||
|
||||
Status status = Status.NOT_SPECIFIED;
|
||||
AlertType alertType = AlertType.INFO;
|
||||
String statusMsg = "status " + status.getLabel();
|
||||
try {
|
||||
status = result.getLifecycleInfoDV().getLastOperationStatus();
|
||||
switch (status) {
|
||||
case OK:
|
||||
alertType = AlertType.SUCCESS;
|
||||
statusMsg = "performed with " + status.getLabel().toUpperCase()+"!";
|
||||
break;
|
||||
case WARNING:
|
||||
alertType = AlertType.WARNING;
|
||||
statusMsg = "performed with " + status.getLabel().toUpperCase()+"!";
|
||||
break;
|
||||
case ERROR:
|
||||
alertType = AlertType.ERROR;
|
||||
statusMsg = "performed with " + status.getLabel().toUpperCase()+"!";
|
||||
break;
|
||||
default:
|
||||
alertType = AlertType.INFO;
|
||||
statusMsg = "performed. Current status " + status.getLabel();
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// silent
|
||||
}
|
||||
|
||||
Alert alert = new Alert(
|
||||
stepString + " " + stepsToString + "performed correclty!");
|
||||
alert.setType(AlertType.INFO);
|
||||
stepString + " " + stepsToString + " " + statusMsg);
|
||||
alert.setType(alertType);
|
||||
alert.setClose(false);
|
||||
modal.add(alert);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance()
|
||||
.getResultDocumentFoProjectByID(result.getProfileID(),
|
||||
result.getId(), new AsyncCallback<ResultDocumentDV>() {
|
||||
result.getProjectId(),
|
||||
new AsyncCallback<ResultDocumentDV>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
Window.alert("Error: " + caught.getMessage());
|
||||
|
||||
}
|
||||
|
||||
|
@ -1631,7 +1661,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
modal.add(hpGetLink);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
|
||||
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, new AsyncCallback<GeoportalItemReferences>() {
|
||||
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER,
|
||||
new AsyncCallback<GeoportalItemReferences>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
try {
|
||||
|
@ -1691,7 +1722,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
modal.add(hpGetLink);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
|
||||
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY, new AsyncCallback<GeoportalItemReferences>() {
|
||||
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY,
|
||||
new AsyncCallback<GeoportalItemReferences>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
try {
|
||||
|
@ -1722,8 +1754,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
Anchor anchor = new Anchor(theURL);
|
||||
anchor.setHref(theURL);
|
||||
anchor.setTarget("_blank");
|
||||
anchor.setTitle(
|
||||
"Shareable link of the project with id: " + resultDocumentDV.getId());
|
||||
anchor.setTitle("Shareable link of the project with id: "
|
||||
+ resultDocumentDV.getId());
|
||||
com.github.gwtbootstrap.client.ui.Label label = new com.github.gwtbootstrap.client.ui.Label(
|
||||
"Shareable link");
|
||||
label.setType(LabelType.SUCCESS);
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||
|
@ -146,7 +147,7 @@ public interface GeoportalDataEntryService extends RemoteService {
|
|||
* @param action the action
|
||||
* @return the project DV
|
||||
*/
|
||||
ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception;
|
||||
StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception;
|
||||
|
||||
/**
|
||||
* Gets the relationships definition.
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||
|
@ -80,7 +81,7 @@ public interface GeoportalDataEntryServiceAsync {
|
|||
AsyncCallback<LifecycleInformationDV> callback);
|
||||
|
||||
void performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action,
|
||||
AsyncCallback<ProjectDV> callback);
|
||||
AsyncCallback<StepPerformedResultDV> callback);
|
||||
|
||||
void getRelationshipsDefinition(String profileID, AsyncCallback<List<RelationshipDefinitionDV>> callback);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<!-- If you add id attribute to element,You should use b:id attribute. -->
|
||||
<b:TextArea addStyleNames="{style.text-are-size}"
|
||||
ui:field="txtOptionalMessage"></b:TextArea>
|
||||
<b:HelpBlock>You can add an optional message...</b:HelpBlock>
|
||||
<b:HelpBlock>You can optionally add a message...</b:HelpBlock>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
</b:Fieldset>
|
||||
|
|
|
@ -55,6 +55,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
|
@ -1272,7 +1273,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
* @throws Exception the exception
|
||||
*/
|
||||
@Override
|
||||
public ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action)
|
||||
public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action)
|
||||
throws Exception {
|
||||
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
||||
|
||||
|
@ -1290,10 +1291,15 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
project = client.performStep(profileID, projectID, stepID, optionalMessage, null);
|
||||
}
|
||||
|
||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||
ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||
LOG.info("performActionSteps returning theProject with ID {}", projectID);
|
||||
return theProject;
|
||||
LifecycleInformationDV lifecycleInfo = getLifecycleInfoForProjectId(profileID, projectID);
|
||||
lifecycleInfo.getLastOperationStatus();
|
||||
|
||||
StepPerformedResultDV sprv = new StepPerformedResultDV(profileID, projectID, lifecycleInfo);
|
||||
|
||||
// ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||
// ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||
LOG.info("performActionSteps returning theProject with ID {}", sprv);
|
||||
return sprv;
|
||||
} catch (Exception e) {
|
||||
String error = "Error occurred on performing the workflow step/s on the project id " + projectID;
|
||||
LOG.error(error, e);
|
||||
|
|
Loading…
Reference in New Issue