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:
parent
ab767fcc51
commit
521ca0bdad
|
@ -38,9 +38,7 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
*/
|
*/
|
||||||
public CkanFramePanel(HandlerManager eventBus) {
|
public CkanFramePanel(HandlerManager eventBus) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.add(loading);
|
addLoading();
|
||||||
loading.getElement().getStyle().setProperty("margin", "auto");
|
|
||||||
loading.getElement().getStyle().setDisplay(Display.BLOCK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,6 +64,8 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
print("Error " + e);
|
print("Error " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addLoading();
|
||||||
|
|
||||||
frame = new Frame(ckanUrlConnector);
|
frame = new Frame(ckanUrlConnector);
|
||||||
frame.getElement().setId(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
|
frame.getElement().setId(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
|
||||||
|
@ -97,4 +97,13 @@ public class CkanFramePanel extends FlowPanel{
|
||||||
public Frame getFrame() {
|
public Frame getFrame() {
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add loading image
|
||||||
|
*/
|
||||||
|
private void addLoading(){
|
||||||
|
this.add(loading);
|
||||||
|
loading.getElement().getStyle().setProperty("margin", "auto");
|
||||||
|
loading.getElement().getStyle().setDisplay(Display.BLOCK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
|
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
|
|
||||||
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
|
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
|
||||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanRole;
|
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanRole;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
||||||
|
@ -63,12 +62,12 @@ public class UserUtil {
|
||||||
for (GCubeGroup gCubeGroup : listOfGroups) {
|
for (GCubeGroup gCubeGroup : listOfGroups) {
|
||||||
|
|
||||||
// TODO: why only the VRES??...however check for the production root vo
|
// TODO: why only the VRES??...however check for the production root vo
|
||||||
if(gCubeGroup.getGroupName().equals(CKanUtilsImpl.PRODUCTION_LIFERAY_ORGNAME_ROOT))
|
// if(gCubeGroup.getGroupName().equals(CKanUtilsImpl.PRODUCTION_LIFERAY_ORGNAME_ROOT))
|
||||||
vreNames.add(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT);
|
// vreNames.add(CKanUtilsImpl.PRODUCTION_CKAN_ORGNAME_ROOT);
|
||||||
|
|
||||||
//if(groupManager.isVRE(gCubeGroup.getGroupId())) //Is it a VRE?
|
//if(groupManager.isVRE(gCubeGroup.getGroupId())) //Is it a VRE?
|
||||||
else
|
// else
|
||||||
vreNames.add(gCubeGroup.getGroupName());
|
vreNames.add(gCubeGroup.getGroupName());
|
||||||
}
|
}
|
||||||
logger.debug("Returning VRE names: "+vreNames);
|
logger.debug("Returning VRE names: "+vreNames);
|
||||||
return vreNames;
|
return vreNames;
|
||||||
|
@ -182,12 +181,12 @@ public class UserUtil {
|
||||||
// get highest role
|
// get highest role
|
||||||
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
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)){
|
if(correspondentRoleToCheck.equals(RolesIntoOrganization.ADMIN) || correspondentRoleToCheck.equals(RolesIntoOrganization.EDITOR)){
|
||||||
|
|
||||||
checkIfRoleIsSetInCkanInstance(username, groupName, currentGroupId,
|
checkIfRoleIsSetInCkanInstance(username, groupName, currentGroupId,
|
||||||
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
|
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
|
||||||
|
|
||||||
toReturn = mapRolesIntoOrganizationToCkanRole(correspondentRoleToCheck);
|
toReturn = mapRolesIntoOrganizationToCkanRole(correspondentRoleToCheck);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,7 +228,7 @@ public class UserUtil {
|
||||||
// get the orgs of the user and retrieve its title and name
|
// get the orgs of the user and retrieve its title and name
|
||||||
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
|
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
|
||||||
for (CkanOrganization ckanOrganization : ckanOrgs) {
|
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()));
|
orgsInWhichAtLeastEditorRole.add(new OrganizationBean(ckanOrganization.getTitle(), ckanOrganization.getName()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue