Revision: 3833
Author: seba.wagner
Date: Sun Jun 19 02:27:59 2011
Log: Fix RoomService to check only for Web-Service Level
http://code.google.com/p/openmeetings/source/detail?r=3833
Modified:
/trunk/singlewebapp/src/app/org/openmeetings/app/data/conference/Roommanagement.java
/trunk/singlewebapp/src/roomservice/org/openmeetings/axis/services/RoomService.java
=======================================
---
/trunk/singlewebapp/src/app/org/openmeetings/app/data/conference/Roommanagement.java
Sun Jun 19 01:09:07 2011
+++
/trunk/singlewebapp/src/app/org/openmeetings/app/data/conference/Roommanagement.java
Sun Jun 19 02:27:59 2011
@@ -957,7 +957,7 @@
* @param ispublic
* @return id of (the newly created) room or NULL
*/
- public Long addExternalRoom(long user_level,String name, long
roomtypes_id, String comment, Long numberOfPartizipants,
+ public Long addExternalRoom(String name, long roomtypes_id, String
comment, Long numberOfPartizipants,
boolean ispublic, List organisations,
Boolean appointment,
Boolean isDemoRoom,
@@ -977,56 +977,54 @@
log.debug("addExternalRoom");
try {
- if
(AuthLevelmanagement.getInstance().checkAdminLevel(user_level)){
- Rooms r = new Rooms();
- r.setName(name);
- r.setComment(comment);
- r.setStarttime(new Date());
-
r.setNumberOfPartizipants(numberOfPartizipants);
-
r.setRoomtype(this.getRoomTypesById(roomtypes_id));
- r.setIspublic(ispublic);
-
-
r.setAllowUserQuestions(allowUserQuestions);
- r.setIsAudioOnly(isAudioOnly);
-
- r.setAppointment(appointment);
-
- r.setIsDemoRoom(isDemoRoom);
- r.setDemoTime(demoTime);
-
- r.setIsModeratedRoom(isModeratedRoom);
-
- r.setDeleted("false");
-
-
r.setExternalRoomId(externalRoomId);
-
r.setExternalRoomType(externalRoomType);
-
-
r.setIsClosed(isClosed);
-
r.setRedirectURL(redirectURL);
-
-
r.setWaitForRecording(waitForRecording);
-
r.setAllowRecording(allowRecording);
-
- Object idf = HibernateUtil.createSession();
- Session session =
HibernateUtil.getSession();
- Transaction tx =
session.beginTransaction();
- long returnId = (Long) session.save(r);
-
- session.flush();
- tx.commit();
- HibernateUtil.closeSession(idf);
-
- if (organisations!=null){
- Long t =
this.updateRoomOrganisations(organisations, r);
- if (t==null) return null;
- }
-
- if (roomModerators!=null) {
-
RoomModeratorsDaoImpl.getInstance().addRoomModeratorByUserList(roomModerators,
r.getRooms_id());
- }
-
- return returnId;
- }
+ Rooms r = new Rooms();
+ r.setName(name);
+ r.setComment(comment);
+ r.setStarttime(new Date());
+ r.setNumberOfPartizipants(numberOfPartizipants);
+ r.setRoomtype(this.getRoomTypesById(roomtypes_id));
+ r.setIspublic(ispublic);
+
+ r.setAllowUserQuestions(allowUserQuestions);
+ r.setIsAudioOnly(isAudioOnly);
+
+ r.setAppointment(appointment);
+
+ r.setIsDemoRoom(isDemoRoom);
+ r.setDemoTime(demoTime);
+
+ r.setIsModeratedRoom(isModeratedRoom);
+
+ r.setDeleted("false");
+
+ r.setExternalRoomId(externalRoomId);
+ r.setExternalRoomType(externalRoomType);
+
+ r.setIsClosed(isClosed);
+ r.setRedirectURL(redirectURL);
+
+ r.setWaitForRecording(waitForRecording);
+ r.setAllowRecording(allowRecording);
+
+ Object idf = HibernateUtil.createSession();
+ Session session = HibernateUtil.getSession();
+ Transaction tx = session.beginTransaction();
+ long returnId = (Long) session.save(r);
+
+ session.flush();
+ tx.commit();
+ HibernateUtil.closeSession(idf);
+
+ if (organisations!=null){
+ Long t =
this.updateRoomOrganisations(organisations, r);
+ if (t==null) return null;
+ }
+
+ if (roomModerators!=null) {
+
RoomModeratorsDaoImpl.getInstance().addRoomModeratorByUserList(roomModerators,
r.getRooms_id());
+ }
+
+ return returnId;
} catch (HibernateException ex) {
log.error("[addExternalRoom] ", ex);
} catch (Exception ex2) {
@@ -1454,60 +1452,97 @@
Boolean allowRecording,
Boolean hideTopBar){
try {
+
log.debug("*** updateRoom numberOfPartizipants:
"+numberOfPartizipants);
if
(AuthLevelmanagement.getInstance().checkAdminLevel(user_level)){
- Rooms r = this.getRoomById(rooms_id);
- r.setComment(comment);
-
- r.setIspublic(ispublic);
- r.setNumberOfPartizipants(numberOfPartizipants);
- r.setName(name);
-
r.setRoomtype(this.getRoomTypesById(roomtypes_id));
- r.setUpdatetime(new Date());
- r.setAllowUserQuestions(allowUserQuestions);
- r.setIsAudioOnly(isAudioOnly);
-
- r.setIsDemoRoom(isDemoRoom);
- r.setDemoTime(demoTime);
-
- r.setAppointment(appointment);
-
- r.setIsModeratedRoom(isModeratedRoom);
- r.setHideTopBar(hideTopBar);
-
- r.setIsClosed(isClosed);
- r.setRedirectURL(redirectURL);
-
- r.setSipNumber(sipNumber);
- r.setConferencePin(conferencePin);
- r.setOwnerId(ownerId);
-
- r.setWaitForRecording(waitForRecording);
- r.setAllowRecording(allowRecording);
-
- Object idf = HibernateUtil.createSession();
- Session session = HibernateUtil.getSession();
- Transaction tx = session.beginTransaction();
- session.update(r);
-
- session.flush();
- session.clear();
-
- session.refresh(r);
-
- tx.commit();
- HibernateUtil.closeSession(idf);
-
- if (organisations!=null){
- Long t =
this.updateRoomOrganisations(organisations, r);
- if (t==null) return null;
- }
- if (roomModerators!=null) {
-
RoomModeratorsDaoImpl.getInstance().updateRoomModeratorByUserList(roomModerators,r.getRooms_id());
- }
-
- return r.getRooms_id();
- }
+
+ return this.updateRoomInternal(rooms_id,
roomtypes_id, name, ispublic,
+ comment, numberOfPartizipants,
organisations, appointment,
+ isDemoRoom, demoTime,
isModeratedRoom, roomModerators,
+ allowUserQuestions,
isAudioOnly, isClosed, redirectURL,
+ sipNumber, conferencePin,
ownerId, waitForRecording,
+ allowRecording, hideTopBar);
+
+ }
+
+ } catch (HibernateException ex) {
+ log.error("[updateRoom] ", ex);
+ } catch (Exception ex2) {
+ log.error("[updateRoom] ", ex2);
+ }
+ return null;
+ }
+
+ public Long updateRoomInternal(long rooms_id, long roomtypes_id, String
name,
+ boolean ispublic, String comment, Long numberOfPartizipants, List
organisations,
+ Boolean appointment,
+ Boolean isDemoRoom,
+ Integer demoTime,
+ Boolean isModeratedRoom,
+ List roomModerators,
+ Boolean allowUserQuestions,
+ Boolean isAudioOnly,
+ Boolean isClosed,
+ String redirectURL,
+ String sipNumber,
+ String conferencePin,
+ Long ownerId,
+ Boolean waitForRecording,
+ Boolean allowRecording,
+ Boolean hideTopBar){
+ try {
+ log.debug("*** updateRoom numberOfPartizipants:
"+numberOfPartizipants);
+ Rooms r = this.getRoomById(rooms_id);
+ r.setComment(comment);
+
+ r.setIspublic(ispublic);
+ r.setNumberOfPartizipants(numberOfPartizipants);
+ r.setName(name);
+ r.setRoomtype(this.getRoomTypesById(roomtypes_id));
+ r.setUpdatetime(new Date());
+ r.setAllowUserQuestions(allowUserQuestions);
+ r.setIsAudioOnly(isAudioOnly);
+
+ r.setIsDemoRoom(isDemoRoom);
+ r.setDemoTime(demoTime);
+
+ r.setAppointment(appointment);
+
+ r.setIsModeratedRoom(isModeratedRoom);
+ r.setHideTopBar(hideTopBar);
+
+ r.setIsClosed(isClosed);
+ r.setRedirectURL(redirectURL);
+
+ r.setSipNumber(sipNumber);
+ r.setConferencePin(conferencePin);
+ r.setOwnerId(ownerId);
+
+ r.setWaitForRecording(waitForRecording);
+ r.setAllowRecording(allowRecording);
+
+ Object idf = HibernateUtil.createSession();
+ Session session = HibernateUtil.getSession();
+ Transaction tx = session.beginTransaction();
+ session.update(r);
+
+ session.flush();
+ session.clear();
+
+ session.refresh(r);
+
+ tx.commit();
+ HibernateUtil.closeSession(idf);
+
+ if (organisations!=null){
+ Long t =
this.updateRoomOrganisations(organisations, r);
+ if (t==null) return null;
+ }
+ if (roomModerators!=null) {
+
RoomModeratorsDaoImpl.getInstance().updateRoomModeratorByUserList(roomModerators,r.getRooms_id());
+ }
+
+ return r.getRooms_id();
} catch (HibernateException ex) {
log.error("[updateRoom] ", ex);
} catch (Exception ex2) {
=======================================
---
/trunk/singlewebapp/src/roomservice/org/openmeetings/axis/services/RoomService.java
Sun Jun 19 01:09:07 2011
+++
/trunk/singlewebapp/src/roomservice/org/openmeetings/axis/services/RoomService.java
Sun Jun 19 02:27:59 2011
@@ -624,20 +624,24 @@
Long externalRoomId,
String externalRoomType )
throws AxisFault {
try {
- Rooms room = ConferenceService.getInstance().getRoomByExternalId(SID,
externalRoomId, externalRoomType, roomtypes_id);
- Long roomId = null;
- if (room == null) {
- Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
- Long user_level =
Usermanagement.getInstance().getUserLevelByID(users_id);
- roomId =
Roommanagement.getInstance().addExternalRoom(user_level, name,
roomtypes_id, comment,
-
numberOfPartizipants, ispublic, null,
- appointment,
isDemoRoom, demoTime, isModeratedRoom, null,
- externalRoomId,
externalRoomType, true, false, false, "",
- false, true,
false);
- } else {
- roomId = room.getRooms_id();
- }
- return roomId;
+ Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
+ Long user_level =
Usermanagement.getInstance().getUserLevelByID(users_id);
+ if
(AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)) {
+ Rooms room = ConferenceService.getInstance().getRoomByExternalId(SID,
externalRoomId, externalRoomType, roomtypes_id);
+ Long roomId = null;
+ if (room == null) {
+ roomId =
Roommanagement.getInstance().addExternalRoom(name, roomtypes_id, comment,
+ numberOfPartizipants,
ispublic, null,
+ appointment,
isDemoRoom, demoTime, isModeratedRoom, null,
+ externalRoomId,
externalRoomType, true, false, false, "",
+ false, true, false);
+ } else {
+ roomId = room.getRooms_id();
+ }
+ return roomId;
+ }
+
+ return -26L;
} catch (Exception err) {
log.error("[addRoomWithModeration] ",err);
throw new AxisFault(err.getMessage());
@@ -696,9 +700,11 @@
try {
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(users_id);
- return Roommanagement.getInstance().updateRoom(user_level, rooms_id,
roomtypes_id, name, ispublic,
- comment, numberOfPartizipants, null,
appointment, false, null, false,
- null,true,false, false, "", "", "",
null, null, null, false);
+ if
(AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)) {
+ return Roommanagement.getInstance().updateRoomInternal(rooms_id,
roomtypes_id, name, ispublic,
+ comment, numberOfPartizipants,
null, appointment, false, null, false,
+ null,true,false, false, "", "",
"", null, null, null, false);
+ }
} catch (Exception err) {
log.error("[addRoom] ",err);
}
@@ -718,10 +724,12 @@
try {
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(users_id);
- return Roommanagement.getInstance().updateRoom(user_level, room_id,
roomtypes_id,
- name, ispublic, comment,
numberOfPartizipants, null,
- appointment, isDemoRoom, demoTime,
isModeratedRoom,null,true,false,
- false, "", "", "", null, null, null,
false);
+ if
(AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)) {
+ return Roommanagement.getInstance().updateRoomInternal(room_id,
roomtypes_id,
+ name, ispublic, comment,
numberOfPartizipants, null,
+ appointment, isDemoRoom,
demoTime, isModeratedRoom,null,true,false,
+ false, "", "", "", null, null,
null, false);
+ }
} catch (Exception err) {
log.error("[updateRoomWithModeration] ",err);
}
@@ -742,10 +750,12 @@
try {
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(users_id);
- return Roommanagement.getInstance().updateRoom(user_level, room_id,
roomtypes_id,
- name, ispublic, comment,
numberOfPartizipants, null,
- appointment, isDemoRoom, demoTime,
isModeratedRoom,
- null,allowUserQuestions,false, false, "", "", "", null, null, null,
false);
+ if
(AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)) {
+ return Roommanagement.getInstance().updateRoomInternal(room_id,
roomtypes_id,
+ name, ispublic, comment,
numberOfPartizipants, null,
+ appointment, isDemoRoom,
demoTime, isModeratedRoom,
+ null,allowUserQuestions,false, false, "", "", "", null, null, null,
false);
+ }
} catch (Exception err) {
log.error("[updateRoomWithModerationAndQuestions]
",err);
}
@@ -782,11 +792,13 @@
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(
users_id);
- return
Roommanagement.getInstance().addExternalRoom(user_level, name,
- roomtypes_id, comment,
numberOfPartizipants, ispublic,
- null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
- null, null, externalRoomType, true, false, false,
"",
- false, true, false);
+ if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level))
{
+ return
Roommanagement.getInstance().addExternalRoom(name,
+ roomtypes_id, comment,
numberOfPartizipants, ispublic,
+ null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
+ null, null, externalRoomType, true,
false, false, "",
+ false, true, false);
+ }
} catch (Exception err) {
log.error("[addRoomWithModeration] ", err);
}
@@ -802,11 +814,13 @@
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(
users_id);
- return
Roommanagement.getInstance().addExternalRoom(user_level, name,
- roomtypes_id, comment,
numberOfPartizipants, ispublic,
- null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
- null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
- false, true, false);
+ if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level))
{
+ return
Roommanagement.getInstance().addExternalRoom(name,
+ roomtypes_id, comment,
numberOfPartizipants, ispublic,
+ null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
+ null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
+ false, true, false);
+ }
} catch (Exception err) {
log.error("[addRoomWithModeration] ", err);
}
@@ -823,11 +837,15 @@
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(
users_id);
- return
Roommanagement.getInstance().addExternalRoom(user_level, name,
- roomtypes_id, comment,
numberOfPartizipants, ispublic,
- null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
- null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
- waitForRecording, allowRecording,
false);
+ if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level))
{
+ return
Roommanagement.getInstance().addExternalRoom(name,
+ roomtypes_id, comment,
numberOfPartizipants, ispublic,
+ null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
+ null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
+ waitForRecording,
allowRecording, false);
+ } else {
+ return -26L;
+ }
} catch (Exception err) {
log.error("[addRoomWithModeration] ", err);
}
@@ -845,11 +863,13 @@
Long users_id =
Sessionmanagement.getInstance().checkSession(SID);
Long user_level =
Usermanagement.getInstance().getUserLevelByID(
users_id);
- return
Roommanagement.getInstance().addExternalRoom(user_level, name,
- roomtypes_id, comment,
numberOfPartizipants, ispublic,
- null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
- null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
- waitForRecording, allowRecording,
hideTopBar);
+ if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level))
{
+ return
Roommanagement.getInstance().addExternalRoom(name,
+ roomtypes_id, comment,
numberOfPartizipants, ispublic,
+ null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
+ null, null, externalRoomType, allowUserQuestions, isAudioOnly,
false, "",
+ waitForRecording,
allowRecording, hideTopBar);
+ }
} catch (Exception err) {
log.error("[addRoomWithModeration] ", err);
}
@@ -1283,7 +1303,7 @@
log.info("validFromDate: "+CalendarPatterns.getDateWithTimeByMiliSeconds(dFrom));
log.info("validToDate: "+CalendarPatterns.getDateWithTimeByMiliSeconds(dTo));
- Long rooms_id =
Roommanagement.getInstance().addExternalRoom(user_level, name,
+ Long rooms_id =
Roommanagement.getInstance().addExternalRoom(name,
roomtypes_id, comment,
numberOfPartizipants, ispublic,
null, appointment, isDemoRoom,
demoTime, isModeratedRoom,
null, null, externalRoomType,
--
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en.