ref 17434: Workspace - info panel hide root VO and VO names in shared with part

https://support.d4science.org/issues/17434

Updated Info Panel to show only VRE info

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181744 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-09-19 14:02:36 +00:00
parent a7c98130e4
commit 8cdea59175
2 changed files with 26 additions and 6 deletions

View File

@ -1,9 +1,10 @@
<ReleaseNotes>
<Changeset component="portlets-widgets.workspace-sharing-widget.1-10-0"
date="2019-07-30">
<change>Updated Info Panel to show only VRE info [ticket: #17434]</change>
<change>Added support to workspace users discovery by VREs [ticket: #17169]</change>
<Change>Added support for users in different Gateway [ticket: #17080]</Change>
<Change>Update the list of shared classes with the tree widget</Change>
<Change>Updated the list of shared classes with the tree widget</Change>
</Changeset>
<Changeset component="portlets-widgets.workspace-sharing-widget.1-9-0"
date="2019-06-05">

View File

@ -47,6 +47,7 @@ import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class GWTWorkspaceSharingBuilder.
*
@ -417,7 +418,7 @@ public class GWTWorkspaceSharingBuilder {
}
}
});
logger.debug("VRE retrieved: "+contexts.size());
logger.debug("VRE retrieved: " + contexts.size());
return contexts;
} catch (Exception e) {
@ -805,7 +806,11 @@ public class GWTWorkspaceSharingBuilder {
String html = "<div style=\"width: 100%; text-align:left; font-size: 10px;\">";
logger.trace("Formatting " + acls.size() + " ACL/s");
logger.info("ACL/s found " + acls.size());
PortalContext context = PortalContext.getConfiguration();
logger.info("context.getInfrastructureName(): " + context.getInfrastructureName());
String infrastructureName = context.getInfrastructureName();
Map<AccessType, List<String>> aclOwner = new HashMap<>();
@ -840,15 +845,29 @@ public class GWTWorkspaceSharingBuilder {
for (String login : listLogins) {
logger.trace("Adding login " + login);
String fullName = UserUtil.getUserFullName(login);
if (fullName != null && !fullName.isEmpty())
html += fullName + "; ";
else
if (fullName != null && !fullName.isEmpty()) {
if (infrastructureName != null && !infrastructureName.isEmpty()
&& fullName.startsWith(infrastructureName) && infrastructureName.length()<fullName.length()) {
fullName = fullName.substring(infrastructureName.length()+1);
int indexOfFirstDash=fullName.indexOf("-");
if(indexOfFirstDash>-1&&fullName.length()>indexOfFirstDash){
fullName = fullName.substring(indexOfFirstDash+1);
html += fullName + "; ";
} else {
html += fullName + "; ";
}
} else {
html += fullName + "; ";
}
} else {
html += login + "; ";
}
}
html += "</span><br/>";
}
html += "</div>";
logger.info("Retrieved: " + html);
return html;
}