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 owner
* @param eventBus * @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)); initWidget(uiBinder.createAndBindUi(this));
@ -249,14 +249,14 @@ public class CreateDatasetForm extends Composite{
// prepare info icons // prepare info icons
prepareInfoIcons(); prepareInfoIcons();
// set info block
setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true);
// disable continue button // disable continue button
continueButton.setEnabled(false); continueButton.setEnabled(false);
resetButton.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>() { ckanServices.getDatasetBean(idFolderWorkspace, owner, new AsyncCallback<DatasetMetadataBean>() {
@Override @Override
@ -310,19 +310,23 @@ public class CreateDatasetForm extends Composite{
} }
} }
// enable manage resources checkbox if(isWorkspaceRequest){
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 // enable manage resources checkbox
if(bean.getResources() == null || bean.getResources().isEmpty()){ 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 // set organizations
List<OrganizationBean> organizations = bean.getOrganizationList(); List<OrganizationBean> organizations = bean.getOrganizationList();
@ -443,13 +447,13 @@ public class CreateDatasetForm extends Composite{
if(!metadataProfilesFormatListbox.getValue(i).equals("none")) if(!metadataProfilesFormatListbox.getValue(i).equals("none"))
metadataProfilesFormatListbox.removeItem(i); metadataProfilesFormatListbox.removeItem(i);
} }
// select "none" // select "none"
metadataProfilesFormatListbox.setSelectedIndex(0); metadataProfilesFormatListbox.setSelectedIndex(0);
// get the name of the organization from the title // get the name of the organization from the title
String orgName = nameTitleOrganizationMap.get(organizationsListbox.getSelectedItemText()); String orgName = nameTitleOrganizationMap.get(organizationsListbox.getSelectedItemText());
// try to retrieve the profiles // try to retrieve the profiles
setAlertBlock("Retrieving profiles, please wait...", AlertType.INFO, true); setAlertBlock("Retrieving profiles, please wait...", AlertType.INFO, true);
@ -463,7 +467,7 @@ public class CreateDatasetForm extends Composite{
receivedBean.setMetadataList(result); receivedBean.setMetadataList(result);
prepareMetadataList(receivedBean); prepareMetadataList(receivedBean);
// everything went ok // everything went ok
setAlertBlock("", AlertType.ERROR, false); setAlertBlock("", AlertType.ERROR, false);
@ -604,6 +608,8 @@ public class CreateDatasetForm extends Composite{
// add the resources to the container panel // add the resources to the container panel
if(workspaceResourcesContainer.getWidget() == null) if(workspaceResourcesContainer.getWidget() == null)
workspaceResourcesContainer.add(resourcesTable); workspaceResourcesContainer.add(resourcesTable);
selectedProfile.setText("Selected Profile is " + metadataProfilesFormatListbox.getSelectedItemText());
}else{ }else{

View File

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