edit_facility_26115 #3
|
@ -17,6 +17,8 @@ import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCre
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEventHandler;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEventHandler;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEvent;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEvent;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEventHandler;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEventHandler;
|
||||||
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEvent;
|
||||||
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEventHandler;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.metadata.CustomFieldEntry;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.metadata.CustomFieldEntry;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.AddResourceToDataset;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.AddResourceToDataset;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.ManageResources;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.ManageResources;
|
||||||
|
@ -354,6 +356,20 @@ public class CreateDatasetForm extends Composite {
|
||||||
InfoIconsLabels.closeDialogBox(popupOpenedIds);
|
InfoIconsLabels.closeDialogBox(popupOpenedIds);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBusPublisherWidget.addHandler(ReloadDatasetPageEvent.TYPE, new ReloadDatasetPageEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReloadDatasetPage(ReloadDatasetPageEvent addResourceEvent) {
|
||||||
|
|
||||||
|
// Firing the event on the main application bus
|
||||||
|
if (addResourceEvent.getDatasetIDorName() != null) {
|
||||||
|
eventBusMainApplication
|
||||||
|
.fireEvent(new ReloadDatasetPageEvent(addResourceEvent.getDatasetIDorName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1265,11 +1281,16 @@ public class CreateDatasetForm extends Composite {
|
||||||
// silent
|
// silent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//firing the event to load the dataset in the Portlet
|
||||||
|
eventBusPublisherWidget.fireEvent(new ReloadDatasetPageEvent(createdDatasetBean.getId()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
alertOnCreate(ERROR_PRODUCT_CREATION, false, AlertType.ERROR, true);
|
alertOnCreate(ERROR_PRODUCT_CREATION, false, AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1335,6 +1335,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
|
|
||||||
// if we are in the "general case" we need to show a form for adding resources
|
// if we are in the "general case" we need to show a form for adding resources
|
||||||
bindManageResources(createdDatasetBean, datasetUrl, 3);
|
bindManageResources(createdDatasetBean, datasetUrl, 3);
|
||||||
|
|
||||||
|
eventBusPublisherWidget.fireEvent(new ReloadDatasetPageEvent(createdDatasetBean.getId()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherService;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherService;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherServiceAsync;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherServiceAsync;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.AddResourceEvent;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.AddResourceEvent;
|
||||||
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEvent;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.LoaderIcon;
|
||||||
|
|
||||||
|
@ -146,6 +147,7 @@ public class AddResourceToDataset extends Composite{
|
||||||
if(result != null){
|
if(result != null){
|
||||||
showAlert("Resource created correctly", AlertType.SUCCESS);
|
showAlert("Resource created correctly", AlertType.SUCCESS);
|
||||||
eventBus.fireEvent(new AddResourceEvent(result));
|
eventBus.fireEvent(new AddResourceEvent(result));
|
||||||
|
eventBus.fireEvent(new ReloadDatasetPageEvent(datasetId));
|
||||||
|
|
||||||
// remove data
|
// remove data
|
||||||
resourceUrlTextBox.setText("");
|
resourceUrlTextBox.setText("");
|
||||||
|
|
Loading…
Reference in New Issue