diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java index 86d6964..4abaad3 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java @@ -7,6 +7,7 @@ import java.util.UUID; import javax.servlet.http.HttpServlet; import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.applicationsupportlayer.social.ex.ApplicationProfileNotFoundException; import org.gcube.common.core.contexts.GHNContext; import org.gcube.common.core.informationsystem.client.ISClient; import org.gcube.common.core.informationsystem.client.XMLResult; @@ -15,7 +16,7 @@ import org.gcube.portal.databook.shared.Application; import org.gcube.portal.databook.shared.Feed; import org.gcube.portal.databook.shared.FeedType; import org.gcube.portal.databook.shared.PrivacyLevel; -import org.gcube.portlets.user.homelibrary.home.data.application.ApplicationDataNotFoundException; + /** * @@ -55,7 +56,7 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa List appProfile = client.execute(query, aslSession.getScope().getInfrastructure()); if (appProfile == null || appProfile.size() == 0) - throw new ApplicationDataNotFoundException("Your application is not registered in the infrastructure"); + throw new ApplicationProfileNotFoundException("Your application is not registered in the infrastructure"); else { XMLResult node = appProfile.get(0); List currValue = null; @@ -63,7 +64,7 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa if (currValue != null && currValue.size() > 0) { toReturn.setName(currValue.get(0)); } - else throw new ApplicationDataNotFoundException("Your application NAME was not found in the profile"); + else throw new ApplicationProfileNotFoundException("Your application NAME was not found in the profile"); currValue = node.evaluate("/Resource/Profile/Description/text()"); if (currValue != null && currValue.size() > 0) { @@ -75,13 +76,13 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa if (currValue != null && currValue.size() > 0) { toReturn.setKey(currValue.get(0)); } - else throw new ApplicationDataNotFoundException("Your application ID n was not found in the profile, consider adding element in "); + else throw new ApplicationProfileNotFoundException("Your application ID n was not found in the profile, consider adding element in "); currValue = node.evaluate("/Resource/Profile/Body/ThumbnailURL/text()"); if (currValue != null && currValue.size() > 0) { toReturn.setImageUrl(currValue.get(0)); } - else throw new ApplicationDataNotFoundException("Your application Image Url was not found in the profile, consider adding element in "); + else throw new ApplicationProfileNotFoundException("Your application Image Url was not found in the profile, consider adding element in "); return toReturn; } @@ -96,22 +97,22 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa * {@inheritDoc} */ @Override - public boolean shareApplicationUpdate(String description) { - return getStoreInstance().saveAppFeed(buildFeed(description, "", "", "", "")); + public boolean shareApplicationUpdate(String feedText) { + return getStoreInstance().saveAppFeed(buildFeed(feedText, "", "", "", "")); } /** * {@inheritDoc} */ @Override - public boolean shareApplicationUpdate(String description, String uri) { - return getStoreInstance().saveAppFeed(buildFeed(description, uri, "", "", "")); + public boolean shareApplicationUpdate(String feedText, String uri) { + return getStoreInstance().saveAppFeed(buildFeed(feedText, uri, "", "", "")); } /** * {@inheritDoc} */ @Override - public boolean shareApplicationUpdate(String description, String uri, String previewTitle, String previewDescription, String previewThumbnailUrl) { - return getStoreInstance().saveAppFeed(buildFeed(description, uri, previewTitle, previewDescription, previewThumbnailUrl)); + public boolean shareApplicationUpdate(String feedText, String uri, String previewTitle, String previewDescription, String previewThumbnailUrl) { + return getStoreInstance().saveAppFeed(buildFeed(feedText, uri, previewTitle, previewDescription, previewThumbnailUrl)); } private Feed buildFeed(String description, String uri, String previewTitle, String previewDescription, String previewThumbnailUrl) {