|
|
|
@ -65,6 +65,7 @@ import com.google.gwt.user.client.ui.Composite;
|
|
|
|
|
import com.google.gwt.user.client.ui.FlowPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.FocusPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.SimplePanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
@ -110,7 +111,7 @@ public class CreateDatasetForm extends Composite{
|
|
|
|
|
@UiField Button goBackButtonSecondStep;
|
|
|
|
|
@UiField Paragraph selectedProfile;
|
|
|
|
|
@UiField Button goToDatasetButton;
|
|
|
|
|
@UiField FlowPanel goToDatasetButtonPanel;
|
|
|
|
|
@UiField HorizontalPanel goToDatasetButtonPanel;
|
|
|
|
|
@UiField Button addResourcesButton;
|
|
|
|
|
@UiField SimplePanel workspaceResourcesContainer;
|
|
|
|
|
@UiField Button continueThirdStep;
|
|
|
|
@ -1004,19 +1005,27 @@ public class CreateDatasetForm extends Composite{
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(final DatasetBean createdDatasetBean) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GWT.log("Created the dataset: "+createdDatasetBean);
|
|
|
|
|
|
|
|
|
|
if(createdDatasetBean != null){
|
|
|
|
|
|
|
|
|
|
final String datasetUrl = createdDatasetBean.getSource();
|
|
|
|
|
|
|
|
|
|
alertOnCreate(PRODUCT_CREATED_OK, AlertType.SUCCESS, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// disable dataset fields
|
|
|
|
|
disableDatasetFields();
|
|
|
|
|
disableDatasetFields();
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// disable reset
|
|
|
|
|
resetButton.setEnabled(false);
|
|
|
|
|
|
|
|
|
|
// show the go to dataset button
|
|
|
|
|
final String datasetUrl = createdDatasetBean.getSource();
|
|
|
|
|
|
|
|
|
|
goToDatasetButtonPanel.setVisible(true);
|
|
|
|
|
goToDatasetButton.setVisible(true);
|
|
|
|
|
goToDatasetButton.setText(
|
|
|
|
@ -1032,58 +1041,59 @@ public class CreateDatasetForm extends Composite{
|
|
|
|
|
//Window.Location.assign(datasetUrl);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set hidden the create button
|
|
|
|
|
createButton.setVisible(false);
|
|
|
|
|
|
|
|
|
|
// if we are in the "general case" we need to show a form for adding resources
|
|
|
|
|
if(isWorkspaceRequest){
|
|
|
|
|
// leave to back button, but remove create and add go to dataset
|
|
|
|
|
createButton.removeFromParent();
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
// remove create button
|
|
|
|
|
createButton.removeFromParent();
|
|
|
|
|
|
|
|
|
|
// show the add resources button
|
|
|
|
|
addResourcesButton.setVisible(true);
|
|
|
|
|
|
|
|
|
|
addResourcesButton.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
|
|
|
|
|
// remove content of the main panel
|
|
|
|
|
createDatasetMainPanel.clear();
|
|
|
|
|
|
|
|
|
|
// TabPanel
|
|
|
|
|
tabPanel = new TabPanel(Tabs.ABOVE);
|
|
|
|
|
tabPanel.setWidth("100%");
|
|
|
|
|
|
|
|
|
|
// add the form
|
|
|
|
|
resourceForm = new AddResourceToDataset(eventBus, createdDatasetBean.getId(), createdDatasetBean.getSelectedOrganization(), owner, datasetUrl);
|
|
|
|
|
|
|
|
|
|
// tab for the form
|
|
|
|
|
Tab formContainer = new Tab();
|
|
|
|
|
formContainer.add(resourceForm);
|
|
|
|
|
formContainer.setHeading("Add New Resource");
|
|
|
|
|
tabPanel.add(formContainer);
|
|
|
|
|
|
|
|
|
|
// tab for the added resources
|
|
|
|
|
Tab addedResources = new Tab();
|
|
|
|
|
addedResources.add(new AddedResourcesSummary(eventBus));
|
|
|
|
|
addedResources.setHeading("Added Resource");
|
|
|
|
|
tabPanel.add(addedResources);
|
|
|
|
|
|
|
|
|
|
// add tabs to resources panel
|
|
|
|
|
tabPanel.selectTab(0);
|
|
|
|
|
|
|
|
|
|
// form container
|
|
|
|
|
AddResourceContainer container = new AddResourceContainer(datasetUrl);
|
|
|
|
|
container.add(tabPanel);
|
|
|
|
|
|
|
|
|
|
// add the new content of the main panel
|
|
|
|
|
createDatasetMainPanel.add(container);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if(!isWorkspaceRequest) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// show the add resources button
|
|
|
|
|
addResourcesButton.setVisible(true);
|
|
|
|
|
|
|
|
|
|
addResourcesButton.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
|
|
|
|
|
// remove content of the main panel
|
|
|
|
|
createDatasetMainPanel.clear();
|
|
|
|
|
|
|
|
|
|
// TabPanelException
|
|
|
|
|
tabPanel = new TabPanel(Tabs.ABOVE);
|
|
|
|
|
tabPanel.setWidth("100%");
|
|
|
|
|
|
|
|
|
|
// add the form
|
|
|
|
|
resourceForm = new AddResourceToDataset(eventBus, createdDatasetBean.getId(), createdDatasetBean.getSelectedOrganization(), owner, datasetUrl);
|
|
|
|
|
|
|
|
|
|
// tab for the form
|
|
|
|
|
Tab formContainer = new Tab();
|
|
|
|
|
formContainer.add(resourceForm);
|
|
|
|
|
formContainer.setHeading("Add New Resource");
|
|
|
|
|
tabPanel.add(formContainer);
|
|
|
|
|
|
|
|
|
|
// tab for the added resources
|
|
|
|
|
Tab addedResources = new Tab();
|
|
|
|
|
addedResources.add(new AddedResourcesSummary(eventBus));
|
|
|
|
|
addedResources.setHeading("Added Resource");
|
|
|
|
|
tabPanel.add(addedResources);
|
|
|
|
|
|
|
|
|
|
// add tabs to resources panel
|
|
|
|
|
tabPanel.selectTab(0);
|
|
|
|
|
|
|
|
|
|
// form container
|
|
|
|
|
AddResourceContainer container = new AddResourceContainer(datasetUrl);
|
|
|
|
|
container.add(tabPanel);
|
|
|
|
|
|
|
|
|
|
// add the new content of the main panel
|
|
|
|
|
createDatasetMainPanel.add(container);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}catch (Exception e2) {
|
|
|
|
|
//silent
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|