wrong ApplicationProfileNotFoundException import
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@62274 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5014089ac5
commit
465a6ec75d
|
@ -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<XMLResult> 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<String> 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 <AppId> element in <Body>");
|
||||
else throw new ApplicationProfileNotFoundException("Your application ID n was not found in the profile, consider adding <AppId> element in <Body>");
|
||||
|
||||
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 <ThumbnailURL> element in <Body>");
|
||||
else throw new ApplicationProfileNotFoundException("Your application Image Url was not found in the profile, consider adding <ThumbnailURL> element in <Body>");
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue