minor fix for actions allowed after product creation
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@132575 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
adfc7a1e77
commit
169974e09b
|
@ -608,9 +608,12 @@ public class CreateDatasetForm extends Composite{
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
// better check for title (only if the dataset was not created.. if it is the case, fields are not frozen)
|
||||||
|
if(!titleTextBox.isEnabled())
|
||||||
|
actionsAfterOnContinue();
|
||||||
|
else{
|
||||||
alertOnContinue("Checking if a product with such title already exists, please wait...", AlertType.INFO);
|
alertOnContinue("Checking if a product with such title already exists, please wait...", AlertType.INFO);
|
||||||
|
|
||||||
// better check for title
|
|
||||||
ckanServices.datasetIdAlreadyExists(titleTextBox.getText(), new AsyncCallback<Boolean>() {
|
ckanServices.datasetIdAlreadyExists(titleTextBox.getText(), new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -621,6 +624,28 @@ public class CreateDatasetForm extends Composite{
|
||||||
alertOnContinue("Sorry but a product with such title already exists, try to change it", AlertType.WARNING);
|
alertOnContinue("Sorry but a product with such title already exists, try to change it", AlertType.WARNING);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
actionsAfterOnContinue();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
|
alertOnContinue("Sorry but there was a problem while checking if the inserted data are correct", AlertType.ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After onContinue ...
|
||||||
|
*/
|
||||||
|
private void actionsAfterOnContinue(){
|
||||||
|
|
||||||
// check what to do
|
// check what to do
|
||||||
if(isWorkspaceRequest){
|
if(isWorkspaceRequest){
|
||||||
|
|
||||||
|
@ -649,18 +674,6 @@ public class CreateDatasetForm extends Composite{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
|
|
||||||
alertOnContinue("Sorry but there was a problem while checking if the inserted data are correct", AlertType.ERROR);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@UiHandler("goBackButtonFirstStep")
|
@UiHandler("goBackButtonFirstStep")
|
||||||
void onGoBackButtonFirstStep(ClickEvent e){
|
void onGoBackButtonFirstStep(ClickEvent e){
|
||||||
|
@ -850,7 +863,6 @@ public class CreateDatasetForm extends Composite{
|
||||||
// add tabs to resources panel
|
// add tabs to resources panel
|
||||||
tabPanel.selectTab(0);
|
tabPanel.selectTab(0);
|
||||||
|
|
||||||
|
|
||||||
// form container
|
// form container
|
||||||
AddResourceContainer container = new AddResourceContainer(datasetUrl);
|
AddResourceContainer container = new AddResourceContainer(datasetUrl);
|
||||||
container.add(tabPanel);
|
container.add(tabPanel);
|
||||||
|
@ -1173,6 +1185,10 @@ public class CreateDatasetForm extends Composite{
|
||||||
licenseListbox.setEnabled(false);
|
licenseListbox.setEnabled(false);
|
||||||
organizationsListbox.setEnabled(false);
|
organizationsListbox.setEnabled(false);
|
||||||
addCustomFieldButton.setEnabled(false);
|
addCustomFieldButton.setEnabled(false);
|
||||||
|
metadataProfilesFormatListbox.setEnabled(false);
|
||||||
|
|
||||||
|
for(CustomFieldEntry ce: customFieldEntriesList)
|
||||||
|
ce.freeze();
|
||||||
|
|
||||||
// disable profile fields
|
// disable profile fields
|
||||||
for (MetaDataFieldSkeleton field : listOfMetadataFields) {
|
for (MetaDataFieldSkeleton field : listOfMetadataFields) {
|
||||||
|
|
|
@ -95,4 +95,13 @@ public class CustomFieldEntry extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove delete button
|
||||||
|
*/
|
||||||
|
public void freeze() {
|
||||||
|
|
||||||
|
removeCustomField.setEnabled(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue