removed forced mapping for production root organization

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@131367 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-09-14 16:06:49 +00:00
parent ab767fcc51
commit 521ca0bdad
2 changed files with 19 additions and 11 deletions

View File

@ -38,9 +38,7 @@ public class CkanFramePanel extends FlowPanel{
*/
public CkanFramePanel(HandlerManager eventBus) {
this.eventBus = eventBus;
this.add(loading);
loading.getElement().getStyle().setProperty("margin", "auto");
loading.getElement().getStyle().setDisplay(Display.BLOCK);
addLoading();
}
/**
@ -66,6 +64,8 @@ public class CkanFramePanel extends FlowPanel{
}catch(Exception e){
print("Error " + e);
}
addLoading();
frame = new Frame(ckanUrlConnector);
frame.getElement().setId(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
@ -97,4 +97,13 @@ public class CkanFramePanel extends FlowPanel{
public Frame getFrame() {
return frame;
}
/**
* add loading image
*/
private void addLoading(){
this.add(loading);
loading.getElement().getStyle().setProperty("margin", "auto");
loading.getElement().getStyle().setDisplay(Display.BLOCK);
}
}

View File

@ -7,7 +7,6 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanRole;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
@ -63,12 +62,12 @@ public class UserUtil {
for (GCubeGroup gCubeGroup : listOfGroups) {
// TODO: why only the VRES??...however check for the production root vo
if(gCubeGroup.getGroupName().equals(CKanUtilsImpl.PRODUCTION_LIFERAY_ORGNAME_ROOT))
vreNames.add(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT);
// if(gCubeGroup.getGroupName().equals(CKanUtilsImpl.PRODUCTION_LIFERAY_ORGNAME_ROOT))
// vreNames.add(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT);
//if(groupManager.isVRE(gCubeGroup.getGroupId())) //Is it a VRE?
else
vreNames.add(gCubeGroup.getGroupName());
// else
vreNames.add(gCubeGroup.getGroupName());
}
logger.debug("Returning VRE names: "+vreNames);
return vreNames;
@ -182,12 +181,12 @@ public class UserUtil {
// get highest role
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
// if it the role is ADMIN/EDITOR we have to be sure to set it
//if it the role is ADMIN/EDITOR we have to be sure to set it
if(correspondentRoleToCheck.equals(RolesIntoOrganization.ADMIN) || correspondentRoleToCheck.equals(RolesIntoOrganization.EDITOR)){
checkIfRoleIsSetInCkanInstance(username, groupName, currentGroupId,
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
toReturn = mapRolesIntoOrganizationToCkanRole(correspondentRoleToCheck);
}
}
@ -229,7 +228,7 @@ public class UserUtil {
// get the orgs of the user and retrieve its title and name
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
for (CkanOrganization ckanOrganization : ckanOrgs) {
if(ckanOrganization.getName().equals(gCubeGroupName.toLowerCase()) || ckanOrganization.getName().equals(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT)){
if(ckanOrganization.getName().equals(gCubeGroupName.toLowerCase())){// || ckanOrganization.getName().equals(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT)){
orgsInWhichAtLeastEditorRole.add(new OrganizationBean(ckanOrganization.getTitle(), ckanOrganization.getName()));
break;
}