minor fixes

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@130616 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-21 09:26:18 +00:00
parent c4c95620a3
commit eabefd3db0
2 changed files with 25 additions and 19 deletions

View File

@ -231,7 +231,7 @@ public class CreateDatasetForm extends Composite{
* @param owner
* @param eventBus
*/
private void createDatasetFormBody(boolean isWorkspaceRequest, String idFolderWorkspace, String owner, final HandlerManager eventBus){
private void createDatasetFormBody(final boolean isWorkspaceRequest, String idFolderWorkspace, String owner, final HandlerManager eventBus){
initWidget(uiBinder.createAndBindUi(this));
@ -249,14 +249,14 @@ public class CreateDatasetForm extends Composite{
// prepare info icons
prepareInfoIcons();
// set info block
setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true);
// disable continue button
continueButton.setEnabled(false);
resetButton.setEnabled(false);
// set info block
setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true);
// get back the licenses and the metadata information from the workspace
// get back the licenses and the metadata information
ckanServices.getDatasetBean(idFolderWorkspace, owner, new AsyncCallback<DatasetMetadataBean>() {
@Override
@ -310,19 +310,23 @@ public class CreateDatasetForm extends Composite{
}
}
// enable manage resources checkbox
resourcesControlGroup.setVisible(true);
addResourcesCheckBox.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
resourcesTable = new ResourcesTable(bean.getResources());
if(isWorkspaceRequest){
// if there are not resources, for now just checked it ( and hide so that the step will be skipped) TODO
if(bean.getResources() == null || bean.getResources().isEmpty()){
// enable manage resources checkbox
resourcesControlGroup.setVisible(true);
addResourcesCheckBox.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
resourcesTable = new ResourcesTable(bean.getResources());
// if there are not resources, for now just checked it ( and hide so that the step will be skipped) TODO
if(bean.getResources() == null || bean.getResources().isEmpty()){
resourcesControlGroup.setVisible(false);
alertNoResources.setType(AlertType.WARNING);
alertNoResources.setVisible(true);
}
resourcesControlGroup.setVisible(false);
alertNoResources.setType(AlertType.WARNING);
alertNoResources.setVisible(true);
}
// set organizations
List<OrganizationBean> organizations = bean.getOrganizationList();
@ -443,13 +447,13 @@ public class CreateDatasetForm extends Composite{
if(!metadataProfilesFormatListbox.getValue(i).equals("none"))
metadataProfilesFormatListbox.removeItem(i);
}
// select "none"
metadataProfilesFormatListbox.setSelectedIndex(0);
// get the name of the organization from the title
String orgName = nameTitleOrganizationMap.get(organizationsListbox.getSelectedItemText());
// try to retrieve the profiles
setAlertBlock("Retrieving profiles, please wait...", AlertType.INFO, true);
@ -463,7 +467,7 @@ public class CreateDatasetForm extends Composite{
receivedBean.setMetadataList(result);
prepareMetadataList(receivedBean);
// everything went ok
setAlertBlock("", AlertType.ERROR, false);
@ -604,6 +608,8 @@ public class CreateDatasetForm extends Composite{
// add the resources to the container panel
if(workspaceResourcesContainer.getWidget() == null)
workspaceResourcesContainer.add(resourcesTable);
selectedProfile.setText("Selected Profile is " + metadataProfilesFormatListbox.getSelectedItemText());
}else{

View File

@ -169,7 +169,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
if(httpSession.getAttribute(keyPerScope) != null){
orgsName = (List<OrganizationBean>)httpSession.getAttribute(keyPerScope);
logger.info("List of organizations was into session ");
logger.info("List of organizations was into session " + orgsName);
}
else{
orgsName = Utils.getUserOrganizationsListAdmin(scope, username, getASLSession().getGroupName(), this);