git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@128232 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7790c9d91d
commit
632ba2cf77
|
@ -7,12 +7,12 @@ import java.util.UUID;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.application.framework.core.session.ASLSession;
|
||||
import org.gcube.applicationsupportlayer.social.mailing.EmailPlugin;
|
||||
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
|
||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
||||
import org.gcube.common.portal.GCubePortalConstants;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.portal.databook.shared.ApplicationProfile;
|
||||
import org.gcube.portal.databook.shared.Notification;
|
||||
|
@ -28,6 +28,9 @@ import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
|
@ -40,38 +43,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
private String portalName;
|
||||
private String senderEmail;
|
||||
private String portalURL;
|
||||
/**
|
||||
* @deprecated:please use ApplicationNotificationsManager(String scope, {@link SocialNetworkingUser} currUser, String portletClassName)
|
||||
* Use this constructor if you do not need notifications to point back to your applications
|
||||
* @param ASLSession the ASLSession instance
|
||||
*/
|
||||
@Deprecated
|
||||
public ApplicationNotificationsManager(ASLSession session) {
|
||||
super(session);
|
||||
PortalContext context = PortalContext.getConfiguration();
|
||||
portalName = context.getGatewayName();
|
||||
senderEmail = context.getSenderEmail();
|
||||
portalURL = context.getGatewayURL();
|
||||
_log.warn("Asked for Simple Notification (without redirect to creator)");
|
||||
}
|
||||
/**
|
||||
* @deprecated: please use ApplicationNotificationsManager(String scope, {@link SocialNetworkingUser} currUser, String portletClassName)
|
||||
* Use this constructor if you do need notifications to point back to your applications,
|
||||
* make sure you create your application profile on the infrastructure.
|
||||
*
|
||||
* @see http://wiki.gcube-system.org/gcube/index.php/Social_Networking_Library#Create_Your_Application_Profile
|
||||
*
|
||||
* @param ASLSession the ASLSession instance
|
||||
* @param portletClassName your portlet class name will be used ad unique identifier for your applicationProfile
|
||||
*/
|
||||
@Deprecated
|
||||
public ApplicationNotificationsManager(ASLSession session, String portletClassName) {
|
||||
super(session, portletClassName);
|
||||
PortalContext context = PortalContext.getConfiguration();
|
||||
portalName = context.getGatewayName();
|
||||
senderEmail = context.getSenderEmail();
|
||||
portalURL = context.getGatewayURL();
|
||||
}
|
||||
private String siteLandingPagePath;
|
||||
/**
|
||||
* Use this constructor if you do not need notifications to point back to your applications
|
||||
* @param scope the current scope
|
||||
|
@ -100,9 +72,12 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
/**
|
||||
* set the current portal context (name, emal, url)
|
||||
* @param request
|
||||
* @throws SystemException
|
||||
* @throws PortalException
|
||||
*/
|
||||
private void setContext(HttpServletRequest request) {
|
||||
PortalContext context = PortalContext.getConfiguration();
|
||||
siteLandingPagePath = context.getSiteLandingPagePath(request);
|
||||
portalName = context.getGatewayName(request);
|
||||
senderEmail = context.getSenderEmail(request);
|
||||
portalURL = context.getGatewayURL(request);
|
||||
|
@ -152,8 +127,8 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
return applicationProfile.getUrl();
|
||||
}
|
||||
else {
|
||||
_log.warn("applicationProfile NULL or url is empty returning " + "/group/data-e-infrastructure-gateway");
|
||||
return "/group/data-e-infrastructure-gateway";
|
||||
_log.warn("applicationProfile NULL or url is empty returning " + siteLandingPagePath);
|
||||
return siteLandingPagePath;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -492,7 +467,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
userIdToNotify, //user no notify
|
||||
messageId, //the unique identifier of the message
|
||||
new Date(),
|
||||
"/group/data-e-infrastructure-gateway/messages",
|
||||
siteLandingPagePath + GCubePortalConstants.USER_MESSAGES_FRIENDLY_URL,
|
||||
"sent you a message: "
|
||||
+ "<br/><div style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 50px; padding-left: 15px; border-left: 3px solid #ccc; font-style: italic;\">"
|
||||
+ messageText +"</div>"
|
||||
|
|
Loading…
Reference in New Issue