[Freeswitch-trunk] [commit] r12611 - freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src

FreeSWITCH SVN silik0n at freeswitch.org
Sun Mar 15 03:16:40 PDT 2009


Author: silik0n
Date: Sun Mar 15 05:16:40 2009
New Revision: 12611

Log:
Add forms for creating new users and domains no backend scripts for these yet

Added:
   freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newDomainForm.mxml
   freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newUserForm.mxml
Modified:
   freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/main.mxml

Modified: freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/main.mxml
==============================================================================
--- freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/main.mxml	(original)
+++ freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/main.mxml	Sun Mar 15 05:16:40 2009
@@ -62,6 +62,16 @@
 					PopUpManager.createPopUp(this, statusForm, false);
 			}
 			
+			public function doNewUserForm():void {
+				var origWindow:IFlexDisplayObject =
+					PopUpManager.createPopUp(this, newUserForm, false);
+			}
+			
+			public function doNewDomainForm():void {
+				var origWindow:IFlexDisplayObject =
+					PopUpManager.createPopUp(this, newDomainForm, false);
+			}
+			
 			public function addDomainParam():void {
 				freeswitch.addDirDomainParam(gridDomainsDomain.selectedItem.uid, inputDomainParamName.text, inputDomainParamValue.text);
 				freeswitch.getDirDomain(gridDomainsDomain.selectedItem.uid);
@@ -221,7 +231,7 @@
                 			<mx:Button label="Refresh Domain" bottom="10" horizontalCenter="-52"/>
                 			<mx:Button label="Add Parameter" left="149" bottom="40" click="addDomainParam()"/>
                 			<mx:Button label="Add Variable" bottom="40" right="168" width="99" click="addDomainVar()"/>
-                			<mx:Button label="Add Domain" bottom="10" horizontalCenter="63"/>
+                			<mx:Button label="Add Domain" bottom="10" horizontalCenter="63" click="doNewDomainForm();"/>
                 			<mx:Label text="Parameter" bottom="90" left="10"/>
                 			<mx:TextInput width="121" id="inputDomainParamName" bottom="70" left="10"/>
                 			<mx:TextInput width="272" id="inputDomainParamValue" bottom="70" left="139"/>
@@ -266,10 +276,10 @@
                 					<mx:DataGridColumn headerText="Data" dataField="value"/>
                 				</mx:columns>
                 			</mx:DataGrid>
-                			<mx:Button label="Refresh Domain" bottom="10" horizontalCenter="-52"/>
+                			<mx:Button label="Refresh User" bottom="10" horizontalCenter="-52"/>
                 			<mx:Button label="Add Parameter" left="149" bottom="40" click="addDomainUserParam()"/>
                 			<mx:Button label="Add Variable" bottom="40" right="168" width="99" click="addDomainUserVar()"/>
-                			<mx:Button label="Add Domain" bottom="10" horizontalCenter="63"/>
+                			<mx:Button label="Add User" bottom="10" horizontalCenter="63" click="doNewUserForm();"/>
                 			<mx:Label text="Parameter" bottom="90" left="10"/>
                 			<mx:TextInput width="121" id="inputDomainUserParamName" bottom="70" left="10"/>
                 			<mx:TextInput width="272" id="inputDomainUserParamValue" bottom="70" left="139"/>

Added: freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newDomainForm.mxml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newDomainForm.mxml	Sun Mar 15 05:16:40 2009
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="doInit();" height="306" title="Add Domain">
+    <mx:Script>
+        <![CDATA[
+            import mx.managers.PopUpManager;
+            import mx.controls.Alert;
+            import mx.rpc.events.ResultEvent;
+            
+            private function doInit():void {
+                PopUpManager.centerPopUp(this);
+            }
+            
+            private function doCall():void {
+				parentApplication.freeswitch.addDirDomain(domainName.text, dialString.text, defaultGateway.text, defaultAreacode.text, xferFallbackExten.text, recordStereo.selected);
+				PopUpManager.removePopUp(this);
+            }
+        ]]>
+    </mx:Script>
+  
+    <mx:Form width="100%">
+        <mx:FormItem label="Domain Name" width="100%">
+            <mx:TextInput id="domainName"  width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="Dial String" width="100%">
+            <mx:TextInput id="dialString" width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="default_gateway" width="100%">
+            <mx:TextInput id="defaultGateway" width="100%"/>
+        </mx:FormItem>         
+        <mx:FormItem label="Default Areacode" width="100%">
+            <mx:TextInput id="defaultAreacode" width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="Xfer Fallback Exten" width="100%">
+            <mx:TextInput id="xferFallbackExten" width="100%"/>
+        </mx:FormItem> 
+        <mx:FormItem label="Record Stereo">
+            <mx:CheckBox id="recordStereo" />
+        </mx:FormItem>
+		
+    </mx:Form>
+    <mx:HBox horizontalAlign="center" width="314"> 
+        <mx:Button click="doCall();" label="Add Domain"/> 
+        <mx:Button click="PopUpManager.removePopUp(this);" label="Cancel"/> 
+    </mx:HBox> 
+</mx:TitleWindow>
\ No newline at end of file

Added: freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newUserForm.mxml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/swk/flex/amf-test1/src/newUserForm.mxml	Sun Mar 15 05:16:40 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="doInit();" height="306" title="Add User">
+    <mx:Script>
+        <![CDATA[
+            import mx.managers.PopUpManager;
+            import mx.controls.Alert;
+            import mx.rpc.events.ResultEvent;
+            
+            private function doInit():void {
+                PopUpManager.centerPopUp(this);
+            }
+            
+            private function doCall():void {
+				parentApplication.freeswitch.addDirDomainUser(username.text, mailbox.text, cidr.text, password.text, vm_password.text, cid_name.text, cid_number.text);
+				PopUpManager.removePopUp(this);
+            }
+        ]]>
+    </mx:Script>
+  
+    <mx:Form width="100%">
+        <mx:FormItem label="UserName" width="100%">
+            <mx:TextInput id="username"  width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="Mailbox" width="100%">
+            <mx:TextInput id="mailbox" width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="CIDR" width="100%">
+            <mx:TextInput id="cidr" width="100%"/>
+        </mx:FormItem>         
+        <mx:FormItem label="Password" width="100%">
+            <mx:TextInput id="password" width="100%"/>
+        </mx:FormItem>
+        <mx:FormItem label="VM PIN" width="100%">
+            <mx:TextInput id="vm_password" width="100%"/>
+        </mx:FormItem> 
+		<mx:FormItem label="CallerID Name" width="100%">
+            <mx:TextInput id="cid_name" width="100%"/>
+        </mx:FormItem>
+		<mx:FormItem label="CallerID Number" width="100%">
+            <mx:TextInput id="cid_number" width="100%"/>
+        </mx:FormItem>
+    </mx:Form>
+    <mx:HBox horizontalAlign="center" width="314"> 
+        <mx:Button click="doCall();" label="Add User"/> 
+        <mx:Button click="PopUpManager.removePopUp(this);" label="Cancel"/> 
+    </mx:HBox> 
+</mx:TitleWindow>
\ No newline at end of file



More information about the Freeswitch-trunk mailing list