minor improvements

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@153236 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-09-19 09:40:04 +00:00
parent 0cf0b6ed45
commit 49bbbf2bde
6 changed files with 24 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.5.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -19,7 +19,7 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.5.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -29,10 +29,10 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.5.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.5.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,6 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-1"
date="2017-10-10">
<Change>Minor improvements</Change>
</Changeset>
<Changeset component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-0"
date="2017-05-10">
<Change>Metadata model v.3 supported</Change>

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.gcubeckan</groupId>
<artifactId>gcube-ckan-datacatalog</artifactId>
<packaging>war</packaging>
<version>1.5.0-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>
<name>gCube CKAN Data Catalog</name>
<description>The gCube CKAN Data Catalog portlet</description>

View File

@ -90,10 +90,16 @@ public class UserUtil {
// retrieve the role
for (GCubeGroup vre: listOfGroups) {
if(vre.getGroupId() == groupIdContext)
if(vre.getGroupId() == groupIdContext){
String localRole = RolesCkanGroupOrOrg.convertToCkanCapacity(getLiferayHighestRoleInOrg(roleManager.listRolesByUserAndGroup(user.getUserId(), vre.getGroupId())));
mapRoleByGroupSingleVre.put(vre.getGroupName().toLowerCase(),
RolesCkanGroupOrOrg.convertToCkanCapacity(getLiferayHighestRoleInOrg(roleManager.listRolesByUserAndGroup(user.getUserId(), vre.getGroupId()))));
else
localRole);
// check if extra roles must be assigned
logger.debug("Checking if there is the need to extend role " + localRole + " for user " + user.getUsername() + " in other vres");
instance.assignRolesOtherOrganization(user.getUsername(),
vre.getGroupName().toLowerCase(),
RolesCkanGroupOrOrg.convertFromCapacity(localRole));
}else
mapRoleByGroupExtrasVre.put(vre.getGroupName().toLowerCase(),
RolesCkanGroupOrOrg.convertToCkanCapacity(getLiferayHighestRoleInOrg(roleManager.listRolesByUserAndGroup(user.getUserId(), vre.getGroupId()))));
}
@ -102,7 +108,7 @@ public class UserUtil {
if(mapRoleByGroupExtrasVre.size() > 0)
new AddUserToOrganizationThread(
instance,
userManager.getUserByEmail(userEMail).getUsername(),
user.getUsername(),
mapRoleByGroupExtrasVre).
start();

View File

@ -40,8 +40,10 @@ public class AddUserToOrganizationThread extends Thread {
logger.debug("Thread for role association started. Organizations and roles are in the map: " + orgAndCapacity);
Set<Entry<String, String>> entrySet = orgAndCapacity.entrySet();
for (Entry<String, String> entry : entrySet) {
if(instance.getOrganizationByName(entry.getKey()) != null)
if(instance.getOrganizationByName(entry.getKey()) != null){
instance.checkRoleIntoOrganization(username, entry.getKey(), RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue()));
instance.assignRolesOtherOrganization(username, entry.getKey(), RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue()));
}
else if(instance.getGroupByName(entry.getKey()) != null){
RolesCkanGroupOrOrg roleInGroup = RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue());
roleInGroup = roleInGroup.equals(RolesCkanGroupOrOrg.EDITOR) ? RolesCkanGroupOrOrg.MEMBER : roleInGroup;