blob: 72bf3d0f078bf14f1016be996b2543847b14952f [file] [log] [blame]
<?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>
<class name="baseDrawImage" extends="baseDrawLetter">
<!-- attribute shows if this image is loaded as part of a wml-file-object
if true it will send a onwmlLoaderSend message and NO extra loading bar
if false it will show a loading abr for that image
-->
<attribute name="isWmlLoaderImage" value="false" type="boolean" />
<!-- indicates if this client is still loading an old image for the screenViwer -->
<attribute name="isScreenImageLoading" value="false" type="boolean" />
<attribute name="screenImageRefNumber" value="1" type="number" />
<attribute name="screenImageRef1" value="null" />
<attribute name="screenImageRef2" value="null" />
<!-- reference to the current loading bar
syncing is now on server side implemented, swagner 11.06.2008
<attribute name="loadimageDataWinRef" value="null" />
-->
<!-- labelid of the message seen while waiting for loading
syncing is now on server side implemented, swagner 11.06.2008
<attribute name="imageLoadMessageId" value="208" type="number" />
-->
<!-- labelid of the message seen while waiting for syncing
syncing is now on server side implemented, swagner 11.06.2008
<attribute name="imageSyncMessageId" value="209" type="number" />
<attribute name="imageSyncMessageText" value="" type="string" />
-->
<!-- syncing process
syncing is now on server side implemented, swagner 11.06.2008
<attribute name="syncImageCheckTime" value="1000" type="number" />
<attribute name="_loadingUsersImageList" value="null" />
<attribute name="loadingUsersImageListIndex" value="0" type="number" />
<attribute name="syncImageRefObj" value="null" />
<attribute name="imageLoadingCompleteMessage" value="null" />
<attribute name="loadImageObjectTimer" value="null" />
-->
<event name="setNewScreenUserName" />
<!-- invoked by clicking on the confirmation dialog after
clicking on an image in the Library -->
<method name="addNewSyncImage" args="urlname,posx,posy,baseurl,fileName,moduleName,parentPath,room,domain">
if ($debug) Debug.write("urlname: ",urlname);
var now = new Date();
//This invokes a Method which is in the remoteWhiteboard.lzx
this.startNewObjectSyncProcess.isStarting = true;
this.startNewObjectSyncProcess.uniqueObjectSyncName = fileName + now.getTime();
this.startNewObjectSyncProcess.doCall();
this.addNewImage(urlname,posx,posy,baseurl,fileName,
moduleName,parentPath,room,domain,
this.startNewObjectSyncProcess.uniqueObjectSyncName,false);
</method>
<!-- standard add Function -->
<method name="addNewImage" args="urlname,posx,posy,baseurl,fileName,moduleName,parentPath,room,domain,uniqueObjectSyncName,isLocalSync">
if ($debug) Debug.write("urlname posx: ",urlname,posx);
this.addImageToLayer(this,'image'+this.getCounter(),urlname,
posx,posy,0,0,
true,
baseurl,fileName,moduleName,parentPath,room,domain,uniqueObjectSyncName,isLocalSync);
</method>
<!--
alterModus => this is added by the mod not remotely
-->
<method name="addImageToLayer" args="obj,nameing,urlname,posx,posy,width,height,alterModus,baseurl,fileName,moduleName,parentPath,room,domain,uniqueObjectSyncName,isLocalSync">
<![CDATA[
//only show if it is not part of wml-file-object
//do not show at all as this is handled via the remote Object
//if (!this.isWmlLoaderImage) {
// this.loadimageDataWinRef = new lz.loadWhiteboardWindow(canvas.main_content._content.inner,{refObj:this});
// this.loadimageDataWinRef.setMessage(canvas.getLabelName(this.imageLoadMessageId));
//}
if ($debug) Debug.write("addImageToLayer ",urlname);
//if ($debug) Debug.write("addImageToLayer ",obj,nameing,urlname,posx,posy,width,height,alterModus,baseurl,fileName,moduleName,parentPath,room,domain);
//if ($debug) Debug.write("addImageToLayer posx ",posx);
var src = baseurl+'?fileName=' + encodeURIComponent(fileName) +
'&moduleName=' + moduleName +
'&parentPath=' + encodeURIComponent(parentPath) +
'&room_id=' + room +
'&sid=' + canvas.sessionId;
if ($debug) Debug.write("addImageToLayer -src- ",src);
if ($debug) Debug.write("alterModus: ",alterModus);
this.currentlayer = new lz.imageForDrawView(obj,{
src:src,refObj:this,name:nameing,x:posx,y:posy,
remotewidth:width,remoteheight:height,
downloadurl:urlname,alterModus:alterModus,
baseurl:baseurl,fileName:fileName,moduleName:moduleName,
parentPath:parentPath,room:room,domain:domain,
uniqueObjectSyncName:uniqueObjectSyncName,
isLocalSync:isLocalSync});
//this.parent.parent.isloadingImage.sendEvent(this.currentlayer);
//this.parent._loading.setAttribute('visible',true);
//Add Layer to global Layer
return this.currentlayer;
]]>
</method>
<!--
@deprecated
-->
<method name="addImageToLayerRecorded" args="obj,nameing,urlname,posx,posy,width,height,alterModus,baseurl,fileName,moduleName,parentPath,room,domain">
<![CDATA[
//only show if it is not part of wml-file-object
if (!this.isWmlLoaderImage) {
this.loadimageDataWinRef = new lz.loadWhiteboardWindow(canvas.main_content._content.inner,{refObj:this});
this.loadimageDataWinRef.setMessage(canvas.getLabelName(this.imageLoadMessageId));
}
var src = baseurl+'?fileName='+fileName+'&moduleName='+moduleName+'&parentPath='+parentPath+'&room_id='+room+'&sid='+canvas.sessionId;
this.currentlayer = new lz.imageForDrawView(obj,{
src:src,refObj:this,name:nameing,x:posx,y:posy,
downloadurl:urlname,remotewidth:width,remoteheight:height,
alterModus:alterModus,baseurl:baseurl,fileName:fileName,
moduleName:moduleName,parentPath:parentPath,
room:room,domain:domain,recorderModus:true});
this.parent.parent.isloadingImage.sendEvent(this.currentlayer);
//this.parent._loading.setAttribute('visible',true);
//Add Layer to global Layer
return this.currentlayer;
]]>
</method>
<method name="incomingScreenSharing" args="value">
<![CDATA[
//only do if last image has been loading successfully
if (!this.isScreenImageLoading){
this.isScreenImageLoading = true;
var downloadurl = canvas.protocol + '://'+canvas.rtmphostlocal+':'+canvas.red5httpport+canvas.httpRootKey+'ScreenViewHandler?'
+'fileName='+encodeURIComponent(value.fileName)
+'&room='+hib.currentroomid
+'&domain='+hib.conferencedomain
+'&sid='+canvas.sessionId;
//Debug.write("incomingScreenSharing URL: ",downloadurl);
if (this.screenImageRefNumber==1){
this.screenImageRef1 = new lz.imageForScreenViewer(this,{visible:false,src:downloadurl,refObj:this,name:'screen1',x:0,y:0,downloadurl:downloadurl});
this.screenImageRefNumber = 2;
} else if (this.screenImageRefNumber==2){
this.screenImageRef2 = new lz.imageForScreenViewer(this,{visible:false,src:downloadurl,refObj:this,name:'screen2',x:0,y:0,downloadurl:downloadurl});
this.screenImageRefNumber = 1;
}
this.setNewScreenUserName.sendEvent('Screen of User: '+value.user.firstname+','+value.user.lastname);
} else {
//Debug.write("frame dropped!");
Debug.warn("frame dropped!");
(new lz.singletonErrorPopupHolder()).setError(canvas.getLabelName(240));
}
]]>
</method>
<!--
TODO: Make new Base Class including the Screen sharing Functions
-->
<method name="toggleVisibleScreenSharing">
if (this.screenImageRefNumber==1){
if (this.screenImageRef1) this.screenImageRef1.destroy();
this.screenImageRef2.setAttribute('visible',true);
} else if (this.screenImageRefNumber==2){
this.screenImageRef1.setAttribute('visible',true);
if (this.screenImageRef2) this.screenImageRef2.destroy();
}
this.isScreenImageLoading = false;
</method>
<!--
actionObject => attributes neccessary for loading image
refObj = drawarea
isWmlLoader => (true)is loaded as part of wml-object
-->
<!-- method adds a new Image to the Layer,
but without making an Update-Event,
Image added by remote host -->
<method name="addImageToLayerHistorySynced" args="actionObject,refObj">
if ($debug) Debug.write("addImageToLayerHistory: ",actionObject,refObj);
//start sync process using the remote uniqueObjectSyncName as identifier
//This invokes a Method which is in the remoteWhiteboard.lzx
this.startNewObjectSyncProcess.isStarting = false;
this.startNewObjectSyncProcess.uniqueObjectSyncName = actionObject[8];
this.startNewObjectSyncProcess.doCall();
this.addImageToLayer(refObj,actionObject[actionObject.length-1],actionObject[1],
actionObject[actionObject.length-5],actionObject[actionObject.length-4],
actionObject[actionObject.length-3],actionObject[actionObject.length-2],
false,
actionObject[2],actionObject[3],actionObject[4],actionObject[5],
actionObject[6],actionObject[7],actionObject[8],false);
this.doSWFDocumentStatus(this.currentlayer,actionObject[actionObject.length-7]);
</method>
<!---
invoke by the initial Loading process in remoteWhiteboard.lzx,
does not invoke any Update Handler
once this object is loaded, it will throw an Update event of kind
addImageToLayerHistoryToLocalLoaded
-->
<method name="addImageToLayerHistoryToLocal" args="actionObject,refObj">
if ($debug) Debug.write("addImageToLayerHistoryToLocal: ",actionObject,refObj);
this.addImageToLayer(refObj,actionObject[actionObject.length-1],actionObject[1],
actionObject[actionObject.length-5],actionObject[actionObject.length-4],
actionObject[actionObject.length-3],actionObject[actionObject.length-2],
false,
actionObject[2],actionObject[3],actionObject[4],actionObject[5],
actionObject[6],actionObject[7],actionObject[8],true);
</method>
<!--
this handler is implemented also in remoteWhiteboard.lzx to sync a Local Object list
but throws NO Update Event, cause its only needed Locally, the whole Sync Process
has a different Sync-Object for Loading the complete Object List from the Sever.
Each Object is loaded Locally, once all Objects are loaded the Complete-Event is broadcasted
to the server, but every Item on the List is only controlled locally
-->
<handler name="addImageToLayerHistoryToLocalLoaded" args="objRef">
if ($debug) Debug.write("addImageToLayerHistoryToLocal: ",objRef);
this.syncImageRefObj = objRef;
this.registerNewImage(this.syncImageRefObj.src,
this.syncImageRefObj.x,this.syncImageRefObj.y,
this.syncImageRefObj.width,this.syncImageRefObj.height,
this.syncImageRefObj.baseurl,this.syncImageRefObj.fileName,
this.syncImageRefObj.moduleName,this.syncImageRefObj.parentPath,
this.syncImageRefObj.room,this.syncImageRefObj.domain,
false,this.syncImageRefObj.uniqueObjectSyncName,this.getSWFDocumentStatus(),
this.getZIndex());
</handler>
<!--- @keywords deprecated
TODO: uniqueObjectSyncName missing
-->
<method name="addImageToLayerHistoryRecorded" args="actionObject,refObj,isWmlLoader">
this.isWmlLoaderImage = isWmlLoader;
this.addImageToLayerRecorded(refObj,
actionObject[actionObject.length-1],actionObject[1],
actionObject[actionObject.length-5],actionObject[actionObject.length-4],
actionObject[actionObject.length-3],actionObject[actionObject.length-2],
false,
actionObject[2],actionObject[3],actionObject[4],actionObject[5],
actionObject[6],actionObject[7]);
</method>
<method name="registerNewImage" args="urlname,posx,posy,width,height,baseurl,fileName,moduleName,parentPath,room,domain,doCallUpdate,uniqueObjectSyncName,swfObj,zIndex">
if ($debug) Debug.write("registerNewImage doCallUpdate: ",doCallUpdate);
if ($debug) Debug.write("registerNewImage swfObj: ",swfObj);
var actionObject = new Array();
actionObject.push('image');
actionObject.push(urlname);
actionObject.push(baseurl);
actionObject.push(fileName);
actionObject.push(moduleName);
actionObject.push(parentPath);
actionObject.push(room);
actionObject.push(domain);
actionObject.push(uniqueObjectSyncName);
actionObject.push(zIndex);//-8
actionObject.push(swfObj);//-7
actionObject.push(this.counter);//-6
actionObject.push(posx);//-5
actionObject.push(posy);//-4
actionObject.push(width);//-3
actionObject.push(height);//-2
actionObject.push(this.currentlayer.name);//-1
this.baseactionobjectList.push(actionObject);
this.checkStepLayers();
if (doCallUpdate) this.onsharedMessage('draw',actionObject);
</method>
<!--
adds the Image to the Layers and throws a onsharedMessage,
this can only happen _after_ loading the Image cause you do not know its
width and height
-->
<method name="storeTempValsAndLoadSyncList" args="objRef">
if ($debug) Debug.write("storeTempValsAndLoadSyncList: ",objRef);
this.syncImageRefObj = objRef;
//This invokes a Method which is in the remoteWhiteboard.lzx
this.sendCompletedObjectSyncEvent.uniqueObjectSyncName = this.syncImageRefObj.uniqueObjectSyncName;
this.sendCompletedObjectSyncEvent.doCall();
this.registerNewImage(this.syncImageRefObj.src,
this.syncImageRefObj.x,this.syncImageRefObj.y,
this.syncImageRefObj.width,this.syncImageRefObj.height,
this.syncImageRefObj.baseurl,this.syncImageRefObj.fileName,
this.syncImageRefObj.moduleName,this.syncImageRefObj.parentPath,
this.syncImageRefObj.room,this.syncImageRefObj.domain,
true,this.syncImageRefObj.uniqueObjectSyncName,this.getSWFDocumentStatus(),
this.getZIndex());
</method>
<!--- @keywords deprecated
TODO: check Recorder Modus
-->
<method name="storeTempValsAndLoadSyncListRecording" args="objRef">
if ($debug) Debug.write("########### storeTempValsAndLoadSyncListRecording: ",objRef);
this.syncImageRefObj = objRef;
this.doRegisterAfterLoadingOrRecording();
this.sendCompleteImageSync();
</method>
<method name="sendLoadNotificationImage" args="objRef" >
if ($debug) Debug.write("sendLoadNotificationImage: ",objRef);
this.syncImageRefObj = objRef;
this.registerNewImage(this.syncImageRefObj.src,
this.syncImageRefObj.x,this.syncImageRefObj.y,
this.syncImageRefObj.width,this.syncImageRefObj.height,
this.syncImageRefObj.baseurl,this.syncImageRefObj.fileName,
this.syncImageRefObj.moduleName,this.syncImageRefObj.parentPath,
this.syncImageRefObj.room,this.syncImageRefObj.domain,
false,this.syncImageRefObj.uniqueObjectSyncName,this.getSWFDocumentStatus(),
this.getZIndex());
//This invokes a Method which is in the remoteWhiteboard.lzx
this.sendCompletedObjectSyncEvent.uniqueObjectSyncName = this.syncImageRefObj.uniqueObjectSyncName;
this.sendCompletedObjectSyncEvent.doCall();
</method>
<!-- sending messages/notifications of sync process
syncing is now on server side implemented, swagner 11.06.2008
<netRemoteCallHib name="sendMessageWithClientImage" funcname="sendMessageWithClient" remotecontext="$once{ canvas.thishib }" >
<netparam name="vars"><method name="getValue">return parent.parent.imageLoadingCompleteMessage;</method></netparam>
<handler name="ondata" args="value">
<![CDATA[
//The onResult-Handler will be called be the rtmpconnection
//Debug.write("getValue : ",value);
]]>
</handler>
</netRemoteCallHib>
-->
<!-- get list of clients before loading image cause
we have to show the sync process
syncing is now on server side implemented, swagner 11.06.2008
<netRemoteCallHib name="getImageClientListScope" funcname="getClientListScope" remotecontext="$once{ canvas.thishib }" >
<handler name="ondata" args="value">
<![CDATA[
//The onResult-Handler will be called by the rtmpconnection
//Debug.write("getClientListScope Instance: ",value);
parent._loadingUsersImageList = new Array();
for (var eg in value){
if (canvas.streamid != value[eg].streamid){
//Debug.write("parent._loadingUsersImageList value eg ",eg,value[eg]);
parent._loadingUsersImageList.push(value[eg]);
}
}
this.parent.doRegisterAfterLoadingOrRecording();
//set modus to hand so users can directly select that image
this.parent.setModus('hand');
this.parent.startImgaesyncCheck();
]]>
</handler>
</netRemoteCallHib>
-->
<!--- @keywords deprecated
TODO: Check recorder Modus
-->
<method name="doRegisterAfterLoadingOrRecording">
if ($debug) Debug.write("########### doRegisterAfterLoadingOrRecording");
this.imageSyncMessageText = canvas.getLabelName(this.imageSyncMessageId);
//now send notifications to connected clients
this.setAttribute('drawmodus','image');
this.registerNewImage(this.syncImageRefObj.src,
this.syncImageRefObj.x,this.syncImageRefObj.y,
this.syncImageRefObj.width,this.syncImageRefObj.height,
this.syncImageRefObj.baseurl,this.syncImageRefObj.fileName,
this.syncImageRefObj.moduleName,this.syncImageRefObj.parentPath,
this.syncImageRefObj.room,this.syncImageRefObj.domain,
this.getSWFDocumentStatus(),
this.getZIndex());
</method>
<!-- after loading the objects check if all connected clients of that conference
have loaded the file completely, check it every 1 seconds
syncing is now on server side implemented, swagner 11.06.2008
<method name="startImgaesyncCheck">
<![CDATA[
if (this._loadingUsersImageList.length==0){
this.sendSyncNotificationImage();
} else {
var txt = this.imageSyncMessageText+' '+this._loadingUsersImageList.length;
this.loadimageDataWinRef.setMessage(txt);
this.loadImageObjectTimer = new LzDelegate( this, "startImgaesyncCheck" );
lz.Timer.addTimer( this.loadImageObjectTimer, this.syncImageCheckTime );
}
]]>
</method>
syncing is now on server side implemented, swagner 11.06.2008
<method name="sendSyncNotificationImage">
this.imageLoadingCompleteMessage = new Array();
this.imageLoadingCompleteMessage[0] = "whiteboard";
this.imageLoadingCompleteMessage[1] = "imagesynccomplete";
this.sendMessageWithClientImage.doCall();
</method>
-->
<!-- invoked by remote client once he has completely loaded the wml-file
remote client is waiting/still shows loading window untill all clients have
completely loaded the object/moderator sends "synccomplete" message
syncing is now on server side implemented, swagner 11.06.2008
<method name="sendCompleteImageLoadedRClient" args="client">
<![CDATA[
//detect self messageing
if (client.streamid!=canvas.streamid){
//remove client from sync list
for (var i=0;i<this._loadingUsersImageList.length;i++){
if (this._loadingUsersImageList[i].streamid==client.streamid){
//Debug.write("deleteing client from list: ",this._loadingUsersImageList[i].streamid);
this._loadingUsersImageList.splice(i,1);
}
}
}
]]>
</method>
-->
<!-- invoked remotely by Moderator
all clients have succeed in loading the image
loading win can be closed
Alert: This notification will be send from Moderator and received by ALL clients INCLUDING
the moderator, so the moderator needs no extra command *close* for loading bar cause he
gets its own *sync* complete nofification
syncing is now on server side implemented, swagner 11.06.2008
<method name="sendCompleteImageSync" args="client">
//Debug.write("sendCompleteImageSync ",client);
this.loadimageDataWinRef.close();
</method>
-->
</class>
</library>