Author: sebawagner
Date: Fri Apr 13 08:28:06 2012
New Revision: 1325650
URL: http://svn.apache.org/viewvc?rev=1325650&view=rev
Log:
OPENMEETINGS-160 Enables private messages to external users
Removed:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/wizard/
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/settings/privatemessages/newPrivateMessage.lzx
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/dao/PrivateMessagesDaoImpl.java
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/user/PrivateMessages.java
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/UserService.java
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/settings/privatemessages/newPrivateMessage.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/settings/privatemessages/newPrivateMessage.lzx?rev=1325650&r1=1325649&r2=1325650&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/settings/privatemessages/newPrivateMessage.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/settings/privatemessages/newPrivateMessage.lzx
Fri Apr 13 08:28:06 2012
@@ -135,7 +135,7 @@
<handler name="ondata" args="value">
<![CDATA[
//The onResult-Handler will be called be the
rtmpconnection
- if ($debug) Debug.write("sendInvitationHash : ",value);
+ if ($debug) Debug.write("composeMail : ",value);
if (parent.saveRefObj != null) {
parent.saveRefObj.saveNotification(parent._bookRoom.getValue());
}
Modified:
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/dao/PrivateMessagesDaoImpl.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/dao/PrivateMessagesDaoImpl.java?rev=1325650&r1=1325649&r2=1325650&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/dao/PrivateMessagesDaoImpl.java
(original)
+++
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/dao/PrivateMessagesDaoImpl.java
Fri Apr 13 08:28:06 2012
@@ -45,7 +45,7 @@ public class PrivateMessagesDaoImpl {
public Long addPrivateMessage(String subject, String message, Long
parentMessageId,
Users from, Users to, Users owner, Boolean bookedRoom,
Rooms room,
- Boolean isContactRequest, Long userContactId) {
+ Boolean isContactRequest, Long userContactId, String
email) {
try {
PrivateMessages privateMessage = new PrivateMessages();
privateMessage.setInserted(new Date());
@@ -62,6 +62,7 @@ public class PrivateMessagesDaoImpl {
privateMessage.setIsRead(false);
privateMessage.setIsContactRequest(isContactRequest);
privateMessage.setUserContactId(userContactId);
+ privateMessage.setEmail(email);
privateMessage = em.merge(privateMessage);
Long privateMessageId =
privateMessage.getPrivateMessageFolderId();
Modified:
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/user/PrivateMessages.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/user/PrivateMessages.java?rev=1325650&r1=1325649&r2=1325650&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/user/PrivateMessages.java
(original)
+++
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/user/PrivateMessages.java
Fri Apr 13 08:28:06 2012
@@ -51,6 +51,9 @@ public class PrivateMessages implements
@Column(name="message")
private String message;
+ @Column(name="email")
+ private String email;
+
@Column(name="inserted")
private Date inserted;
@@ -192,5 +195,11 @@ public class PrivateMessages implements
public void setUserContactId(Long userContactId) {
this.userContactId = userContactId;
}
+ public String getEmail() {
+ return email;
+ }
+ public void setEmail(String email) {
+ this.email = email;
+ }
}
Modified:
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/UserService.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/UserService.java?rev=1325650&r1=1325649&r2=1325650&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/UserService.java
(original)
+++
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/UserService.java
Fri Apr 13 08:28:06 2012
@@ -662,7 +662,7 @@ public class UserService {
privateMessagesDao.addPrivateMessage(user.getFirstname() + " "
+ user.getLastname() + " " +
fValue1193.getValue(),
message, 0L, user, userToAdd,
userToAdd, false, null,
- true, userContactId);
+ true, userContactId,
userToAdd.getAdresses().getEmail());
String link = baseURL + "?cuser=" + hash;
@@ -880,7 +880,7 @@ public class UserService {
user.getFirstname() + " " + user.getLastname()
+ " " + fValue1198.getValue(), message,
0L,
userContacts.getContact(), user, user,
- false, null,
false, 0L);
+ false, null,
false, 0L, user.getAdresses().getEmail());
mailHandler.sendMail(user.getAdresses().getEmail(),
userContacts.getContact().getFirstname()
@@ -1007,59 +1007,76 @@ public class UserService {
// Map receipent = (Map)
recipients.get(iter.next());
// String email =
receipent.get("email").toString();
-
- Users to =
userManagement.getUserByEmail(email);
-
- if (to == null) {
- throw new Exception("Could not
find user " + email);
- }
-
+
Boolean invitor = false;
- if
(email.equals(from.getAdresses().getEmail())) {
- invitor = true;
+ Long language_id =
from.getLanguage_id();
+ if (language_id == null) {
+ language_id = Long.valueOf(
+
cfgManagement.getConfKey(3,
+
"default_lang_id").getConf_value())
+ .longValue();
+ }
+
+ Users to =
userManagement.getUserByEmail(email);
+
+ if (to != null) {
+
+ if
(email.equals(from.getAdresses().getEmail())) {
+ invitor = true;
+ } else {
+
+ // One message to the
Send
+
privateMessagesDao.addPrivateMessage(subject, message,
+
parentMessageId, from, to, from, bookedRoom,
+ room,
false, 0L, email);
+
+ // One message to the
Inbox
+
privateMessagesDao.addPrivateMessage(subject, message,
+
parentMessageId, from, to, to, bookedRoom,
+ room,
false, 0L, email);
+
+ // One copy of the
Inbox message to the user
+ if (to.getLanguage_id()
!= null) {
+ language_id =
to.getLanguage_id();
+ }
+ }
+
} else {
-
+
// One message to the Send
privateMessagesDao.addPrivateMessage(subject, message,
parentMessageId, from, to, from, bookedRoom,
- room, false,
0L);
-
- // One message to the Inbox
-
privateMessagesDao.addPrivateMessage(subject, message,
-
parentMessageId, from, to, to, bookedRoom,
- room, false,
0L);
-
- // One copy of the Inbox
message to the user
- Long language_id =
to.getLanguage_id();
- if (language_id == null) {
- language_id =
Long.valueOf(
-
cfgManagement.getConfKey(3,
-
"default_lang_id").getConf_value())
-
.longValue();
- }
-
- Fieldlanguagesvalues fValue1301
= fieldmanagment
-
.getFieldByIdAndLanguage(1301L, language_id);
- Fieldlanguagesvalues fValue1302
= fieldmanagment
-
.getFieldByIdAndLanguage(1302L, language_id);
-
- String aLinkHTML =
"<br/><br/><a href='" + profile_link
- + "'>" +
fValue1302.getValue() + "</a><br/>";
-
- mailHandler.sendMail(email,
fValue1301.getValue() + " "
- + subject,
message.replaceAll("\\<.*?>", "")
- + aLinkHTML);
-
+ room, false,
0L, email);
+
+ //there is no Inbox for
external users
+
+ }
+ Fieldlanguagesvalues fValue1301 =
fieldmanagment
+
.getFieldByIdAndLanguage(1301L, language_id);
+ Fieldlanguagesvalues fValue1302 =
fieldmanagment
+
.getFieldByIdAndLanguage(1302L, language_id);
+
+ String aLinkHTML = "";
+ if (to != null) {
+ aLinkHTML = "<br/><br/><a
href='" + profile_link
+ + "'>" +
fValue1302.getValue() + "</a><br/>";
}
+ mailHandler.sendMail(email,
fValue1301.getValue() + " "
+ + subject,
message.replaceAll("\\<.*?>", "")
+ + aLinkHTML);
+
if (bookedRoom) {
// But add the appointment to
everybody
-
this.addAppointmentToUser(subject, message, to,
- recipients,
room, appointmentstart,
- appointmentend,
invitor, true,
-
sendJNameTimeZone);
-
+
+ if (to != null) {
+
this.addAppointmentToUser(subject, message, to,
+
recipients, room, appointmentstart,
+
appointmentend, invitor, true,
+
sendJNameTimeZone);
+ }
+
}
}
@@ -1090,14 +1107,23 @@ public class UserService {
for (String email : recipients) {
Users meetingMember =
userManagement.getUserByEmail(email);
+
+ if (meetingMember != null) {
- String firstname = meetingMember.getFirstname();
- String lastname = meetingMember.getLastname();
-
- meetingMemberDao.addMeetingMember(firstname, lastname,
"0", "0",
- appointmentId,
meetingMember.getUser_id(), email, invitor,
- meetingMember.getOmTimeZone(),
isConnectedEvent);
-
+ String firstname = meetingMember.getFirstname();
+ String lastname = meetingMember.getLastname();
+
+ meetingMemberDao.addMeetingMember(firstname,
lastname, "0", "0",
+ appointmentId,
meetingMember.getUser_id(), email, invitor,
+ meetingMember.getOmTimeZone(),
isConnectedEvent);
+
+ } else {
+
+ meetingMemberDao.addMeetingMember("", "", "0",
"0",
+ appointmentId, null, email,
invitor,
+
omTimeZoneDaoImpl.getOmTimeZone(sendJNameTimeZone), isConnectedEvent);
+
+ }
}
}