diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java index 482af46..bd03a32 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNewsManager.java @@ -34,16 +34,16 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa * @param aslSession the ASLSession instance * @param applicationClass your servlet class name will be used ad unique identifier for your application */ - public ApplicationNewsManager(ASLSession session, Class applicationClass) { + public ApplicationNewsManager(ASLSession session, String portletClassName) { super(session); - this.application = getProfileFromInfrastrucure(applicationClass); + this.application = getProfileFromInfrastrucure(portletClassName); } /** * this method looks up the application profile among the ones available in the infrastructure * @param applicationClass * @return the application profile */ - private Application getProfileFromInfrastrucure(Class applicationClass) { + private Application getProfileFromInfrastrucure(String portletClassName) { try { Application toReturn = new Application(); ISClient client = GHNContext.getImplementation(ISClient.class); @@ -52,7 +52,7 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa query.setExpression("for $profile in collection('/db/Profiles/GenericResource')//Resource " + "where $profile/Profile/SecondaryType/string() eq 'ApplicationProfile' and $profile/Profile/Body/AppId/string() " + - " eq '" + applicationClass.getName() + "'" + + " eq '" + portletClassName + "'" + "return $profile"); GCUBEScope scope = aslSession.getScope(); @@ -150,8 +150,9 @@ public class ApplicationNewsManager extends SocialPortalBridge implements NewsMa //add the GET params if necessary if (uriParams != null && uriParams.compareTo("") != 0) uri += "?"+uriParams; - String scope = getScopeByOrganizationId(""+aslSession.getGroupId()); - //String scope = "/gcube/devsec/devVRE"; + //String scope = getScopeByOrganizationId(""+aslSession.getGroupId()); + String scope = aslSession.getScopeName(); + System.out.println("scope: " + aslSession.getScopeName()); Feed toReturn = new Feed( UUID.randomUUID().toString(), FeedType.PUBLISH, diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NewsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NewsManager.java index e5aa4ff..2f8cc09 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NewsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NewsManager.java @@ -12,30 +12,27 @@ public interface NewsManager { /** * use to share an update from your application * - * @param applicationClass your servlet class name will be used ad unique identifier for your application - * @param description add a description for the update you are sharing - * @param uri the link to which the subject of this update is available + * @param feedtext add a description for the update you are sharing * @return true if the update is correctly delivered, false otherwise */ - boolean shareApplicationUpdate(String description); + boolean shareApplicationUpdate(String feedtext); /** - * use to share an update from your application with a reference to the news subject + * use to share an update from your application with a reference to the news object * - * @param description add a description for the update you are sharing - * @param uriParams the additional parameteres your application needs to open the subject of this update e.g. id=12345&type=foo + * @param feedtext description for the update you are sharing + * @param uriGETparams additional parameters if your application supports the direct opening of of this update's object e.g. id=12345&type=foo * @return true if the update is correctly delivered, false otherwise */ - boolean shareApplicationUpdate(String description, String uriGETparams); + boolean shareApplicationUpdate(String feedtext, String uriGETparams); /** - * use to share an update from your application with a link preview + * use to share an update from your application with a reference to the news object and with a link preview * - * @param applicationClass your servlet class name will be used ad unique identifier for your application with a link preview - * @param description add a description for the update you are sharing - * @param uriParams the additional parameteres your application needs to open the subject of this update e.g. id=12345&type=foo + * @param feedtext add a description for the update you are sharing + * @param uriGETparams additional parameters if your application supports the direct opening of of this update's object e.g. id=12345&type=foo * @param previewTitle the title to show in the preview * @param previewDescription the description to show in the preview * @param previewThumbnailUrl the image url to show in the preview * @return true if the update is correctly delivered, false otherwise */ - boolean shareApplicationUpdate(String description, String uriGETparams, String previewTitle, String previewDescription, String previewThumbnailUrl); + boolean shareApplicationUpdate(String feedtext, String uriGETparams, String previewTitle, String previewDescription, String previewThumbnailUrl); }