From ab7478c31a644fad14f1745dd36f564ba4cbadb6 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Thu, 13 Dec 2012 14:45:21 +0000 Subject: [PATCH] retrieve of URL for applications from IS done git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@62310 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../social/ApplicationNewsManager.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java index 084af68..8293aeb 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java @@ -89,12 +89,17 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa currValue = node.evaluate("/Resource/Profile/Body/EndPoint/Scope/text()"); if (currValue != null && currValue.size() > 0) { List scopes = currValue; - for (int i = 0; i < scopes.size(); i++) - if (currValue.get(i).trim().compareTo(scope.toString()) == 0) { + boolean foundUrl = false; + for (int i = 0; i < scopes.size(); i++) { + if (currValue.get(i).trim().compareTo(scope.toString()) == 0) { toReturn.setUrl(node.evaluate("/Resource/Profile/Body/EndPoint/URL/text()").get(i)); toReturn.setScope(scope.toString()); - } else - throw new ApplicationProfileNotFoundException("Your application EndPoint URL was not found in the profile, consider adding $scopeMyAppurl element in "); + foundUrl = true; + break; + } + } + if (! foundUrl) + throw new ApplicationProfileNotFoundException("Your application URL was not found in the profile for Scope: " + scope.toString()); } else throw new ApplicationProfileNotFoundException("Your application EndPoint was not found in the profile, consider adding element in "); return toReturn;