Author: solomax
Date: Tue May 12 18:32:02 2015
New Revision: 1679028
URL: http://svn.apache.org/r1679028
Log:
[OPENMEETINGS-1206] first and last name can be specified while invitation hash
generation
Modified:
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebService.java
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
openmeetings/trunk/singlewebapp/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/RoomWebService.java
Modified:
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebService.java
URL:
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebService.java?rev=1679028&r1=1679027&r2=1679028&view=diff
==============================================================================
---
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebService.java
(original)
+++
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebService.java
Tue May 12 18:32:02 2015
@@ -1414,72 +1414,57 @@ public class RoomWebService {
Boolean isPasswordProtected, String invitationpass,
Integer valid,
String validFromDate, String validFromTime, String
validToDate,
String validToTime) throws AxisFault {
- try {
- Long users_id = sessiondataDao.checkSession(SID);
-
- if
(AuthLevelUtil.hasWebServiceLevel(userDao.getRights(users_id))) {
-
- Date dFrom = null;
- Date dTo = null;
-
- if (valid == 2) {
- Integer validFromHour = Integer.valueOf(
-
validFromTime.substring(0, 2)).intValue();
- Integer validFromMinute =
Integer.valueOf(
-
validFromTime.substring(3, 5)).intValue();
-
- Integer validToHour = Integer.valueOf(
-
validToTime.substring(0, 2)).intValue();
- Integer validToMinute = Integer.valueOf(
-
validToTime.substring(3, 5)).intValue();
-
- log.info("validFromHour: " +
validFromHour);
- log.info("validFromMinute: " +
validFromMinute);
-
- Date fromDate =
CalendarPatterns.parseDate(validFromDate); // dd.MM.yyyy
- Date toDate =
CalendarPatterns.parseDate(validToDate); // dd.MM.yyyy
-
- Calendar calFrom =
Calendar.getInstance();
- calFrom.setTime(fromDate);
- calFrom.set(calFrom.get(Calendar.YEAR),
-
calFrom.get(Calendar.MONTH),
-
calFrom.get(Calendar.DATE), validFromHour,
- validFromMinute, 0);
-
- Calendar calTo = Calendar.getInstance();
- calTo.setTime(toDate);
- calTo.set(calTo.get(Calendar.YEAR),
-
calTo.get(Calendar.MONTH),
-
calTo.get(Calendar.DATE), validToHour,
- validToMinute, 0);
-
- dFrom = calFrom.getTime();
- dTo = calTo.getTime();
-
- log.info("validFromDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dFrom));
- log.info("validToDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dTo));
- }
- User invitee = userDao.getContact(username,
username, username, users_id);
- Invitation invitation =
invitationManager.getInvitation(invitee, roomDao.get(room_id),
-
isPasswordProtected, invitationpass, Valid.fromInt(valid)
- ,
userDao.get(users_id), 1L, dFrom, dTo, null);
-
- if (invitation != null) {
- return invitation.getHash();
- } else {
- return "Sys - Error";
- }
- } else {
- return "Need Admin Privileges to perfom the
Action";
- }
- } catch (Exception err) {
- log.error("[sendInvitationHash] ", err);
- throw new AxisFault(err.getMessage());
- }
+ return getInvitationHash(SID, username, username, username,
room_id, isPasswordProtected, invitationpass, valid,
+ validFromDate, validFromTime, validToDate,
validToTime);
+ }
+ /**
+ *
+ * Create a Invitation hash and optionally send it by mail the From to
Date
+ * is as String as some SOAP libraries do not accept Date Objects in
SOAP
+ * Calls Date is parsed as dd.mm.yyyy, time as hh:mm (don't forget the
+ * leading zero's)
+ *
+ * @param SID
+ * The SID of the User. This SID must be marked as Loggedin a
+ * valid Session Token
+ * @param username
+ * the username of the User that he will get
+ * @param firstname
+ * the first name of the User that he will get
+ * @param lastname
+ * the last name of the User that he will get
+ * @param room_id
+ * the conference room id of the invitation
+ * @param isPasswordProtected
+ * if the invitation is password protected
+ * @param invitationpass
+ * the password for accessing the conference room via the
+ * invitation hash
+ * @param valid
+ * the type of validation for the hash 1: endless, 2: from-to
+ * period, 3: one-time
+ * @param validFromDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validFromTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @param validToDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validToTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @return a HASH value that can be made into a URL with
+ * http://$OPENMEETINGS_HOST
+ * :$PORT/openmeetings/?invitationHash="+invitationsHash;
+ * @throws AxisFault
+ */
+ public String getInvitationHash(String SID, String username, String
firstname, String lastname, Long room_id,
+ Boolean isPasswordProtected, String invitationpass,
Integer valid,
+ String validFromDate, String validFromTime, String
validToDate,
+ String validToTime) throws AxisFault {
+ return sendInvitationHash(SID, username, firstname, lastname,
null, null,
+ room_id, isPasswordProtected, invitationpass,
valid, validFromDate,
+ validFromTime, validToDate, validToTime, 1L,
false);
}
/**
@@ -1503,8 +1488,6 @@ public class RoomWebService {
* is true
* @param room_id
* the conference room id of the invitation
- * @param conferencedomain
- * the domain of the room (keep empty)
* @param isPasswordProtected
* if the invitation is password protected
* @param invitationpass
@@ -1534,30 +1517,31 @@ public class RoomWebService {
* :$PORT/openmeetings/?invitationHash="+invitationsHash;
* @throws AxisFault
*/
- public String sendInvitationHash(String SID, String username,
- String message, String email, String subject,
- Long room_id, String conferencedomain, Boolean
isPasswordProtected,
- String invitationpass, Integer valid, String
validFromDate,
- String validFromTime, String validToDate, String
validToTime,
- Long language_id, Boolean sendMail) throws AxisFault {
+ public String sendInvitationHash(String SID, String username, String
message, String email, String subject,
+ Long room_id, Boolean isPasswordProtected, String
invitationpass, Integer valid, String validFromDate,
+ String validFromTime, String validToDate, String
validToTime, Long language_id, Boolean sendMail) throws AxisFault {
+ return sendInvitationHash(SID, email, username, username,
message, subject,
+ room_id, isPasswordProtected, invitationpass,
valid, validFromDate,
+ validFromTime, validToDate, validToTime,
language_id, sendMail);
+ }
+
+ private String sendInvitationHash(String SID, String email, String
firstname, String lastname, String message, String subject,
+ Long room_id, Boolean isPasswordProtected, String
invitationpass, Integer valid, String validFromDate,
+ String validFromTime, String validToDate, String
validToTime, Long language_id, Boolean sendMail) throws AxisFault {
try {
Long users_id = sessiondataDao.checkSession(SID);
if
(AuthLevelUtil.hasWebServiceLevel(userDao.getRights(users_id))) {
- Date dFrom = null;
- Date dTo = null;
+ Date dFrom = new Date();
+ Date dTo = new Date();
if (valid == 2) {
- Integer validFromHour = Integer.valueOf(
-
validFromTime.substring(0, 2)).intValue();
- Integer validFromMinute =
Integer.valueOf(
-
validFromTime.substring(3, 5)).intValue();
-
- Integer validToHour = Integer.valueOf(
-
validToTime.substring(0, 2)).intValue();
- Integer validToMinute = Integer.valueOf(
-
validToTime.substring(3, 5)).intValue();
+ Integer validFromHour =
Integer.valueOf(validFromTime.substring(0, 2));
+ Integer validFromMinute =
Integer.valueOf(validFromTime.substring(3, 5));
+
+ Integer validToHour =
Integer.valueOf(validToTime.substring(0, 2));
+ Integer validToMinute =
Integer.valueOf(validToTime.substring(3, 5));
log.info("validFromHour: " +
validFromHour);
log.info("validFromMinute: " +
validFromMinute);
@@ -1582,15 +1566,11 @@ public class RoomWebService {
dFrom = calFrom.getTime();
dTo = calTo.getTime();
- log.info("validFromDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dFrom));
- log.info("validToDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dTo));
+ log.info("validFromDate: " +
CalendarPatterns.getDateWithTimeByMiliSeconds(dFrom));
+ log.info("validToDate: " +
CalendarPatterns.getDateWithTimeByMiliSeconds(dTo));
}
- User invitee = userDao.getContact(email,
users_id);
+ User invitee = userDao.getContact(email,
firstname, lastname, users_id);
Invitation invitation =
invitationManager.getInvitation(invitee, roomDao.get(room_id),
isPasswordProtected, invitationpass, Valid.fromInt(valid)
,
userDao.get(users_id), language_id,
Modified:
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
URL:
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java?rev=1679028&r1=1679027&r2=1679028&view=diff
==============================================================================
---
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
(original)
+++
openmeetings/branches/3.0.x/src/axis/java/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
Tue May 12 18:32:02 2015
@@ -342,6 +342,55 @@ public class RoomWebServiceFacade extend
}
/**
+ *
+ * Create a Invitation hash and optionally send it by mail the From to
Date
+ * is as String as some SOAP libraries do not accept Date Objects in
SOAP
+ * Calls Date is parsed as dd.mm.yyyy, time as hh:mm (don't forget the
+ * leading zero's)
+ *
+ * @param SID
+ * a valid Session Token
+ * @param username
+ * the username of the User that he will get
+ * @param firstname
+ * the first name of the User that he will get
+ * @param lastname
+ * the last name of the User that he will get
+ * @param room_id
+ * the conference room id of the invitation
+ * @param isPasswordProtected
+ * if the invitation is password protected
+ * @param invitationpass
+ * the password for accessing the conference room via the
+ * invitation hash
+ * @param valid
+ * the type of validation for the hash 1: endless, 2: from-to
+ * period, 3: one-time
+ * @param validFromDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validFromTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @param validToDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validToTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @return a HASH value that can be made into a URL with
+ * http://$OPENMEETINGS_HOST
+ * :$PORT/openmeetings/?invitationHash="+invitationsHash;
+ * @throws AxisFault
+ */
+ public String getInvitationHash(String SID, String username, String
firstname, String lastname, Long room_id,
+ Boolean isPasswordProtected, String invitationpass,
Integer valid,
+ String validFromDate, String validFromTime, String
validToDate,
+ String validToTime) throws AxisFault {
+ return getBean(RoomWebService.class).getInvitationHash(SID,
username, firstname, lastname,
+ room_id, isPasswordProtected, invitationpass,
valid, validFromDate, validFromTime, validToDate, validToTime);
+
+ }
+
+ /**
* Create a Invitation hash and optionally send it by mail the From to
Date
* is as String as some SOAP libraries do not accept Date Objects in
SOAP
* Calls Date is parsed as dd.mm.yyyy, time as hh:mm (don't forget the
@@ -361,8 +410,6 @@ public class RoomWebServiceFacade extend
* is true
* @param room_id
* the conference room id of the invitation
- * @param conferencedomain
- * the domain of the room (keep empty)
* @param isPasswordProtected
* if the invitation is password protected
* @param invitationpass
@@ -394,14 +441,12 @@ public class RoomWebServiceFacade extend
*/
public String sendInvitationHash(String SID, String username,
String message, String email, String subject,
- Long room_id, String conferencedomain, Boolean
isPasswordProtected,
+ Long room_id, Boolean isPasswordProtected,
String invitationpass, Integer valid, String
validFromDate,
String validFromTime, String validToDate, String
validToTime,
Long language_id, Boolean sendMail) throws AxisFault {
- return getBean(RoomWebService.class).sendInvitationHash(SID,
username,
- message, email, subject, room_id,
conferencedomain,
- isPasswordProtected, invitationpass, valid,
validFromDate,
- validFromTime, validToDate, validToTime,
language_id, sendMail);
+ return getBean(RoomWebService.class).sendInvitationHash(SID,
username, message, email, subject, room_id,
+ isPasswordProtected, invitationpass, valid,
validFromDate, validFromTime, validToDate, validToTime, language_id, sendMail);
}
/**
@@ -454,24 +499,19 @@ public class RoomWebServiceFacade extend
Long room_id, String conferencedomain, Boolean
isPasswordProtected,
String invitationpass, Integer valid, Date fromDate,
Date toDate,
Long language_id, Boolean sendMail) throws AxisFault {
- return
getBean(RoomWebService.class).sendInvitationHashWithDateObject(SID,
- username, message, email, subject, room_id,
- conferencedomain, isPasswordProtected,
invitationpass, valid,
- fromDate, toDate, language_id, sendMail);
+ return
getBean(RoomWebService.class).sendInvitationHashWithDateObject(SID, username,
message, email, subject, room_id,
+ conferencedomain, isPasswordProtected,
invitationpass, valid, fromDate, toDate, language_id, sendMail);
}
public List<RoomReturn> getRoomsWithCurrentUsersByList(String SID,
int start, int max, String orderby, boolean asc) throws
AxisFault {
- return
getBean(RoomWebService.class).getRoomsWithCurrentUsersByList(SID,
- start, max, orderby, asc);
+ return
getBean(RoomWebService.class).getRoomsWithCurrentUsersByList(SID, start, max,
orderby, asc);
}
public List<RoomReturn> getRoomsWithCurrentUsersByListAndType(String
SID,
int start, int max, String orderby, boolean asc,
String externalRoomType) throws AxisFault {
- return getBean(RoomWebService.class)
- .getRoomsWithCurrentUsersByListAndType(SID,
start, max,
- orderby, asc, externalRoomType);
+ return
getBean(RoomWebService.class).getRoomsWithCurrentUsersByListAndType(SID, start,
max, orderby, asc, externalRoomType);
}
public Long addRoomWithModerationAndExternalTypeAndStartEnd(String SID,
Modified:
openmeetings/trunk/singlewebapp/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/RoomWebService.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/RoomWebService.java?rev=1679028&r1=1679027&r2=1679028&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/RoomWebService.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/RoomWebService.java
Tue May 12 18:32:02 2015
@@ -1438,68 +1438,57 @@ public class RoomWebService {
Boolean isPasswordProtected, String invitationpass,
Integer valid,
String validFromDate, String validFromTime, String
validToDate,
String validToTime) throws ServiceException {
- try {
- Long users_id = sessiondataDao.checkSession(SID);
-
- if
(AuthLevelUtil.hasWebServiceLevel(userDao.getRights(users_id))) {
-
- Date dFrom = new Date();
- Date dTo = new Date();
-
- if (valid == 2) {
- Integer validFromHour =
Integer.valueOf(validFromTime.substring(0, 2));
- Integer validFromMinute =
Integer.valueOf(validFromTime.substring(3, 5));
-
- Integer validToHour =
Integer.valueOf(validToTime.substring(0, 2));
- Integer validToMinute =
Integer.valueOf(validToTime.substring(3, 5));
-
- log.info("validFromHour: " +
validFromHour);
- log.info("validFromMinute: " +
validFromMinute);
-
- Date fromDate =
CalendarPatterns.parseDate(validFromDate); // dd.MM.yyyy
- Date toDate =
CalendarPatterns.parseDate(validToDate); // dd.MM.yyyy
-
- Calendar calFrom =
Calendar.getInstance();
- calFrom.setTime(fromDate);
- calFrom.set(calFrom.get(Calendar.YEAR),
-
calFrom.get(Calendar.MONTH),
-
calFrom.get(Calendar.DATE), validFromHour,
- validFromMinute, 0);
-
- Calendar calTo = Calendar.getInstance();
- calTo.setTime(toDate);
- calTo.set(calTo.get(Calendar.YEAR),
-
calTo.get(Calendar.MONTH),
-
calTo.get(Calendar.DATE), validToHour,
- validToMinute, 0);
-
- dFrom = calFrom.getTime();
- dTo = calTo.getTime();
-
- log.info("validFromDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dFrom));
- log.info("validToDate: "
- + CalendarPatterns
-
.getDateWithTimeByMiliSeconds(dTo));
- }
- User invitee = userDao.getContact(username,
username, username, users_id);
- Invitation invitation =
invitationManager.getInvitation(invitee, roomDao.get(room_id),
-
isPasswordProtected, invitationpass, Valid.fromInt(valid)
- ,
userDao.get(users_id), 1L, dFrom, dTo, null);
-
- if (invitation != null) {
- return invitation.getHash();
- } else {
- return "Sys - Error";
- }
- } else {
- return "Need Admin Privileges to perfom the
Action";
- }
- } catch (Exception err) {
- log.error("[sendInvitationHash] ", err);
- throw new ServiceException(err.getMessage());
- }
+ return getInvitationHash(SID, username, username, username,
room_id, isPasswordProtected, invitationpass, valid,
+ validFromDate, validFromTime, validToDate,
validToTime);
+ }
+ /**
+ *
+ * Create a Invitation hash and optionally send it by mail the From to
Date
+ * is as String as some SOAP libraries do not accept Date Objects in
SOAP
+ * Calls Date is parsed as dd.mm.yyyy, time as hh:mm (don't forget the
+ * leading zero's)
+ *
+ * @param SID
+ * The SID of the User. This SID must be marked as Loggedin a
+ * valid Session Token
+ * @param username
+ * the username of the User that he will get
+ * @param firstname
+ * the first name of the User that he will get
+ * @param lastname
+ * the last name of the User that he will get
+ * @param room_id
+ * the conference room id of the invitation
+ * @param isPasswordProtected
+ * if the invitation is password protected
+ * @param invitationpass
+ * the password for accessing the conference room via the
+ * invitation hash
+ * @param valid
+ * the type of validation for the hash 1: endless, 2: from-to
+ * period, 3: one-time
+ * @param validFromDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validFromTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @param validToDate
+ * Date in Format of dd.mm.yyyy only of interest if valid is
type
+ * 2
+ * @param validToTime
+ * time in Format of hh:mm only of interest if valid is type
2
+ * @return a HASH value that can be made into a URL with
+ * http://$OPENMEETINGS_HOST
+ * :$PORT/openmeetings/?invitationHash="+invitationsHash;
+ * @throws ServiceException
+ */
+ public String getInvitationHash(String SID, String username, String
firstname, String lastname, Long room_id,
+ Boolean isPasswordProtected, String invitationpass,
Integer valid,
+ String validFromDate, String validFromTime, String
validToDate,
+ String validToTime) throws ServiceException {
+ return sendInvitationHash(SID, username, firstname, lastname,
null, null,
+ room_id, isPasswordProtected, invitationpass,
valid, validFromDate,
+ validFromTime, validToDate, validToTime, 1L,
false);
}
/**
@@ -1523,8 +1512,6 @@ public class RoomWebService {
* is true
* @param room_id
* the conference room id of the invitation
- * @param conferencedomain
- * the domain of the room (keep empty)
* @param isPasswordProtected
* if the invitation is password protected
* @param invitationpass
@@ -1554,12 +1541,17 @@ public class RoomWebService {
* :$PORT/openmeetings/?invitationHash="+invitationsHash;
* @throws ServiceException
*/
- public String sendInvitationHash(String SID, String username,
- String message, String email, String subject,
- Long room_id, String conferencedomain, Boolean
isPasswordProtected,
- String invitationpass, Integer valid, String
validFromDate,
- String validFromTime, String validToDate, String
validToTime,
- Long language_id, Boolean sendMail) throws
ServiceException {
+ public String sendInvitationHash(String SID, String username, String
message, String email, String subject,
+ Long room_id, Boolean isPasswordProtected, String
invitationpass, Integer valid, String validFromDate,
+ String validFromTime, String validToDate, String
validToTime, Long language_id, Boolean sendMail) throws ServiceException {
+ return sendInvitationHash(SID, email, username, username,
message, subject,
+ room_id, isPasswordProtected, invitationpass,
valid, validFromDate,
+ validFromTime, validToDate, validToTime,
language_id, sendMail);
+ }
+
+ private String sendInvitationHash(String SID, String email, String
firstname, String lastname, String message, String subject,
+ Long room_id, Boolean isPasswordProtected, String
invitationpass, Integer valid, String validFromDate,
+ String validFromTime, String validToDate, String
validToTime, Long language_id, Boolean sendMail) throws ServiceException {
try {
Long users_id = sessiondataDao.checkSession(SID);
@@ -1602,7 +1594,7 @@ public class RoomWebService {
log.info("validToDate: " +
CalendarPatterns.getDateWithTimeByMiliSeconds(dTo));
}
- User invitee = userDao.getContact(email,
users_id);
+ User invitee = userDao.getContact(email,
firstname, lastname, users_id);
Invitation invitation =
invitationManager.getInvitation(invitee, roomDao.get(room_id),
isPasswordProtected, invitationpass, Valid.fromInt(valid)
,
userDao.get(users_id), language_id,