blob: 033f20551c62efbf88198a581c44d3fb4fa4255a [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="dynamicFileName" extends="customInputtext"
fontsize="10" bgcolor="0xFFFFFF">
<attribute name="isNew" value="false" type="boolean" />
<!-- Only used in case its an update -->
<attribute name="fileExplorerItemId" value="0" type="number" />
<attribute name="parentFileExplorerItemId" value="0" type="number" />
<attribute name="isOwner" value="false" type="boolean" />
<attribute name="refObj" value="null" />
<handler name="onblur">
lz.ModeManager.release(this);
if ($debug) Debug.write("Store and Destroy ",this.parentFileExplorerItemId);
if (this.isNew) {
this.addFolder();
} else {
this.updateFileOrFolderName();
}
</handler>
<handler name="onkeydown" args="k">
<![CDATA[
if (k == 13 || k == 27) {
this.onblur.sendEvent();
}
]]>
</handler>
<!--
public Long addFolderSelf(String SID, Long parentFileExplorerItemId,
String fileName, Long room_id, Boolean isOwner)
-->
<method name="addFolder">
<![CDATA[
if ($debug) Debug.write("moveFile HTTP 1: ");
//this.getFileExplorerByRoom.doCall();
var downloadurl = canvas.getUrl()+'services/FileService/addFolderSelfInternal?'
+'SID='+canvas.sessionId
+'&parentFileExplorerItemId='+this.parentFileExplorerItemId
+'&fileName='+this.text
+'&roomId='+hib.currentroomid
+'&isOwner='+this.isOwner;
this.addFolderSelf.setAttribute("src",downloadurl);
if ($debug) Debug.write("addFolderSelf doRequest ",downloadurl);
this.addFolderSelf.doRequest();
]]>
</method>
<dataset name="addFolderSelf" type="http" >
<handler name="ondata" args="d">
<![CDATA[
//if ($debug) Debug.write("ondata ",d);
if ($debug) Debug.write("addFolderSelf: ",d);
parent.completed();
]]>
</handler>
</dataset>
<!--
<netRemoteCallHib name="addFolder" funcname="fileservice.addFolder"
remotecontext="$once{ canvas.thishib }" >
<netparam><method name="getValue">return canvas.sessionId;</method></netparam>
<netparam><method name="getValue">return parent.parent.parentFileExplorerItemId;</method></netparam>
<netparam><method name="getValue">return parent.parent.text;</method></netparam>
<netparam><method name="getValue">return hib.currentroomid;</method></netparam>
<netparam><method name="getValue">return parent.parent.isOwner;</method></netparam>
<handler name="ondata" args="value">
if ($debug) Debug.write("addFolder: ",value);
parent.completed(value);
</handler>
</netRemoteCallHib>
-->
<!--
public Long updateFileOrFolderNameSelf(String SID, Long fileExplorerItemId,
String fileName)
-->
<method name="updateFileOrFolderName">
<![CDATA[
if ($debug) Debug.write("moveFile HTTP 1: ");
//this.getFileExplorerByRoom.doCall();
var downloadurl = canvas.getUrl()+'services/FileService/updateFileOrFolderNameSelf?'
+'SID='+canvas.sessionId
+'&fileExplorerItemId='+this.fileExplorerItemId
+'&fileName='+this.text;
this.updateFileOrFolderNameSelf.setAttribute("src",downloadurl);
if ($debug) Debug.write("updateFileOrFolderNameSelf doRequest ",downloadurl);
this.updateFileOrFolderNameSelf.doRequest();
]]>
</method>
<dataset name="updateFileOrFolderNameSelf" type="http" >
<handler name="ondata" args="d">
<![CDATA[
//if ($debug) Debug.write("ondata ",d);
if ($debug) Debug.write("updateFileOrFolderNameSelf: ",d);
parent.completedRename();
]]>
</handler>
</dataset>
<!--
<netRemoteCallHib name="updateFileOrFolderName" funcname="fileservice.updateFileOrFolderName"
remotecontext="$once{ canvas.thishib }" >
<netparam><method name="getValue">return canvas.sessionId;</method></netparam>
<netparam><method name="getValue">return parent.parent.fileExplorerItemId;</method></netparam>
<netparam><method name="getValue">return parent.parent.text;</method></netparam>
<handler name="ondata" args="value">
if ($debug) Debug.write("updateFileOrFolderName: ",parent.fileExplorerItemId);
parent.completedRename();
</handler>
</netRemoteCallHib>
-->
<method name="completed">
//this.refObj.fileExplorerItemId = fileExplorerItemId;
this.refObj.setAttribute("fileName",this.getText());
this.refObj.parent.parent.doOpen();
this.destroy();
</method>
<method name="completedRename">
this.refObj.setAttribute("fileName",this.getText());
this.destroy();
</method>
</class>
</library>