Author: solomax
Date: Thu Nov 15 07:19:52 2012
New Revision: 1409670

URL: http://svn.apache.org/viewvc?rev=1409670&view=rev
Log:
Method to modify room parameters via RESTful call is added

Modified:
    incubator/openmeetings/trunk/singlewebapp/docs/RoomService.html
    
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebService.java
    
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java

Modified: incubator/openmeetings/trunk/singlewebapp/docs/RoomService.html
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/docs/RoomService.html?rev=1409670&r1=1409669&r2=1409670&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/docs/RoomService.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/docs/RoomService.html Thu Nov 15 
07:19:52 2012
@@ -235,6 +235,10 @@ limitations under the License.
  
  Returns positive value if authentication was successful.</i></div>
                 </div>
+                                               <div>
+                <a 
href="#modifyRoomParameter"><b>modifyRoomParameter</b></a><br/>
+                <div class="navigation_comment"><i >Method to update arbitrary 
room parameter.</i></div>
+                </div>
                            </div>
           
            <h3>Methods Details in RoomService</h3>
@@ -5068,6 +5072,78 @@ limitations under the License.
                        REST Sample Call/URL:<br/>
                                                                                
                                                                                
                                                                                
                                                                                
                                                <a 
href="http://localhost:5080/openmeetings/services/RoomService/closeRoom?SID=VALUE&room_id=VALUE&status=VALUE";>http://localhost:5080/openmeetings/services/RoomService/closeRoom?&amp;&amp;</a>
                  </div>
+                                                             <div 
class="method">
+                       <div class="method_header">
+                       <div style="margin-left:10px">
+                       <a name="modifyRoomParameter" 
><b>modifyRoomParameter</b></a>
+                       </div>
+                       </div>
+                       
+                       Method: <i>modifyRoomParameter (
+                                                                               
                   String SID
+                                                                               
                     , 
+                                                  Long room_id
+                                                                               
                     , 
+                                                  String paramName
+                                                                               
                     , 
+                                                  String paramValue
+                                                                       )
+                       </i><br/>
+                       <p>
+                         Method to update arbitrary room parameter.
+                       </p>
+                       <p>
+                  Return Type: int
+                </p>
+                       <p>Params:</p>
+                                               
+                                                       <table rules="all" 
border="1">
+                                  <thead>
+                                  <tr>
+                                    <th width="200" align="left">Type</th>
+                                    <th width="200" align="left">Fieldname</th>
+                                    <th width="400" 
align="left">Description</th>
+                                  </tr>
+                                  </thead>
+                                  <tbody>
+                                                                               
                   <tr>
+                            <td valign="top">
+                                                                       String
+                                                            </td>
+                            <td valign="top">SID</td>
+                            <td valign="top">The SID of the User. This SID 
must be marked as Loggedin</td>
+                          </tr>
+                          
+                                                                               
   <tr>
+                            <td valign="top">
+                                                                       Long
+                                                            </td>
+                            <td valign="top">room_id</td>
+                            <td valign="top">the room id</td>
+                          </tr>
+                          
+                                                                               
   <tr>
+                            <td valign="top">
+                                                                       String
+                                                            </td>
+                            <td valign="top">paramName</td>
+                            <td valign="top"></td>
+                          </tr>
+                          
+                                                                               
   <tr>
+                            <td valign="top">
+                                                                       String
+                                                            </td>
+                            <td valign="top">paramValue</td>
+                            <td valign="top"></td>
+                          </tr>
+                          
+                                                                          
</tbody>
+                               </table>
+                                               <br/>
+                       REST Sample Call/URL:<br/>
+                                                                               
                                                                                
                                                                                
                                                                                
                                                                                
                                                                <a 
href="http://localhost:5080/openmeetings/services/RoomService/modifyRoomParameter?SID=VALUE&room_id=VALUE&paramName=VALUE&paramValue=VALUE";>http://localhost:5080/openmeetings/services/RoomService/modifyRoomParameter?&amp;&amp;&amp;</a>
+                 </div>
                                
        
        </body>

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebService.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebService.java?rev=1409670&r1=1409669&r2=1409670&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebService.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebService.java
 Thu Nov 15 07:19:52 2012
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.axis2.AxisFault;
+import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.conference.room.IClientList;
 import org.apache.openmeetings.conference.room.RoomClient;
@@ -2444,4 +2445,36 @@ public class RoomWebService {
 
        }
 
+       /**
+        * Method to update arbitrary room parameter.
+        * 
+        * @param SID The SID of the User. This SID must be marked as Loggedin
+        * @param room_id the room id
+        * @param paramName
+        * @param paramValue
+        * @return 1 in case of success, -2 if permissions are insufficient
+        * @throws AxisFault if any error ocurred
+        */
+       public int modifyRoomParameter(String SID, Long room_id, String 
paramName, String paramValue)
+                       throws AxisFault {
+               try {
+                       Long users_id = sessionManagement.checkSession(SID);
+                       Long user_level = 
userManagement.getUserLevelByID(users_id);
+       
+                       log.debug("closeRoom 1 " + room_id);
+       
+                       if 
(authLevelManagement.checkWebServiceLevel(user_level)) {
+                               Rooms r = roomDao.get(room_id);
+                               PropertyUtils.setSimpleProperty(r, paramName, 
paramValue);
+                               roomDao.update(r, users_id);
+                       } else {
+                               return -2;
+                       }
+                       return 1;
+               } catch (Exception err) {
+                       log.error("[modifyRoomParameter] ", err);
+
+                       throw new AxisFault(err.getMessage());
+               }
+       }
 }

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java?rev=1409670&r1=1409669&r2=1409670&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/RoomWebServiceFacade.java
 Thu Nov 15 07:19:52 2012
@@ -665,4 +665,8 @@ public class RoomWebServiceFacade {
                return this.getRoomServiceProxy().closeRoom(SID, room_id, 
status);
        }
 
+       public int modifyRoomParameter(String SID, Long room_id, String 
paramName, String paramValue)
+                       throws AxisFault {
+               return getRoomServiceProxy().modifyRoomParameter(SID, room_id, 
paramName, paramValue);
+       }
 }


Reply via email to