Added support for SendTo
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/message-conversations@169229 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d6a28f356a
commit
3cd5a30c1b
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/messages-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/messages-2.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/messages-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/messages-2.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="target/messages-2.0.0-SNAPSHOT/WEB-INF/classes" path="target/generated-sources/gwt">
|
<classpathentry kind="src" output="target/messages-2.1.0-SNAPSHOT/WEB-INF/classes" path="target/generated-sources/gwt">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
@ -35,5 +35,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/messages-2.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/messages-2.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
<dependent-module archiveName="workspace-explorer-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-explorer-TRUNK-1.5.0-SNAPSHOT/workspace-explorer-TRUNK-1.5.0-SNAPSHOT">
|
<dependent-module archiveName="workspace-explorer-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-explorer-TRUNK-1.5.0-SNAPSHOT/workspace-explorer-TRUNK-1.5.0-SNAPSHOT">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="storagehub-icons-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-icons-library/storagehub-icons-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<dependent-module archiveName="client-context-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/client-context-library/client-context-library">
|
<dependent-module archiveName="client-context-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/client-context-library/client-context-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Changeset component="org.gcube.portlets-user.messages.2-0-0"
|
<Changeset component="org.gcube.portlets-user.messages.2-1-0"
|
||||||
date="2018-05-23">
|
date="2018-06-14">
|
||||||
<Change>Updated Workspace Explorer dependency</Change>
|
<Change>Updated Workspace Explorer dependency</Change>
|
||||||
|
<Change>Added support for SendTo</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-user.messages.2-0-0"
|
<Changeset component="org.gcube.portlets-user.messages.2-0-0"
|
||||||
date="2017-09-21">
|
date="2017-09-21">
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.gcube.portets.user.message_conversations.client;
|
||||||
|
/**
|
||||||
|
* simply encode base64 strings
|
||||||
|
* @author massi
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Encoder {
|
||||||
|
public static native String encode(String toEncode) /*-{
|
||||||
|
return btoa(toEncode);
|
||||||
|
}-*/;
|
||||||
|
|
||||||
|
public static native String decode(String toDecode) /*-{
|
||||||
|
return atob(toDecode);
|
||||||
|
}-*/;
|
||||||
|
}
|
|
@ -3,22 +3,50 @@ package org.gcube.portets.user.message_conversations.client;
|
||||||
import org.gcube.portets.user.message_conversations.client.ui.ApplicationView;
|
import org.gcube.portets.user.message_conversations.client.ui.ApplicationView;
|
||||||
|
|
||||||
import com.google.gwt.core.client.EntryPoint;
|
import com.google.gwt.core.client.EntryPoint;
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.RootPanel;
|
import com.google.gwt.user.client.ui.RootPanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point classes define <code>onModuleLoad()</code>.
|
* @author Massimiliano Assante, CNR-ISTI
|
||||||
*/
|
*/
|
||||||
public class MessageConversations implements EntryPoint {
|
public class MessageConversations implements EntryPoint {
|
||||||
public static final String DIV_CONTAINER_ID = "create-users-container";
|
public static final String DIV_CONTAINER_ID = "create-users-container";
|
||||||
public static final String ARTIFACT_ID = "messages";
|
public static final String ARTIFACT_ID = "messages";
|
||||||
|
public static final String USER_PROFILE_OID = "userIdentificationParameter";
|
||||||
private ApplicationView ap;
|
private ApplicationView ap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the entry point method.
|
* This is the entry point method.
|
||||||
*/
|
*/
|
||||||
public void onModuleLoad() {
|
public void onModuleLoad() {
|
||||||
ap = new ApplicationView();
|
String[] usernamesToSendTo = getUserToShowId();
|
||||||
|
//we check whether there exists usernames to send to in the params, if not regular Messages else we show the new message panel to send the message to the users passed
|
||||||
|
ap = (usernamesToSendTo != null && usernamesToSendTo.length > 0) ?
|
||||||
|
new ApplicationView(usernamesToSendTo) : new ApplicationView();
|
||||||
RootPanel.get(DIV_CONTAINER_ID).add(ap);
|
RootPanel.get(DIV_CONTAINER_ID).add(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* decode the usernames from the location param (the list of usernames decoded should be comma separated e.g. username1,username2)
|
||||||
|
* @return the decoded (base64) userid
|
||||||
|
*/
|
||||||
|
public static String[] getUserToShowId() {
|
||||||
|
String encodedOid = Encoder.encode(USER_PROFILE_OID);
|
||||||
|
if (Window.Location.getParameter(encodedOid) == null)
|
||||||
|
return null;
|
||||||
|
try {
|
||||||
|
String encodedUsernames = Window.Location.getParameter(encodedOid);
|
||||||
|
String decodedUserNames = Encoder.decode(encodedUsernames);
|
||||||
|
if (decodedUserNames.contains(","))
|
||||||
|
return decodedUserNames.split(",");
|
||||||
|
else {
|
||||||
|
String[] usernames = {decodedUserNames};
|
||||||
|
return usernames;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
GWT.log("Something wring in parsing username list");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ public interface MessageService extends RemoteService {
|
||||||
ArrayList<ConvMessage> getMessages(boolean sent);
|
ArrayList<ConvMessage> getMessages(boolean sent);
|
||||||
ConvMessage getMessageById(String messageId, boolean sent);
|
ConvMessage getMessageById(String messageId, boolean sent);
|
||||||
CurrUserAndPortalUsersWrapper getWorkspaceUsers();
|
CurrUserAndPortalUsersWrapper getWorkspaceUsers();
|
||||||
|
ArrayList<WSUser> getUsersInfo(String[] usernames);
|
||||||
ArrayList<WSUser> searchUsers(String keyword);
|
ArrayList<WSUser> searchUsers(String keyword);
|
||||||
boolean sendToById(ArrayList<String> recipientIds, ArrayList<String> listAttachmentsId, String subject, String body);
|
boolean sendToById(ArrayList<String> recipientIds, ArrayList<String> listAttachmentsId, String subject, String body);
|
||||||
boolean deleteMessageById(String messageId, boolean sent);
|
boolean deleteMessageById(String messageId, boolean sent);
|
||||||
|
|
|
@ -63,7 +63,9 @@ import gwt.material.design.client.ui.MaterialRow;
|
||||||
import gwt.material.design.client.ui.MaterialToast;
|
import gwt.material.design.client.ui.MaterialToast;
|
||||||
import gwt.material.design.client.ui.animate.MaterialAnimation;
|
import gwt.material.design.client.ui.animate.MaterialAnimation;
|
||||||
import gwt.material.design.client.ui.animate.Transition;
|
import gwt.material.design.client.ui.animate.Transition;
|
||||||
|
/**
|
||||||
|
* @author Massimiliano Assante, CNR-ISTI
|
||||||
|
*/
|
||||||
public class ApplicationView extends Composite {
|
public class ApplicationView extends Composite {
|
||||||
|
|
||||||
interface Binder extends UiBinder<Widget, ApplicationView> {
|
interface Binder extends UiBinder<Widget, ApplicationView> {
|
||||||
|
@ -92,9 +94,9 @@ public class ApplicationView extends Composite {
|
||||||
private ConvMessage currentSelected;
|
private ConvMessage currentSelected;
|
||||||
private DisplayMessage displayMessage;
|
private DisplayMessage displayMessage;
|
||||||
private WriteMessage newMessageDisplay;
|
private WriteMessage newMessageDisplay;
|
||||||
|
private boolean isSendTo = false;
|
||||||
|
|
||||||
|
public ApplicationView(String... sendToUserNames) {
|
||||||
public ApplicationView() {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
((ServiceDefTarget) convService).setServiceEntryPoint(Utils.getServiceEntryPoint());
|
((ServiceDefTarget) convService).setServiceEntryPoint(Utils.getServiceEntryPoint());
|
||||||
displayMessage = new DisplayMessage(convService, this);
|
displayMessage = new DisplayMessage(convService, this);
|
||||||
|
@ -115,14 +117,22 @@ public class ApplicationView extends Composite {
|
||||||
forward.setTooltip("Forward");
|
forward.setTooltip("Forward");
|
||||||
forward.setTooltipPosition(Position.LEFT);
|
forward.setTooltipPosition(Position.LEFT);
|
||||||
}
|
}
|
||||||
readUserMessages(false);
|
|
||||||
|
String[] usernamesToSendTo = sendToUserNames;
|
||||||
|
if (usernamesToSendTo != null && usernamesToSendTo.length > 0) {
|
||||||
|
prepareNewMessageForSendTo(usernamesToSendTo);
|
||||||
|
isSendTo = true;
|
||||||
|
messageLoader.setVisible(false);
|
||||||
|
}
|
||||||
|
readUserMessages(false, isSendTo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param sent
|
* @param sent
|
||||||
*/
|
*/
|
||||||
public void readUserMessages(final boolean sent) {
|
public void readUserMessages(final boolean sent, boolean isSendTo) {
|
||||||
messagesLoader.setVisible(true);
|
messagesLoader.setVisible(true);
|
||||||
convService.getMessages(sent, new AsyncCallback<ArrayList<ConvMessage>>() {
|
convService.getMessages(sent, new AsyncCallback<ArrayList<ConvMessage>>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -134,11 +144,13 @@ public class ApplicationView extends Composite {
|
||||||
public void onSuccess(ArrayList<ConvMessage> messages) {
|
public void onSuccess(ArrayList<ConvMessage> messages) {
|
||||||
if (messages != null) {
|
if (messages != null) {
|
||||||
showMessages(messages, sent);
|
showMessages(messages, sent);
|
||||||
if (messages.size() > 0)
|
if (!isSendTo) {
|
||||||
readUserMessage(messages.get(0).getId(), sent);
|
if (messages.size() > 0)
|
||||||
else {
|
readUserMessage(messages.get(0).getId(), sent);
|
||||||
writeWelcomeMessage();
|
else {
|
||||||
messageLoader.setVisible(false);
|
writeWelcomeMessage();
|
||||||
|
messageLoader.setVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showErrorOccurred();
|
showErrorOccurred();
|
||||||
|
@ -279,7 +291,7 @@ public class ApplicationView extends Composite {
|
||||||
switcher.setIconType(IconType.INBOX);
|
switcher.setIconType(IconType.INBOX);
|
||||||
}
|
}
|
||||||
toggleSwitch = ! toggleSwitch;
|
toggleSwitch = ! toggleSwitch;
|
||||||
readUserMessages(toggleSwitch);
|
readUserMessages(toggleSwitch, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("menu")
|
@UiHandler("menu")
|
||||||
|
@ -302,6 +314,12 @@ public class ApplicationView extends Composite {
|
||||||
hideSidePanel();
|
hideSidePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void prepareNewMessageForSendTo(String[] usernamesToSendTo) {
|
||||||
|
newMessageDisplay = new WriteMessage(convService, this);
|
||||||
|
newMessageDisplay.setNewMessageForSendTo(usernamesToSendTo);
|
||||||
|
displayNewOrReplyMessage();
|
||||||
|
}
|
||||||
|
|
||||||
@UiHandler("newMessage")
|
@UiHandler("newMessage")
|
||||||
void onNewMessage(ClickEvent e) {
|
void onNewMessage(ClickEvent e) {
|
||||||
newMessageDisplay = new WriteMessage(convService, this);
|
newMessageDisplay = new WriteMessage(convService, this);
|
||||||
|
@ -382,7 +400,7 @@ public class ApplicationView extends Composite {
|
||||||
totalMessages++;
|
totalMessages++;
|
||||||
updateBadge(false);
|
updateBadge(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeErrorMessage() {
|
private void writeErrorMessage() {
|
||||||
MessagesResources images = GWT.create(MessagesResources.class);
|
MessagesResources images = GWT.create(MessagesResources.class);
|
||||||
List<MessageUserModel> recipients = Arrays.asList(new MessageUserModel(0, "you", "You", ""));
|
List<MessageUserModel> recipients = Arrays.asList(new MessageUserModel(0, "you", "You", ""));
|
||||||
|
|
|
@ -44,7 +44,9 @@ import gwt.material.design.client.ui.MaterialPreLoader;
|
||||||
import gwt.material.design.client.ui.MaterialRow;
|
import gwt.material.design.client.ui.MaterialRow;
|
||||||
import gwt.material.design.client.ui.MaterialTextArea;
|
import gwt.material.design.client.ui.MaterialTextArea;
|
||||||
import gwt.material.design.client.ui.MaterialTextBox;
|
import gwt.material.design.client.ui.MaterialTextBox;
|
||||||
|
/**
|
||||||
|
* @author Massimiliano Assante, CNR-ISTI
|
||||||
|
*/
|
||||||
public class WriteMessage extends Composite {
|
public class WriteMessage extends Composite {
|
||||||
|
|
||||||
private static MessageWindowUiBinder uiBinder = GWT.create(MessageWindowUiBinder.class);
|
private static MessageWindowUiBinder uiBinder = GWT.create(MessageWindowUiBinder.class);
|
||||||
|
@ -79,6 +81,21 @@ public class WriteMessage extends Composite {
|
||||||
MaterialPanel getMainPanel() {
|
MaterialPanel getMainPanel() {
|
||||||
return mainPanel;
|
return mainPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNewMessageForSendTo(String[] usernames) {
|
||||||
|
GWT.log("her add the users");
|
||||||
|
convService.getUsersInfo(usernames, new AsyncCallback<ArrayList<WSUser>>() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ArrayList<WSUser> result) {
|
||||||
|
for (WSUser user : result) {
|
||||||
|
acModal.addItem(new UserSuggestion(user));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void setIsReply(ConvMessage msg) {
|
public void setIsReply(ConvMessage msg) {
|
||||||
acModal.addItem(new UserSuggestion(
|
acModal.addItem(new UserSuggestion(
|
||||||
|
|
|
@ -53,7 +53,7 @@ import com.liferay.portal.service.GroupLocalServiceUtil;
|
||||||
import com.liferay.portal.service.UserLocalServiceUtil;
|
import com.liferay.portal.service.UserLocalServiceUtil;
|
||||||
import com.liferay.portal.util.PortalUtil;
|
import com.liferay.portal.util.PortalUtil;
|
||||||
/**
|
/**
|
||||||
* The server side implementation of the RPC service.
|
* @author Massimiliano Assante, CNR-ISTI
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ConvServiceImpl extends RemoteServiceServlet implements MessageService {
|
public class ConvServiceImpl extends RemoteServiceServlet implements MessageService {
|
||||||
|
@ -362,6 +362,25 @@ public class ConvServiceImpl extends RemoteServiceServlet implements MessageServ
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<WSUser> getUsersInfo(String[] usernames) {
|
||||||
|
ArrayList<WSUser> toReturn = new ArrayList<>();
|
||||||
|
if (isWithinPortal()) {
|
||||||
|
try {
|
||||||
|
for (String username : usernames) {
|
||||||
|
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
|
||||||
|
toReturn.add(new WSUser(""+user.getUserId(), user.getScreenName(), user.getFullName(), extractDomainFromEmail(user.getEmailAddress())));
|
||||||
|
}
|
||||||
|
} catch (SystemException | PortalException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else { //development
|
||||||
|
toReturn.add(new WSUser("andrea.rossi", "andrea.rossi", "Andrea Rossi", "rossi@gmail.com"));
|
||||||
|
toReturn.add(new WSUser("ginoi", "gino", "Gino Pino", "gino@hotmail.com"));
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean sendToById(ArrayList<String> recipientIds, ArrayList<String> listAttachmentsId, String subject, String body) {
|
public boolean sendToById(ArrayList<String> recipientIds, ArrayList<String> listAttachmentsId, String subject, String body) {
|
||||||
PortalContext pContext = PortalContext.getConfiguration();
|
PortalContext pContext = PortalContext.getConfiguration();
|
||||||
|
@ -521,4 +540,5 @@ public class ConvServiceImpl extends RemoteServiceServlet implements MessageServ
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,16 +11,7 @@ import javax.portlet.PortletRequestDispatcher;
|
||||||
import javax.portlet.RenderRequest;
|
import javax.portlet.RenderRequest;
|
||||||
import javax.portlet.RenderResponse;
|
import javax.portlet.RenderResponse;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class MessagesPortlet extends GenericPortlet {
|
public class MessagesPortlet extends GenericPortlet {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSP folder name
|
* JSP folder name
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,31 @@
|
||||||
|
|
||||||
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
<%@ page
|
<%@ page
|
||||||
import="org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager"%>
|
import="org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager"%>
|
||||||
<%@ page
|
<%@ page
|
||||||
import="org.gcube.common.authorization.library.provider.UserInfo"%>
|
import="org.gcube.common.authorization.library.provider.UserInfo"%>
|
||||||
<%@ page import="org.gcube.common.portal.PortalContext"%>
|
<%@ page import="org.gcube.common.portal.PortalContext"%>
|
||||||
|
<%@ page import="com.liferay.portal.util.PortalUtil"%>
|
||||||
|
<%@ page import="javax.servlet.http.HttpServletRequest"%>
|
||||||
|
<portlet:defineObjects />
|
||||||
|
|
||||||
|
|
||||||
<%
|
<%
|
||||||
|
String USER_PROFILE_OID = "userIdentificationParameter";
|
||||||
|
String encoded_USER_PROFILE_OID = "dXNlcklkZW50aWZpY2F0aW9uUGFyYW1ldGVy"; //for simplicity we add the encoded version of the param above
|
||||||
|
String additionalParameter = "";
|
||||||
|
|
||||||
|
HttpServletRequest r = PortalUtil.getHttpServletRequest(renderRequest);
|
||||||
|
|
||||||
|
if (PortalUtil.getOriginalServletRequest(r).getParameter(encoded_USER_PROFILE_OID) != null) {
|
||||||
|
additionalParameter = "&"+encoded_USER_PROFILE_OID+"="+PortalUtil.getOriginalServletRequest(r).getParameter(encoded_USER_PROFILE_OID);
|
||||||
|
System.out.println("found additional parameter ... " + additionalParameter);
|
||||||
|
}
|
||||||
long groupId = com.liferay.portal.util.PortalUtil.getScopeGroupId(request);
|
long groupId = com.liferay.portal.util.PortalUtil.getScopeGroupId(request);
|
||||||
long userId = com.liferay.portal.util.PortalUtil.getUser(request).getUserId();
|
long userId = com.liferay.portal.util.PortalUtil.getUser(request).getUserId();
|
||||||
|
|
||||||
String strURL = response.encodeURL(
|
String strURL = response.encodeURL(
|
||||||
request.getContextPath() + "/MessageConversations.html?gid=" + groupId + "&uid=" + userId);
|
request.getContextPath() + "/MessageConversations.html?gid=" + groupId + "&uid=" + userId + additionalParameter);
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
@ -28,7 +41,8 @@ window.addEventListener('DOMContentLoaded', function(e) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<iframe id="myIframe" src='<%=strURL%>' width="100%" marginwidth="0"
|
<iframe id="myIframe" src='<%=strURL%>' width="100%" marginwidth="0"
|
||||||
marginheight="0" frameborder="0" scrolling="no" style=" overflow-x: hidden; "> </iframe>
|
marginheight="0" frameborder="0" scrolling="no"
|
||||||
|
style="overflow-x: hidden;"> </iframe>
|
||||||
|
|
||||||
<!-- iFrame resize handler -->
|
<!-- iFrame resize handler -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<portlet-name>MessageConv</portlet-name>
|
<portlet-name>MessageConv</portlet-name>
|
||||||
<layout-cacheable>false</layout-cacheable>
|
<layout-cacheable>false</layout-cacheable>
|
||||||
<instanceable>false</instanceable>
|
<instanceable>false</instanceable>
|
||||||
|
<requires-namespaced-parameters>false</requires-namespaced-parameters>
|
||||||
<ajaxable>false</ajaxable>
|
<ajaxable>false</ajaxable>
|
||||||
<header-portlet-css>/MessageConversations.css</header-portlet-css>
|
<header-portlet-css>/MessageConversations.css</header-portlet-css>
|
||||||
</portlet>
|
</portlet>
|
||||||
|
|
Loading…
Reference in New Issue