fix for incident #7553

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@144984 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2017-03-16 17:14:23 +00:00
parent 44589386fe
commit 9205d0c4df
2 changed files with 19 additions and 14 deletions

View File

@ -5,6 +5,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="share-updates"/> <property name="context-root" value="share-updates"/>
</wb-module> </wb-module>

View File

@ -455,26 +455,28 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
.start(); .start();
} }
} }
/** /**
* Extract mentioned VRE's group names * Extract mentioned VRE's group names
* @return Set<String> of vre groups' names * @return Set<String> of vre groups' names
*/ */
private static Set<String> getVreGroupsNames(ArrayList<ItemBean> mentionedUsers){ private static Set<String> getVreGroupsNames(ArrayList<ItemBean> mentionedUsers){
Set<String> toReturn = new HashSet<String>(); Set<String> toReturn = new HashSet<String>();
RoleManager rManager = new LiferayRoleManager(); RoleManager rManager = new LiferayRoleManager();
for (ItemBean itemBean : mentionedUsers) { if (mentionedUsers != null && !mentionedUsers.isEmpty()) {
for (ItemBean itemBean : mentionedUsers) {
if(itemBean.isItemGroup())
try { if(itemBean.isItemGroup())
toReturn.add(rManager.getTeam(Long.parseLong(itemBean.getId())).getTeamName()); try {
} catch (NumberFormatException | UserManagementSystemException toReturn.add(rManager.getTeam(Long.parseLong(itemBean.getId())).getTeamName());
| TeamRetrievalFault e) { } catch (NumberFormatException | UserManagementSystemException
_log.warn("Unable to add this team", e); | TeamRetrievalFault e) {
} _log.warn("Unable to add this team", e);
}
}
} }
return toReturn; return toReturn;
} }
@ -604,7 +606,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
return false; return false;
} }
} }
/** /**
* generate a preview of the file, upload the file on the storage and shorts the link * generate a preview of the file, upload the file on the storage and shorts the link
*/ */
@ -686,7 +688,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
_log.debug("Returning httpURL=" + httpURL); _log.debug("Returning httpURL=" + httpURL);
return toReturn; return toReturn;
} }
/** /**
* tries the following in the indicated order for Populating the Link preview * tries the following in the indicated order for Populating the Link preview
* Open Graph protocol * Open Graph protocol