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
This commit is contained in:
Massimiliano Assante 2012-12-13 14:45:21 +00:00
parent 45bf988b5d
commit ab7478c31a
1 changed files with 9 additions and 4 deletions

View File

@ -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<String> 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 <EndPoint><Scope>$scope</Scope><URL>MyAppurl</URL> element in <Body>");
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 <EndPoint><Scope> element in <Body>");
return toReturn;