removed portletXClassName for NotificationsManager why was even there?
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@67400 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1bfe6577b0
commit
b6cc3f9032
|
@ -1,9 +1,15 @@
|
||||||
package org.gcube.applicationsupportlayer.social;
|
package org.gcube.applicationsupportlayer.social;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.application.framework.core.session.ASLSession;
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
|
import org.gcube.common.core.utils.logging.GCUBEClientLog;
|
||||||
import org.gcube.portal.databook.shared.ApplicationProfile;
|
import org.gcube.portal.databook.shared.ApplicationProfile;
|
||||||
import org.gcube.portal.databook.shared.Comment;
|
import org.gcube.portal.databook.shared.Comment;
|
||||||
import org.gcube.portal.databook.shared.Feed;
|
import org.gcube.portal.databook.shared.Feed;
|
||||||
|
import org.gcube.portal.databook.shared.Notification;
|
||||||
|
import org.gcube.portal.databook.shared.NotificationType;
|
||||||
import org.gcube.portal.databook.shared.RunningJob;
|
import org.gcube.portal.databook.shared.RunningJob;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder;
|
import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder;
|
||||||
import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem;
|
import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem;
|
||||||
|
@ -16,13 +22,14 @@ import org.gcube.portlets.user.homelibrary.home.workspace.sharing.WorkspaceMessa
|
||||||
* use to notify users from within your application
|
* use to notify users from within your application
|
||||||
*/
|
*/
|
||||||
public class ApplicationNotificationsManager extends SocialPortalBridge implements NotificationsManager {
|
public class ApplicationNotificationsManager extends SocialPortalBridge implements NotificationsManager {
|
||||||
|
static GCUBEClientLog _log = new GCUBEClientLog(ApplicationNotificationsManager.class);
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param aslSession the ASLSession instance
|
* @param aslSession the ASLSession instance
|
||||||
* @param portletClassName your portlet class name will be used ad unique identifier for your applicationProfile
|
* @param portletClassName your portlet class name will be used ad unique identifier for your applicationProfile
|
||||||
*/
|
*/
|
||||||
public ApplicationNotificationsManager(ASLSession session, String portletClassName) {
|
public ApplicationNotificationsManager(ASLSession session) {
|
||||||
super(session, portletClassName);
|
super(session);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -70,8 +77,21 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean notifyMessageReceived(String userIdToNotify, WorkspaceMessage message) {
|
public boolean notifyMessageReceived(String userIdToNotify, String subject) {
|
||||||
return true;
|
Notification not = new Notification(
|
||||||
|
UUID.randomUUID().toString(),
|
||||||
|
NotificationType.MESSAGE,
|
||||||
|
userIdToNotify, //user no notify
|
||||||
|
"messageid_not_provided", //the
|
||||||
|
new Date(),
|
||||||
|
"",
|
||||||
|
" has sent you a message with subject: " + subject,
|
||||||
|
false,
|
||||||
|
aslSession.getUsername(),
|
||||||
|
aslSession.getUserFullName(),
|
||||||
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
|
return getStoreInstance().saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -101,6 +121,6 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,10 +64,10 @@ public interface NotificationsManager {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userIdToNotify the user you want to notify
|
* @param userIdToNotify the user you want to notify
|
||||||
* @param message the {@link WorkspaceMessage} sent
|
* @param subject the subject of the message sent
|
||||||
* @return true if the notification is correctly delivered, false otherwise
|
* @return true if the notification is correctly delivered, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean notifyMessageReceived(String userIdToNotify, WorkspaceMessage message);
|
boolean notifyMessageReceived(String userIdToNotify, String subject);
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userIdToNotify the user you want to notify
|
* @param userIdToNotify the user you want to notify
|
||||||
|
|
|
@ -39,6 +39,14 @@ public class SocialPortalBridge {
|
||||||
this.aslSession = session;
|
this.aslSession = session;
|
||||||
this.applicationProfile = getProfileFromInfrastrucure(portletClassName);
|
this.applicationProfile = getProfileFromInfrastrucure(portletClassName);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param session
|
||||||
|
*/
|
||||||
|
public SocialPortalBridge(ASLSession session) {
|
||||||
|
this.aslSession = session;
|
||||||
|
this.applicationProfile = null;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the unique instance of the store
|
* @return the unique instance of the store
|
||||||
|
|
Loading…
Reference in New Issue