You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2012/07/03 12:57:42 UTC

svn commit: r1356670 [2/2] - in /incubator/openmeetings/trunk/singlewebapp: WebContent/languages/ WebContent/src/base/hibernate/ WebContent/src/modules/chat/ WebContent/src/modules/conference/flexibleConferenceRoom/ WebContent/src/modules/conference/fl...

Added: incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/tabcontent/chat/privateChatTabBottom.lzx
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/tabcontent/chat/privateChatTabBottom.lzx?rev=1356670&view=auto
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/tabcontent/chat/privateChatTabBottom.lzx (added)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/tabcontent/chat/privateChatTabBottom.lzx Tue Jul  3 10:57:35 2012
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<library>
+	<!-- FIXME need to be generalized -->
+	<!--- View of the buttom area of chat. It contains buttons of message,emoticons,clear. -->
+	<class name="privateChatTabBottom" extends="view">
+
+		<view x="0" y="0" height="20" width="${ parent.width }" name="message"
+			bgcolor="$once{ canvas.getThemeColor('basebgcolorizer') }">
+			<method name="getText">
+				return this._ctext.getText();
+			</method>
+			<method name="setText" args="txt">
+				this._ctext.setAttribute('text',txt);
+			</method>
+			<customInputtext name="_ctext" width="${ parent.width-2 }"
+				height="$once{ parent.height-2 }" x="1" y="1" bgcolor="white">
+				<!-- RTL should be fixed separately -->
+				<handler name="onkeyup" args="key">
+	            <![CDATA[
+	            	/* RTL should be fixed separately
+	                if ($debug) Debug.write("onkeyup");
+	                
+	                var reverse = canvas.reverseAll(parent.getText());
+	                if ($debug) Debug.write("reverse : ", reverse);
+	                */
+	               // parent.setText(reverse);
+	                // 13 is return
+	                if ((key==27) || (key==13)) {
+	                	this.parent.parent._button._button.onclick.sendEvent();
+	                }
+	            ]]>
+				</handler>
+			</customInputtext>
+		</view>
+
+		<labelCheckbox name="_inverseWording" x="2" y="24"
+			labelid="580">
+			<attribute name="doUpdate" value="false" type="boolean" />
+			<handler name="oninit">
+				var t = new lz.sharedObject();
+				t.getLocal('userdata');
+				var g = t.getData('userdata');
+				var save = g["rtlCheckbox"];
+				//if ($debug) Debug.write("oninit doUpdate",save,g);
+				if(save) {
+					this.doUpdate = false;
+					this.setValue(true);
+				}
+				this.doUpdate = true;
+			</handler>
+			<handler name="onvalue" args="v">
+				if (this.doUpdate) {
+					//if ($debug) Debug.write("onvalue doUpdate",this.getValue());
+					var t = new lz.sharedObject();
+					t.getLocal('userdata');
+					var g = t.getData('userdata');
+					if (g==null) g = new Array();
+					g["rtlCheckbox"]=this.getValue();
+					//if ($debug) Debug.write("onvalue doUpdate",g["rtlCheckbox"]);
+					t.setData('userdata',g);
+					t.flush();
+				}
+			</handler>
+			<labelTooltip labelid="581" />
+		</labelCheckbox>
+
+		<view name="_button" layout="axis:x;spacing:0" y="22" align="right">
+
+			<attribute name="objMessage" value="null" />
+			<simpleLabelButton align="right" y="0" labelid="220"
+				name="_button" width="70">
+				<handler name="onclick">
+					parent.objMessage = new Array ();
+					parent.objMessage[0] = 'privatechat';
+					//The server side will put time here
+					parent.objMessage[1] = "";
+					parent.objMessage[2] = 'newtextmessage';
+					parent.objMessage[3] = hib.userobject.login;
+					var message = this.parent.parent.message.getText();
+					//if (parent.parent._inverseWording.getValue()) message = canvas.reverseAll(message)
+					parent.objMessage[4] = message;
+					parent.objMessage[5] = canvas.currentusercolor;
+					parent.objMessage[6] = parent.parent.parent.refObj.publicSID;
+					parent.objMessage[7] = canvas.isrtl;
+					parent.objMessage[8] = hib.userobject.user_id;
+					if (this.parent.parent.message.getText().length!=0){
+						//Debug.write("send: ",this.parent.objMessage);
+						parent.sendMessageWithClientByPublicSID.doCall();
+						this.parent.parent.message.setText('');
+					}
+				</handler>
+			</simpleLabelButton>
+
+			<netRemoteCallHib name="sendMessageWithClientByPublicSID"
+				funcname="chatservice.sendMessageWithClientByPublicSID"
+				remotecontext="$once{ canvas.thishib }">
+				<netparam><method name="getValue"> return parent.parent.objMessage; </method></netparam>
+				<netparam><method name="getValue"> return parent.parent.parent.parent.refObj.publicSID; </method></netparam>
+				<handler name="ondata" args="value">
+                <![CDATA[
+                    //The onResult-Handler will be called be the rtmpconnection
+                    if ($debug) Debug.write("chatservice.sendMessageWithClientByPublicSID getValue : ",parent.parent.parent.refObj.publicSID,value);
+                ]]>
+				</handler>
+			</netRemoteCallHib>
+
+		</view>
+		<miniIcons y="22" name="_show_emots" resource="smile_chat_log_rsc"
+			width="16" height="16" showhandcursor="true" align="right" x="90" layout="axis:x;spacing:5" >
+			<handler name="onclick">
+				if ($debug) Debug.write("this: ", this);
+				var pick = new lz.emotIconsSelector(canvas,{
+					btnRef: this.parent,
+					x:(this.getAttributeRelative('x',canvas)-140),
+					y:(this.getAttributeRelative('y',canvas)-140)
+				});
+				lz.ModeManager.makeModal( pick );
+			</handler>
+			<labelTooltip labelid="445" />
+		</miniIcons>
+	</class>
+</library>

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ChatService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ChatService.java?rev=1356670&r1=1356669&r2=1356670&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ChatService.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ChatService.java Tue Jul  3 10:57:35 2012
@@ -94,44 +94,44 @@ public class ChatService implements IPen
 	 * @param newMessage
 	 * @return
 	 */
-	@SuppressWarnings({ "rawtypes", "unchecked" })
+	@SuppressWarnings("unchecked")
 	public int sendMessageWithClient(Object newMessage) {
 		try {
 			IConnection current = Red5.getConnectionLocal();
 			RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
 			Long room_id = currentClient.getRoom_id();
 			
-			log.debug("room_id: "+room_id);
-			log.debug("currentClient.getIsChatNotification(): "+currentClient.getIsChatNotification());
-			if (currentClient.getIsChatNotification()){
+			log.debug("room_id: " + room_id);
+			log.debug("currentClient.getIsChatNotification(): " + currentClient.getIsChatNotification());
+			if (currentClient.getIsChatNotification()) {
 				room_id = currentClient.getChatUserRoomId();
 			}
 			
-			//log.error(newMessage.getClass().getName());
+			@SuppressWarnings("rawtypes")
 			ArrayList messageMap = (ArrayList) newMessage;
-			//adding delimiter space, cause otherwise an emoticon in the last string would not be found
-			String messageText = messageMap.get(4).toString()+" ";
-			//log.error("messageText"+messageText);
-			//add server time
-			messageMap.set(1,parseDateAsTimeString());
+			// adding delimiter space, cause otherwise an emoticon in the last
+			// string would not be found
+			String messageText = messageMap.get(4).toString() + " ";
+			// add server time
+			messageMap.set(1, parseDateAsTimeString());
 			LinkedList<String[]> parsedStringObjects = ChatString.parseChatString(messageText, emoticonsManager.getEmotfilesList());
-			//log.error("parsedStringObjects"+parsedStringObjects.size());
-			log.debug("size:"+messageMap.size());
+			// log.error("parsedStringObjects"+parsedStringObjects.size());
+			log.debug("size:" + messageMap.size());
 			messageMap.add(parsedStringObjects);
 			newMessage = messageMap;			
 			
-			HashMap<String,Object> hsm = new HashMap<String,Object>();
+			HashMap<String, Object> hsm = new HashMap<String, Object>();
 			hsm.put("client", currentClient);
 			hsm.put("message", newMessage);
 			
-			List<HashMap<String,Object>> myChatList = myChats.get(room_id);
-			if (myChatList==null) myChatList = new LinkedList<HashMap<String,Object>>();
+			List<HashMap<String, Object>> myChatList = myChats.get(room_id);
+			if (myChatList == null) myChatList = new LinkedList<HashMap<String, Object>>();
 			
-			if (myChatList.size()==chatRoomHistory) myChatList.remove(0);
+			if (myChatList.size() == chatRoomHistory) myChatList.remove(0);
 			myChatList.add(hsm);
-			myChats.put(room_id,myChatList);
+			myChats.put(room_id, myChatList);
 			
-			log.debug("SET CHATROOM: "+room_id);
+			log.debug("SET CHATROOM: " + room_id);
 			
 			//broadcast to everybody in the room/domain
 			Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
@@ -154,7 +154,7 @@ public class ChatService implements IPen
     						
     						log.debug("*..*idremote room_id: " + room_id);
     						log.debug("*..*my idstreamid room_id: " + rcl.getRoom_id());
-    						if (room_id!=null && room_id.equals(rcl.getRoom_id())) {
+    						if (room_id != null && room_id.equals(rcl.getRoom_id())) {
     							((IServiceCapableConnection) conn).invoke("sendVarsToMessageWithClient",new Object[] { hsm }, this);
     							log.debug("sending sendVarsToMessageWithClient to " + conn);
     						} else if (rcl.getIsChatNotification()) {
@@ -162,19 +162,86 @@ public class ChatService implements IPen
     								((IServiceCapableConnection) conn).invoke("sendVarsToMessageWithClient",new Object[] { hsm }, this);
     							}
     						}
-    						
 	    			 	}
 	    			}
     			}
 			}
-    					
 		} catch (Exception err) {
 			log.error("[ChatService sendMessageWithClient] ",err);
 			return -1;
 		}
 		return 1;
 	}
-	
+
+	//FIXME copy/past need to be removed
+	@SuppressWarnings("unchecked")
+	public int sendMessageWithClientByPublicSID(Object newMessage, String publicSID) {
+		try {
+			IConnection current = Red5.getConnectionLocal();
+			RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
+			Long room_id = currentClient.getRoom_id();
+
+			log.debug("room_id: " + room_id);
+			log.debug("currentClient.getIsChatNotification(): " + currentClient.getIsChatNotification());
+			if (currentClient.getIsChatNotification()) {
+				room_id = currentClient.getChatUserRoomId();
+			}
+
+			@SuppressWarnings("rawtypes")
+			ArrayList messageMap = (ArrayList) newMessage;
+			// adding delimiter space, cause otherwise an emoticon in the last
+			// string would not be found
+			String messageText = messageMap.get(4).toString() + " ";
+			// add server time
+			messageMap.set(1, parseDateAsTimeString());
+			LinkedList<String[]> parsedStringObjects = ChatString.parseChatString(messageText, emoticonsManager.getEmotfilesList());
+			// log.error("parsedStringObjects"+parsedStringObjects.size());
+			log.debug("size:" + messageMap.size());
+			messageMap.add(parsedStringObjects);
+			newMessage = messageMap;
+
+			HashMap<String, Object> hsm = new HashMap<String, Object>();
+			hsm.put("client", currentClient);
+			hsm.put("message", newMessage);
+
+			// broadcast to everybody in the room/domain
+			Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
+			for (Set<IConnection> conset : conCollection) {
+				for (IConnection conn : conset) {
+					if (conn != null) {
+						if (conn instanceof IServiceCapableConnection) {
+
+							RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
+
+    						if (rcl == null) {
+    							continue;
+    						}
+    						if (rcl.getIsAVClient()) {
+    							continue;
+    						}
+    						if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
+	    						continue;
+	    					}
+
+							if (rcl.getPublicSID().equals(publicSID)
+									|| rcl.getPublicSID().equals(
+											currentClient.getPublicSID())) {
+								((IServiceCapableConnection) conn).invoke(
+										"sendVarsToMessageWithClient",
+										new Object[] { hsm }, this);
+							}
+
+						}
+					}
+				}
+			}
+		} catch (Exception err) {
+			log.error("[ChatService sendMessageWithClient] ", err);
+			return -1;
+		}
+		return 1;
+	}
+
 	public List<HashMap<String,Object>> clearChat() {
 		try {
 			IConnection current = Red5.getConnectionLocal();

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/xmlrpc/OpenXGHttpClient.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/xmlrpc/OpenXGHttpClient.java?rev=1356670&r1=1356669&r2=1356670&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/xmlrpc/OpenXGHttpClient.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/xmlrpc/OpenXGHttpClient.java Tue Jul  3 10:57:35 2012
@@ -61,6 +61,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+@SuppressWarnings("deprecation")
 public class OpenXGHttpClient {
 
 	private static final Logger log = Red5LoggerFactory.getLogger(