Updated loaders
This commit is contained in:
parent
ce835fadd0
commit
15232dc6b4
|
@ -35,6 +35,7 @@ import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetada
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.CategoryPanel;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.CategoryPanel;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.tags.TagsPanel;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.tags.TagsPanel;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.LoaderIcon;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
||||||
|
@ -75,7 +76,9 @@ import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Anchor;
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
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.FocusPanel;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.SimplePanel;
|
import com.google.gwt.user.client.ui.SimplePanel;
|
||||||
|
@ -322,6 +325,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
|
|
||||||
private String datasetIdOrName = null;
|
private String datasetIdOrName = null;
|
||||||
|
|
||||||
|
private FlowPanel alertPanel = new FlowPanel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new update dataset form.
|
* Instantiates a new update dataset form.
|
||||||
*
|
*
|
||||||
|
@ -387,6 +392,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
iconSpinner.setSpin(true);
|
iconSpinner.setSpin(true);
|
||||||
iconSpinner.getElement().getStyle().setMarginLeft(5, Unit.PX);
|
iconSpinner.getElement().getStyle().setMarginLeft(5, Unit.PX);
|
||||||
|
|
||||||
|
infoBlock.add(alertPanel);
|
||||||
|
|
||||||
List<String> listOfSteps = Arrays.asList("Edit Common Metadata", "Edit Item Specific Metadata & Update");
|
List<String> listOfSteps = Arrays.asList("Edit Common Metadata", "Edit Item Specific Metadata & Update");
|
||||||
|
|
||||||
this.wizCreator = new WizardCreator(listOfSteps);
|
this.wizCreator = new WizardCreator(listOfSteps);
|
||||||
|
@ -405,7 +412,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
tagsPanel.setVisible(false);
|
tagsPanel.setVisible(false);
|
||||||
|
|
||||||
// check if the user has publishing rights
|
// check if the user has publishing rights
|
||||||
setAlertBlock("Checking your permissions, please wait...", AlertType.INFO, true);
|
LoaderIcon loader = new LoaderIcon("Checking your permissions, please wait...");
|
||||||
|
setAlertBlock(null, loader, AlertType.INFO, true);
|
||||||
|
|
||||||
ckanServices.isPublisherOwnerOrAdminUser(this.datasetIdOrName, new AsyncCallback<Boolean>() {
|
ckanServices.isPublisherOwnerOrAdminUser(this.datasetIdOrName, new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
|
@ -415,7 +423,9 @@ public class UpdateDatasetForm extends Composite {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
||||||
// set info block
|
// set info block
|
||||||
setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true);
|
|
||||||
|
LoaderIcon loader = new LoaderIcon("Retrieving information, please wait...");
|
||||||
|
setAlertBlock(null, loader, AlertType.INFO, true);
|
||||||
|
|
||||||
// get back the licenses and the metadata information
|
// get back the licenses and the metadata information
|
||||||
ckanServices.getDatasetBeanForUpdate(datasetIdOrName, new AsyncCallback<DatasetBean>() {
|
ckanServices.getDatasetBeanForUpdate(datasetIdOrName, new AsyncCallback<DatasetBean>() {
|
||||||
|
@ -423,7 +433,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
setAlertBlock(caught.getMessage(), AlertType.ERROR, true);
|
setAlertBlock(caught.getMessage(), null, AlertType.ERROR, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +442,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
GWT.log("getDatasetBeanForUpdate returns: " + datasetBean);
|
GWT.log("getDatasetBeanForUpdate returns: " + datasetBean);
|
||||||
|
|
||||||
if (datasetBean == null) {
|
if (datasetBean == null) {
|
||||||
setAlertBlock("Error while retrieving information.", AlertType.ERROR, true);
|
setAlertBlock("Error while retrieving information.", null, AlertType.ERROR, true);
|
||||||
} else {
|
} else {
|
||||||
// save it
|
// save it
|
||||||
theDatasetBean = datasetBean;
|
theDatasetBean = datasetBean;
|
||||||
|
@ -446,7 +456,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
maintainerTextbox.setText(datasetBean.getMaintainer());
|
maintainerTextbox.setText(datasetBean.getMaintainer());
|
||||||
maintainerEmailTextbox.setText(datasetBean.getMaintainerEmail());
|
maintainerEmailTextbox.setText(datasetBean.getMaintainerEmail());
|
||||||
|
|
||||||
setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true);
|
LoaderIcon loader = new LoaderIcon("Retrieving dataset information, please wait...");
|
||||||
|
setAlertBlock(null, loader, AlertType.INFO, true);
|
||||||
|
|
||||||
// vocabulary list of tags has preemption
|
// vocabulary list of tags has preemption
|
||||||
List<String> vocabularyTags = datasetBean.getTagsVocabulary();
|
List<String> vocabularyTags = datasetBean.getTagsVocabulary();
|
||||||
|
@ -459,8 +470,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
//Settings the tags
|
// Settings the tags
|
||||||
if (datasetBean.getTags() != null) {
|
if (datasetBean.getTags() != null) {
|
||||||
for (String tag : datasetBean.getTags()) {
|
for (String tag : datasetBean.getTags()) {
|
||||||
tagsPanel.addTagElement(tag);
|
tagsPanel.addTagElement(tag);
|
||||||
|
@ -513,7 +524,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
for (OrganizationBean organization : organizations) {
|
for (OrganizationBean organization : organizations) {
|
||||||
organizationsListbox.addItem(organization.getTitle());
|
organizationsListbox.addItem(organization.getTitle());
|
||||||
nameTitleOrganizationMap.put(organization.getTitle(), organization.getName());
|
nameTitleOrganizationMap.put(organization.getTitle(), organization.getName());
|
||||||
break; //expecting only one
|
break; // expecting only one
|
||||||
}
|
}
|
||||||
|
|
||||||
// force the selection of the first one, and retrieve the list of profiles
|
// force the selection of the first one, and retrieve the list of profiles
|
||||||
|
@ -537,7 +548,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
theDatasetBean.setSelectedOrganization(orgName);
|
theDatasetBean.setSelectedOrganization(orgName);
|
||||||
|
|
||||||
// try to retrieve the profiles
|
// try to retrieve the profiles
|
||||||
setAlertBlock("Retrieving types, please wait...", AlertType.INFO, true);
|
loader = new LoaderIcon("Retrieving types, please wait...");
|
||||||
|
setAlertBlock(null, loader, AlertType.INFO, true);
|
||||||
|
|
||||||
// perform remote request of profiles for the selected organization
|
// perform remote request of profiles for the selected organization
|
||||||
ckanServices.getProfileForUpdate(orgName, datasetBean.getChosenType(),
|
ckanServices.getProfileForUpdate(orgName, datasetBean.getChosenType(),
|
||||||
|
@ -545,13 +557,13 @@ public class UpdateDatasetForm extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
setAlertBlock(caught.getMessage(), AlertType.ERROR, true);
|
setAlertBlock(caught.getMessage(), null, AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(
|
public void onSuccess(
|
||||||
final MetadataProfileBeanForUpdate metadataProfileForUpdate) {
|
final MetadataProfileBeanForUpdate metadataProfileForUpdate) {
|
||||||
setAlertBlock("", AlertType.ERROR, false);
|
setAlertBlock("", null, AlertType.ERROR, false);
|
||||||
|
|
||||||
List<MetaDataProfileBean> profiles = metadataProfileForUpdate
|
List<MetaDataProfileBean> profiles = metadataProfileForUpdate
|
||||||
.getListProfileBean();
|
.getListProfileBean();
|
||||||
|
@ -559,7 +571,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
if (profiles == null) {
|
if (profiles == null) {
|
||||||
setAlertBlock(
|
setAlertBlock(
|
||||||
"An unknow error occurred while retrieving types, sorry",
|
"An unknow error occurred while retrieving types, sorry",
|
||||||
AlertType.ERROR, true);
|
null, AlertType.ERROR, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GWT.log("Profile returned are: " + profiles.size());
|
GWT.log("Profile returned are: " + profiles.size());
|
||||||
|
@ -577,18 +589,21 @@ public class UpdateDatasetForm extends Composite {
|
||||||
metadataTypeListbox.setEnabled(true);
|
metadataTypeListbox.setEnabled(true);
|
||||||
|
|
||||||
// try to retrieve the licenses
|
// try to retrieve the licenses
|
||||||
setAlertBlock("Retrieving licenses, please wait...", AlertType.INFO,
|
LoaderIcon loaderLic = new LoaderIcon(
|
||||||
true);
|
"Retrieving types, please wait...");
|
||||||
|
setAlertBlock(null, loaderLic, AlertType.INFO, true);
|
||||||
|
|
||||||
ckanServices.getLicenses(new AsyncCallback<List<LicenseBean>>() {
|
ckanServices.getLicenses(new AsyncCallback<List<LicenseBean>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
setAlertBlock(caught.getMessage(), AlertType.ERROR, true);
|
setAlertBlock(caught.getMessage(), null, AlertType.ERROR,
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<LicenseBean> licenses) {
|
public void onSuccess(List<LicenseBean> licenses) {
|
||||||
setAlertBlock("", AlertType.ERROR, false);
|
setAlertBlock("", null, AlertType.ERROR, false);
|
||||||
|
|
||||||
if (licenses != null && !licenses.isEmpty()) {
|
if (licenses != null && !licenses.isEmpty()) {
|
||||||
|
|
||||||
|
@ -602,9 +617,9 @@ public class UpdateDatasetForm extends Composite {
|
||||||
// set the url of the license, if any
|
// set the url of the license, if any
|
||||||
showLicenseUrl();
|
showLicenseUrl();
|
||||||
|
|
||||||
// try to retrieve the licenses
|
LoaderIcon loaderLic = new LoaderIcon(
|
||||||
setAlertBlock("Retrieving groups, please wait...",
|
"Retrieving groups, please wait...");
|
||||||
AlertType.INFO, true);
|
setAlertBlock(null, loaderLic, AlertType.INFO, true);
|
||||||
|
|
||||||
// request groups
|
// request groups
|
||||||
ckanServices.getUserGroups(orgName,
|
ckanServices.getUserGroups(orgName,
|
||||||
|
@ -616,7 +631,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
if (groups == null) {
|
if (groups == null) {
|
||||||
setAlertBlock(
|
setAlertBlock(
|
||||||
"Error while retrieving groups",
|
"Error while retrieving groups",
|
||||||
AlertType.ERROR, true);
|
null, AlertType.ERROR,
|
||||||
|
true);
|
||||||
} else {
|
} else {
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
groupsControlGroup
|
groupsControlGroup
|
||||||
|
@ -633,8 +649,8 @@ public class UpdateDatasetForm extends Composite {
|
||||||
profiles);
|
profiles);
|
||||||
}
|
}
|
||||||
// everything went ok
|
// everything went ok
|
||||||
setAlertBlock("", AlertType.ERROR,
|
setAlertBlock("", null,
|
||||||
false);
|
AlertType.ERROR, false);
|
||||||
continueButton.setEnabled(true);
|
continueButton.setEnabled(true);
|
||||||
resetButton.setEnabled(true);
|
resetButton.setEnabled(true);
|
||||||
addResourcesButtonStep1
|
addResourcesButtonStep1
|
||||||
|
@ -647,13 +663,13 @@ public class UpdateDatasetForm extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
setAlertBlock(caught.getMessage(),
|
setAlertBlock(caught.getMessage(), null,
|
||||||
AlertType.ERROR, true);
|
AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setAlertBlock("Error while retrieving licenses",
|
setAlertBlock("Error while retrieving licenses", null,
|
||||||
AlertType.ERROR, true);
|
AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -666,14 +682,14 @@ public class UpdateDatasetForm extends Composite {
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setAlertBlock(MISSING_PUBLISH_RIGHTS, AlertType.ERROR, true);
|
setAlertBlock(MISSING_PUBLISH_RIGHTS, null, AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
setAlertBlock(MISSING_PUBLISH_RIGHTS, AlertType.ERROR, true);
|
setAlertBlock(MISSING_PUBLISH_RIGHTS, null, AlertType.ERROR, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -710,119 +726,97 @@ public class UpdateDatasetForm extends Composite {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// NEVER USED IN UPDATE MODE
|
// NEVER USED IN UPDATE MODE
|
||||||
/*private void organizationsListboxChangeHandlerBody(OPERATION operation) {
|
/*
|
||||||
|
* private void organizationsListboxChangeHandlerBody(OPERATION operation) {
|
||||||
// remove any other product profiles
|
*
|
||||||
metadataTypeListbox.clear();
|
* // remove any other product profiles metadataTypeListbox.clear();
|
||||||
|
*
|
||||||
// add "none" item again
|
* // add "none" item again metadataTypeListbox.addItem(NONE_PROFILE);
|
||||||
metadataTypeListbox.addItem(NONE_PROFILE);
|
*
|
||||||
|
* // select "none" metadataTypeListbox.setSelectedIndex(0);
|
||||||
// select "none"
|
*
|
||||||
metadataTypeListbox.setSelectedIndex(0);
|
* // get the name of the organization from the title String
|
||||||
|
* selectedOrganizationTitle = organizationsListbox.getSelectedItemText(); final
|
||||||
// get the name of the organization from the title
|
* String orgName = nameTitleOrganizationMap.get(selectedOrganizationTitle);
|
||||||
String selectedOrganizationTitle = organizationsListbox.getSelectedItemText();
|
*
|
||||||
final String orgName = nameTitleOrganizationMap.get(selectedOrganizationTitle);
|
* theDatasetBean.setSelectedOrganization(orgName);
|
||||||
|
*
|
||||||
theDatasetBean.setSelectedOrganization(orgName);
|
* // try to retrieve the profiles
|
||||||
|
* setAlertBlock("Retrieving types, please wait...", AlertType.INFO, true);
|
||||||
// try to retrieve the profiles
|
*
|
||||||
setAlertBlock("Retrieving types, please wait...", AlertType.INFO, true);
|
* // disable the list of organizations name so that the user doesn't change it
|
||||||
|
* // again // also disable the profiles and the list of groups
|
||||||
// disable the list of organizations name so that the user doesn't change it
|
* organizationsListbox.setEnabled(false);
|
||||||
// again
|
* metadataTypeListbox.setEnabled(false); groupsListbox.clear();
|
||||||
// also disable the profiles and the list of groups
|
* groupsControlGroup.setVisible(false);
|
||||||
organizationsListbox.setEnabled(false);
|
*
|
||||||
metadataTypeListbox.setEnabled(false);
|
* // perform remote request of profiles for the selected organization
|
||||||
groupsListbox.clear();
|
* ckanServices.getProfiles(orgName, new
|
||||||
groupsControlGroup.setVisible(false);
|
* AsyncCallback<List<MetaDataProfileBean>>() {
|
||||||
|
*
|
||||||
// perform remote request of profiles for the selected organization
|
* @Override public void onSuccess(final List<MetaDataProfileBean> profiles) {
|
||||||
ckanServices.getProfiles(orgName, new AsyncCallback<List<MetaDataProfileBean>>() {
|
*
|
||||||
|
* if (profiles != null) {
|
||||||
@Override
|
*
|
||||||
public void onSuccess(final List<MetaDataProfileBean> profiles) {
|
* theDatasetBean.setMetadataList(profiles); prepareMetadataList(theDatasetBean,
|
||||||
|
* operation); organizationsListbox.setEnabled(true);
|
||||||
if (profiles != null) {
|
* metadataTypeListbox.setEnabled(true);
|
||||||
|
*
|
||||||
theDatasetBean.setMetadataList(profiles);
|
* // try to retrieve the licenses
|
||||||
prepareMetadataList(theDatasetBean, operation);
|
* setAlertBlock("Retrieving groups, please wait...", AlertType.INFO, true);
|
||||||
organizationsListbox.setEnabled(true);
|
*
|
||||||
metadataTypeListbox.setEnabled(true);
|
* // request groups ckanServices.getUserGroups(orgName, new
|
||||||
|
* AsyncCallback<List<OrganizationBean>>() {
|
||||||
// try to retrieve the licenses
|
*
|
||||||
setAlertBlock("Retrieving groups, please wait...", AlertType.INFO, true);
|
* @Override public void onSuccess(List<OrganizationBean> groups) {
|
||||||
|
*
|
||||||
// request groups
|
* if (groups == null) {
|
||||||
ckanServices.getUserGroups(orgName, new AsyncCallback<List<OrganizationBean>>() {
|
* setAlertBlock("Error while retrieving groups, try later", AlertType.ERROR,
|
||||||
|
* true); } else { if (groups.isEmpty()) { groupsControlGroup.setVisible(false);
|
||||||
@Override
|
* } else {
|
||||||
public void onSuccess(List<OrganizationBean> groups) {
|
*
|
||||||
|
* // add groups for (OrganizationBean group : groups) {
|
||||||
if (groups == null) {
|
* groupsListbox.addItem(group.getTitle(), group.getName()); }
|
||||||
setAlertBlock("Error while retrieving groups, try later", AlertType.ERROR, true);
|
* groupsListbox.setEnabled(true); hideGroupsAlreadyInProfile(profiles); }
|
||||||
} else {
|
* setAlertBlock("", AlertType.ERROR, false); } }
|
||||||
if (groups.isEmpty()) {
|
*
|
||||||
groupsControlGroup.setVisible(false);
|
* @Override public void onFailure(Throwable caught) {
|
||||||
} else {
|
* setAlertBlock("Error while retrieving groups, try later", AlertType.ERROR,
|
||||||
|
* true); } });
|
||||||
// add groups
|
*
|
||||||
for (OrganizationBean group : groups) {
|
* // check also for tags (if for that context there is a vocabulary or not)
|
||||||
groupsListbox.addItem(group.getTitle(), group.getName());
|
* tagsPanel.setVisible(false);
|
||||||
}
|
* setAlertBlock("Checking for tags vocabulary, please wait...", AlertType.INFO,
|
||||||
groupsListbox.setEnabled(true);
|
* true); ckanServices.getTagsForOrganization(orgName, new
|
||||||
hideGroupsAlreadyInProfile(profiles);
|
* AsyncCallback<List<String>>() {
|
||||||
}
|
*
|
||||||
setAlertBlock("", AlertType.ERROR, false);
|
* @Override public void onSuccess(List<String> vocabulary) {
|
||||||
}
|
*
|
||||||
}
|
* tagsPanel.setVocabulary(vocabulary); tagsPanel.setVisible(true);
|
||||||
|
* setAlertBlock("", AlertType.ERROR, false); }
|
||||||
@Override
|
*
|
||||||
public void onFailure(Throwable caught) {
|
* @Override public void onFailure(Throwable arg0) {
|
||||||
setAlertBlock("Error while retrieving groups, try later", AlertType.ERROR, true);
|
*
|
||||||
}
|
* setAlertBlock(
|
||||||
});
|
* "Error while checking if a vocabulary of tags is defined in the selected organization."
|
||||||
|
* , AlertType.ERROR, true); tagsPanel.setVocabulary(null);
|
||||||
// check also for tags (if for that context there is a vocabulary or not)
|
* tagsPanel.setVisible(true);
|
||||||
tagsPanel.setVisible(false);
|
*
|
||||||
setAlertBlock("Checking for tags vocabulary, please wait...", AlertType.INFO, true);
|
* } });
|
||||||
ckanServices.getTagsForOrganization(orgName, new AsyncCallback<List<String>>() {
|
*
|
||||||
|
* } else setAlertBlock("Error while retrieving types, sorry", AlertType.ERROR,
|
||||||
@Override
|
* true);
|
||||||
public void onSuccess(List<String> vocabulary) {
|
*
|
||||||
|
* }
|
||||||
tagsPanel.setVocabulary(vocabulary);
|
*
|
||||||
tagsPanel.setVisible(true);
|
* @Override public void onFailure(Throwable caught) {
|
||||||
setAlertBlock("", AlertType.ERROR, false);
|
*
|
||||||
}
|
* setAlertBlock("Error while retrieving types, sorry", AlertType.ERROR, true);
|
||||||
|
*
|
||||||
@Override
|
* } });
|
||||||
public void onFailure(Throwable arg0) {
|
*
|
||||||
|
* }
|
||||||
setAlertBlock(
|
*/
|
||||||
"Error while checking if a vocabulary of tags is defined in the selected organization.",
|
|
||||||
AlertType.ERROR, true);
|
|
||||||
tagsPanel.setVocabulary(null);
|
|
||||||
tagsPanel.setVisible(true);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else
|
|
||||||
setAlertBlock("Error while retrieving types, sorry", AlertType.ERROR, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
|
|
||||||
setAlertBlock("Error while retrieving types, sorry", AlertType.ERROR, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the items to the listbox and put data into the metadataPanel.
|
* Add the items to the listbox and put data into the metadataPanel.
|
||||||
|
@ -1344,7 +1338,7 @@ 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()));
|
eventBusPublisherWidget.fireEvent(new ReloadDatasetPageEvent(createdDatasetBean.getId()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -1741,12 +1735,24 @@ public class UpdateDatasetForm extends Composite {
|
||||||
* @param type the type
|
* @param type the type
|
||||||
* @param visible the visible
|
* @param visible the visible
|
||||||
*/
|
*/
|
||||||
private void setAlertBlock(String textToShow, AlertType type, boolean visible) {
|
private void setAlertBlock(String textToShow, LoaderIcon loader, AlertType type, boolean visible) {
|
||||||
|
|
||||||
infoBlock.setText(textToShow);
|
// infoBlock.setText(textToShow);
|
||||||
|
// infoBlock.setType(type);
|
||||||
|
// infoBlock.setVisible(visible);
|
||||||
|
|
||||||
|
alertPanel.clear();
|
||||||
|
|
||||||
|
if (loader != null) {
|
||||||
|
alertPanel.add(loader);
|
||||||
|
}
|
||||||
infoBlock.setType(type);
|
infoBlock.setType(type);
|
||||||
infoBlock.setVisible(visible);
|
infoBlock.setVisible(visible);
|
||||||
|
|
||||||
|
if (textToShow != null) {
|
||||||
|
alertPanel.add(new HTML(textToShow));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -127,22 +127,23 @@ public class AddedResourcesSummary extends Composite {
|
||||||
accordionGroup.setHeading("* " + addedResourceBean.getName());
|
accordionGroup.setHeading("* " + addedResourceBean.getName());
|
||||||
accordionGroup.getHeading().addStyleName("accordion-resource-added");
|
accordionGroup.getHeading().addStyleName("accordion-resource-added");
|
||||||
accordion.add(accordionGroup);
|
accordion.add(accordionGroup);
|
||||||
|
|
||||||
FlexTable resourceTable = new FlexTable();
|
FlexTable resourceTable = new FlexTable();
|
||||||
resourceTable.addStyleName("resource-table");
|
resourceTable.addStyleName("resource-table");
|
||||||
|
|
||||||
// add sub-info such as url and description
|
// add sub-info such as url and description
|
||||||
//HTML htmlURL = new HTML();
|
// HTML htmlURL = new HTML();
|
||||||
if (addedResourceBean.getUrl() != null) {
|
if (addedResourceBean.getUrl() != null) {
|
||||||
// htmlURL.setHTML(
|
// htmlURL.setHTML(
|
||||||
// "URL: <a href=" + addedResourceBean.getUrl() + ">" + addedResourceBean.getUrl() + "</a>");
|
// "URL: <a href=" + addedResourceBean.getUrl() + ">" + addedResourceBean.getUrl() + "</a>");
|
||||||
resourceTable.setWidget(0, 0, new HTML("URL"));
|
resourceTable.setWidget(0, 0, new HTML("URL"));
|
||||||
resourceTable.setWidget(0, 1, new HTML("<a href=" + addedResourceBean.getUrl() + ">" + addedResourceBean.getUrl() + "</a>"));
|
resourceTable.setWidget(0, 1, new HTML(
|
||||||
|
"<a href=" + addedResourceBean.getUrl() + ">" + addedResourceBean.getUrl() + "</a>"));
|
||||||
|
|
||||||
}
|
}
|
||||||
//Paragraph pDescription = new Paragraph();
|
// Paragraph pDescription = new Paragraph();
|
||||||
//pDescription.setText("Description : " + addedResourceBean.getDescription());
|
// pDescription.setText("Description : " + addedResourceBean.getDescription());
|
||||||
|
|
||||||
resourceTable.setWidget(1, 0, new HTML("Description"));
|
resourceTable.setWidget(1, 0, new HTML("Description"));
|
||||||
resourceTable.setWidget(1, 1, new HTML(addedResourceBean.getDescription()));
|
resourceTable.setWidget(1, 1, new HTML(addedResourceBean.getDescription()));
|
||||||
|
|
||||||
|
@ -160,7 +161,7 @@ public class AddedResourcesSummary extends Composite {
|
||||||
});
|
});
|
||||||
|
|
||||||
// fill accordion
|
// fill accordion
|
||||||
//accordionGroup.add(htmlURL);
|
// accordionGroup.add(htmlURL);
|
||||||
accordionGroup.add(resourceTable);
|
accordionGroup.add(resourceTable);
|
||||||
accordionGroup.add(deleteButton);
|
accordionGroup.add(deleteButton);
|
||||||
|
|
||||||
|
@ -215,7 +216,7 @@ public class AddedResourcesSummary extends Composite {
|
||||||
addedResources.remove(toDelete);
|
addedResources.remove(toDelete);
|
||||||
addResourcesPanel.remove(toDeleteAccordion);
|
addResourcesPanel.remove(toDeleteAccordion);
|
||||||
|
|
||||||
//Firing event to reload the dataset page
|
// Firing event to reload the dataset page
|
||||||
eventBus.fireEvent(new ReloadDatasetPageEvent(
|
eventBus.fireEvent(new ReloadDatasetPageEvent(
|
||||||
deleteResourceEvent.getResource().getCkanDatasetId()));
|
deleteResourceEvent.getResource().getCkanDatasetId()));
|
||||||
|
|
||||||
|
@ -263,11 +264,12 @@ public class AddedResourcesSummary extends Composite {
|
||||||
|
|
||||||
alertPanel.clear();
|
alertPanel.clear();
|
||||||
|
|
||||||
|
alertMessage.setType(type);
|
||||||
|
alertMessage.setVisible(visible);
|
||||||
|
|
||||||
if (loader != null) {
|
if (loader != null) {
|
||||||
alertPanel.add(loader);
|
alertPanel.add(loader);
|
||||||
}
|
}
|
||||||
alertMessage.setType(type);
|
|
||||||
alertMessage.setVisible(visible);
|
|
||||||
|
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
alertPanel.add(new HTML(message));
|
alertPanel.add(new HTML(message));
|
||||||
|
|
Loading…
Reference in New Issue