home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 September / Chip_2003-09_cd1.bin / zkuste / macos / Files / wamcom.sit / wamcom-131-macos9-20030721 / Components / nsXmlRpcClient.js < prev    next >
MacBinary  |  2003-06-30  |  48.9 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Janne Salmijarvi Optimizer (music/janneSalmijarviOptimizer) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Jun 30 01:09:28 2003, modified Mon Jun 30 01:09:28 2003, creator 'CWIE', type ASCII, 49284 bytes "nsXmlRpcClient.js" , at 0xc104 412 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 11 6e 73 58 6d 6c 52 | 70 63 43 6c 69 65 6e 74 |..nsXmlR|pcClient|
|00000010| 2e 6a 73 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.js.....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 c0 84 00 | 00 01 9c bb 25 76 88 bb |........|....%v..|
|00000060| 25 76 88 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |%v......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8c ec 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 20 54 68 | 65 20 63 6f 6e 74 65 6e |/*. * Th|e conten|
|00000090| 74 73 20 6f 66 20 74 68 | 69 73 20 66 69 6c 65 20 |ts of th|is file |
|000000a0| 61 72 65 20 73 75 62 6a | 65 63 74 20 74 6f 20 74 |are subj|ect to t|
|000000b0| 68 65 20 4d 6f 7a 69 6c | 6c 61 20 50 75 62 6c 69 |he Mozil|la Publi|
|000000c0| 63 20 4c 69 63 65 6e 73 | 65 20 56 65 72 73 69 6f |c Licens|e Versio|
|000000d0| 6e 0d 20 2a 20 31 2e 31 | 20 28 74 68 65 20 22 4c |n. * 1.1| (the "L|
|000000e0| 69 63 65 6e 73 65 22 29 | 3b 20 79 6f 75 20 6d 61 |icense")|; you ma|
|000000f0| 79 20 6e 6f 74 20 75 73 | 65 20 74 68 69 73 20 66 |y not us|e this f|
|00000100| 69 6c 65 20 65 78 63 65 | 70 74 20 69 6e 20 63 6f |ile exce|pt in co|
|00000110| 6d 70 6c 69 61 6e 63 65 | 20 77 69 74 68 20 74 68 |mpliance| with th|
|00000120| 65 0d 20 2a 20 4c 69 63 | 65 6e 73 65 2e 20 59 6f |e. * Lic|ense. Yo|
|00000130| 75 20 6d 61 79 20 6f 62 | 74 61 69 6e 20 61 20 63 |u may ob|tain a c|
|00000140| 6f 70 79 20 6f 66 20 74 | 68 65 20 4c 69 63 65 6e |opy of t|he Licen|
|00000150| 73 65 20 61 74 20 68 74 | 74 70 3a 2f 2f 77 77 77 |se at ht|tp://www|
|00000160| 2e 6d 6f 7a 69 6c 6c 61 | 2e 6f 72 67 2f 4d 50 4c |.mozilla|.org/MPL|
|00000170| 2f 0d 20 2a 0d 20 2a 20 | 53 6f 66 74 77 61 72 65 |/. *. * |Software|
|00000180| 20 64 69 73 74 72 69 62 | 75 74 65 64 20 75 6e 64 | distrib|uted und|
|00000190| 65 72 20 74 68 65 20 4c | 69 63 65 6e 73 65 20 69 |er the L|icense i|
|000001a0| 73 20 64 69 73 74 72 69 | 62 75 74 65 64 20 6f 6e |s distri|buted on|
|000001b0| 20 61 6e 20 22 41 53 20 | 49 53 22 20 62 61 73 69 | an "AS |IS" basi|
|000001c0| 73 2c 0d 20 2a 20 57 49 | 54 48 4f 55 54 20 57 41 |s,. * WI|THOUT WA|
|000001d0| 52 52 41 4e 54 59 20 4f | 46 20 41 4e 59 20 4b 49 |RRANTY O|F ANY KI|
|000001e0| 4e 44 2c 20 65 69 74 68 | 65 72 20 65 78 70 72 65 |ND, eith|er expre|
|000001f0| 73 73 20 6f 72 20 69 6d | 70 6c 69 65 64 2e 20 53 |ss or im|plied. S|
|00000200| 65 65 20 74 68 65 20 4c | 69 63 65 6e 73 65 20 66 |ee the L|icense f|
|00000210| 6f 72 0d 20 2a 20 74 68 | 65 20 73 70 65 63 69 66 |or. * th|e specif|
|00000220| 69 63 20 6c 61 6e 67 75 | 61 67 65 20 67 6f 76 65 |ic langu|age gove|
|00000230| 72 6e 69 6e 67 20 72 69 | 67 68 74 73 20 61 6e 64 |rning ri|ghts and|
|00000240| 20 6c 69 6d 69 74 61 74 | 69 6f 6e 73 20 75 6e 64 | limitat|ions und|
|00000250| 65 72 20 74 68 65 20 4c | 69 63 65 6e 73 65 2e 0d |er the L|icense..|
|00000260| 20 2a 0d 20 2a 20 54 68 | 65 20 4f 72 69 67 69 6e | *. * Th|e Origin|
|00000270| 61 6c 20 43 6f 64 65 20 | 69 73 20 4d 6f 7a 69 6c |al Code |is Mozil|
|00000280| 6c 61 20 58 4d 4c 2d 52 | 50 43 20 43 6c 69 65 6e |la XML-R|PC Clien|
|00000290| 74 20 63 6f 6d 70 6f 6e | 65 6e 74 2e 0d 20 2a 0d |t compon|ent.. *.|
|000002a0| 20 2a 20 54 68 65 20 49 | 6e 69 74 69 61 6c 20 44 | * The I|nitial D|
|000002b0| 65 76 65 6c 6f 70 65 72 | 20 6f 66 20 74 68 65 20 |eveloper| of the |
|000002c0| 4f 72 69 67 69 6e 61 6c | 20 43 6f 64 65 20 69 73 |Original| Code is|
|000002d0| 20 44 69 67 69 74 61 6c | 20 43 72 65 61 74 69 6f | Digital| Creatio|
|000002e0| 6e 73 20 32 2c 20 49 6e | 63 2e 0d 20 2a 20 50 6f |ns 2, In|c.. * Po|
|000002f0| 72 74 69 6f 6e 73 20 63 | 72 65 61 74 65 64 20 62 |rtions c|reated b|
|00000300| 79 20 44 69 67 69 74 61 | 6c 20 43 72 65 61 74 69 |y Digita|l Creati|
|00000310| 6f 6e 73 20 32 2c 20 49 | 6e 63 2e 20 61 72 65 20 |ons 2, I|nc. are |
|00000320| 43 6f 70 79 72 69 67 68 | 74 20 28 43 29 20 32 30 |Copyrigh|t (C) 20|
|00000330| 30 30 20 44 69 67 69 74 | 61 6c 0d 20 2a 20 43 72 |00 Digit|al. * Cr|
|00000340| 65 61 74 69 6f 6e 73 20 | 32 2c 20 49 6e 63 2e 20 |eations |2, Inc. |
|00000350| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|00000360| 72 76 65 64 2e 0d 20 2a | 0d 20 2a 20 43 6f 6e 74 |rved.. *|. * Cont|
|00000370| 72 69 62 75 74 6f 72 28 | 73 29 3a 20 4d 61 72 74 |ributor(|s): Mart|
|00000380| 69 6a 6e 20 50 69 65 74 | 65 72 73 20 3c 6d 6a 40 |ijn Piet|ers <mj@|
|00000390| 64 69 67 69 63 6f 6f 6c | 2e 63 6f 6d 3e 20 28 6f |digicool|.com> (o|
|000003a0| 72 69 67 69 6e 61 6c 20 | 61 75 74 68 6f 72 29 0d |riginal |author).|
|000003b0| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|000003c0| 20 20 20 53 61 6d 75 65 | 6c 20 53 69 65 62 20 3c | Samue|l Sieb <|
|000003d0| 73 61 6d 75 65 6c 40 73 | 69 65 62 2e 6e 65 74 3e |samuel@s|ieb.net>|
|000003e0| 20 62 72 6f 75 67 68 74 | 20 69 74 20 75 70 20 74 | brought| it up t|
|000003f0| 6f 20 64 61 74 65 20 77 | 69 74 68 20 0d 20 2a 20 |o date w|ith . * |
|00000400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000410| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 75 72 72 | | curr|
|00000420| 65 6e 74 20 41 50 49 73 | 20 61 6e 64 20 61 64 64 |ent APIs| and add|
|00000430| 65 64 20 61 75 74 68 65 | 6e 74 69 63 61 74 69 6f |ed authe|nticatio|
|00000440| 6e 0d 20 2a 2f 0d 0d 2f | 2a 0d 20 2a 20 20 6e 73 |n. */../|*. * ns|
|00000450| 58 6d 6c 52 70 63 43 6c | 69 65 6e 74 20 58 50 43 |XmlRpcCl|ient XPC|
|00000460| 4f 4d 20 63 6f 6d 70 6f | 6e 65 6e 74 0d 20 2a 20 |OM compo|nent. * |
|00000470| 20 56 65 72 73 69 6f 6e | 3a 20 24 52 65 76 69 73 | Version|: $Revis|
|00000480| 69 6f 6e 3a 20 31 2e 33 | 31 2e 38 2e 31 20 24 0d |ion: 1.3|1.8.1 $.|
|00000490| 20 2a 0d 20 2a 20 20 24 | 49 64 3a 20 6e 73 58 6d | *. * $|Id: nsXm|
|000004a0| 6c 52 70 63 43 6c 69 65 | 6e 74 2e 6a 73 2c 76 20 |lRpcClie|nt.js,v |
|000004b0| 31 2e 33 31 2e 38 2e 31 | 20 32 30 30 33 2f 30 33 |1.31.8.1| 2003/03|
|000004c0| 2f 31 30 20 32 30 3a 32 | 31 3a 34 36 20 73 61 6d |/10 20:2|1:46 sam|
|000004d0| 75 65 6c 25 73 69 65 62 | 2e 6e 65 74 20 45 78 70 |uel%sieb|.net Exp|
|000004e0| 20 24 0d 20 2a 2f 0d 0d | 2f 2a 0d 20 2a 20 43 6f | $. */..|/*. * Co|
|000004f0| 6e 73 74 61 6e 74 73 0d | 20 2a 2f 0d 63 6f 6e 73 |nstants.| */.cons|
|00000500| 74 20 58 4d 4c 52 50 43 | 43 4c 49 45 4e 54 5f 43 |t XMLRPC|CLIENT_C|
|00000510| 4f 4e 54 52 41 43 54 49 | 44 20 3d 20 27 40 6d 6f |ONTRACTI|D = '@mo|
|00000520| 7a 69 6c 6c 61 2e 6f 72 | 67 2f 78 6d 6c 2d 72 70 |zilla.or|g/xml-rp|
|00000530| 63 2f 63 6c 69 65 6e 74 | 3b 31 27 3b 0d 63 6f 6e |c/client|;1';.con|
|00000540| 73 74 20 58 4d 4c 52 50 | 43 43 4c 49 45 4e 54 5f |st XMLRP|CCLIENT_|
|00000550| 43 49 44 20 3d 0d 20 20 | 20 20 43 6f 6d 70 6f 6e |CID =. | Compon|
|00000560| 65 6e 74 73 2e 49 44 28 | 27 7b 33 37 31 32 37 32 |ents.ID(|'{371272|
|00000570| 34 31 2d 31 65 36 65 2d | 34 36 61 61 2d 62 61 38 |41-1e6e-|46aa-ba8|
|00000580| 37 2d 36 30 31 64 34 31 | 62 62 34 37 64 66 7d 27 |7-601d41|bb47df}'|
|00000590| 29 3b 0d 63 6f 6e 73 74 | 20 58 4d 4c 52 50 43 43 |);.const| XMLRPCC|
|000005a0| 4c 49 45 4e 54 5f 49 49 | 44 20 3d 20 43 6f 6d 70 |LIENT_II|D = Comp|
|000005b0| 6f 6e 65 6e 74 73 2e 69 | 6e 74 65 72 66 61 63 65 |onents.i|nterface|
|000005c0| 73 2e 6e 73 49 58 6d 6c | 52 70 63 43 6c 69 65 6e |s.nsIXml|RpcClien|
|000005d0| 74 3b 0d 0d 63 6f 6e 73 | 74 20 58 4d 4c 52 50 43 |t;..cons|t XMLRPC|
|000005e0| 46 41 55 4c 54 5f 43 4f | 4e 54 52 41 43 54 49 44 |FAULT_CO|NTRACTID|
|000005f0| 20 3d 20 27 40 6d 6f 7a | 69 6c 6c 61 2e 6f 72 67 | = '@moz|illa.org|
|00000600| 2f 78 6d 6c 2d 72 70 63 | 2f 66 61 75 6c 74 3b 31 |/xml-rpc|/fault;1|
|00000610| 27 3b 0d 63 6f 6e 73 74 | 20 58 4d 4c 52 50 43 46 |';.const| XMLRPCF|
|00000620| 41 55 4c 54 5f 43 49 44 | 20 3d 0d 20 20 20 20 43 |AULT_CID| =. C|
|00000630| 6f 6d 70 6f 6e 65 6e 74 | 73 2e 49 44 28 27 7b 36 |omponent|s.ID('{6|
|00000640| 39 31 63 62 38 36 34 2d | 30 61 37 65 2d 34 34 38 |91cb864-|0a7e-448|
|00000650| 63 2d 39 38 65 65 2d 34 | 61 37 66 33 35 39 63 66 |c-98ee-4|a7f359cf|
|00000660| 31 34 35 7d 27 29 3b 0d | 63 6f 6e 73 74 20 58 4d |145}');.|const XM|
|00000670| 4c 52 50 43 46 41 55 4c | 54 5f 49 49 44 20 3d 20 |LRPCFAUL|T_IID = |
|00000680| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00000690| 66 61 63 65 73 2e 6e 73 | 49 58 6d 6c 52 70 63 46 |faces.ns|IXmlRpcF|
|000006a0| 61 75 6c 74 3b 0d 0d 63 | 6f 6e 73 74 20 44 45 42 |ault;..c|onst DEB|
|000006b0| 55 47 20 3d 20 66 61 6c | 73 65 3b 0d 63 6f 6e 73 |UG = fal|se;.cons|
|000006c0| 74 20 44 45 42 55 47 50 | 41 52 53 45 20 3d 20 66 |t DEBUGP|ARSE = f|
|000006d0| 61 6c 73 65 3b 0d 0d 2f | 2a 0d 20 2a 20 43 6c 61 |alse;../|*. * Cla|
|000006e0| 73 73 20 64 65 66 69 6e | 69 74 69 6f 6e 73 0d 20 |ss defin|itions. |
|000006f0| 2a 2f 0d 0d 2f 2a 20 54 | 68 65 20 6e 73 58 6d 6c |*/../* T|he nsXml|
|00000700| 52 70 63 46 61 75 6c 74 | 20 63 6c 61 73 73 20 63 |RpcFault| class c|
|00000710| 6f 6e 73 74 72 75 63 74 | 6f 72 2e 20 2a 2f 0d 66 |onstruct|or. */.f|
|00000720| 75 6e 63 74 69 6f 6e 20 | 6e 73 58 6d 6c 52 70 63 |unction |nsXmlRpc|
|00000730| 46 61 75 6c 74 28 29 20 | 7b 7d 0d 0d 2f 2a 20 74 |Fault() |{}../* t|
|00000740| 68 65 20 6e 73 58 6d 6c | 52 70 63 46 61 75 6c 74 |he nsXml|RpcFault|
|00000750| 20 63 6c 61 73 73 20 64 | 65 66 20 2a 2f 0d 6e 73 | class d|ef */.ns|
|00000760| 58 6d 6c 52 70 63 46 61 | 75 6c 74 2e 70 72 6f 74 |XmlRpcFa|ult.prot|
|00000770| 6f 74 79 70 65 20 3d 20 | 7b 0d 20 20 20 20 66 61 |otype = |{. fa|
|00000780| 75 6c 74 43 6f 64 65 3a | 20 30 2c 0d 20 20 20 20 |ultCode:| 0,. |
|00000790| 66 61 75 6c 74 53 74 72 | 69 6e 67 3a 20 27 27 2c |faultStr|ing: '',|
|000007a0| 0d 0d 20 20 20 20 69 6e | 69 74 3a 20 66 75 6e 63 |.. in|it: func|
|000007b0| 74 69 6f 6e 28 66 61 75 | 6c 74 43 6f 64 65 2c 20 |tion(fau|ltCode, |
|000007c0| 66 61 75 6c 74 53 74 72 | 69 6e 67 29 20 7b 0d 20 |faultStr|ing) {. |
|000007d0| 20 20 20 20 20 20 20 74 | 68 69 73 2e 66 61 75 6c | t|his.faul|
|000007e0| 74 43 6f 64 65 20 3d 20 | 66 61 75 6c 74 43 6f 64 |tCode = |faultCod|
|000007f0| 65 3b 0d 20 20 20 20 20 | 20 20 20 74 68 69 73 2e |e;. | this.|
|00000800| 66 61 75 6c 74 53 74 72 | 69 6e 67 20 3d 20 66 61 |faultStr|ing = fa|
|00000810| 75 6c 74 53 74 72 69 6e | 67 3b 0d 20 20 20 20 7d |ultStrin|g;. }|
|00000820| 2c 0d 0d 20 20 20 20 74 | 6f 53 74 72 69 6e 67 3a |,.. t|oString:|
|00000830| 20 66 75 6e 63 74 69 6f | 6e 28 29 20 7b 0d 20 20 | functio|n() {. |
|00000840| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 27 3c 58 | re|turn '<X|
|00000850| 4d 4c 2d 52 50 43 20 46 | 61 75 6c 74 3a 20 28 27 |ML-RPC F|ault: ('|
|00000860| 20 2b 20 74 68 69 73 2e | 66 61 75 6c 74 43 6f 64 | + this.|faultCod|
|00000870| 65 20 2b 20 27 29 20 27 | 20 2b 0d 20 20 20 20 20 |e + ') '| +. |
|00000880| 20 20 20 20 20 20 20 74 | 68 69 73 2e 66 61 75 6c | t|his.faul|
|00000890| 74 53 74 72 69 6e 67 20 | 2b 20 27 3e 27 3b 0d 20 |tString |+ '>';. |
|000008a0| 20 20 20 7d 2c 0d 0d 20 | 20 20 20 2f 2f 20 6e 73 | },.. | // ns|
|000008b0| 49 53 75 70 70 6f 72 74 | 73 20 69 6e 74 65 72 66 |ISupport|s interf|
|000008c0| 61 63 65 0d 20 20 20 20 | 51 75 65 72 79 49 6e 74 |ace. |QueryInt|
|000008d0| 65 72 66 61 63 65 3a 20 | 66 75 6e 63 74 69 6f 6e |erface: |function|
|000008e0| 28 69 69 64 29 20 7b 0d | 20 20 20 20 20 20 20 20 |(iid) {.| |
|000008f0| 69 66 20 28 21 69 69 64 | 2e 65 71 75 61 6c 73 28 |if (!iid|.equals(|
|00000900| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00000910| 66 61 63 65 73 2e 6e 73 | 49 53 75 70 70 6f 72 74 |faces.ns|ISupport|
|00000920| 73 29 20 26 26 0d 20 20 | 20 20 20 20 20 20 20 20 |s) &&. | |
|00000930| 20 20 21 69 69 64 2e 65 | 71 75 61 6c 73 28 58 4d | !iid.e|quals(XM|
|00000940| 4c 52 50 43 46 41 55 4c | 54 5f 49 49 44 29 29 0d |LRPCFAUL|T_IID)).|
|00000950| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 72 6f | | thro|
|00000960| 77 20 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 72 65 73 |w Compon|ents.res|
|00000970| 75 6c 74 73 2e 4e 53 5f | 45 52 52 4f 52 5f 4e 4f |ults.NS_|ERROR_NO|
|00000980| 5f 49 4e 54 45 52 46 41 | 43 45 3b 0d 20 20 20 20 |_INTERFA|CE;. |
|00000990| 20 20 20 20 72 65 74 75 | 72 6e 20 74 68 69 73 3b | retu|rn this;|
|000009a0| 0d 20 20 20 20 7d 0d 7d | 3b 0d 0d 2f 2a 20 54 68 |. }.}|;../* Th|
|000009b0| 65 20 6e 73 58 6d 6c 52 | 70 63 43 6c 69 65 6e 74 |e nsXmlR|pcClient|
|000009c0| 20 63 6c 61 73 73 20 63 | 6f 6e 73 74 72 75 63 74 | class c|onstruct|
|000009d0| 6f 72 2e 20 2a 2f 0d 66 | 75 6e 63 74 69 6f 6e 20 |or. */.f|unction |
|000009e0| 6e 73 58 6d 6c 52 70 63 | 43 6c 69 65 6e 74 28 29 |nsXmlRpc|Client()|
|000009f0| 20 7b 7d 0d 0d 2f 2a 20 | 74 68 65 20 6e 73 58 6d | {}../* |the nsXm|
|00000a00| 6c 52 70 63 43 6c 69 65 | 6e 74 20 63 6c 61 73 73 |lRpcClie|nt class|
|00000a10| 20 64 65 66 20 2a 2f 0d | 6e 73 58 6d 6c 52 70 63 | def */.|nsXmlRpc|
|00000a20| 43 6c 69 65 6e 74 2e 70 | 72 6f 74 6f 74 79 70 65 |Client.p|rototype|
|00000a30| 20 3d 20 7b 0d 20 20 20 | 20 5f 73 65 72 76 65 72 | = {. | _server|
|00000a40| 55 72 6c 3a 20 6e 75 6c | 6c 2c 0d 20 20 20 20 5f |Url: nul|l,. _|
|00000a50| 75 73 65 41 75 74 68 3a | 20 66 61 6c 73 65 2c 0d |useAuth:| false,.|
|00000a60| 20 20 20 20 5f 70 61 73 | 73 77 6f 72 64 54 72 69 | _pas|swordTri|
|00000a70| 65 64 3a 20 66 61 6c 73 | 65 2c 0d 0d 20 20 20 20 |ed: fals|e,.. |
|00000a80| 69 6e 69 74 3a 20 66 75 | 6e 63 74 69 6f 6e 28 73 |init: fu|nction(s|
|00000a90| 65 72 76 65 72 55 52 4c | 29 20 7b 0d 20 20 20 20 |erverURL|) {. |
|00000aa0| 20 20 20 20 76 61 72 20 | 69 6f 73 20 3d 20 43 6f | var |ios = Co|
|00000ab0| 6d 70 6f 6e 65 6e 74 73 | 2e 63 6c 61 73 73 65 73 |mponents|.classes|
|00000ac0| 5b 22 40 6d 6f 7a 69 6c | 6c 61 2e 6f 72 67 2f 6e |["@mozil|la.org/n|
|00000ad0| 65 74 77 6f 72 6b 2f 69 | 6f 2d 73 65 72 76 69 63 |etwork/i|o-servic|
|00000ae0| 65 3b 31 22 5d 2e 0d 20 | 20 20 20 20 20 20 20 20 |e;1"].. | |
|00000af0| 20 20 20 67 65 74 53 65 | 72 76 69 63 65 28 43 6f | getSe|rvice(Co|
|00000b00| 6d 70 6f 6e 65 6e 74 73 | 2e 69 6e 74 65 72 66 61 |mponents|.interfa|
|00000b10| 63 65 73 2e 6e 73 49 49 | 4f 53 65 72 76 69 63 65 |ces.nsII|OService|
|00000b20| 29 3b 0d 20 20 20 20 20 | 20 20 20 76 61 72 20 6f |);. | var o|
|00000b30| 55 52 4c 20 3d 20 69 6f | 73 2e 6e 65 77 55 52 49 |URL = io|s.newURI|
|00000b40| 28 73 65 72 76 65 72 55 | 52 4c 2c 20 6e 75 6c 6c |(serverU|RL, null|
|00000b50| 2c 20 6e 75 6c 6c 29 3b | 0d 0d 20 20 20 20 20 20 |, null);|.. |
|00000b60| 20 20 2f 2f 20 4d 61 6b | 65 20 73 75 72 65 20 69 | // Mak|e sure i|
|00000b70| 74 20 69 73 20 61 20 63 | 6f 6d 70 6c 65 74 65 20 |t is a c|omplete |
|00000b80| 73 70 65 63 0d 20 20 20 | 20 20 20 20 20 2f 2f 20 |spec. | // |
|00000b90| 4e 6f 74 65 20 74 68 61 | 74 20 77 65 20 64 6f 6e |Note tha|t we don|
|00000ba0| 27 74 20 63 61 72 65 20 | 77 68 61 74 20 74 68 65 |'t care |what the|
|00000bb0| 20 73 63 68 65 6d 65 20 | 69 73 20 6f 74 68 65 72 | scheme |is other|
|00000bc0| 77 69 73 65 2e 0d 20 20 | 20 20 20 20 20 20 2f 2f |wise.. | //|
|00000bd0| 20 53 68 6f 75 6c 64 20 | 77 65 20 63 61 72 65 3f | Should |we care?|
|00000be0| 20 50 4f 53 54 20 77 6f | 72 6b 73 20 6f 6e 6c 79 | POST wo|rks only|
|00000bf0| 20 6f 6e 20 68 74 74 70 | 20 61 6e 64 20 68 74 74 | on http| and htt|
|00000c00| 70 73 2e 2e 0d 20 20 20 | 20 20 20 20 20 69 66 20 |ps... | if |
|00000c10| 28 21 6f 55 52 4c 2e 73 | 63 68 65 6d 65 29 20 6f |(!oURL.s|cheme) o|
|00000c20| 55 52 4c 2e 73 63 68 65 | 6d 65 20 3d 20 27 68 74 |URL.sche|me = 'ht|
|00000c30| 74 70 27 3b 0d 20 20 20 | 20 20 20 20 20 69 66 20 |tp';. | if |
|00000c40| 28 28 6f 55 52 4c 2e 73 | 63 68 65 6d 65 20 21 3d |((oURL.s|cheme !=|
|00000c50| 20 27 68 74 74 70 27 29 | 20 26 26 20 28 6f 55 52 | 'http')| && (oUR|
|00000c60| 4c 2e 73 63 68 65 6d 65 | 20 21 3d 20 27 68 74 74 |L.scheme| != 'htt|
|00000c70| 70 73 27 29 29 0d 20 20 | 20 20 20 20 20 20 20 20 |ps')). | |
|00000c80| 20 20 74 68 72 6f 77 20 | 43 6f 6d 70 6f 6e 65 6e | throw |Componen|
|00000c90| 74 73 2e 45 78 63 65 70 | 74 69 6f 6e 28 27 4f 6e |ts.Excep|tion('On|
|00000ca0| 6c 79 20 48 54 54 50 20 | 69 73 20 73 75 70 70 6f |ly HTTP |is suppo|
|00000cb0| 72 74 65 64 27 29 3b 0d | 0d 20 20 20 20 20 20 20 |rted');.|. |
|00000cc0| 20 74 68 69 73 2e 5f 73 | 65 72 76 65 72 55 72 6c | this._s|erverUrl|
|00000cd0| 20 3d 20 6f 55 52 4c 3b | 0d 20 20 20 20 7d 2c 0d | = oURL;|. },.|
|00000ce0| 0d 20 20 20 20 73 65 74 | 41 75 74 68 65 6e 74 69 |. set|Authenti|
|00000cf0| 63 61 74 69 6f 6e 3a 20 | 66 75 6e 63 74 69 6f 6e |cation: |function|
|00000d00| 28 75 73 65 72 6e 61 6d | 65 2c 20 70 61 73 73 77 |(usernam|e, passw|
|00000d10| 6f 72 64 29 7b 0d 20 20 | 20 20 20 20 20 20 69 66 |ord){. | if|
|00000d20| 20 28 28 74 79 70 65 6f | 66 20 75 73 65 72 6e 61 | ((typeo|f userna|
|00000d30| 6d 65 20 3d 3d 20 22 73 | 74 72 69 6e 67 22 29 20 |me == "s|tring") |
|00000d40| 26 26 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |&&. | (|
|00000d50| 74 79 70 65 6f 66 20 70 | 61 73 73 77 6f 72 64 20 |typeof p|assword |
|00000d60| 3d 3d 20 22 73 74 72 69 | 6e 67 22 29 29 7b 0d 20 |== "stri|ng")){. |
|00000d70| 20 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 75 | | this._u|
|00000d80| 73 65 41 75 74 68 20 3d | 20 74 72 75 65 3b 0d 20 |seAuth =| true;. |
|00000d90| 20 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 75 | | this._u|
|00000da0| 73 65 72 6e 61 6d 65 20 | 3d 20 75 73 65 72 6e 61 |sername |= userna|
|00000db0| 6d 65 3b 0d 20 20 20 20 | 20 20 20 20 20 20 74 68 |me;. | th|
|00000dc0| 69 73 2e 5f 70 61 73 73 | 77 6f 72 64 20 3d 20 70 |is._pass|word = p|
|00000dd0| 61 73 73 77 6f 72 64 3b | 0d 20 20 20 20 20 20 20 |assword;|. |
|00000de0| 20 20 20 74 68 69 73 2e | 5f 70 61 73 73 77 6f 72 | this.|_passwor|
|00000df0| 64 54 72 69 65 64 20 3d | 20 66 61 6c 73 65 3b 0d |dTried =| false;.|
|00000e00| 20 20 20 20 20 20 20 20 | 7d 0d 20 20 20 20 7d 2c | |}. },|
|00000e10| 0d 0d 20 20 20 20 63 6c | 65 61 72 41 75 74 68 65 |.. cl|earAuthe|
|00000e20| 6e 74 69 63 61 74 69 6f | 6e 3a 20 66 75 6e 63 74 |nticatio|n: funct|
|00000e30| 69 6f 6e 28 29 7b 0d 20 | 20 20 20 20 20 20 20 74 |ion(){. | t|
|00000e40| 68 69 73 2e 5f 75 73 65 | 41 75 74 68 20 3d 20 66 |his._use|Auth = f|
|00000e50| 61 6c 73 65 3b 0d 20 20 | 20 20 7d 2c 0d 0d 20 20 |alse;. | },.. |
|00000e60| 20 20 67 65 74 20 73 65 | 72 76 65 72 55 72 6c 28 | get se|rverUrl(|
|00000e70| 29 20 7b 20 72 65 74 75 | 72 6e 20 74 68 69 73 2e |) { retu|rn this.|
|00000e80| 5f 73 65 72 76 65 72 55 | 72 6c 3b 20 7d 2c 0d 0d |_serverU|rl; },..|
|00000e90| 20 20 20 20 2f 2f 20 49 | 6e 74 65 72 6e 61 6c 20 | // I|nternal |
|00000ea0| 63 6f 70 79 20 6f 66 20 | 74 68 65 20 73 74 61 74 |copy of |the stat|
|00000eb0| 75 73 0d 20 20 20 20 5f | 73 74 61 74 75 73 3a 20 |us. _|status: |
|00000ec0| 6e 75 6c 6c 2c 0d 20 20 | 20 20 5f 65 72 72 6f 72 |null,. | _error|
|00000ed0| 4d 73 67 3a 20 6e 75 6c | 6c 2c 0d 20 20 20 20 5f |Msg: nul|l,. _|
|00000ee0| 6c 69 73 74 65 6e 65 72 | 3a 20 6e 75 6c 6c 2c 0d |listener|: null,.|
|00000ef0| 20 20 20 20 5f 73 65 65 | 6e 53 74 61 72 74 3a 20 | _see|nStart: |
|00000f00| 66 61 6c 73 65 2c 0d 0d | 20 20 20 20 61 73 79 6e |false,..| asyn|
|00000f10| 63 43 61 6c 6c 3a 20 66 | 75 6e 63 74 69 6f 6e 28 |cCall: f|unction(|
|00000f20| 6c 69 73 74 65 6e 65 72 | 2c 20 63 6f 6e 74 65 78 |listener|, contex|
|00000f30| 74 2c 20 6d 65 74 68 6f | 64 4e 61 6d 65 2c 20 6d |t, metho|dName, m|
|00000f40| 65 74 68 6f 64 41 72 67 | 73 2c 20 63 6f 75 6e 74 |ethodArg|s, count|
|00000f50| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 64 65 62 75 |) {. | debu|
|00000f60| 67 28 27 61 73 79 6e 63 | 43 61 6c 6c 27 29 3b 0d |g('async|Call');.|
|00000f70| 20 20 20 20 20 20 20 20 | 2f 2f 20 43 68 65 63 6b | |// Check|
|00000f80| 20 66 6f 72 20 63 61 6c | 6c 20 69 6e 20 70 72 6f | for cal|l in pro|
|00000f90| 67 72 65 73 73 2e 0d 20 | 20 20 20 20 20 20 20 69 |gress.. | i|
|00000fa0| 66 20 28 74 68 69 73 2e | 5f 69 6e 50 72 6f 67 72 |f (this.|_inProgr|
|00000fb0| 65 73 73 29 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ess). | |
|00000fc0| 20 74 68 72 6f 77 20 43 | 6f 6d 70 6f 6e 65 6e 74 | throw C|omponent|
|00000fd0| 73 2e 45 78 63 65 70 74 | 69 6f 6e 28 27 43 61 6c |s.Except|ion('Cal|
|00000fe0| 6c 20 69 6e 20 70 72 6f | 67 72 65 73 73 21 27 29 |l in pro|gress!')|
|00000ff0| 3b 0d 0d 20 20 20 20 20 | 20 20 20 2f 2f 20 43 68 |;.. | // Ch|
|00001000| 65 63 6b 20 66 6f 72 20 | 74 68 65 20 73 65 72 76 |eck for |the serv|
|00001010| 65 72 20 55 52 4c 3b 0d | 20 20 20 20 20 20 20 20 |er URL;.| |
|00001020| 69 66 20 28 21 74 68 69 | 73 2e 5f 73 65 72 76 65 |if (!thi|s._serve|
|00001030| 72 55 72 6c 29 0d 20 20 | 20 20 20 20 20 20 20 20 |rUrl). | |
|00001040| 20 20 74 68 72 6f 77 20 | 43 6f 6d 70 6f 6e 65 6e | throw |Componen|
|00001050| 74 73 2e 45 78 63 65 70 | 74 69 6f 6e 28 27 4e 6f |ts.Excep|tion('No|
|00001060| 74 20 69 6e 69 74 69 6c | 69 7a 65 64 27 29 3b 0d |t initil|ized');.|
|00001070| 0d 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 69 |. | this._i|
|00001080| 6e 50 72 6f 67 72 65 73 | 73 20 3d 20 74 72 75 65 |nProgres|s = true|
|00001090| 3b 0d 0d 20 20 20 20 20 | 20 20 20 2f 2f 20 43 6c |;.. | // Cl|
|000010a0| 65 61 72 20 73 74 61 74 | 65 2e 0d 20 20 20 20 20 |ear stat|e.. |
|000010b0| 20 20 20 74 68 69 73 2e | 5f 73 74 61 74 75 73 20 | this.|_status |
|000010c0| 3d 20 6e 75 6c 6c 3b 0d | 20 20 20 20 20 20 20 20 |= null;.| |
|000010d0| 74 68 69 73 2e 5f 65 72 | 72 6f 72 4d 73 67 20 3d |this._er|rorMsg =|
|000010e0| 20 6e 75 6c 6c 3b 0d 20 | 20 20 20 20 20 20 20 74 | null;. | t|
|000010f0| 68 69 73 2e 5f 6c 69 73 | 74 65 6e 65 72 20 3d 20 |his._lis|tener = |
|00001100| 6c 69 73 74 65 6e 65 72 | 3b 0d 20 20 20 20 20 20 |listener|;. |
|00001110| 20 20 74 68 69 73 2e 5f | 73 65 65 6e 53 74 61 72 | this._|seenStar|
|00001120| 74 20 3d 20 66 61 6c 73 | 65 3b 0d 20 20 20 20 20 |t = fals|e;. |
|00001130| 20 20 20 74 68 69 73 2e | 5f 63 6f 6e 74 65 78 74 | this.|_context|
|00001140| 20 3d 20 63 6f 6e 74 65 | 78 74 3b 0d 20 20 20 20 | = conte|xt;. |
|00001150| 20 20 20 20 0d 20 20 20 | 20 20 20 20 20 64 65 62 | . | deb|
|00001160| 75 67 28 27 41 72 67 75 | 6d 65 6e 74 73 3a 20 27 |ug('Argu|ments: '|
|00001170| 20 2b 20 6d 65 74 68 6f | 64 41 72 67 73 29 3b 0d | + metho|dArgs);.|
|00001180| 0d 20 20 20 20 20 20 20 | 20 2f 2f 20 47 65 6e 65 |. | // Gene|
|00001190| 72 61 74 65 20 72 65 71 | 75 65 73 74 20 62 6f 64 |rate req|uest bod|
|000011a0| 79 0d 20 20 20 20 20 20 | 20 20 76 61 72 20 78 6d |y. | var xm|
|000011b0| 6c 57 72 69 74 65 72 20 | 3d 20 6e 65 77 20 58 4d |lWriter |= new XM|
|000011c0| 4c 57 72 69 74 65 72 28 | 29 3b 0d 20 20 20 20 20 |LWriter(|);. |
|000011d0| 20 20 20 74 68 69 73 2e | 5f 67 65 6e 65 72 61 74 | this.|_generat|
|000011e0| 65 52 65 71 75 65 73 74 | 42 6f 64 79 28 78 6d 6c |eRequest|Body(xml|
|000011f0| 57 72 69 74 65 72 2c 20 | 6d 65 74 68 6f 64 4e 61 |Writer, |methodNa|
|00001200| 6d 65 2c 20 6d 65 74 68 | 6f 64 41 72 67 73 29 3b |me, meth|odArgs);|
|00001210| 0d 0d 20 20 20 20 20 20 | 20 20 76 61 72 20 72 65 |.. | var re|
|00001220| 71 75 65 73 74 42 6f 64 | 79 20 3d 20 78 6d 6c 57 |questBod|y = xmlW|
|00001230| 72 69 74 65 72 2e 64 61 | 74 61 3b 0d 0d 20 20 20 |riter.da|ta;.. |
|00001240| 20 20 20 20 20 64 65 62 | 75 67 28 27 52 65 71 75 | deb|ug('Requ|
|00001250| 65 73 74 3a 20 27 20 2b | 20 72 65 71 75 65 73 74 |est: ' +| request|
|00001260| 42 6f 64 79 29 3b 0d 0d | 20 20 20 20 20 20 20 20 |Body);..| |
|00001270| 76 61 72 20 63 68 61 6e | 6e 20 3d 20 74 68 69 73 |var chan|n = this|
|00001280| 2e 5f 67 65 74 43 68 61 | 6e 6e 65 6c 28 72 65 71 |._getCha|nnel(req|
|00001290| 75 65 73 74 42 6f 64 79 | 29 3b 0d 0d 20 20 20 20 |uestBody|);.. |
|000012a0| 20 20 20 20 2f 2f 20 41 | 6e 64 2e 2e 2e 2e 2e 2e | // A|nd......|
|000012b0| 20 63 61 6c 6c 21 0d 20 | 20 20 20 20 20 20 20 63 | call!. | c|
|000012c0| 68 61 6e 6e 2e 61 73 79 | 6e 63 4f 70 65 6e 28 74 |hann.asy|ncOpen(t|
|000012d0| 68 69 73 2c 20 63 6f 6e | 74 65 78 74 29 3b 0d 20 |his, con|text);. |
|000012e0| 20 20 20 7d 2c 0d 0d 20 | 20 20 20 2f 2f 20 52 65 | },.. | // Re|
|000012f0| 74 75 72 6e 20 61 20 48 | 54 54 50 20 63 68 61 6e |turn a H|TTP chan|
|00001300| 6e 65 6c 20 72 65 61 64 | 79 20 66 6f 72 20 50 4f |nel read|y for PO|
|00001310| 53 54 69 6e 67 2e 0d 20 | 20 20 20 5f 67 65 74 43 |STing.. | _getC|
|00001320| 68 61 6e 6e 65 6c 3a 20 | 66 75 6e 63 74 69 6f 6e |hannel: |function|
|00001330| 28 72 65 71 75 65 73 74 | 29 20 7b 0d 20 20 20 20 |(request|) {. |
|00001340| 20 20 20 20 2f 2f 20 53 | 65 74 20 75 70 20 63 68 | // S|et up ch|
|00001350| 61 6e 6e 65 6c 2e 0d 20 | 20 20 20 20 20 20 20 76 |annel.. | v|
|00001360| 61 72 20 69 6f 53 65 72 | 76 69 63 65 20 3d 20 67 |ar ioSer|vice = g|
|00001370| 65 74 53 65 72 76 69 63 | 65 28 27 40 6d 6f 7a 69 |etServic|e('@mozi|
|00001380| 6c 6c 61 2e 6f 72 67 2f | 6e 65 74 77 6f 72 6b 2f |lla.org/|network/|
|00001390| 69 6f 2d 73 65 72 76 69 | 63 65 3b 31 27 2c 0d 20 |io-servi|ce;1',. |
|000013a0| 20 20 20 20 20 20 20 20 | 20 20 20 27 6e 73 49 49 | | 'nsII|
|000013b0| 4f 53 65 72 76 69 63 65 | 27 29 3b 0d 0d 20 20 20 |OService|');.. |
|000013c0| 20 20 20 20 20 76 61 72 | 20 63 68 61 6e 6e 20 3d | var| chann =|
|000013d0| 20 69 6f 53 65 72 76 69 | 63 65 2e 6e 65 77 43 68 | ioServi|ce.newCh|
|000013e0| 61 6e 6e 65 6c 46 72 6f | 6d 55 52 49 28 74 68 69 |annelFro|mURI(thi|
|000013f0| 73 2e 5f 73 65 72 76 65 | 72 55 72 6c 29 0d 20 20 |s._serve|rUrl). |
|00001400| 20 20 20 20 20 20 20 20 | 20 20 2e 51 75 65 72 79 | | .Query|
|00001410| 49 6e 74 65 72 66 61 63 | 65 28 43 6f 6d 70 6f 6e |Interfac|e(Compon|
|00001420| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00001430| 6e 73 49 48 74 74 70 43 | 68 61 6e 6e 65 6c 29 3b |nsIHttpC|hannel);|
|00001440| 0d 0d 20 20 20 20 20 20 | 20 20 2f 2f 20 43 72 65 |.. | // Cre|
|00001450| 61 74 65 20 61 20 73 74 | 72 65 61 6d 20 6f 75 74 |ate a st|ream out|
|00001460| 20 6f 66 20 74 68 65 20 | 72 65 71 75 65 73 74 20 | of the |request |
|00001470| 61 6e 64 20 61 74 74 61 | 63 68 20 69 74 20 74 6f |and atta|ch it to|
|00001480| 20 74 68 65 20 63 68 61 | 6e 6e 65 6c 0d 20 20 20 | the cha|nnel. |
|00001490| 20 20 20 20 20 76 61 72 | 20 75 70 6c 6f 61 64 20 | var| upload |
|000014a0| 3d 20 63 68 61 6e 6e 2e | 51 75 65 72 79 49 6e 74 |= chann.|QueryInt|
|000014b0| 65 72 66 61 63 65 28 43 | 6f 6d 70 6f 6e 65 6e 74 |erface(C|omponent|
|000014c0| 73 2e 69 6e 74 65 72 66 | 61 63 65 73 2e 6e 73 49 |s.interf|aces.nsI|
|000014d0| 55 70 6c 6f 61 64 43 68 | 61 6e 6e 65 6c 29 3b 0d |UploadCh|annel);.|
|000014e0| 20 20 20 20 20 20 20 20 | 76 61 72 20 70 6f 73 74 | |var post|
|000014f0| 53 74 72 65 61 6d 20 3d | 20 63 72 65 61 74 65 49 |Stream =| createI|
|00001500| 6e 73 74 61 6e 63 65 28 | 27 40 6d 6f 7a 69 6c 6c |nstance(|'@mozill|
|00001510| 61 2e 6f 72 67 2f 69 6f | 2f 73 74 72 69 6e 67 2d |a.org/io|/string-|
|00001520| 69 6e 70 75 74 2d 73 74 | 72 65 61 6d 3b 31 27 2c |input-st|ream;1',|
|00001530| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 27 6e 73 |. | 'ns|
|00001540| 49 53 74 72 69 6e 67 49 | 6e 70 75 74 53 74 72 65 |IStringI|nputStre|
|00001550| 61 6d 27 29 3b 0d 20 20 | 20 20 20 20 20 20 70 6f |am');. | po|
|00001560| 73 74 53 74 72 65 61 6d | 2e 73 65 74 44 61 74 61 |stStream|.setData|
|00001570| 28 72 65 71 75 65 73 74 | 2c 20 72 65 71 75 65 73 |(request|, reques|
|00001580| 74 2e 6c 65 6e 67 74 68 | 29 3b 0d 20 20 20 20 20 |t.length|);. |
|00001590| 20 20 20 75 70 6c 6f 61 | 64 2e 73 65 74 55 70 6c | uploa|d.setUpl|
|000015a0| 6f 61 64 53 74 72 65 61 | 6d 28 70 6f 73 74 53 74 |oadStrea|m(postSt|
|000015b0| 72 65 61 6d 2c 20 27 74 | 65 78 74 2f 78 6d 6c 27 |ream, 't|ext/xml'|
|000015c0| 2c 20 2d 31 29 3b 0d 0d | 20 20 20 20 20 20 20 20 |, -1);..| |
|000015d0| 2f 2f 20 53 65 74 20 74 | 68 65 20 72 65 71 75 65 |// Set t|he reque|
|000015e0| 73 74 20 6d 65 74 68 6f | 64 2e 20 73 65 74 55 70 |st metho|d. setUp|
|000015f0| 6c 6f 61 64 53 74 72 65 | 61 6d 20 67 75 65 73 73 |loadStre|am guess|
|00001600| 65 73 20 74 68 65 20 6d | 65 74 68 6f 64 2c 0d 20 |es the m|ethod,. |
|00001610| 20 20 20 20 20 20 20 2f | 2f 20 73 6f 20 77 65 20 | /|/ so we |
|00001620| 67 6f 74 74 61 20 64 6f | 20 74 68 69 73 20 61 66 |gotta do| this af|
|00001630| 74 65 72 77 61 72 64 73 | 2e 0d 20 20 20 20 20 20 |terwards|.. |
|00001640| 20 20 63 68 61 6e 6e 2e | 72 65 71 75 65 73 74 4d | chann.|requestM|
|00001650| 65 74 68 6f 64 20 3d 20 | 27 50 4f 53 54 27 3b 0d |ethod = |'POST';.|
|00001660| 0d 20 20 20 20 20 20 20 | 20 63 68 61 6e 6e 2e 6e |. | chann.n|
|00001670| 6f 74 69 66 69 63 61 74 | 69 6f 6e 43 61 6c 6c 62 |otificat|ionCallb|
|00001680| 61 63 6b 73 20 3d 20 74 | 68 69 73 3b 0d 0d 20 20 |acks = t|his;.. |
|00001690| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 63 68 61 | re|turn cha|
|000016a0| 6e 6e 3b 0d 20 20 20 20 | 7d 2c 0d 0d 20 20 20 20 |nn;. |},.. |
|000016b0| 2f 2f 20 46 6c 61 67 20 | 69 6e 64 69 63 61 74 69 |// Flag |indicati|
|000016c0| 6e 67 20 77 65 74 68 65 | 72 20 6f 72 20 6e 6f 74 |ng wethe|r or not|
|000016d0| 20 77 65 20 61 72 65 20 | 63 61 6c 6c 69 6e 67 20 | we are |calling |
|000016e0| 74 68 65 20 73 65 72 76 | 65 72 2e 0d 20 20 20 20 |the serv|er.. |
|000016f0| 5f 69 6e 50 72 6f 67 72 | 65 73 73 3a 20 66 61 6c |_inProgr|ess: fal|
|00001700| 73 65 2c 0d 20 20 20 20 | 67 65 74 20 69 6e 50 72 |se,. |get inPr|
|00001710| 6f 67 72 65 73 73 28 29 | 20 7b 20 72 65 74 75 72 |ogress()| { retur|
|00001720| 6e 20 74 68 69 73 2e 5f | 69 6e 50 72 6f 67 72 65 |n this._|inProgre|
|00001730| 73 73 3b 20 7d 2c 0d 0d | 20 20 20 20 2f 2f 20 6e |ss; },..| // n|
|00001740| 73 49 53 74 72 65 61 6d | 4c 69 73 74 65 6e 65 72 |sIStream|Listener|
|00001750| 20 69 6e 74 65 72 66 61 | 63 65 2c 20 73 6f 27 73 | interfa|ce, so's|
|00001760| 20 77 65 20 6b 6e 6f 77 | 20 61 62 6f 75 74 20 74 | we know| about t|
|00001770| 68 65 20 70 65 6e 64 69 | 6e 67 20 72 65 71 75 65 |he pendi|ng reque|
|00001780| 73 74 2e 0d 20 20 20 20 | 6f 6e 53 74 61 72 74 52 |st.. |onStartR|
|00001790| 65 71 75 65 73 74 3a 20 | 66 75 6e 63 74 69 6f 6e |equest: |function|
|000017a0| 28 63 68 61 6e 6e 65 6c | 2c 20 63 74 78 74 29 20 |(channel|, ctxt) |
|000017b0| 7b 20 0d 20 20 20 20 20 | 20 20 20 64 65 62 75 67 |{ . | debug|
|000017c0| 28 27 53 74 61 72 74 20 | 52 65 71 75 65 73 74 27 |('Start |Request'|
|000017d0| 29 20 0d 20 20 20 20 7d | 2c 20 2f 2f 20 44 6f 20 |) . }|, // Do |
|000017e0| 65 78 61 63 74 6c 79 20 | 6e 61 64 61 2e 0d 0d 20 |exactly |nada... |
|000017f0| 20 20 20 2f 2f 20 45 6e | 64 20 6f 66 20 74 68 65 | // En|d of the|
|00001800| 20 72 65 71 75 65 73 74 | 0d 20 20 20 20 6f 6e 53 | request|. onS|
|00001810| 74 6f 70 52 65 71 75 65 | 73 74 3a 20 66 75 6e 63 |topReque|st: func|
|00001820| 74 69 6f 6e 28 63 68 61 | 6e 6e 65 6c 2c 20 63 74 |tion(cha|nnel, ct|
|00001830| 78 74 2c 20 73 74 61 74 | 75 73 29 20 7b 0d 20 20 |xt, stat|us) {. |
|00001840| 20 20 20 20 20 20 64 65 | 62 75 67 28 27 53 74 6f | de|bug('Sto|
|00001850| 70 20 52 65 71 75 65 73 | 74 27 29 3b 0d 20 20 20 |p Reques|t');. |
|00001860| 20 20 20 20 20 69 66 20 | 28 21 74 68 69 73 2e 5f | if |(!this._|
|00001870| 69 6e 50 72 6f 67 72 65 | 73 73 29 20 72 65 74 75 |inProgre|ss) retu|
|00001880| 72 6e 3b 20 2f 2f 20 4e | 6f 20 6c 6f 6e 67 65 72 |rn; // N|o longer|
|00001890| 20 69 6e 74 65 72 65 73 | 74 65 64 2e 0d 0d 20 20 | interes|ted... |
|000018a0| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 69 6e 50 72 | th|is._inPr|
|000018b0| 6f 67 72 65 73 73 20 3d | 20 66 61 6c 73 65 3b 0d |ogress =| false;.|
|000018c0| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 70 61 | |this._pa|
|000018d0| 72 73 65 72 20 3d 20 6e | 75 6c 6c 3b 0d 20 20 20 |rser = n|ull;. |
|000018e0| 20 20 20 20 20 0d 20 20 | 20 20 20 20 20 20 69 66 | . | if|
|000018f0| 20 28 73 74 61 74 75 73 | 29 20 7b 0d 20 20 20 20 | (status|) {. |
|00001900| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 28 27 4e | |debug('N|
|00001910| 6f 6e 2d 7a 65 72 6f 20 | 73 74 61 74 75 73 3a 20 |on-zero |status: |
|00001920| 28 27 20 2b 20 73 74 61 | 74 75 73 2e 74 6f 53 74 |(' + sta|tus.toSt|
|00001930| 72 69 6e 67 28 31 36 29 | 20 2b 20 27 29 20 27 29 |ring(16)| + ') ')|
|00001940| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 |;. | th|
|00001950| 69 73 2e 5f 73 74 61 74 | 75 73 20 3d 20 73 74 61 |is._stat|us = sta|
|00001960| 74 75 73 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |tus;. | |
|00001970| 20 74 68 69 73 2e 5f 65 | 72 72 6f 72 4d 73 67 20 | this._e|rrorMsg |
|00001980| 3d 20 65 72 72 6f 72 4d | 73 67 3b 0d 20 20 20 20 |= errorM|sg;. |
|00001990| 20 20 20 20 20 20 20 20 | 74 72 79 20 7b 0d 20 20 | |try {. |
|000019a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|000019b0| 69 73 2e 5f 6c 69 73 74 | 65 6e 65 72 2e 6f 6e 45 |is._list|ener.onE|
|000019c0| 72 72 6f 72 28 74 68 69 | 73 2c 20 63 74 78 74 2c |rror(thi|s, ctxt,|
|000019d0| 20 73 74 61 74 75 73 2c | 0d 20 20 20 20 20 20 20 | status,|. |
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a00| 73 74 61 74 75 73 2e 74 | 6f 53 74 72 69 6e 67 28 |status.t|oString(|
|00001a10| 31 36 29 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |16));. | |
|00001a20| 20 20 7d 20 63 61 74 63 | 68 20 28 65 78 29 20 7b | } catc|h (ex) {|
|00001a30| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001a40| 20 64 65 62 75 67 28 27 | 45 78 63 65 70 74 69 6f | debug('|Exceptio|
|00001a50| 6e 20 69 6e 20 6c 69 73 | 74 65 6e 65 72 2e 6f 6e |n in lis|tener.on|
|00001a60| 45 72 72 6f 72 3a 20 27 | 20 2b 20 65 78 29 3b 0d |Error: '| + ex);.|
|00001a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 | | }. |
|00001a80| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00001a90| 3b 0d 20 20 20 20 20 20 | 20 20 7d 0d 0d 20 20 20 |;. | }.. |
|00001aa0| 20 20 20 20 20 2f 2f 20 | 41 6c 6c 20 64 6f 6e 65 | // |All done|
|00001ab0| 2e 0d 20 20 20 20 20 20 | 20 20 64 65 62 75 67 28 |.. | debug(|
|00001ac0| 27 50 61 72 73 65 20 66 | 69 6e 69 73 68 65 64 27 |'Parse f|inished'|
|00001ad0| 29 3b 0d 20 20 20 20 20 | 20 20 20 69 66 20 28 74 |);. | if (t|
|00001ae0| 68 69 73 2e 5f 66 6f 75 | 6e 64 46 61 75 6c 74 29 |his._fou|ndFault)|
|00001af0| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | {. | t|
|00001b00| 72 79 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ry {. | |
|00001b10| 20 20 20 20 20 74 68 69 | 73 2e 5f 66 61 75 6c 74 | thi|s._fault|
|00001b20| 20 3d 20 63 72 65 61 74 | 65 49 6e 73 74 61 6e 63 | = creat|eInstanc|
|00001b30| 65 28 58 4d 4c 52 50 43 | 46 41 55 4c 54 5f 43 4f |e(XMLRPC|FAULT_CO|
|00001b40| 4e 54 52 41 43 54 49 44 | 2c 0d 20 20 20 20 20 20 |NTRACTID|,. |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 27 6e | | 'n|
|00001b60| 73 49 58 6d 6c 52 70 63 | 46 61 75 6c 74 27 29 3b |sIXmlRpc|Fault');|
|00001b70| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001b80| 20 74 68 69 73 2e 5f 66 | 61 75 6c 74 2e 69 6e 69 | this._f|ault.ini|
|00001b90| 74 28 74 68 69 73 2e 5f | 72 65 73 75 6c 74 2e 67 |t(this._|result.g|
|00001ba0| 65 74 56 61 6c 75 65 28 | 27 66 61 75 6c 74 43 6f |etValue(|'faultCo|
|00001bb0| 64 65 27 29 2e 64 61 74 | 61 2c 0d 20 20 20 20 20 |de').dat|a,. |
|00001bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|00001bd0| 68 69 73 2e 5f 72 65 73 | 75 6c 74 2e 67 65 74 56 |his._res|ult.getV|
|00001be0| 61 6c 75 65 28 27 66 61 | 75 6c 74 53 74 72 69 6e |alue('fa|ultStrin|
|00001bf0| 67 27 29 2e 64 61 74 61 | 29 3b 0d 20 20 20 20 20 |g').data|);. |
|00001c00| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 69 73 2e | | this.|
|00001c10| 5f 72 65 73 75 6c 74 20 | 3d 20 6e 75 6c 6c 3b 0d |_result |= null;.|
|00001c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 20 63 61 | | } ca|
|00001c30| 74 63 68 28 65 29 20 7b | 0d 20 20 20 20 20 20 20 |tch(e) {|. |
|00001c40| 20 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 66 | | this._f|
|00001c50| 61 75 6c 74 20 3d 20 6e | 75 6c 6c 3b 0d 20 20 20 |ault = n|ull;. |
|00001c60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 74 68 69 | | thi|
|00001c70| 73 2e 5f 72 65 73 75 6c | 74 20 3d 20 6e 75 6c 6c |s._resul|t = null|
|00001c80| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00001c90| 20 20 74 68 72 6f 77 20 | 43 6f 6d 70 6f 6e 65 6e | throw |Componen|
|00001ca0| 74 73 2e 45 78 63 65 70 | 74 69 6f 6e 28 27 43 6f |ts.Excep|tion('Co|
|00001cb0| 75 6c 64 20 6e 6f 74 20 | 70 61 72 73 65 20 72 65 |uld not |parse re|
|00001cc0| 73 70 6f 6e 73 65 27 29 | 3b 0d 20 20 20 20 20 20 |sponse')|;. |
|00001cd0| 20 20 20 20 20 20 20 20 | 20 20 74 72 79 20 7b 20 | | try { |
|00001ce0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001cf0| 20 20 20 20 20 74 68 69 | 73 2e 5f 6c 69 73 74 65 | thi|s._liste|
|00001d00| 6e 65 72 2e 6f 6e 45 72 | 72 6f 72 28 74 68 69 73 |ner.onEr|ror(this|
|00001d10| 2c 20 63 74 78 74 2c 20 | 0d 20 20 20 20 20 20 20 |, ctxt, |. |
|00001d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001d30| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 72 65 73 75 | Compone|nts.resu|
|00001d40| 6c 74 73 2e 4e 53 5f 45 | 52 52 4f 52 5f 46 41 49 |lts.NS_E|RROR_FAI|
|00001d50| 4c 2c 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |L, . | |
|00001d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 27 53 65 72 | | 'Ser|
|00001d70| 76 65 72 20 72 65 74 75 | 72 6e 65 64 20 69 6e 76 |ver retu|rned inv|
|00001d80| 61 6c 69 64 20 46 61 75 | 6c 74 27 29 3b 0d 20 20 |alid Fau|lt');. |
|00001d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 0d | | }.|
|00001da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001db0| 63 61 74 63 68 28 65 78 | 29 20 7b 0d 20 20 20 20 |catch(ex|) {. |
|00001dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001dd0| 64 65 62 75 67 28 27 45 | 78 63 65 70 74 69 6f 6e |debug('E|xception|
|00001de0| 20 69 6e 20 6c 69 73 74 | 65 6e 65 72 2e 6f 6e 45 | in list|ener.onE|
|00001df0| 72 72 6f 72 3a 20 27 20 | 2b 20 65 78 29 3b 0d 20 |rror: ' |+ ex);. |
|00001e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00001e10| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0d 20 |. | }. |
|00001e20| 20 20 20 20 20 20 20 20 | 20 20 20 64 65 62 75 67 | | debug|
|00001e30| 28 27 46 61 75 6c 74 3a | 20 27 20 2b 20 74 68 69 |('Fault:| ' + thi|
|00001e40| 73 2e 5f 66 61 75 6c 74 | 29 3b 0d 20 20 20 20 20 |s._fault|);. |
|00001e50| 20 20 20 20 20 20 20 74 | 72 79 20 7b 20 74 68 69 | t|ry { thi|
|00001e60| 73 2e 5f 6c 69 73 74 65 | 6e 65 72 2e 6f 6e 46 61 |s._liste|ner.onFa|
|00001e70| 75 6c 74 28 74 68 69 73 | 2c 20 63 74 78 74 2c 20 |ult(this|, ctxt, |
|00001e80| 74 68 69 73 2e 5f 66 61 | 75 6c 74 29 3b 20 7d 0d |this._fa|ult); }.|
|00001e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 74 63 | | catc|
|00001ea0| 68 28 65 78 29 20 7b 0d | 20 20 20 20 20 20 20 20 |h(ex) {.| |
|00001eb0| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 28 27 45 | |debug('E|
|00001ec0| 78 63 65 70 74 69 6f 6e | 20 69 6e 20 6c 69 73 74 |xception| in list|
|00001ed0| 65 6e 65 72 2e 6f 6e 46 | 61 75 6c 74 3a 20 27 20 |ener.onF|ault: ' |
|00001ee0| 2b 20 65 78 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |+ ex);. | |
|00001ef0| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 7d 20 65 | }. | } e|
|00001f00| 6c 73 65 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |lse {. | |
|00001f10| 20 20 64 65 62 75 67 28 | 27 52 65 73 75 6c 74 3a | debug(|'Result:|
|00001f20| 20 27 20 2b 20 74 68 69 | 73 2e 5f 72 65 73 75 6c | ' + thi|s._resul|
|00001f30| 74 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |t);. | |
|00001f40| 74 72 79 20 7b 20 0d 20 | 20 20 20 20 20 20 20 20 |try { . | |
|00001f50| 20 20 20 20 20 20 20 74 | 68 69 73 2e 5f 6c 69 73 | t|his._lis|
|00001f60| 74 65 6e 65 72 2e 6f 6e | 52 65 73 75 6c 74 28 74 |tener.on|Result(t|
|00001f70| 68 69 73 2c 20 63 74 78 | 74 2c 20 74 68 69 73 2e |his, ctx|t, this.|
|00001f80| 5f 72 65 73 75 6c 74 29 | 3b 0d 20 20 20 20 20 20 |_result)|;. |
|00001f90| 20 20 20 20 20 20 7d 20 | 63 61 74 63 68 20 28 65 | } |catch (e|
|00001fa0| 78 29 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |x) {. | |
|00001fb0| 20 20 20 20 20 64 65 62 | 75 67 28 27 45 78 63 65 | deb|ug('Exce|
|00001fc0| 70 74 69 6f 6e 20 69 6e | 20 6c 69 73 74 65 6e 65 |ption in| listene|
|00001fd0| 72 2e 6f 6e 52 65 73 75 | 6c 74 3a 20 27 20 2b 20 |r.onResu|lt: ' + |
|00001fe0| 65 78 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ex);. | |
|00001ff0| 20 7d 0d 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | }. | }. |
|00002000| 20 7d 2c 0d 0d 20 20 20 | 20 5f 70 61 72 73 65 72 | },.. | _parser|
|00002010| 3a 20 6e 75 6c 6c 2c 0d | 20 20 20 20 5f 66 6f 75 |: null,.| _fou|
|00002020| 6e 64 46 61 75 6c 74 3a | 20 66 61 6c 73 65 2c 0d |ndFault:| false,.|
|00002030| 20 20 20 20 0d 20 20 20 | 20 2f 2f 20 48 6f 75 73 | . | // Hous|
|00002040| 74 6f 6e 2c 20 77 65 20 | 68 61 76 65 20 64 61 74 |ton, we |have dat|
|00002050| 61 2e 0d 20 20 20 20 6f | 6e 44 61 74 61 41 76 61 |a.. o|nDataAva|
|00002060| 69 6c 61 62 6c 65 3a 20 | 66 75 6e 63 74 69 6f 6e |ilable: |function|
|00002070| 28 63 68 61 6e 6e 65 6c | 2c 20 63 74 78 74 2c 20 |(channel|, ctxt, |
|00002080| 69 6e 53 74 72 2c 20 73 | 6f 75 72 63 65 4f 66 66 |inStr, s|ourceOff|
|00002090| 73 65 74 2c 20 63 6f 75 | 6e 74 29 20 7b 0d 20 20 |set, cou|nt) {. |
|000020a0| 20 20 20 20 20 20 64 65 | 62 75 67 28 27 44 61 74 | de|bug('Dat|
|000020b0| 61 20 61 76 61 69 6c 61 | 62 6c 65 20 28 27 20 2b |a availa|ble (' +|
|000020c0| 20 73 6f 75 72 63 65 4f | 66 66 73 65 74 20 2b 20 | sourceO|ffset + |
|000020d0| 27 2c 20 27 20 2b 20 63 | 6f 75 6e 74 20 2b 20 27 |', ' + c|ount + '|
|000020e0| 29 27 29 3b 0d 20 20 20 | 20 20 20 20 20 69 66 20 |)');. | if |
|000020f0| 28 21 74 68 69 73 2e 5f | 69 6e 50 72 6f 67 72 65 |(!this._|inProgre|
|00002100| 73 73 29 20 72 65 74 75 | 72 6e 3b 20 2f 2f 20 4e |ss) retu|rn; // N|
|00002110| 6f 20 6c 6f 6e 67 65 72 | 20 69 6e 74 65 72 65 73 |o longer| interes|
|00002120| 74 65 64 2e 0d 0d 20 20 | 20 20 20 20 20 20 69 66 |ted... | if|
|00002130| 20 28 21 74 68 69 73 2e | 5f 73 65 65 6e 53 74 61 | (!this.|_seenSta|
|00002140| 72 74 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |rt) {. | |
|00002150| 20 20 2f 2f 20 46 69 72 | 73 74 20 74 69 6d 65 20 | // Fir|st time |
|00002160| 72 6f 75 6e 64 0d 20 20 | 20 20 20 20 20 20 20 20 |round. | |
|00002170| 20 20 74 68 69 73 2e 5f | 73 65 65 6e 53 74 61 72 | this._|seenStar|
|00002180| 74 20 3d 20 74 72 75 65 | 3b 0d 0d 20 20 20 20 20 |t = true|;.. |
|00002190| 20 20 20 20 20 20 20 2f | 2f 20 53 74 6f 72 65 20 | /|/ Store |
|000021a0| 72 65 71 75 65 73 74 20 | 73 74 61 74 75 73 20 61 |request |status a|
|000021b0| 6e 64 20 6d 65 73 73 61 | 67 65 2e 0d 20 20 20 20 |nd messa|ge.. |
|000021c0| 20 20 20 20 20 20 20 20 | 63 68 61 6e 6e 65 6c 20 | |channel |
|000021d0| 3d 20 63 68 61 6e 6e 65 | 6c 0d 20 20 20 20 20 20 |= channe|l. |
|000021e0| 20 20 20 20 20 20 20 20 | 20 20 2e 51 75 65 72 79 | | .Query|
|000021f0| 49 6e 74 65 72 66 61 63 | 65 28 43 6f 6d 70 6f 6e |Interfac|e(Compon|
|00002200| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00002210| 6e 73 49 48 74 74 70 43 | 68 61 6e 6e 65 6c 29 3b |nsIHttpC|hannel);|
|00002220| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 74 68 69 |. | thi|
|00002230| 73 2e 5f 72 65 73 70 6f | 6e 73 65 53 74 61 74 75 |s._respo|nseStatu|
|00002240| 73 20 3d 20 63 68 61 6e | 6e 65 6c 2e 72 65 73 70 |s = chan|nel.resp|
|00002250| 6f 6e 73 65 53 74 61 74 | 75 73 3b 0d 20 20 20 20 |onseStat|us;. |
|00002260| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 72 65 | |this._re|
|00002270| 73 70 6f 6e 73 65 53 74 | 72 69 6e 67 20 3d 20 63 |sponseSt|ring = c|
|00002280| 68 61 6e 6e 65 6c 2e 72 | 65 73 70 6f 6e 73 65 53 |hannel.r|esponseS|
|00002290| 74 72 69 6e 67 3b 0d 0d | 20 20 20 20 20 20 20 20 |tring;..| |
|000022a0| 20 20 20 20 2f 2f 20 43 | 68 65 63 6b 20 66 6f 72 | // C|heck for|
|000022b0| 20 61 20 32 30 30 20 72 | 65 73 70 6f 6e 73 65 2e | a 200 r|esponse.|
|000022c0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|000022d0| 28 63 68 61 6e 6e 65 6c | 2e 72 65 73 70 6f 6e 73 |(channel|.respons|
|000022e0| 65 53 74 61 74 75 73 20 | 21 3d 20 32 30 30 29 20 |eStatus |!= 200) |
|000022f0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00002300| 20 20 74 68 69 73 2e 5f | 73 74 61 74 75 73 20 3d | this._|status =|
|00002310| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 72 65 73 75 | Compone|nts.resu|
|00002320| 6c 74 73 2e 4e 53 5f 45 | 52 52 4f 52 5f 46 41 49 |lts.NS_E|RROR_FAI|
|00002330| 4c 55 52 45 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |LURE;. | |
|00002340| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 65 72 72 6f | th|is._erro|
|00002350| 72 4d 73 67 20 3d 20 27 | 53 65 72 76 65 72 20 72 |rMsg = '|Server r|
|00002360| 65 74 75 72 6e 65 64 20 | 75 6e 65 78 70 65 63 74 |eturned |unexpect|
|00002370| 65 64 20 73 74 61 74 75 | 73 20 27 20 2b 0d 20 20 |ed statu|s ' +. |
|00002380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002390| 20 20 63 68 61 6e 6e 65 | 6c 2e 72 65 73 70 6f 6e | channe|l.respon|
|000023a0| 73 65 53 74 61 74 75 73 | 3b 0d 20 20 20 20 20 20 |seStatus|;. |
|000023b0| 20 20 20 20 20 20 20 20 | 20 20 74 68 69 73 2e 5f | | this._|
|000023c0| 69 6e 50 72 6f 67 72 65 | 73 73 20 3d 20 66 61 6c |inProgre|ss = fal|
|000023d0| 73 65 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |se;. | |
|000023e0| 20 20 20 20 74 72 79 20 | 7b 0d 20 20 20 20 20 20 | try |{. |
|000023f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00002400| 69 73 2e 5f 6c 69 73 74 | 65 6e 65 72 2e 6f 6e 45 |is._list|ener.onE|
|00002410| 72 72 6f 72 28 74 68 69 | 73 2c 20 63 74 78 74 2c |rror(thi|s, ctxt,|
|00002420| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002430| 20 20 20 20 20 20 20 20 | 20 43 6f 6d 70 6f 6e 65 | | Compone|
|00002440| 6e 74 73 2e 72 65 73 75 | 6c 74 73 2e 4e 53 5f 45 |nts.resu|lts.NS_E|
|00002450| 52 52 4f 52 5f 46 41 49 | 4c 55 52 45 2c 0d 20 20 |RROR_FAI|LURE,. |
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002470| 20 20 20 20 20 20 27 53 | 65 72 76 65 72 20 72 65 | 'S|erver re|
|00002480| 74 75 72 6e 65 64 20 75 | 6e 65 78 70 65 63 74 65 |turned u|nexpecte|
|00002490| 64 20 73 74 61 74 75 73 | 20 27 20 2b 0d 20 20 20 |d status| ' +. |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024b0| 20 20 20 20 20 20 20 20 | 20 63 68 61 6e 6e 65 6c | | channel|
|000024c0| 2e 72 65 73 70 6f 6e 73 | 65 53 74 61 74 75 73 29 |.respons|eStatus)|
|000024d0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000024e0| 20 20 7d 20 63 61 74 63 | 68 20 28 65 78 29 20 7b | } catc|h (ex) {|
|000024f0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002500| 20 20 20 20 20 64 65 62 | 75 67 28 27 45 78 63 65 | deb|ug('Exce|
|00002510| 70 74 69 6f 6e 20 69 6e | 20 6c 69 73 74 65 6e 65 |ption in| listene|
|00002520| 72 2e 6f 6e 45 72 72 6f | 72 3a 20 27 20 2b 20 65 |r.onErro|r: ' + e|
|00002530| 78 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |x);. | |
|00002540| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00002550| 20 20 20 20 20 20 72 65 | 74 75 72 6e 3b 0d 20 20 | re|turn;. |
|00002560| 20 20 20 20 20 20 20 20 | 20 20 7d 0d 0d 20 20 20 | | }.. |
|00002570| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 63 68 65 63 | | // chec|
|00002580| 6b 20 63 6f 6e 74 65 6e | 74 20 74 79 70 65 0d 20 |k conten|t type. |
|00002590| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 28 63 | | if (c|
|000025a0| 68 61 6e 6e 65 6c 2e 63 | 6f 6e 74 65 6e 74 54 79 |hannel.c|ontentTy|
|000025b0| 70 65 20 21 3d 20 27 74 | 65 78 74 2f 78 6d 6c 27 |pe != 't|ext/xml'|
|000025c0| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|000025d0| 20 20 20 20 74 68 69 73 | 2e 5f 73 74 61 74 75 73 | this|._status|
|000025e0| 20 3d 20 43 6f 6d 70 6f | 6e 65 6e 74 73 2e 72 65 | = Compo|nents.re|
|000025f0| 73 75 6c 74 73 2e 4e 53 | 5f 45 52 52 4f 52 5f 46 |sults.NS|_ERROR_F|
|00002600| 41 49 4c 55 52 45 3b 0d | 20 20 20 20 20 20 20 20 |AILURE;.| |
|00002610| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 65 72 | |this._er|
|00002620| 72 6f 72 4d 73 67 20 3d | 20 27 53 65 72 76 65 72 |rorMsg =| 'Server|
|00002630| 20 72 65 74 75 72 6e 65 | 64 20 75 6e 65 78 70 65 | returne|d unexpe|
|00002640| 63 74 65 64 20 63 6f 6e | 74 65 6e 74 2d 74 79 70 |cted con|tent-typ|
|00002650| 65 20 27 20 2b 0d 20 20 | 20 20 20 20 20 20 20 20 |e ' +. | |
|00002660| 20 20 20 20 20 20 20 20 | 20 20 63 68 61 6e 6e 65 | | channe|
|00002670| 6c 2e 63 6f 6e 74 65 6e | 74 54 79 70 65 3b 0d 20 |l.conten|tType;. |
|00002680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|00002690| 68 69 73 2e 5f 69 6e 50 | 72 6f 67 72 65 73 73 20 |his._inP|rogress |
|000026a0| 3d 20 66 61 6c 73 65 3b | 0d 20 20 20 20 20 20 20 |= false;|. |
|000026b0| 20 20 20 20 20 20 20 20 | 20 74 72 79 20 7b 0d 20 | | try {. |
|000026c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000026d0| 20 20 20 74 68 69 73 2e | 5f 6c 69 73 74 65 6e 65 | this.|_listene|
|000026e0| 72 2e 6f 6e 45 72 72 6f | 72 28 74 68 69 73 2c 20 |r.onErro|r(this, |
|000026f0| 63 74 78 74 2c 0d 20 20 | 20 20 20 20 20 20 20 20 |ctxt,. | |
|00002700| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 43 6f | | Co|
|00002710| 6d 70 6f 6e 65 6e 74 73 | 2e 72 65 73 75 6c 74 73 |mponents|.results|
|00002720| 2e 4e 53 5f 45 52 52 4f | 52 5f 46 41 49 4c 55 52 |.NS_ERRO|R_FAILUR|
|00002730| 45 2c 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |E,. | |
|00002740| 20 20 20 20 20 20 20 20 | 20 20 20 27 53 65 72 76 | | 'Serv|
|00002750| 65 72 20 72 65 74 75 72 | 6e 65 64 20 75 6e 65 78 |er retur|ned unex|
|00002760| 70 65 63 74 65 64 20 63 | 6f 6e 74 65 6e 74 2d 74 |pected c|ontent-t|
|00002770| 79 70 65 20 27 20 2b 0d | 20 20 20 20 20 20 20 20 |ype ' +.| |
|00002780| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002790| 20 20 20 20 63 68 61 6e | 6e 65 6c 2e 63 6f 6e 74 | chan|nel.cont|
|000027a0| 65 6e 74 54 79 70 65 29 | 3b 0d 20 20 20 20 20 20 |entType)|;. |
|000027b0| 20 20 20 20 20 20 20 20 | 20 20 7d 20 63 61 74 63 | | } catc|
|000027c0| 68 20 28 65 78 29 20 7b | 0d 20 20 20 20 20 20 20 |h (ex) {|. |
|000027d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 64 65 62 | | deb|
|000027e0| 75 67 28 27 45 78 63 65 | 70 74 69 6f 6e 20 69 6e |ug('Exce|ption in|
|000027f0| 20 6c 69 73 74 65 6e 65 | 72 2e 6f 6e 45 72 72 6f | listene|r.onErro|
|00002800| 72 3a 20 27 20 2b 20 65 | 78 29 3b 0d 20 20 20 20 |r: ' + e|x);. |
|00002810| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 | | }. |
|00002820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 | | re|
|00002830| 74 75 72 6e 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |turn;. | |
|00002840| 20 20 7d 0d 0d 20 20 20 | 20 20 20 20 20 20 20 20 | }.. | |
|00002850| 20 64 65 62 75 67 28 27 | 56 69 61 62 6c 65 20 72 | debug('|Viable r|
|00002860| 65 73 70 6f 6e 73 65 2e | 20 4c 65 74 5c 27 73 20 |esponse.| Let\'s |
|00002870| 70 61 72 73 65 21 27 29 | 3b 0d 20 20 20 20 20 20 |parse!')|;. |
|00002880| 20 20 20 20 20 20 64 65 | 62 75 67 28 27 43 6f 6e | de|bug('Con|
|00002890| 74 65 6e 74 20 6c 65 6e | 67 74 68 20 3d 20 27 20 |tent len|gth = ' |
|000028a0| 2b 20 63 68 61 6e 6e 65 | 6c 2e 63 6f 6e 74 65 6e |+ channe|l.conten|
|000028b0| 74 4c 65 6e 67 74 68 29 | 3b 0d 20 20 20 20 20 20 |tLength)|;. |
|000028c0| 20 20 20 20 20 20 0d 20 | 20 20 20 20 20 20 20 20 | . | |
|000028d0| 20 20 20 74 68 69 73 2e | 5f 70 61 72 73 65 72 20 | this.|_parser |
|000028e0| 3d 20 6e 65 77 20 53 69 | 6d 70 6c 65 58 4d 4c 50 |= new Si|mpleXMLP|
|000028f0| 61 72 73 65 72 28 74 6f | 53 63 72 69 70 74 61 62 |arser(to|Scriptab|
|00002900| 6c 65 53 74 72 65 61 6d | 28 69 6e 53 74 72 29 2c |leStream|(inStr),|
|00002910| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002920| 20 63 68 61 6e 6e 65 6c | 2e 63 6f 6e 74 65 6e 74 | channel|.content|
|00002930| 4c 65 6e 67 74 68 29 3b | 0d 20 20 20 20 20 20 20 |Length);|. |
|00002940| 20 20 20 20 20 74 68 69 | 73 2e 5f 70 61 72 73 65 | thi|s._parse|
|00002950| 72 2e 73 65 74 44 6f 63 | 75 6d 65 6e 74 48 61 6e |r.setDoc|umentHan|
|00002960| 64 6c 65 72 28 74 68 69 | 73 29 3b 0d 0d 20 20 20 |dler(thi|s);.. |
|00002970| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 4d 61 6b 65 | | // Make|
|00002980| 20 73 75 72 65 20 73 74 | 61 74 65 20 69 73 20 63 | sure st|ate is c|
|00002990| 6c 65 61 6e 0d 20 20 20 | 20 20 20 20 20 20 20 20 |lean. | |
|000029a0| 20 74 68 69 73 2e 5f 76 | 61 6c 75 65 53 74 61 63 | this._v|alueStac|
|000029b0| 6b 20 3d 20 5b 5d 3b 0d | 20 20 20 20 20 20 20 20 |k = [];.| |
|000029c0| 20 20 20 20 74 68 69 73 | 2e 5f 63 75 72 72 56 61 | this|._currVa|
|000029d0| 6c 75 65 20 3d 20 6e 75 | 6c 6c 3b 0d 20 20 20 20 |lue = nu|ll;. |
|000029e0| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 63 64 | |this._cd|
|000029f0| 61 74 61 20 3d 20 6e 75 | 6c 6c 3b 0d 20 20 20 20 |ata = nu|ll;. |
|00002a00| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 66 6f | |this._fo|
|00002a10| 75 6e 64 46 61 75 6c 74 | 20 3d 20 66 61 6c 73 65 |undFault| = false|
|00002a20| 3b 0d 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 |;. | }. |
|00002a30| 20 20 20 20 0d 20 20 20 | 20 20 20 20 20 64 65 62 | . | deb|
|00002a40| 75 67 28 27 43 72 61 6e | 6b 69 6e 67 20 75 70 20 |ug('Cran|king up |
|00002a50| 74 68 65 20 70 61 72 73 | 65 72 2c 20 77 69 6e 64 |the pars|er, wind|
|00002a60| 6f 77 20 3d 20 27 20 2b | 20 63 6f 75 6e 74 29 3b |ow = ' +| count);|
|00002a70| 0d 20 20 20 20 20 20 20 | 20 74 72 79 20 7b 0d 20 |. | try {. |
|00002a80| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 69 73 2e | | this.|
|00002a90| 5f 70 61 72 73 65 72 2e | 70 61 72 73 65 28 63 6f |_parser.|parse(co|
|00002aa0| 75 6e 74 29 3b 0d 20 20 | 20 20 20 20 20 20 7d 20 |unt);. | } |
|00002ab0| 63 61 74 63 68 28 65 78 | 29 20 7b 0d 20 20 20 20 |catch(ex|) {. |
|00002ac0| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 28 27 50 | |debug('P|
|00002ad0| 61 72 73 65 72 20 65 78 | 63 65 70 74 69 6f 6e 3a |arser ex|ception:|
|00002ae0| 20 27 20 2b 20 65 78 29 | 3b 0d 20 20 20 20 20 20 | ' + ex)|;. |
|00002af0| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 73 74 61 74 | th|is._stat|
|00002b00| 75 73 20 3d 20 65 78 2e | 72 65 73 75 6c 74 3b 0d |us = ex.|result;.|
|00002b10| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|00002b20| 2e 5f 65 72 72 6f 72 4d | 73 67 20 3d 20 65 78 2e |._errorM|sg = ex.|
|00002b30| 6d 65 73 73 61 67 65 3b | 0d 20 20 20 20 20 20 20 |message;|. |
|00002b40| 20 20 20 20 20 74 72 79 | 20 7b 0d 20 20 20 20 20 | try| {. |
|00002b50| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 69 73 2e | | this.|
|00002b60| 5f 6c 69 73 74 65 6e 65 | 72 2e 6f 6e 45 72 72 6f |_listene|r.onErro|
|00002b70| 72 28 74 68 69 73 2c 20 | 63 74 78 74 2c 20 65 78 |r(this, |ctxt, ex|
|00002b80| 2e 72 65 73 75 6c 74 2c | 20 65 78 2e 6d 65 73 73 |.result,| ex.mess|
|00002b90| 61 67 65 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |age);. | |
|00002ba0| 20 20 7d 20 63 61 74 63 | 68 28 65 78 29 20 7b 0d | } catc|h(ex) {.|
|00002bb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002bc0| 64 65 62 75 67 28 27 45 | 78 63 65 70 74 69 6f 6e |debug('E|xception|
|00002bd0| 20 69 6e 20 6c 69 73 74 | 65 6e 65 72 2e 6f 6e 45 | in list|ener.onE|
|00002be0| 72 72 6f 72 3a 20 27 20 | 2b 20 65 78 29 3b 0d 20 |rror: ' |+ ex);. |
|00002bf0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|00002c00| 20 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 69 | | this._i|
|00002c10| 6e 50 72 6f 67 72 65 73 | 73 20 3d 20 66 61 6c 73 |nProgres|s = fals|
|00002c20| 65 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 74 |e;. | t|
|00002c30| 68 69 73 2e 5f 70 61 72 | 73 65 72 20 3d 20 6e 75 |his._par|ser = nu|
|00002c40| 6c 6c 3b 0d 20 20 20 20 | 20 20 20 20 7d 0d 0d 20 |ll;. | }.. |
|00002c50| 20 20 20 7d 2c 0d 0d 20 | 20 20 20 5f 66 61 75 6c | },.. | _faul|
|00002c60| 74 3a 20 6e 75 6c 6c 2c | 0d 20 20 20 20 5f 72 65 |t: null,|. _re|
|00002c70| 73 75 6c 74 3a 20 6e 75 | 6c 6c 2c 0d 20 20 20 20 |sult: nu|ll,. |
|00002c80| 5f 72 65 73 70 6f 6e 73 | 65 53 74 61 74 75 73 3a |_respons|eStatus:|
|00002c90| 20 6e 75 6c 6c 2c 0d 20 | 20 20 20 5f 72 65 73 70 | null,. | _resp|
|00002ca0| 6f 6e 73 65 53 74 72 69 | 6e 67 3a 20 6e 75 6c 6c |onseStri|ng: null|
|00002cb0| 2c 0d 0d 20 20 20 20 67 | 65 74 20 66 61 75 6c 74 |,.. g|et fault|
|00002cc0| 28 29 20 7b 20 72 65 74 | 75 72 6e 20 74 68 69 73 |() { ret|urn this|
|00002cd0| 2e 5f 66 61 75 6c 74 3b | 20 7d 2c 0d 20 20 20 20 |._fault;| },. |
|00002ce0| 67 65 74 20 72 65 73 75 | 6c 74 28 29 20 7b 20 72 |get resu|lt() { r|
|00002cf0| 65 74 75 72 6e 20 74 68 | 69 73 2e 5f 72 65 73 75 |eturn th|is._resu|
|00002d00| 6c 74 3b 20 7d 2c 0d 20 | 20 20 20 67 65 74 20 72 |lt; },. | get r|
|00002d10| 65 73 70 6f 6e 73 65 53 | 74 61 74 75 73 28 29 20 |esponseS|tatus() |
|00002d20| 7b 20 72 65 74 75 72 6e | 20 74 68 69 73 2e 5f 72 |{ return| this._r|
|00002d30| 65 73 70 6f 6e 73 65 53 | 74 61 74 75 73 3b 20 7d |esponseS|tatus; }|
|00002d40| 2c 0d 20 20 20 20 67 65 | 74 20 72 65 73 70 6f 6e |,. ge|t respon|
|00002d50| 73 65 53 74 72 69 6e 67 | 28 29 20 7b 20 72 65 74 |seString|() { ret|
|00002d60| 75 72 6e 20 74 68 69 73 | 2e 5f 72 65 73 70 6f 6e |urn this|._respon|
|00002d70| 73 65 53 74 72 69 6e 67 | 3b 20 7d 2c 0d 0d 20 20 |seString|; },.. |
|00002d80| 20 20 2f 2a 20 43 6f 6e | 76 65 6e 69 65 6e 63 65 | /* Con|venience|
|00002d90| 2e 20 43 72 65 61 74 65 | 20 61 6e 20 61 70 70 72 |. Create| an appr|
|00002da0| 6f 70 72 69 61 74 65 20 | 58 50 43 4f 4d 20 6f 62 |opriate |XPCOM ob|
|00002db0| 6a 65 63 74 20 66 6f 72 | 20 61 20 67 69 76 65 6e |ject for| a given|
|00002dc0| 20 74 79 70 65 20 2a 2f | 0d 20 20 20 20 49 4e 54 | type */|. INT|
|00002dd0| 3a 20 20 20 20 20 20 31 | 2c 0d 20 20 20 20 42 4f |: 1|,. BO|
|00002de0| 4f 4c 45 41 4e 3a 20 20 | 32 2c 0d 20 20 20 20 53 |OLEAN: |2,. S|
|00002df0| 54 52 49 4e 47 3a 20 20 | 20 33 2c 0d 20 20 20 20 |TRING: | 3,. |
|00002e00| 44 4f 55 42 4c 45 3a 20 | 20 20 34 2c 0d 20 20 20 |DOUBLE: | 4,. |
|00002e10| 20 44 41 54 45 54 49 4d | 45 3a 20 35 2c 0d 20 20 | DATETIM|E: 5,. |
|00002e20| 20 20 41 52 52 41 59 3a | 20 20 20 20 36 2c 0d 20 | ARRAY:| 6,. |
|00002e30| 20 20 20 53 54 52 55 43 | 54 3a 20 20 20 37 2c 0d | STRUC|T: 7,.|
|00002e40| 20 20 20 20 42 41 53 45 | 36 34 3a 20 20 20 38 2c | BASE|64: 8,|
|00002e50| 20 2f 2f 20 4e 6f 74 20 | 70 61 72 74 20 6f 66 20 | // Not |part of |
|00002e60| 6e 73 49 58 6d 6c 52 70 | 63 43 6c 69 65 6e 74 20 |nsIXmlRp|cClient |
|00002e70| 69 6e 74 65 72 66 61 63 | 65 2c 20 69 6e 74 65 72 |interfac|e, inter|
|00002e80| 6e 61 6c 20 75 73 65 2e | 0d 20 20 20 20 63 72 65 |nal use.|. cre|
|00002e90| 61 74 65 54 79 70 65 3a | 20 66 75 6e 63 74 69 6f |ateType:| functio|
|00002ea0| 6e 28 74 79 70 65 2c 20 | 75 75 69 64 29 20 7b 0d |n(type, |uuid) {.|
|00002eb0| 20 20 20 20 20 20 20 20 | 63 6f 6e 73 74 20 53 55 | |const SU|
|00002ec0| 50 50 4f 52 54 53 49 44 | 20 3d 20 27 40 6d 6f 7a |PPORTSID| = '@moz|
|00002ed0| 69 6c 6c 61 2e 6f 72 67 | 2f 73 75 70 70 6f 72 74 |illa.org|/support|
|00002ee0| 73 2d 27 3b 0d 20 20 20 | 20 20 20 20 20 73 77 69 |s-';. | swi|
|00002ef0| 74 63 68 28 74 79 70 65 | 29 20 7b 0d 20 20 20 20 |tch(type|) {. |
|00002f00| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 74 68 69 | |case thi|
|00002f10| 73 2e 49 4e 54 3a 0d 20 | 20 20 20 20 20 20 20 20 |s.INT:. | |
|00002f20| 20 20 20 20 20 20 20 75 | 75 69 64 2e 76 61 6c 75 | u|uid.valu|
|00002f30| 65 20 3d 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |e = Comp|onents.i|
|00002f40| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 53 75 70 |nterface|s.nsISup|
|00002f50| 70 6f 72 74 73 50 52 49 | 6e 74 33 32 0d 20 20 20 |portsPRI|nt32. |
|00002f60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 | | ret|
|00002f70| 75 72 6e 20 63 72 65 61 | 74 65 49 6e 73 74 61 6e |urn crea|teInstan|
|00002f80| 63 65 28 53 55 50 50 4f | 52 54 53 49 44 20 2b 20 |ce(SUPPO|RTSID + |
|00002f90| 27 50 52 49 6e 74 33 32 | 3b 31 27 2c 0d 20 20 20 |'PRInt32|;1',. |
|00002fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002fb0| 20 27 6e 73 49 53 75 70 | 70 6f 72 74 73 50 52 49 | 'nsISup|portsPRI|
|00002fc0| 6e 74 33 32 27 29 3b 0d | 0d 20 20 20 20 20 20 20 |nt32');.|. |
|00002fd0| 20 20 20 20 20 63 61 73 | 65 20 74 68 69 73 2e 42 | cas|e this.B|
|00002fe0| 4f 4f 4c 45 41 4e 3a 0d | 20 20 20 20 20 20 20 20 |OOLEAN:.| |
|00002ff0| 20 20 20 20 20 20 20 20 | 75 75 69 64 2e 76 61 6c | |uuid.val|
|00003000| 75 65 20 3d 20 43 6f 6d | 70 6f 6e 65 6e 74 73 2e |ue = Com|ponents.|
|00003010| 69 6e 74 65 72 66 61 63 | 65 73 2e 6e 73 49 53 75 |interfac|es.nsISu|
|00003020| 70 70 6f 72 74 73 50 52 | 42 6f 6f 6c 0d 20 20 20 |pportsPR|Bool. |
|00003030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 | | ret|
|00003040| 75 72 6e 20 63 72 65 61 | 74 65 49 6e 73 74 61 6e |urn crea|teInstan|
|00003050| 63 65 28 53 55 50 50 4f | 52 54 53 49 44 20 2b 20 |ce(SUPPO|RTSID + |
|00003060| 27 50 52 42 6f 6f 6c 3b | 31 27 2c 0d 20 20 20 20 |'PRBool;|1',. |
|00003070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003080| 27 6e 73 49 53 75 70 70 | 6f 72 74 73 50 52 42 6f |'nsISupp|ortsPRBo|
|00003090| 6f 6c 27 29 3b 0d 0d 20 | 20 20 20 20 20 20 20 20 |ol');.. | |
|000030a0| 20 20 20 63 61 73 65 20 | 74 68 69 73 2e 53 54 52 | case |this.STR|
|000030b0| 49 4e 47 3a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ING:. | |
|000030c0| 20 20 20 20 20 75 75 69 | 64 2e 76 61 6c 75 65 20 | uui|d.value |
|000030d0| 3d 20 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |= Compon|ents.int|
|000030e0| 65 72 66 61 63 65 73 2e | 6e 73 49 53 75 70 70 6f |erfaces.|nsISuppo|
|000030f0| 72 74 73 43 53 74 72 69 | 6e 67 0d 20 20 20 20 20 |rtsCStri|ng. |
|00003100| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 | | retur|
|00003110| 6e 20 63 72 65 61 74 65 | 49 6e 73 74 61 6e 63 65 |n create|Instance|
|00003120| 28 53 55 50 50 4f 52 54 | 53 49 44 20 2b 20 27 63 |(SUPPORT|SID + 'c|
|00003130| 73 74 72 69 6e 67 3b 31 | 27 2c 0d 20 20 20 20 20 |string;1|',. |
|00003140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 27 | | '|
|00003150| 6e 73 49 53 75 70 70 6f | 72 74 73 43 53 74 72 69 |nsISuppo|rtsCStri|
|00003160| 6e 67 27 29 3b 0d 0d 20 | 20 20 20 20 20 20 20 20 |ng');.. | |
|00003170| 20 20 20 63 61 73 65 20 | 74 68 69 73 2e 44 4f 55 | case |this.DOU|
|00003180| 42 4c 45 3a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |BLE:. | |
|00003190| 20 20 20 20 20 75 75 69 | 64 2e 76 61 6c 75 65 20 | uui|d.value |
|000031a0| 3d 20 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |= Compon|ents.int|
|000031b0| 65 72 66 61 63 65 73 2e | 6e 73 49 53 75 70 70 6f |erfaces.|nsISuppo|
|000031c0| 72 74 73 44 6f 75 62 6c | 65 0d 20 20 20 20 20 20 |rtsDoubl|e. |
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|000031e0| 20 63 72 65 61 74 65 49 | 6e 73 74 61 6e 63 65 28 | createI|nstance(|
|000031f0| 53 55 50 50 4f 52 54 53 | 49 44 20 2b 20 27 64 6f |SUPPORTS|ID + 'do|
|00003200| 75 62 6c 65 3b 31 27 2c | 0d 20 20 20 20 20 20 20 |uble;1',|. |
|00003210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 27 6e 73 | | 'ns|
|00003220| 49 53 75 70 70 6f 72 74 | 73 44 6f 75 62 6c 65 27 |ISupport|sDouble'|
|00003230| 29 3b 0d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |);.. | |
|00003240| 63 61 73 65 20 74 68 69 | 73 2e 44 41 54 45 54 49 |case thi|s.DATETI|
|00003250| 4d 45 3a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ME:. | |
|00003260| 20 20 20 20 75 75 69 64 | 2e 76 61 6c 75 65 20 3d | uuid|.value =|
|00003270| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 | Compone|nts.inte|
|00003280| 72 66 61 63 65 73 2e 6e | 73 49 53 75 70 70 6f 72 |rfaces.n|sISuppor|
|00003290| 74 73 50 52 54 69 6d 65 | 0d 20 20 20 20 20 20 20 |tsPRTime|. |
|000032a0| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|000032b0| 63 72 65 61 74 65 49 6e | 73 74 61 6e 63 65 28 53 |createIn|stance(S|
|000032c0| 55 50 50 4f 52 54 53 49 | 44 20 2b 20 27 50 52 54 |UPPORTSI|D + 'PRT|
|000032d0| 69 6d 65 3b 31 27 2c 0d | 20 20 20 20 20 20 20 20 |ime;1',.| |
|000032e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 27 6e 73 49 | | 'nsI|
|000032f0| 53 75 70 70 6f 72 74 73 | 50 52 54 69 6d 65 27 29 |Supports|PRTime')|
|00003300| 3b 0d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 63 |;.. | c|
|00003310| 61 73 65 20 74 68 69 73 | 2e 41 52 52 41 59 3a 0d |ase this|.ARRAY:.|
|00003320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003330| 75 75 69 64 2e 76 61 6c | 75 65 20 3d 20 43 6f 6d |uuid.val|ue = Com|
|00003340| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00003350| 65 73 2e 6e 73 49 53 75 | 70 70 6f 72 74 73 41 72 |es.nsISu|pportsAr|
|00003360| 72 61 79 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ray. | |
|00003370| 20 20 20 20 72 65 74 75 | 72 6e 20 63 72 65 61 74 | retu|rn creat|
|00003380| 65 49 6e 73 74 61 6e 63 | 65 28 53 55 50 50 4f 52 |eInstanc|e(SUPPOR|
|00003390| 54 53 49 44 20 2b 20 27 | 61 72 72 61 79 3b 31 27 |TSID + '|array;1'|
|000033a0| 2c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |,. | |
|000033b0| 20 20 20 20 20 20 27 6e | 73 49 53 75 70 70 6f 72 | 'n|sISuppor|
|000033c0| 74 73 41 72 72 61 79 27 | 29 3b 0d 0d 20 20 20 20 |tsArray'|);.. |
|000033d0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 74 68 69 | |case thi|
|000033e0| 73 2e 53 54 52 55 43 54 | 3a 0d 20 20 20 20 20 20 |s.STRUCT|:. |
|000033f0| 20 20 20 20 20 20 20 20 | 20 20 75 75 69 64 2e 76 | | uuid.v|
|00003400| 61 6c 75 65 20 3d 20 43 | 6f 6d 70 6f 6e 65 6e 74 |alue = C|omponent|
|00003410| 73 2e 69 6e 74 65 72 66 | 61 63 65 73 2e 6e 73 49 |s.interf|aces.nsI|
|00003420| 44 69 63 74 69 6f 6e 61 | 72 79 0d 20 20 20 20 20 |Dictiona|ry. |
|00003430| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 | | retur|
|00003440| 6e 20 63 72 65 61 74 65 | 49 6e 73 74 61 6e 63 65 |n create|Instance|
|00003450| 28 27 40 6d 6f 7a 69 6c | 6c 61 2e 6f 72 67 2f 64 |('@mozil|la.org/d|
|00003460| 69 63 74 69 6f 6e 61 72 | 79 3b 31 27 2c 20 0d 20 |ictionar|y;1', . |
|00003470| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003480| 20 20 20 27 6e 73 49 44 | 69 63 74 69 6f 6e 61 72 | 'nsID|ictionar|
|00003490| 79 27 29 3b 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |y');.. | |
|000034a0| 20 20 64 65 66 61 75 6c | 74 3a 20 74 68 72 6f 77 | defaul|t: throw|
|000034b0| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 45 78 63 65 | Compone|nts.Exce|
|000034c0| 70 74 69 6f 6e 28 27 55 | 6e 73 75 70 70 6f 72 74 |ption('U|nsupport|
|000034d0| 65 64 20 74 79 70 65 27 | 29 3b 0d 20 20 20 20 20 |ed type'|);. |
|000034e0| 20 20 20 7d 0d 20 20 20 | 20 7d 2c 0d 0d 20 20 20 | }. | },.. |
|000034f0| 20 2f 2f 20 6e 73 49 53 | 75 70 70 6f 72 74 73 20 | // nsIS|upports |
|00003500| 69 6e 74 65 72 66 61 63 | 65 0d 20 20 20 20 51 75 |interfac|e. Qu|
|00003510| 65 72 79 49 6e 74 65 72 | 66 61 63 65 3a 20 66 75 |eryInter|face: fu|
|00003520| 6e 63 74 69 6f 6e 28 69 | 69 64 29 20 7b 0d 20 20 |nction(i|id) {. |
|00003530| 20 20 20 20 20 20 69 66 | 20 28 21 69 69 64 2e 65 | if| (!iid.e|
|00003540| 71 75 61 6c 73 28 43 6f | 6d 70 6f 6e 65 6e 74 73 |quals(Co|mponents|
|00003550| 2e 69 6e 74 65 72 66 61 | 63 65 73 2e 6e 73 49 53 |.interfa|ces.nsIS|
|00003560| 75 70 70 6f 72 74 73 29 | 20 26 26 0d 20 20 20 20 |upports)| &&. |
|00003570| 20 20 20 20 20 20 20 20 | 21 69 69 64 2e 65 71 75 | |!iid.equ|
|00003580| 61 6c 73 28 58 4d 4c 52 | 50 43 43 4c 49 45 4e 54 |als(XMLR|PCCLIENT|
|00003590| 5f 49 49 44 29 20 26 26 | 0d 20 20 20 20 20 20 20 |_IID) &&|. |
|000035a0| 20 20 20 20 20 21 69 69 | 64 2e 65 71 75 61 6c 73 | !ii|d.equals|
|000035b0| 28 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 |(Compone|nts.inte|
|000035c0| 72 66 61 63 65 73 2e 6e | 73 49 58 6d 6c 52 70 63 |rfaces.n|sIXmlRpc|
|000035d0| 43 6c 69 65 6e 74 4c 69 | 73 74 65 6e 65 72 29 20 |ClientLi|stener) |
|000035e0| 26 26 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 21 |&&. | !|
|000035f0| 69 69 64 2e 65 71 75 61 | 6c 73 28 43 6f 6d 70 6f |iid.equa|ls(Compo|
|00003600| 6e 65 6e 74 73 2e 69 6e | 74 65 72 66 61 63 65 73 |nents.in|terfaces|
|00003610| 2e 6e 73 49 52 65 71 75 | 65 73 74 4f 62 73 65 72 |.nsIRequ|estObser|
|00003620| 76 65 72 29 20 26 26 0d | 20 20 20 20 20 20 20 20 |ver) &&.| |
|00003630| 20 20 20 20 21 69 69 64 | 2e 65 71 75 61 6c 73 28 | !iid|.equals(|
|00003640| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00003650| 66 61 63 65 73 2e 6e 73 | 49 53 74 72 65 61 6d 4c |faces.ns|IStreamL|
|00003660| 69 73 74 65 6e 65 72 29 | 20 26 26 0d 20 20 20 20 |istener)| &&. |
|00003670| 20 20 20 20 20 20 20 20 | 21 69 69 64 2e 65 71 75 | |!iid.equ|
|00003680| 61 6c 73 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |als(Comp|onents.i|
|00003690| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 49 6e 74 |nterface|s.nsIInt|
|000036a0| 65 72 66 61 63 65 52 65 | 71 75 65 73 74 6f 72 29 |erfaceRe|questor)|
|000036b0| 29 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 |). | th|
|000036c0| 72 6f 77 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 72 |row Comp|onents.r|
|000036d0| 65 73 75 6c 74 73 2e 4e | 53 5f 45 52 52 4f 52 5f |esults.N|S_ERROR_|
|000036e0| 4e 4f 5f 49 4e 54 45 52 | 46 41 43 45 3b 0d 20 20 |NO_INTER|FACE;. |
|000036f0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 74 68 69 | re|turn thi|
|00003700| 73 3b 0d 20 20 20 20 7d | 2c 0d 0d 20 20 20 20 2f |s;. }|,.. /|
|00003710| 2f 20 6e 73 49 49 6e 74 | 65 72 66 61 63 65 52 65 |/ nsIInt|erfaceRe|
|00003720| 71 75 65 73 74 65 72 20 | 69 6e 74 65 72 66 61 63 |quester |interfac|
|00003730| 65 0d 20 20 20 20 67 65 | 74 49 6e 74 65 72 66 61 |e. ge|tInterfa|
|00003740| 63 65 3a 20 66 75 6e 63 | 74 69 6f 6e 28 69 69 64 |ce: func|tion(iid|
|00003750| 2c 20 72 65 73 75 6c 74 | 29 7b 0d 20 20 20 20 20 |, result|){. |
|00003760| 20 20 20 69 66 20 28 69 | 69 64 2e 65 71 75 61 6c | if (i|id.equal|
|00003770| 73 28 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |s(Compon|ents.int|
|00003780| 65 72 66 61 63 65 73 2e | 6e 73 49 41 75 74 68 50 |erfaces.|nsIAuthP|
|00003790| 72 6f 6d 70 74 29 29 7b | 0d 20 20 20 20 20 20 20 |rompt)){|. |
|000037a0| 20 20 20 20 20 72 65 74 | 75 72 6e 20 74 68 69 73 | ret|urn this|
|000037b0| 3b 0d 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 |;. | }. |
|000037c0| 20 20 20 20 72 65 74 75 | 72 6e 20 43 6f 6d 70 6f | retu|rn Compo|
|000037d0| 6e 65 6e 74 73 2e 72 65 | 73 75 6c 74 73 2e 4e 53 |nents.re|sults.NS|
|000037e0| 5f 45 52 52 4f 52 5f 4e | 4f 5f 49 4e 54 45 52 46 |_ERROR_N|O_INTERF|
|000037f0| 41 43 45 3b 0d 20 20 20 | 20 7d 2c 0d 0d 20 20 20 |ACE;. | },.. |
|00003800| 20 2f 2f 20 6e 73 49 41 | 75 74 68 50 72 6f 6d 70 | // nsIA|uthPromp|
|00003810| 74 20 69 6e 74 65 72 66 | 61 63 65 0d 20 20 20 20 |t interf|ace. |
|00003820| 5f 70 61 73 73 77 6f 72 | 64 54 72 69 65 64 3a 20 |_passwor|dTried: |
|00003830| 66 61 6c 73 65 2c 0d 20 | 20 20 20 70 72 6f 6d 70 |false,. | promp|
|00003840| 74 55 73 65 72 6e 61 6d | 65 41 6e 64 50 61 73 73 |tUsernam|eAndPass|
|00003850| 77 6f 72 64 3a 20 66 75 | 6e 63 74 69 6f 6e 28 64 |word: fu|nction(d|
|00003860| 69 61 6c 6f 67 54 69 74 | 6c 65 2c 20 74 65 78 74 |ialogTit|le, text|
|00003870| 2c 20 70 61 73 73 77 6f | 72 64 52 65 61 6c 6d 2c |, passwo|rdRealm,|
|00003880| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003890| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000038a0| 20 20 20 20 20 20 20 20 | 20 73 61 76 65 50 61 73 | | savePas|
|000038b0| 73 77 6f 72 64 2c 20 75 | 73 65 72 2c 20 70 77 64 |sword, u|ser, pwd|
|000038c0| 29 7b 0d 0d 20 20 20 20 | 20 20 20 20 69 66 20 28 |){.. | if (|
|000038d0| 74 68 69 73 2e 5f 75 73 | 65 41 75 74 68 29 7b 0d |this._us|eAuth){.|
|000038e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|000038f0| 74 68 69 73 2e 5f 70 61 | 73 73 77 6f 72 64 54 72 |this._pa|sswordTr|
|00003900| 69 65 64 29 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |ied){. | |
|00003910| 20 20 20 20 20 20 74 72 | 79 20 7b 20 0d 20 20 20 | tr|y { . |
|00003920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003930| 20 74 68 69 73 2e 5f 6c | 69 73 74 65 6e 65 72 2e | this._l|istener.|
|00003940| 6f 6e 45 72 72 6f 72 28 | 74 68 69 73 2c 20 63 74 |onError(|this, ct|
|00003950| 78 74 2c 20 0d 20 20 20 | 20 20 20 20 20 20 20 20 |xt, . | |
|00003960| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 43 6f 6d | | Com|
|00003970| 70 6f 6e 65 6e 74 73 2e | 72 65 73 75 6c 74 73 2e |ponents.|results.|
|00003980| 4e 53 5f 45 52 52 4f 52 | 5f 46 41 49 4c 2c 20 0d |NS_ERROR|_FAIL, .|
|00003990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000039a0| 20 20 20 20 20 20 20 20 | 27 53 65 72 76 65 72 20 | |'Server |
|000039b0| 72 65 74 75 72 6e 65 64 | 20 69 6e 76 61 6c 69 64 |returned| invalid|
|000039c0| 20 46 61 75 6c 74 27 29 | 3b 0d 20 20 20 20 20 20 | Fault')|;. |
|000039d0| 20 20 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 | | }. |
|000039e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 74 63 | | catc|
|000039f0| 68 28 65 78 29 20 7b 0d | 20 20 20 20 20 20 20 20 |h(ex) {.| |
|00003a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 65 62 75 | | debu|
|00003a10| 67 28 27 45 78 63 65 70 | 74 69 6f 6e 20 69 6e 20 |g('Excep|tion in |
|00003a20| 6c 69 73 74 65 6e 65 72 | 2e 6f 6e 45 72 72 6f 72 |listener|.onError|
|00003a30| 3a 20 27 20 2b 20 65 78 | 29 3b 0d 20 20 20 20 20 |: ' + ex|);. |
|00003a40| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|00003a50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 | | ret|
|00003a60| 75 72 6e 20 66 61 6c 73 | 65 3b 0d 20 20 20 20 20 |urn fals|e;. |
|00003a70| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 20 20 20 | }|. |
|00003a80| 20 20 20 20 20 75 73 65 | 72 2e 76 61 6c 75 65 20 | use|r.value |
|00003a90| 3d 20 74 68 69 73 2e 5f | 75 73 65 72 6e 61 6d 65 |= this._|username|
|00003aa0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 70 77 |;. | pw|
|00003ab0| 64 2e 76 61 6c 75 65 20 | 3d 20 74 68 69 73 2e 5f |d.value |= this._|
|00003ac0| 70 61 73 73 77 6f 72 64 | 3b 0d 20 20 20 20 20 20 |password|;. |
|00003ad0| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 70 61 73 73 | th|is._pass|
|00003ae0| 77 6f 72 64 54 72 69 65 | 64 20 3d 20 74 72 75 65 |wordTrie|d = true|
|00003af0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 |;. | re|
|00003b00| 74 75 72 6e 20 74 72 75 | 65 3b 0d 20 20 20 20 20 |turn tru|e;. |
|00003b10| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 72 65 74 | }. | ret|
|00003b20| 75 72 6e 20 66 61 6c 73 | 65 3b 0d 20 20 20 20 7d |urn fals|e;. }|
|00003b30| 2c 0d 0d 20 20 20 20 2f | 2a 20 47 65 6e 65 72 61 |,.. /|* Genera|
|00003b40| 74 65 20 74 68 65 20 58 | 4d 4c 2d 52 50 43 20 72 |te the X|ML-RPC r|
|00003b50| 65 71 75 65 73 74 20 62 | 6f 64 79 20 2a 2f 0d 20 |equest b|ody */. |
|00003b60| 20 20 20 5f 67 65 6e 65 | 72 61 74 65 52 65 71 75 | _gene|rateRequ|
|00003b70| 65 73 74 42 6f 64 79 3a | 20 66 75 6e 63 74 69 6f |estBody:| functio|
|00003b80| 6e 28 77 72 69 74 65 72 | 2c 20 6d 65 74 68 6f 64 |n(writer|, method|
|00003b90| 4e 61 6d 65 2c 20 6d 65 | 74 68 6f 64 41 72 67 73 |Name, me|thodArgs|
|00003ba0| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 77 72 69 74 |) {. | writ|
|00003bb0| 65 72 2e 73 74 61 72 74 | 45 6c 65 6d 65 6e 74 28 |er.start|Element(|
|00003bc0| 27 6d 65 74 68 6f 64 43 | 61 6c 6c 27 29 3b 0d 0d |'methodC|all');..|
|00003bd0| 20 20 20 20 20 20 20 20 | 77 72 69 74 65 72 2e 73 | |writer.s|
|00003be0| 74 61 72 74 45 6c 65 6d | 65 6e 74 28 27 6d 65 74 |tartElem|ent('met|
|00003bf0| 68 6f 64 4e 61 6d 65 27 | 29 3b 0d 20 20 20 20 20 |hodName'|);. |
|00003c00| 20 20 20 77 72 69 74 65 | 72 2e 77 72 69 74 65 28 | write|r.write(|
|00003c10| 6d 65 74 68 6f 64 4e 61 | 6d 65 29 3b 0d 20 20 20 |methodNa|me);. |
|00003c20| 20 20 20 20 20 77 72 69 | 74 65 72 2e 65 6e 64 45 | wri|ter.endE|
|00003c30| 6c 65 6d 65 6e 74 28 27 | 6d 65 74 68 6f 64 4e 61 |lement('|methodNa|
|00003c40| 6d 65 27 29 3b 0d 0d 20 | 20 20 20 20 20 20 20 77 |me');.. | w|
|00003c50| 72 69 74 65 72 2e 73 74 | 61 72 74 45 6c 65 6d 65 |riter.st|artEleme|
|00003c60| 6e 74 28 27 70 61 72 61 | 6d 73 27 29 3b 0d 20 20 |nt('para|ms');. |
|00003c70| 20 20 20 20 20 20 66 6f | 72 20 28 76 61 72 20 69 | fo|r (var i|
|00003c80| 20 69 6e 20 6d 65 74 68 | 6f 64 41 72 67 73 29 20 | in meth|odArgs) |
|00003c90| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 77 72 |{. | wr|
|00003ca0| 69 74 65 72 2e 73 74 61 | 72 74 45 6c 65 6d 65 6e |iter.sta|rtElemen|
|00003cb0| 74 28 27 70 61 72 61 6d | 27 29 3b 0d 20 20 20 20 |t('param|');. |
|00003cc0| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 67 65 | |this._ge|
|00003cd0| 6e 65 72 61 74 65 41 72 | 67 75 6d 65 6e 74 42 6f |nerateAr|gumentBo|
|00003ce0| 64 79 28 77 72 69 74 65 | 72 2c 20 6d 65 74 68 6f |dy(write|r, metho|
|00003cf0| 64 41 72 67 73 5b 69 5d | 29 3b 0d 20 20 20 20 20 |dArgs[i]|);. |
|00003d00| 20 20 20 20 20 20 20 77 | 72 69 74 65 72 2e 65 6e | w|riter.en|
|00003d10| 64 45 6c 65 6d 65 6e 74 | 28 27 70 61 72 61 6d 27 |dElement|('param'|
|00003d20| 29 3b 0d 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 |);. | }. |
|00003d30| 20 20 20 20 20 77 72 69 | 74 65 72 2e 65 6e 64 45 | wri|ter.endE|
|00003d40| 6c 65 6d 65 6e 74 28 27 | 70 61 72 61 6d 73 27 29 |lement('|params')|
|00003d50| 3b 0d 0d 20 20 20 20 20 | 20 20 20 77 72 69 74 65 |;.. | write|
|00003d60| 72 2e 65 6e 64 45 6c 65 | 6d 65 6e 74 28 27 6d 65 |r.endEle|ment('me|
|00003d70| 74 68 6f 64 43 61 6c 6c | 27 29 3b 0d 20 20 20 20 |thodCall|');. |
|00003d80| 7d 2c 0d 0d 20 20 20 20 | 2f 2a 20 57 72 69 74 65 |},.. |/* Write|
|00003d90| 20 6f 75 74 20 61 20 58 | 4d 4c 2d 52 50 43 20 70 | out a X|ML-RPC p|
|00003da0| 61 72 61 6d 65 74 65 72 | 20 76 61 6c 75 65 20 2a |arameter| value *|
|00003db0| 2f 0d 20 20 20 20 5f 67 | 65 6e 65 72 61 74 65 41 |/. _g|enerateA|
|00003dc0| 72 67 75 6d 65 6e 74 42 | 6f 64 79 3a 20 66 75 6e |rgumentB|ody: fun|
|00003dd0| 63 74 69 6f 6e 28 77 72 | 69 74 65 72 2c 20 6f 62 |ction(wr|iter, ob|
|00003de0| 6a 29 20 7b 0d 20 20 20 | 20 20 20 20 20 77 72 69 |j) {. | wri|
|00003df0| 74 65 72 2e 73 74 61 72 | 74 45 6c 65 6d 65 6e 74 |ter.star|tElement|
|00003e00| 28 27 76 61 6c 75 65 27 | 29 3b 0d 20 20 20 20 20 |('value'|);. |
|00003e10| 20 20 20 76 61 72 20 73 | 54 79 70 65 20 3d 20 74 | var s|Type = t|
|00003e20| 68 69 73 2e 5f 74 79 70 | 65 4f 66 28 6f 62 6a 29 |his._typ|eOf(obj)|
|00003e30| 3b 0d 20 20 20 20 20 20 | 20 20 73 77 69 74 63 68 |;. | switch|
|00003e40| 20 28 73 54 79 70 65 29 | 20 7b 0d 20 20 20 20 20 | (sType)| {. |
|00003e50| 20 20 20 20 20 20 20 63 | 61 73 65 20 27 50 52 55 | c|ase 'PRU|
|00003e60| 69 6e 74 38 27 3a 0d 20 | 20 20 20 20 20 20 20 20 |int8':. | |
|00003e70| 20 20 20 63 61 73 65 20 | 27 50 52 55 69 6e 74 31 | case |'PRUint1|
|00003e80| 36 27 3a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |6':. | |
|00003e90| 63 61 73 65 20 27 50 52 | 49 6e 74 31 36 27 3a 0d |case 'PR|Int16':.|
|00003ea0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|00003eb0| 20 27 50 52 49 6e 74 33 | 32 27 3a 0d 20 20 20 20 | 'PRInt3|2':. |
|00003ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 6f 62 6a 3d | | obj=|
|00003ed0| 6f 62 6a 2e 51 75 65 72 | 79 49 6e 74 65 72 66 61 |obj.Quer|yInterfa|
|00003ee0| 63 65 28 43 6f 6d 70 6f | 6e 65 6e 74 73 2e 69 6e |ce(Compo|nents.in|
|00003ef0| 74 65 72 66 61 63 65 73 | 5b 27 6e 73 49 53 75 70 |terfaces|['nsISup|
|00003f00| 70 6f 72 74 73 27 20 2b | 0d 20 20 20 20 20 20 20 |ports' +|. |
|00003f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 73 54 79 | | sTy|
|00003f20| 70 65 5d 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |pe]);. | |
|00003f30| 20 20 20 20 20 20 77 72 | 69 74 65 72 2e 73 74 61 | wr|iter.sta|
|00003f40| 72 74 45 6c 65 6d 65 6e | 74 28 27 69 34 27 29 3b |rtElemen|t('i4');|
|00003f50| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003f60| 20 77 72 69 74 65 72 2e | 77 72 69 74 65 28 6f 62 | writer.|write(ob|
|00003f70| 6a 2e 74 6f 53 74 72 69 | 6e 67 28 29 29 3b 0d 20 |j.toStri|ng());. |
|00003f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|00003f90| 72 69 74 65 72 2e 65 6e | 64 45 6c 65 6d 65 6e 74 |riter.en|dElement|
|00003fa0| 28 27 69 34 27 29 3b 0d | 20 20 20 20 20 20 20 20 |('i4');.| |
|00003fb0| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 0d | |break;..|
|00003fc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|00003fd0| 20 27 50 52 42 6f 6f 6c | 27 3a 0d 20 20 20 20 20 | 'PRBool|':. |
|00003fe0| 20 20 20 20 20 20 20 20 | 20 20 20 6f 62 6a 3d 6f | | obj=o|
|00003ff0| 62 6a 2e 51 75 65 72 79 | 49 6e 74 65 72 66 61 63 |bj.Query|Interfac|
|00004000| 65 28 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |e(Compon|ents.int|
|00004010| 65 72 66 61 63 65 73 2e | 6e 73 49 53 75 70 70 6f |erfaces.|nsISuppo|
|00004020| 72 74 73 50 52 42 6f 6f | 6c 29 3b 0d 20 20 20 20 |rtsPRBoo|l);. |
|00004030| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 72 69 74 | | writ|
|00004040| 65 72 2e 73 74 61 72 74 | 45 6c 65 6d 65 6e 74 28 |er.start|Element(|
|00004050| 27 62 6f 6f 6c 65 61 6e | 27 29 3b 0d 20 20 20 20 |'boolean|');. |
|00004060| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 72 69 74 | | writ|
|00004070| 65 72 2e 77 72 69 74 65 | 28 6f 62 6a 2e 64 61 74 |er.write|(obj.dat|
|00004080| 61 20 3f 20 27 31 27 20 | 3a 20 27 30 27 29 3b 0d |a ? '1' |: '0');.|
|00004090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000040a0| 77 72 69 74 65 72 2e 65 | 6e 64 45 6c 65 6d 65 6e |writer.e|ndElemen|
|000040b0| 74 28 27 62 6f 6f 6c 65 | 61 6e 27 29 3b 0d 20 20 |t('boole|an');. |
|000040c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 62 72 | | br|
|000040d0| 65 61 6b 3b 0d 0d 20 20 | 20 20 20 20 20 20 20 20 |eak;.. | |
|000040e0| 20 20 63 61 73 65 20 27 | 43 68 61 72 27 3a 0d 20 | case '|Char':. |
|000040f0| 20 20 20 20 20 20 20 20 | 20 20 20 63 61 73 65 20 | | case |
|00004100| 27 43 53 74 72 69 6e 67 | 27 3a 0d 20 20 20 20 20 |'CString|':. |
|00004110| 20 20 20 20 20 20 20 20 | 20 20 20 6f 62 6a 3d 6f | | obj=o|
|00004120| 62 6a 2e 51 75 65 72 79 | 49 6e 74 65 72 66 61 63 |bj.Query|Interfac|
|00004130| 65 28 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |e(Compon|ents.int|
|00004140| 65 72 66 61 63 65 73 5b | 27 6e 73 49 53 75 70 70 |erfaces[|'nsISupp|
|00004150| 6f 72 74 73 27 20 2b 0d | 20 20 20 20 20 20 20 20 |orts' +.| |
|00004160| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 54 79 70 | | sTyp|
|00004170| 65 5d 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |e]);. | |
|00004180| 20 20 20 20 20 77 72 69 | 74 65 72 2e 73 74 61 72 | wri|ter.star|
|00004190| 74 45 6c 65 6d 65 6e 74 | 28 27 73 74 72 69 6e 67 |tElement|('string|
|000041a0| 27 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |');. | |
|000041b0| 20 20 20 20 77 72 69 74 | 65 72 2e 77 72 69 74 65 | writ|er.write|
|000041c0| 28 6f 62 6a 2e 74 6f 53 | 74 72 69 6e 67 28 29 29 |(obj.toS|tring())|
|000041d0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000041e0| 20 20 77 72 69 74 65 72 | 2e 65 6e 64 45 6c 65 6d | writer|.endElem|
|000041f0| 65 6e 74 28 27 73 74 72 | 69 6e 67 27 29 3b 0d 20 |ent('str|ing');. |
|00004200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | | b|
|00004210| 72 65 61 6b 3b 0d 0d 20 | 20 20 20 20 20 20 20 20 |reak;.. | |
|00004220| 20 20 20 63 61 73 65 20 | 27 46 6c 6f 61 74 27 3a | case |'Float':|
|00004230| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 63 61 73 |. | cas|
|00004240| 65 20 27 44 6f 75 62 6c | 65 27 3a 0d 20 20 20 20 |e 'Doubl|e':. |
|00004250| 20 20 20 20 20 20 20 20 | 20 20 20 20 6f 62 6a 3d | | obj=|
|00004260| 6f 62 6a 2e 51 75 65 72 | 79 49 6e 74 65 72 66 61 |obj.Quer|yInterfa|
|00004270| 63 65 28 43 6f 6d 70 6f | 6e 65 6e 74 73 2e 69 6e |ce(Compo|nents.in|
|00004280| 74 65 72 66 61 63 65 73 | 5b 27 6e 73 49 53 75 70 |terfaces|['nsISup|
|00004290| 70 6f 72 74 73 27 20 2b | 0d 20 20 20 20 20 20 20 |ports' +|. |
|000042a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 73 54 79 | | sTy|
|000042b0| 70 65 5d 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |pe]);. | |
|000042c0| 20 20 20 20 20 20 77 72 | 69 74 65 72 2e 73 74 61 | wr|iter.sta|
|000042d0| 72 74 45 6c 65 6d 65 6e | 74 28 27 64 6f 75 62 6c |rtElemen|t('doubl|
|000042e0| 65 27 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |e');. | |
|000042f0| 20 20 20 20 20 77 72 69 | 74 65 72 2e 77 72 69 74 | wri|ter.writ|
|00004300| 65 28 6f 62 6a 2e 74 6f | 53 74 72 69 6e 67 28 29 |e(obj.to|String()|
|00004310| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00004320| 20 20 20 77 72 69 74 65 | 72 2e 65 6e 64 45 6c 65 | write|r.endEle|
|00004330| 6d 65 6e 74 28 27 64 6f | 75 62 6c 65 27 29 3b 0d |ment('do|uble');.|
|00004340| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004350| 62 72 65 61 6b 3b 0d 0d | 20 20 20 20 20 20 20 20 |break;..| |
|00004360| 20 20 20 20 63 61 73 65 | 20 27 50 52 54 69 6d 65 | case| 'PRTime|
|00004370| 27 3a 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |':. | |
|00004380| 20 20 20 6f 62 6a 20 3d | 20 6f 62 6a 2e 51 75 65 | obj =| obj.Que|
|00004390| 72 79 49 6e 74 65 72 66 | 61 63 65 28 0d 20 20 20 |ryInterf|ace(. |
|000043a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000043b0| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 | Compone|nts.inte|
|000043c0| 72 66 61 63 65 73 2e 6e | 73 49 53 75 70 70 6f 72 |rfaces.n|sISuppor|
|000043d0| 74 73 50 52 54 69 6d 65 | 29 3b 0d 20 20 20 20 20 |tsPRTime|);. |
|000043e0| 20 20 20 20 20 20 20 20 | 20 20 20 76 61 72 20 64 | | var d|
|000043f0| 61 74 65 20 3d 20 6e 65 | 77 20 44 61 74 65 28 6f |ate = ne|w Date(o|
|00004400| 62 6a 2e 64 61 74 61 29 | 0d 20 20 20 20 20 20 20 |bj.data)|. |
|00004410| 20 20 20 20 20 20 20 20 | 20 77 72 69 74 65 72 2e | | writer.|
|00004420| 73 74 61 72 74 45 6c 65 | 6d 65 6e 74 28 27 64 61 |startEle|ment('da|
|00004430| 74 65 54 69 6d 65 2e 69 | 73 6f 38 36 30 31 27 29 |teTime.i|so8601')|
|00004440| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00004450| 20 20 77 72 69 74 65 72 | 2e 77 72 69 74 65 28 69 | writer|.write(i|
|00004460| 73 6f 38 36 30 31 46 6f | 72 6d 61 74 28 64 61 74 |so8601Fo|rmat(dat|
|00004470| 65 29 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |e));. | |
|00004480| 20 20 20 20 20 77 72 69 | 74 65 72 2e 65 6e 64 45 | wri|ter.endE|
|00004490| 6c 65 6d 65 6e 74 28 27 | 64 61 74 65 54 69 6d 65 |lement('|dateTime|
|000044a0| 2e 69 73 6f 38 36 30 31 | 27 29 3b 0d 20 20 20 20 |.iso8601|');. |
|000044b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 72 65 61 | | brea|
|000044c0| 6b 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |k;. | |
|000044d0| 20 20 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | . | |
|000044e0| 63 61 73 65 20 27 49 6e | 70 75 74 53 74 72 65 61 |case 'In|putStrea|
|000044f0| 6d 27 3a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |m':. | |
|00004500| 20 20 20 20 6f 62 6a 20 | 3d 20 6f 62 6a 2e 51 75 | obj |= obj.Qu|
|00004510| 65 72 79 49 6e 74 65 72 | 66 61 63 65 28 43 6f 6d |eryInter|face(Com|
|00004520| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00004530| 65 73 2e 6e 73 49 49 6e | 70 75 74 53 74 72 65 61 |es.nsIIn|putStrea|
|00004540| 6d 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |m);. | |
|00004550| 20 20 20 20 6f 62 6a 20 | 3d 20 74 6f 53 63 72 69 | obj |= toScri|
|00004560| 70 74 61 62 6c 65 53 74 | 72 65 61 6d 28 6f 62 6a |ptableSt|ream(obj|
|00004570| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00004580| 20 20 20 77 72 69 74 65 | 72 2e 73 74 61 72 74 45 | write|r.startE|
|00004590| 6c 65 6d 65 6e 74 28 27 | 62 61 73 65 36 34 27 29 |lement('|base64')|
|000045a0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000045b0| 20 20 73 74 72 65 61 6d | 54 6f 42 61 73 65 36 34 | stream|ToBase64|
|000045c0| 28 6f 62 6a 2c 20 77 72 | 69 74 65 72 29 3b 0d 20 |(obj, wr|iter);. |
|000045d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|000045e0| 72 69 74 65 72 2e 65 6e | 64 45 6c 65 6d 65 6e 74 |riter.en|dElement|
|000045f0| 28 27 62 61 73 65 36 34 | 27 29 3b 0d 20 20 20 20 |('base64|');. |
|00004600| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 72 65 61 | | brea|
|00004610| 6b 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 0d |k;. | .|
|00004620| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|00004630| 20 27 41 72 72 61 79 27 | 3a 0d 20 20 20 20 20 20 | 'Array'|:. |
|00004640| 20 20 20 20 20 20 20 20 | 20 20 6f 62 6a 20 3d 20 | | obj = |
|00004650| 6f 62 6a 2e 51 75 65 72 | 79 49 6e 74 65 72 66 61 |obj.Quer|yInterfa|
|00004660| 63 65 28 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ce(. | |
|00004670| 20 20 20 20 20 20 20 20 | 43 6f 6d 70 6f 6e 65 6e | |Componen|
|00004680| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|00004690| 49 53 75 70 70 6f 72 74 | 73 41 72 72 61 79 29 3b |ISupport|sArray);|
|000046a0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000046b0| 20 77 72 69 74 65 72 2e | 73 74 61 72 74 45 6c 65 | writer.|startEle|
|000046c0| 6d 65 6e 74 28 27 61 72 | 72 61 79 27 29 3b 0d 20 |ment('ar|ray');. |
|000046d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|000046e0| 72 69 74 65 72 2e 73 74 | 61 72 74 45 6c 65 6d 65 |riter.st|artEleme|
|000046f0| 6e 74 28 27 64 61 74 61 | 27 29 3b 0d 20 20 20 20 |nt('data|');. |
|00004700| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 6f 72 20 | | for |
|00004710| 28 76 61 72 20 69 20 3d | 20 30 3b 20 69 20 3c 20 |(var i =| 0; i < |
|00004720| 6f 62 6a 2e 43 6f 75 6e | 74 28 29 3b 20 69 2b 2b |obj.Coun|t(); i++|
|00004730| 29 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |). | |
|00004740| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 67 65 6e 65 | th|is._gene|
|00004750| 72 61 74 65 41 72 67 75 | 6d 65 6e 74 42 6f 64 79 |rateArgu|mentBody|
|00004760| 28 77 72 69 74 65 72 2c | 20 6f 62 6a 2e 47 65 74 |(writer,| obj.Get|
|00004770| 45 6c 65 6d 65 6e 74 41 | 74 28 69 29 29 3b 0d 20 |ElementA|t(i));. |
|00004780| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|00004790| 72 69 74 65 72 2e 65 6e | 64 45 6c 65 6d 65 6e 74 |riter.en|dElement|
|000047a0| 28 27 64 61 74 61 27 29 | 3b 0d 20 20 20 20 20 20 |('data')|;. |
|000047b0| 20 20 20 20 20 20 20 20 | 20 20 77 72 69 74 65 72 | | writer|
|000047c0| 2e 65 6e 64 45 6c 65 6d | 65 6e 74 28 27 61 72 72 |.endElem|ent('arr|
|000047d0| 61 79 27 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ay');. | |
|000047e0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0d 0d 20 20 | br|eak;.. |
|000047f0| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 27 | | case '|
|00004800| 44 69 63 74 69 6f 6e 61 | 72 79 27 3a 0d 20 20 20 |Dictiona|ry':. |
|00004810| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 62 6a | | obj|
|00004820| 20 3d 20 6f 62 6a 2e 51 | 75 65 72 79 49 6e 74 65 | = obj.Q|ueryInte|
|00004830| 72 66 61 63 65 28 43 6f | 6d 70 6f 6e 65 6e 74 73 |rface(Co|mponents|
|00004840| 2e 69 6e 74 65 72 66 61 | 63 65 73 2e 6e 73 49 44 |.interfa|ces.nsID|
|00004850| 69 63 74 69 6f 6e 61 72 | 79 29 3b 0d 20 20 20 20 |ictionar|y);. |
|00004860| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 72 69 74 | | writ|
|00004870| 65 72 2e 73 74 61 72 74 | 45 6c 65 6d 65 6e 74 28 |er.start|Element(|
|00004880| 27 73 74 72 75 63 74 27 | 29 3b 0d 20 20 20 20 20 |'struct'|);. |
|00004890| 20 20 20 20 20 20 20 20 | 20 20 20 76 61 72 20 6b | | var k|
|000048a0| 65 79 73 20 3d 20 6f 62 | 6a 2e 67 65 74 4b 65 79 |eys = ob|j.getKey|
|000048b0| 73 28 7b 7d 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |s({});. | |
|000048c0| 20 20 20 20 20 20 20 66 | 6f 72 20 28 76 61 72 20 | f|or (var |
|000048d0| 6b 20 69 6e 20 6b 65 79 | 73 29 20 7b 0d 20 20 20 |k in key|s) {. |
|000048e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000048f0| 20 77 72 69 74 65 72 2e | 73 74 61 72 74 45 6c 65 | writer.|startEle|
|00004900| 6d 65 6e 74 28 27 6d 65 | 6d 62 65 72 27 29 3b 0d |ment('me|mber');.|
|00004910| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004920| 20 20 20 20 77 72 69 74 | 65 72 2e 73 74 61 72 74 | writ|er.start|
|00004930| 45 6c 65 6d 65 6e 74 28 | 27 6e 61 6d 65 27 29 3b |Element(|'name');|
|00004940| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004950| 20 20 20 20 20 77 72 69 | 74 65 72 2e 77 72 69 74 | wri|ter.writ|
|00004960| 65 28 6b 65 79 73 5b 6b | 5d 29 3b 0d 20 20 20 20 |e(keys[k|]);. |
|00004970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004980| 77 72 69 74 65 72 2e 65 | 6e 64 45 6c 65 6d 65 6e |writer.e|ndElemen|
|00004990| 74 28 27 6e 61 6d 65 27 | 29 3b 0d 20 20 20 20 20 |t('name'|);. |
|000049a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|000049b0| 68 69 73 2e 5f 67 65 6e | 65 72 61 74 65 41 72 67 |his._gen|erateArg|
|000049c0| 75 6d 65 6e 74 42 6f 64 | 79 28 77 72 69 74 65 72 |umentBod|y(writer|
|000049d0| 2c 20 6f 62 6a 2e 67 65 | 74 56 61 6c 75 65 28 6b |, obj.ge|tValue(k|
|000049e0| 65 79 73 5b 6b 5d 29 29 | 3b 0d 20 20 20 20 20 20 |eys[k]))|;. |
|000049f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 72 | | wr|
|00004a00| 69 74 65 72 2e 65 6e 64 | 45 6c 65 6d 65 6e 74 28 |iter.end|Element(|
|00004a10| 27 6d 65 6d 62 65 72 27 | 29 3b 0d 20 20 20 20 20 |'member'|);. |
|00004a20| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|00004a30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 77 72 69 | | wri|
|00004a40| 74 65 72 2e 65 6e 64 45 | 6c 65 6d 65 6e 74 28 27 |ter.endE|lement('|
|00004a50| 73 74 72 75 63 74 27 29 | 3b 0d 20 20 20 20 20 20 |struct')|;. |
|00004a60| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|00004a70| 0d 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 64 65 |.. | de|
|00004a80| 66 61 75 6c 74 3a 0d 20 | 20 20 20 20 20 20 20 20 |fault:. | |
|00004a90| 20 20 20 20 20 20 20 74 | 68 72 6f 77 20 43 6f 6d | t|hrow Com|
|00004aa0| 70 6f 6e 65 6e 74 73 2e | 45 78 63 65 70 74 69 6f |ponents.|Exceptio|
|00004ab0| 6e 28 27 55 6e 73 75 70 | 70 6f 72 74 65 64 20 61 |n('Unsup|ported a|
|00004ac0| 72 67 75 6d 65 6e 74 27 | 2c 20 6e 75 6c 6c 2c 20 |rgument'|, null, |
|00004ad0| 6e 75 6c 6c 2c 0d 20 20 | 20 20 20 20 20 20 20 20 |null,. | |
|00004ae0| 20 20 20 20 20 20 20 20 | 20 20 6f 62 6a 29 3b 0d | | obj);.|
|00004af0| 20 20 20 20 20 20 20 20 | 7d 0d 0d 20 20 20 20 20 | |}.. |
|00004b00| 20 20 20 77 72 69 74 65 | 72 2e 65 6e 64 45 6c 65 | write|r.endEle|
|00004b10| 6d 65 6e 74 28 27 76 61 | 6c 75 65 27 29 3b 0d 20 |ment('va|lue');. |
|00004b20| 20 20 20 7d 2c 0d 0d 20 | 20 20 20 2f 2a 20 44 65 | },.. | /* De|
|00004b30| 74 65 72 6d 69 6e 65 20 | 74 79 70 65 20 6f 66 20 |termine |type of |
|00004b40| 61 20 6e 73 49 53 75 70 | 70 6f 72 74 73 20 70 72 |a nsISup|ports pr|
|00004b50| 69 6d 69 74 69 76 65 2c | 20 61 72 72 61 79 20 6f |imitive,| array o|
|00004b60| 72 20 64 69 63 74 69 6f | 6e 61 72 79 2e 20 2a 2f |r dictio|nary. */|
|00004b70| 0d 20 20 20 20 5f 74 79 | 70 65 4f 66 3a 20 66 75 |. _ty|peOf: fu|
|00004b80| 6e 63 74 69 6f 6e 28 6f | 62 6a 29 20 7b 0d 20 20 |nction(o|bj) {. |
|00004b90| 20 20 20 20 20 20 2f 2f | 20 58 50 43 6f 6e 6e 65 | //| XPConne|
|00004ba0| 63 74 20 61 6c 6f 77 73 | 20 4a 53 20 74 6f 20 70 |ct alows| JS to p|
|00004bb0| 61 73 73 20 69 6e 20 61 | 6e 79 74 68 69 6e 67 2c |ass in a|nything,|
|00004bc0| 20 62 65 63 61 75 73 65 | 20 77 65 20 61 72 65 20 | because| we are |
|00004bd0| 61 20 72 65 67 75 6c 61 | 72 0d 20 20 20 20 20 20 |a regula|r. |
|00004be0| 20 20 2f 2f 20 4a 53 20 | 6f 62 6a 65 63 74 20 74 | // JS |object t|
|00004bf0| 6f 20 69 74 2e 20 53 6f | 20 77 65 20 68 61 76 65 |o it. So| we have|
|00004c00| 20 74 6f 20 74 65 73 74 | 20 72 69 67 6f 72 6f 75 | to test| rigorou|
|00004c10| 73 6c 79 2e 0d 20 20 20 | 20 20 20 20 20 69 66 20 |sly.. | if |
|00004c20| 28 74 79 70 65 6f 66 20 | 6f 62 6a 20 21 3d 20 27 |(typeof |obj != '|
|00004c30| 6f 62 6a 65 63 74 27 29 | 20 72 65 74 75 72 6e 20 |object')| return |
|00004c40| 27 55 6e 6b 6e 6f 77 6e | 27 3b 0d 0d 20 20 20 20 |'Unknown|';.. |
|00004c50| 20 20 20 20 2f 2f 20 41 | 6e 79 74 68 69 6e 67 20 | // A|nything |
|00004c60| 65 6c 73 65 20 6e 6f 74 | 20 6e 73 49 53 75 70 70 |else not| nsISupp|
|00004c70| 6f 72 74 73 20 69 73 20 | 6e 6f 74 20 61 6c 6c 6f |orts is |not allo|
|00004c80| 77 65 64 2e 0d 20 20 20 | 20 20 20 20 20 69 66 20 |wed.. | if |
|00004c90| 28 74 79 70 65 6f 66 20 | 6f 62 6a 2e 51 75 65 72 |(typeof |obj.Quer|
|00004ca0| 79 49 6e 74 65 72 66 61 | 63 65 20 21 3d 20 27 66 |yInterfa|ce != 'f|
|00004cb0| 75 6e 63 74 69 6f 6e 27 | 29 20 72 65 74 75 72 6e |unction'|) return|
|00004cc0| 20 27 55 6e 6b 6e 6f 77 | 6e 27 3b 0d 0d 20 20 20 | 'Unknow|n';.. |
|00004cd0| 20 20 20 20 20 2f 2f 20 | 4e 6f 77 20 77 65 20 77 | // |Now we w|
|00004ce0| 69 6c 6c 20 68 61 76 65 | 20 74 6f 20 65 6c 69 6d |ill have| to elim|
|00004cf0| 69 6e 61 74 65 20 62 79 | 20 74 72 79 69 6e 67 20 |inate by| trying |
|00004d00| 61 6c 6c 20 70 6f 73 73 | 65 62 69 6c 69 74 69 65 |all poss|ebilitie|
|00004d10| 73 2e 0d 20 20 20 20 20 | 20 20 20 74 72 79 20 7b |s.. | try {|
|00004d20| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 62 6a |. | obj|
|00004d30| 2e 51 75 65 72 79 49 6e | 74 65 72 66 61 63 65 28 |.QueryIn|terface(|
|00004d40| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00004d50| 66 61 63 65 73 2e 6e 73 | 49 53 75 70 70 6f 72 74 |faces.ns|ISupport|
|00004d60| 73 50 52 55 69 6e 74 38 | 29 3b 0d 20 20 20 20 20 |sPRUint8|);. |
|00004d70| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 27 50 | r|eturn 'P|
|00004d80| 52 55 69 6e 74 38 27 3b | 0d 20 20 20 20 20 20 20 |RUint8';|. |
|00004d90| 20 7d 20 63 61 74 63 68 | 28 65 29 20 7b 7d 0d 20 | } catch|(e) {}. |
|00004da0| 20 20 20 20 20 20 20 0d | 20 20 20 20 20 20 20 20 | .| |
|00004db0| 74 72 79 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |try {. | |
|00004dc0| 20 20 6f 62 6a 2e 51 75 | 65 72 79 49 6e 74 65 72 | obj.Qu|eryInter|
|00004dd0| 66 61 63 65 28 43 6f 6d | 70 6f 6e 65 6e 74 73 2e |face(Com|ponents.|
|00004de0| 69 6e 74 65 72 66 61 63 | 65 73 2e 6e 73 49 53 75 |interfac|es.nsISu|
|00004df0| 70 70 6f 72 74 73 50 52 | 55 69 6e 74 31 36 29 3b |pportsPR|Uint16);|
|00004e00| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |. | ret|
|00004e10| 75 72 6e 20 27 50 52 55 | 69 6e 74 31 36 27 3b 0d |urn 'PRU|int16';.|
|00004e20| 20 20 20 20 20 20 20 20 | 7d 20 63 61 74 63 68 28 | |} catch(|
|00004e30| 65 29 20 7b 7d 0d 20 20 | 20 20 20 20 20 20 0d 20 |e) {}. | . |
|00004e40| 20 20 20 20 20 20 20 74 | 72 79 20 7b 0d 20 20 20 | t|ry {. |
|00004e50| 20 20 20 20 20 20 20 20 | 20 6f 62 6a 2e 51 75 65 | | obj.Que|
|00004e60| 72 79 49 6e 74 65 72 66 | 61 63 65 28 43 6f 6d 70 |ryInterf|ace(Comp|
|00004e70| 6f 6e 65 6e 74 73 2e 69 | 6e 74 65 72 66 61 63 65 |onents.i|nterface|
|00004e80| 73 2e 6e 73 49 53 75 70 | 70 6f 72 74 73 50 52 49 |s.nsISup|portsPRI|
|00004e90| 6e 74 31 36 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |nt16);. | |
|00004ea0| 20 20 20 72 65 74 75 72 | 6e 20 27 50 52 49 6e 74 | retur|n 'PRInt|
|00004eb0| 31 36 27 3b 0d 20 20 20 | 20 20 20 20 20 7d 20 63 |16';. | } c|
|00004ec0| 61 74 63 68 28 65 29 20 | 7b 7d 0d 20 20 20 20 20 |atch(e) |{}. |
|00004ed0| 20 20 20 0d 20 20 20 20 | 20 20 20 20 74 72 79 20 | . | try |
|00004ee0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 6f 62 |{. | ob|
|00004ef0| 6a 2e 51 75 65 72 79 49 | 6e 74 65 72 66 61 63 65 |j.QueryI|nterface|
|00004f00| 28 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 |(Compone|nts.inte|
|00004f10| 72 66 61 63 65 73 2e 6e | 73 49 53 75 70 70 6f 72 |rfaces.n|sISuppor|
|00004f20| 74 73 50 52 49 6e 74 33 | 32 29 3b 0d 20 20 20 20 |tsPRInt3|2);. |
|00004f30| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 27 | |return '|
|00004f40| 50 52 49 6e 74 33 32 27 | 3b 0d 20 20 20 20 20 20 |PRInt32'|;. |
|00004f50| 20 20 7d 20 63 61 74 63 | 68 28 65 29 20 7b 7d 0d | } catc|h(e) {}.|
|00004f60| 20 20 20 20 20 20 20 20 | 0d 20 20 20 20 20 20 20 | |. |
|00004f70| 20 74 72 79 20 7b 0d 20 | 20 20 20 20 20 20 20 20 | try {. | |
|00004f80| 20 20 20 6f 62 6a 2e 51 | 75 65 72 79 49 6e 74 65 | obj.Q|ueryInte|
|00004f90| 72 66 61 63 65 28 43 6f | 6d 70 6f 6e 65 6e 74 73 |rface(Co|mponents|
|00004fa0| 2e 69 6e 74 65 72 66 61 | 63 65 73 2e 6e 73 49 53 |.interfa|ces.nsIS|
|00004fb0| 75 70 70 6f 72 74 73 50 | 52 42 6f 6f 6c 29 3b 0d |upportsP|RBool);.|
|00004fc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 72 65 74 75 | | retu|
|00004fd0| 72 6e 20 27 50 52 42 6f | 6f 6c 27 3b 0d 20 20 20 |rn 'PRBo|ol';. |
|00004fe0| 20 20 20 20 20 7d 20 63 | 61 74 63 68 28 65 29 20 | } c|atch(e) |
|00004ff0| 7b 7d 0d 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 |{}. | . |
|00005000| 20 20 20 20 74 72 79 20 | 7b 0d 20 20 20 20 20 20 | try |{. |
|00005010| 20 20 20 20 20 20 6f 62 | 6a 2e 51 75 65 72 79 49 | ob|j.QueryI|
|00005020| 6e 74 65 72 66 61 63 65 | 28 43 6f 6d 70 6f 6e 65 |nterface|(Compone|
|00005030| 6e 74 73 2e 69 6e 74 65 | 72 66 61 63 65 73 2e 6e |nts.inte|rfaces.n|
|00005040| 73 49 53 75 70 70 6f 72 | 74 73 43 68 61 72 29 3b |sISuppor|tsChar);|
|00005050| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |. | ret|
|00005060| 75 72 6e 20 27 43 68 61 | 72 27 3b 0d 20 20 20 20 |urn 'Cha|r';. |
|00005070| 20 20 20 20 7d 20 63 61 | 74 63 68 28 65 29 20 7b | } ca|tch(e) {|
|00005080| 7d 0d 20 20 20 20 20 20 | 20 20 0d 20 20 20 20 20 |}. | . |
|00005090| 20 20 20 74 72 79 20 7b | 0d 20 20 20 20 20 20 20 | try {|. |
|000050a0| 20 20 20 20 20 6f 62 6a | 2e 51 75 65 72 79 49 6e | obj|.QueryIn|
|000050b0| 74 65 72 66 61 63 65 28 | 43 6f 6d 70 6f 6e 65 6e |terface(|Componen|
|000050c0| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|000050d0| 49 53 75 70 70 6f 72 74 | 73 43 53 74 72 69 6e 67 |ISupport|sCString|
|000050e0| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |);. | r|
|000050f0| 65 74 75 72 6e 20 27 43 | 53 74 72 69 6e 67 27 3b |eturn 'C|String';|
|00005100| 0d 20 20 20 20 20 20 20 | 20 7d 20 63 61 74 63 68 |. | } catch|
|00005110| 28 65 29 20 7b 7d 0d 20 | 20 20 20 20 20 20 20 0d |(e) {}. | .|
|00005120| 20 20 20 20 20 20 20 20 | 74 72 79 20 7b 0d 20 20 | |try {. |
|00005130| 20 20 20 20 20 20 20 20 | 20 20 6f 62 6a 2e 51 75 | | obj.Qu|
|00005140| 65 72 79 49 6e 74 65 72 | 66 61 63 65 28 43 6f 6d |eryInter|face(Com|
|00005150| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00005160| 65 73 2e 6e 73 49 53 75 | 70 70 6f 72 74 73 46 6c |es.nsISu|pportsFl|
|00005170| 6f 61 74 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |oat);. | |
|00005180| 20 20 72 65 74 75 72 6e | 20 27 46 6c 6f 61 74 27 | return| 'Float'|
|00005190| 3b 0d 20 20 20 20 20 20 | 20 20 7d 20 63 61 74 63 |;. | } catc|
|000051a0| 68 28 65 29 20 7b 7d 0d | 20 20 20 20 20 20 20 20 |h(e) {}.| |
|000051b0| 0d 20 20 20 20 20 20 20 | 20 74 72 79 20 7b 0d 20 |. | try {. |
|000051c0| 20 20 20 20 20 20 20 20 | 20 20 20 6f 62 6a 2e 51 | | obj.Q|
|000051d0| 75 65 72 79 49 6e 74 65 | 72 66 61 63 65 28 43 6f |ueryInte|rface(Co|
|000051e0| 6d 70 6f 6e 65 6e 74 73 | 2e 69 6e 74 65 72 66 61 |mponents|.interfa|
|000051f0| 63 65 73 2e 6e 73 49 53 | 75 70 70 6f 72 74 73 44 |ces.nsIS|upportsD|
|00005200| 6f 75 62 6c 65 29 3b 0d | 20 20 20 20 20 20 20 20 |ouble);.| |
|00005210| 20 20 20 20 72 65 74 75 | 72 6e 20 27 44 6f 75 62 | retu|rn 'Doub|
|00005220| 6c 65 27 3b 0d 20 20 20 | 20 20 20 20 20 7d 20 63 |le';. | } c|
|00005230| 61 74 63 68 28 65 29 20 | 7b 7d 0d 20 20 20 20 20 |atch(e) |{}. |
|00005240| 20 20 20 0d 20 20 20 20 | 20 20 20 20 74 72 79 20 | . | try |
|00005250| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 6f 62 |{. | ob|
|00005260| 6a 2e 51 75 65 72 79 49 | 6e 74 65 72 66 61 63 65 |j.QueryI|nterface|
|00005270| 28 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 |(Compone|nts.inte|
|00005280| 72 66 61 63 65 73 2e 6e | 73 49 53 75 70 70 6f 72 |rfaces.n|sISuppor|
|00005290| 74 73 50 52 54 69 6d 65 | 29 3b 0d 20 20 20 20 20 |tsPRTime|);. |
|000052a0| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 27 50 | r|eturn 'P|
|000052b0| 52 54 69 6d 65 27 3b 0d | 20 20 20 20 20 20 20 20 |RTime';.| |
|000052c0| 7d 20 63 61 74 63 68 28 | 65 29 20 7b 7d 0d 20 20 |} catch(|e) {}. |
|000052d0| 20 20 20 20 20 20 0d 20 | 20 20 20 20 20 20 20 74 | . | t|
|000052e0| 72 79 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ry {. | |
|000052f0| 20 6f 62 6a 2e 51 75 65 | 72 79 49 6e 74 65 72 66 | obj.Que|ryInterf|
|00005300| 61 63 65 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |ace(Comp|onents.i|
|00005310| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 49 6e 70 |nterface|s.nsIInp|
|00005320| 75 74 53 74 72 65 61 6d | 29 3b 0d 20 20 20 20 20 |utStream|);. |
|00005330| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 27 49 | r|eturn 'I|
|00005340| 6e 70 75 74 53 74 72 65 | 61 6d 27 3b 0d 20 20 20 |nputStre|am';. |
|00005350| 20 20 20 20 20 7d 20 63 | 61 74 63 68 28 65 29 20 | } c|atch(e) |
|00005360| 7b 7d 0d 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 |{}. | . |
|00005370| 20 20 20 20 74 72 79 20 | 7b 0d 20 20 20 20 20 20 | try |{. |
|00005380| 20 20 20 20 20 20 6f 62 | 6a 2e 51 75 65 72 79 49 | ob|j.QueryI|
|00005390| 6e 74 65 72 66 61 63 65 | 28 43 6f 6d 70 6f 6e 65 |nterface|(Compone|
|000053a0| 6e 74 73 2e 69 6e 74 65 | 72 66 61 63 65 73 2e 6e |nts.inte|rfaces.n|
|000053b0| 73 49 53 75 70 70 6f 72 | 74 73 41 72 72 61 79 29 |sISuppor|tsArray)|
|000053c0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 |;. | re|
|000053d0| 74 75 72 6e 20 27 41 72 | 72 61 79 27 3b 0d 20 20 |turn 'Ar|ray';. |
|000053e0| 20 20 20 20 20 20 7d 20 | 63 61 74 63 68 28 65 29 | } |catch(e)|
|000053f0| 20 7b 7d 0d 20 20 20 20 | 20 20 20 20 0d 20 20 20 | {}. | . |
|00005400| 20 20 20 20 20 74 72 79 | 20 7b 0d 20 20 20 20 20 | try| {. |
|00005410| 20 20 20 20 20 20 20 6f | 62 6a 2e 51 75 65 72 79 | o|bj.Query|
|00005420| 49 6e 74 65 72 66 61 63 | 65 28 43 6f 6d 70 6f 6e |Interfac|e(Compon|
|00005430| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00005440| 6e 73 49 44 69 63 74 69 | 6f 6e 61 72 79 29 3b 0d |nsIDicti|onary);.|
|00005450| 20 20 20 20 20 20 20 20 | 20 20 20 20 72 65 74 75 | | retu|
|00005460| 72 6e 20 27 44 69 63 74 | 69 6f 6e 61 72 79 27 3b |rn 'Dict|ionary';|
|00005470| 0d 20 20 20 20 20 20 20 | 20 7d 20 63 61 74 63 68 |. | } catch|
|00005480| 28 65 29 20 7b 7d 0d 20 | 20 20 20 20 20 20 20 0d |(e) {}. | .|
|00005490| 20 20 20 20 20 20 20 20 | 2f 2f 20 4e 6f 74 20 61 | |// Not a|
|000054a0| 20 73 75 70 70 6f 72 74 | 65 64 20 74 79 70 65 0d | support|ed type.|
|000054b0| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 27 | |return '|
|000054c0| 55 6e 6b 6e 6f 77 6e 27 | 3b 0d 20 20 20 20 7d 2c |Unknown'|;. },|
|000054d0| 0d 0d 20 20 20 20 2f 2f | 20 52 65 73 70 6f 6e 73 |.. //| Respons|
|000054e0| 65 20 70 61 72 73 69 6e | 67 20 73 74 61 74 65 0d |e parsin|g state.|
|000054f0| 20 20 20 20 5f 76 61 6c | 75 65 53 74 61 63 6b 3a | _val|ueStack:|
|00005500| 20 5b 5d 2c 0d 20 20 20 | 20 5f 63 75 72 72 56 61 | [],. | _currVa|
|00005510| 6c 75 65 3a 20 6e 75 6c | 6c 2c 0d 20 20 20 20 5f |lue: nul|l,. _|
|00005520| 63 64 61 74 61 3a 20 6e | 75 6c 6c 2c 0d 0d 20 20 |cdata: n|ull,.. |
|00005530| 20 20 2f 2a 20 53 41 58 | 20 64 6f 63 75 6d 65 6e | /* SAX| documen|
|00005540| 74 48 61 6e 64 6c 65 72 | 20 69 6e 74 65 72 66 61 |tHandler| interfa|
|00005550| 63 65 20 28 77 65 6c 6c | 2c 20 73 6f 72 74 61 29 |ce (well|, sorta)|
|00005560| 20 2a 2f 0d 20 20 20 20 | 63 68 61 72 61 63 74 65 | */. |characte|
|00005570| 72 73 3a 20 66 75 6e 63 | 74 69 6f 6e 28 63 68 61 |rs: func|tion(cha|
|00005580| 72 73 29 20 7b 0d 20 20 | 20 20 20 20 20 20 69 66 |rs) {. | if|
|00005590| 20 28 44 45 42 55 47 50 | 41 52 53 45 29 20 64 65 | (DEBUGP|ARSE) de|
|000055a0| 62 75 67 28 27 63 68 61 | 72 61 63 74 65 72 20 64 |bug('cha|racter d|
|000055b0| 61 74 61 3a 20 27 20 2b | 20 63 68 61 72 73 29 3b |ata: ' +| chars);|
|000055c0| 0d 20 20 20 20 20 20 20 | 20 69 66 20 28 74 68 69 |. | if (thi|
|000055d0| 73 2e 5f 63 64 61 74 61 | 20 3d 3d 20 6e 75 6c 6c |s._cdata| == null|
|000055e0| 29 20 72 65 74 75 72 6e | 3b 0d 20 20 20 20 20 20 |) return|;. |
|000055f0| 20 20 74 68 69 73 2e 5f | 63 64 61 74 61 20 2b 3d | this._|cdata +=|
|00005600| 20 63 68 61 72 73 3b 0d | 20 20 20 20 7d 2c 0d 0d | chars;.| },..|
|00005610| 20 20 20 20 73 74 61 72 | 74 45 6c 65 6d 65 6e 74 | star|tElement|
|00005620| 3a 20 66 75 6e 63 74 69 | 6f 6e 28 6e 61 6d 65 29 |: functi|on(name)|
|00005630| 20 7b 0d 20 20 20 20 20 | 20 20 20 69 66 20 28 44 | {. | if (D|
|00005640| 45 42 55 47 50 41 52 53 | 45 29 20 64 65 62 75 67 |EBUGPARS|E) debug|
|00005650| 28 27 53 74 61 72 74 20 | 65 6c 65 6d 65 6e 74 20 |('Start |element |
|00005660| 27 20 2b 20 6e 61 6d 65 | 29 3b 0d 20 20 20 20 20 |' + name|);. |
|00005670| 20 20 20 73 77 69 74 63 | 68 20 28 6e 61 6d 65 29 | switc|h (name)|
|00005680| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 63 | {. | c|
|00005690| 61 73 65 20 27 66 61 75 | 6c 74 27 3a 0d 20 20 20 |ase 'fau|lt':. |
|000056a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 74 68 69 | | thi|
|000056b0| 73 2e 5f 66 6f 75 6e 64 | 46 61 75 6c 74 20 3d 20 |s._found|Fault = |
|000056c0| 74 72 75 65 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |true;. | |
|000056d0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0d 0d 20 20 | br|eak;.. |
|000056e0| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 27 | | case '|
|000056f0| 76 61 6c 75 65 27 3a 0d | 20 20 20 20 20 20 20 20 |value':.| |
|00005700| 20 20 20 20 20 20 20 20 | 76 61 72 20 76 61 6c 20 | |var val |
|00005710| 3d 20 6e 65 77 20 56 61 | 6c 75 65 28 29 3b 0d 20 |= new Va|lue();. |
|00005720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|00005730| 68 69 73 2e 5f 76 61 6c | 75 65 53 74 61 63 6b 2e |his._val|ueStack.|
|00005740| 70 75 73 68 28 76 61 6c | 29 3b 0d 20 20 20 20 20 |push(val|);. |
|00005750| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 69 73 2e | | this.|
|00005760| 5f 63 75 72 72 56 61 6c | 75 65 20 3d 20 76 61 6c |_currVal|ue = val|
|00005770| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00005780| 20 20 74 68 69 73 2e 5f | 63 64 61 74 61 20 3d 20 | this._|cdata = |
|00005790| 27 27 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |'';. | |
|000057a0| 20 20 20 20 62 72 65 61 | 6b 3b 0d 0d 20 20 20 20 | brea|k;.. |
|000057b0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 27 6e 61 | |case 'na|
|000057c0| 6d 65 27 3a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |me':. | |
|000057d0| 20 20 20 20 20 74 68 69 | 73 2e 5f 63 64 61 74 61 | thi|s._cdata|
|000057e0| 20 3d 20 27 27 3b 0d 20 | 20 20 20 20 20 20 20 20 | = '';. | |
|000057f0| 20 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0d 0d 20 | b|reak;.. |
|00005800| 20 20 20 20 20 20 20 20 | 20 20 20 63 61 73 65 20 | | case |
|00005810| 27 69 34 27 3a 0d 20 20 | 20 20 20 20 20 20 20 20 |'i4':. | |
|00005820| 20 20 63 61 73 65 20 27 | 69 6e 74 27 3a 0d 20 20 | case '|int':. |
|00005830| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00005840| 69 73 2e 5f 63 75 72 72 | 56 61 6c 75 65 2e 74 79 |is._curr|Value.ty|
|00005850| 70 65 20 3d 20 74 68 69 | 73 2e 49 4e 54 3b 0d 20 |pe = thi|s.INT;. |
|00005860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | | b|
|00005870| 72 65 61 6b 3b 0d 0d 20 | 20 20 20 20 20 20 20 20 |reak;.. | |
|00005880| 20 20 20 63 61 73 65 20 | 27 62 6f 6f 6c 65 61 6e | case |'boolean|
|00005890| 27 3a 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |':. | |
|000058a0| 20 20 20 74 68 69 73 2e | 5f 63 75 72 72 56 61 6c | this.|_currVal|
|000058b0| 75 65 2e 74 79 70 65 20 | 3d 20 74 68 69 73 2e 42 |ue.type |= this.B|
|000058c0| 4f 4f 4c 45 41 4e 3b 0d | 20 20 20 20 20 20 20 20 |OOLEAN;.| |
|000058d0| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 0d | |break;..|
|000058e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|000058f0| 20 27 64 6f 75 62 6c 65 | 27 3a 0d 20 20 20 20 20 | 'double|':. |
|00005900| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 69 73 2e | | this.|
|00005910| 5f 63 75 72 72 56 61 6c | 75 65 2e 74 79 70 65 20 |_currVal|ue.type |
|00005920| 3d 20 74 68 69 73 2e 44 | 4f 55 42 4c 45 3b 0d 20 |= this.D|OUBLE;. |
|00005930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | | b|
|00005940| 72 65 61 6b 3b 0d 0d 20 | 20 20 20 20 20 20 20 20 |reak;.. | |
|00005950| 20 20 20 63 61 73 65 20 | 27 64 61 74 65 54 69 6d | case |'dateTim|
|00005960| 65 2e 69 73 6f 38 36 30 | 31 27 3a 0d 20 20 20 20 |e.iso860|1':. |
|00005970| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|00005980| 2e 5f 63 75 72 72 56 61 | 6c 75 65 2e 74 79 70 65 |._currVa|lue.type|
|00005990| 20 3d 20 74 68 69 73 2e | 44 41 54 45 54 49 4d 45 | = this.|DATETIME|
|000059a0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000059b0| 20 20 62 72 65 61 6b 3b | 0d 0d 20 20 20 20 20 20 | break;|.. |
|000059c0| 20 20 20 20 20 20 63 61 | 73 65 20 27 62 61 73 65 | ca|se 'base|
|000059d0| 36 34 27 3a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |64':. | |
|000059e0| 20 20 20 20 20 74 68 69 | 73 2e 5f 63 75 72 72 56 | thi|s._currV|
|000059f0| 61 6c 75 65 2e 74 79 70 | 65 20 3d 20 74 68 69 73 |alue.typ|e = this|
|00005a00| 2e 42 41 53 45 36 34 3b | 0d 20 20 20 20 20 20 20 |.BASE64;|. |
|00005a10| 20 20 20 20 20 20 20 20 | 20 62 72 65 61 6b 3b 0d | | break;.|
|00005a20| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 63 61 73 |. | cas|
|00005a30| 65 20 27 73 74 72 75 63 | 74 27 3a 0d 20 20 20 20 |e 'struc|t':. |
|00005a40| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|00005a50| 2e 5f 63 75 72 72 56 61 | 6c 75 65 2e 74 79 70 65 |._currVa|lue.type|
|00005a60| 20 3d 20 74 68 69 73 2e | 53 54 52 55 43 54 3b 0d | = this.|STRUCT;.|
|00005a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005a80| 62 72 65 61 6b 3b 0d 0d | 20 20 20 20 20 20 20 20 |break;..| |
|00005a90| 20 20 20 20 63 61 73 65 | 20 27 61 72 72 61 79 27 | case| 'array'|
|00005aa0| 3a 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:. | |
|00005ab0| 20 20 74 68 69 73 2e 5f | 63 75 72 72 56 61 6c 75 | this._|currValu|
|00005ac0| 65 2e 74 79 70 65 20 3d | 20 74 68 69 73 2e 41 52 |e.type =| this.AR|
|00005ad0| 52 41 59 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |RAY;. | |
|00005ae0| 20 20 20 20 20 62 72 65 | 61 6b 3b 0d 20 20 20 20 | bre|ak;. |
|00005af0| 20 20 20 20 7d 0d 20 20 | 20 20 7d 2c 0d 0d 20 20 | }. | },.. |
|00005b00| 20 20 65 6e 64 45 6c 65 | 6d 65 6e 74 3a 20 66 75 | endEle|ment: fu|
|00005b10| 6e 63 74 69 6f 6e 28 6e | 61 6d 65 29 20 7b 0d 20 |nction(n|ame) {. |
|00005b20| 20 20 20 20 20 20 20 76 | 61 72 20 76 61 6c 3b 0d | v|ar val;.|
|00005b30| 20 20 20 20 20 20 20 20 | 69 66 20 28 44 45 42 55 | |if (DEBU|
|00005b40| 47 50 41 52 53 45 29 20 | 64 65 62 75 67 28 27 45 |GPARSE) |debug('E|
|00005b50| 6e 64 20 65 6c 65 6d 65 | 6e 74 20 27 20 2b 20 6e |nd eleme|nt ' + n|
|00005b60| 61 6d 65 29 3b 0d 20 20 | 20 20 20 20 20 20 73 77 |ame);. | sw|
|00005b70| 69 74 63 68 20 28 6e 61 | 6d 65 29 20 7b 0d 20 20 |itch (na|me) {. |
|00005b80| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 27 | | case '|
|00005b90| 76 61 6c 75 65 27 3a 0d | 20 20 20 20 20 20 20 20 |value':.| |
|00005ba0| 20 20 20 20 20 20 20 20 | 2f 2f 20 74 61 6b 65 20 | |// take |
|00005bb0| 63 64 61 74 61 20 61 6e | 64 20 70 75 74 20 69 74 |cdata an|d put it|
|00005bc0| 20 69 6e 20 74 68 69 73 | 20 76 61 6c 75 65 3b 0d | in this| value;.|
|00005bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005be0| 69 66 20 28 74 68 69 73 | 2e 5f 63 75 72 72 56 61 |if (this|._currVa|
|00005bf0| 6c 75 65 2e 74 79 70 65 | 20 21 3d 20 74 68 69 73 |lue.type| != this|
|00005c00| 2e 41 52 52 41 59 20 26 | 26 0d 20 20 20 20 20 20 |.ARRAY &|&. |
|00005c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00005c20| 69 73 2e 5f 63 75 72 72 | 56 61 6c 75 65 2e 74 79 |is._curr|Value.ty|
|00005c30| 70 65 20 21 3d 20 74 68 | 69 73 2e 53 54 52 55 43 |pe != th|is.STRUC|
|00005c40| 54 29 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |T) {. | |
|00005c50| 20 20 20 20 20 20 20 20 | 20 74 68 69 73 2e 5f 63 | | this._c|
|00005c60| 75 72 72 56 61 6c 75 65 | 2e 76 61 6c 75 65 20 3d |urrValue|.value =|
|00005c70| 20 74 68 69 73 2e 5f 63 | 64 61 74 61 3b 0d 20 20 | this._c|data;. |
|00005c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005c90| 20 20 74 68 69 73 2e 5f | 63 64 61 74 61 20 3d 20 | this._|cdata = |
|00005ca0| 6e 75 6c 6c 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |null;. | |
|00005cb0| 20 20 20 20 20 20 7d 0d | 0d 20 20 20 20 20 20 20 | }.|. |
|00005cc0| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 46 69 6e 64 | | // Find|
|00005cd0| 20 6f 75 74 20 69 66 20 | 74 68 69 73 20 69 73 20 | out if |this is |
|00005ce0| 74 68 65 20 65 6e 64 20 | 76 61 6c 75 65 0d 20 20 |the end |value. |
|00005cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f | | //|
|00005d00| 20 4e 6f 74 65 20 74 68 | 61 74 20 77 65 20 74 72 | Note th|at we tr|
|00005d10| 65 61 74 20 61 20 73 74 | 72 75 63 74 20 64 69 66 |eat a st|ruct dif|
|00005d20| 66 65 72 65 6e 74 6c 79 | 2c 20 73 65 65 20 27 6d |ferently|, see 'm|
|00005d30| 65 6d 62 65 72 27 0d 20 | 20 20 20 20 20 20 20 20 |ember'. | |
|00005d40| 20 20 20 20 20 20 20 76 | 61 72 20 64 65 70 74 68 | v|ar depth|
|00005d50| 20 3d 20 74 68 69 73 2e | 5f 76 61 6c 75 65 53 74 | = this.|_valueSt|
|00005d60| 61 63 6b 2e 6c 65 6e 67 | 74 68 3b 0d 20 20 20 20 |ack.leng|th;. |
|00005d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00005d80| 64 65 70 74 68 20 3c 20 | 32 20 7c 7c 20 0d 20 20 |depth < |2 || . |
|00005d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005da0| 20 20 74 68 69 73 2e 5f | 76 61 6c 75 65 53 74 61 | this._|valueSta|
|00005db0| 63 6b 5b 64 65 70 74 68 | 20 2d 20 32 5d 2e 74 79 |ck[depth| - 2].ty|
|00005dc0| 70 65 20 21 3d 20 74 68 | 69 73 2e 53 54 52 55 43 |pe != th|is.STRUC|
|00005dd0| 54 29 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |T) {. | |
|00005de0| 20 20 20 20 20 20 20 20 | 20 76 61 6c 20 3d 20 74 | | val = t|
|00005df0| 68 69 73 2e 5f 63 75 72 | 72 56 61 6c 75 65 3b 0d |his._cur|rValue;.|
|00005e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005e10| 20 20 20 20 74 68 69 73 | 2e 5f 76 61 6c 75 65 53 | this|._valueS|
|00005e20| 74 61 63 6b 2e 70 6f 70 | 28 29 3b 0d 0d 20 20 20 |tack.pop|();.. |
|00005e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005e40| 20 69 66 20 28 64 65 70 | 74 68 20 3c 20 32 29 20 | if (dep|th < 2) |
|00005e50| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00005e60| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 44 45 | | if (DE|
|00005e70| 42 55 47 29 20 64 65 62 | 75 67 28 27 46 6f 75 6e |BUG) deb|ug('Foun|
|00005e80| 64 20 72 65 73 75 6c 74 | 27 29 3b 0d 20 20 20 20 |d result|');. |
|00005e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005ea0| 20 20 20 20 2f 2f 20 54 | 68 69 73 20 69 73 20 74 | // T|his is t|
|00005eb0| 68 65 20 74 6f 70 20 6c | 65 76 65 6c 20 6f 62 6a |he top l|evel obj|
|00005ec0| 65 63 74 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ect. | |
|00005ed0| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|00005ee0| 2e 5f 72 65 73 75 6c 74 | 20 3d 20 76 61 6c 2e 76 |._result| = val.v|
|00005ef0| 61 6c 75 65 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |alue;. | |
|00005f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00005f10| 69 73 2e 5f 63 75 72 72 | 56 61 6c 75 65 20 3d 20 |is._curr|Value = |
|00005f20| 6e 75 6c 6c 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |null;. | |
|00005f30| 20 20 20 20 20 20 20 20 | 20 20 7d 20 65 6c 73 65 | | } else|
|00005f40| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00005f50| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 54 68 | | // Th|
|00005f60| 69 73 20 69 73 20 61 6e | 20 61 72 72 61 79 20 65 |is is an| array e|
|00005f70| 6c 65 6d 65 6e 74 2e 20 | 41 64 64 20 69 74 2e 0d |lement. |Add it..|
|00005f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005f90| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 63 75 | |this._cu|
|00005fa0| 72 72 56 61 6c 75 65 20 | 3d 20 0d 20 20 20 20 20 |rrValue |= . |
|00005fb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005fc0| 20 20 20 20 20 20 20 74 | 68 69 73 2e 5f 76 61 6c | t|his._val|
|00005fd0| 75 65 53 74 61 63 6b 5b | 74 68 69 73 2e 5f 76 61 |ueStack[|this._va|
|00005fe0| 6c 75 65 53 74 61 63 6b | 2e 6c 65 6e 67 74 68 20 |lueStack|.length |
|00005ff0| 2d 20 31 5d 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |- 1];. | |
|00006000| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00006010| 69 73 2e 5f 63 75 72 72 | 56 61 6c 75 65 2e 61 70 |is._curr|Value.ap|
|00006020| 70 65 6e 64 56 61 6c 75 | 65 28 76 61 6c 2e 76 61 |pendValu|e(val.va|
|00006030| 6c 75 65 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |lue);. | |
|00006040| 20 20 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 | | }. |
|00006050| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 | | }. |
|00006060| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 62 72 | | br|
|00006070| 65 61 6b 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |eak;. | |
|00006080| 20 20 20 20 20 0d 20 20 | 20 20 20 20 20 20 20 20 | . | |
|00006090| 20 20 63 61 73 65 20 27 | 6d 65 6d 62 65 72 27 3a | case '|member':|
|000060a0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000060b0| 20 76 61 6c 20 3d 20 74 | 68 69 73 2e 5f 63 75 72 | val = t|his._cur|
|000060c0| 72 56 61 6c 75 65 3b 0d | 20 20 20 20 20 20 20 20 |rValue;.| |
|000060d0| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 5f 76 61 | |this._va|
|000060e0| 6c 75 65 53 74 61 63 6b | 2e 70 6f 70 28 29 3b 0d |lueStack|.pop();.|
|000060f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006100| 74 68 69 73 2e 5f 63 75 | 72 72 56 61 6c 75 65 20 |this._cu|rrValue |
|00006110| 3d 20 74 68 69 73 2e 5f | 76 61 6c 75 65 53 74 61 |= this._|valueSta|
|00006120| 63 6b 5b 74 68 69 73 2e | 5f 76 61 6c 75 65 53 74 |ck[this.|_valueSt|
|00006130| 61 63 6b 2e 6c 65 6e 67 | 74 68 20 2d 20 31 5d 3b |ack.leng|th - 1];|
|00006140| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00006150| 20 74 68 69 73 2e 5f 63 | 75 72 72 56 61 6c 75 65 | this._c|urrValue|
|00006160| 2e 61 70 70 65 6e 64 56 | 61 6c 75 65 28 76 61 6c |.appendV|alue(val|
|00006170| 2e 76 61 6c 75 65 29 3b | 0d 20 20 20 20 20 20 20 |.value);|. |
|00006180| 20 20 20 20 20 20 20 20 | 20 62 72 65 61 6b 3b 0d | | break;.|
|00006190| 20 20 20 20 20 20 20 20 | 20 20 20 20 0d 20 20 20 | | . |
|000061a0| 20 20 20 20 20 20 20 20 | 20 63 61 73 65 20 27 6e | | case 'n|
|000061b0| 61 6d 65 27 3a 0d 20 20 | 20 20 20 20 20 20 20 20 |ame':. | |
|000061c0| 20 20 20 20 20 20 74 68 | 69 73 2e 5f 63 75 72 72 | th|is._curr|
|000061d0| 56 61 6c 75 65 2e 6e 61 | 6d 65 20 3d 20 74 68 69 |Value.na|me = thi|
|000061e0| 73 2e 5f 63 64 61 74 61 | 3b 0d 20 20 20 20 20 20 |s._cdata|;. |
|000061f0| 20 20 20 20 20 20 20 20 | 20 20 74 68 69 73 2e 5f | | this._|
|00006200| 63 64 61 74 61 20 3d 20 | 6e 75 6c 6c 3b 0d 20 20 |cdata = |null;. |
|00006210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 62 72 | | br|
|00006220| 65 61 6b 3b 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 |eak;. | }. |
|00006230| 20 20 20 7d 0d 7d 3b 0d | 0d 2f 2a 20 54 68 65 20 | }.};.|./* The |
|00006240| 58 4d 4c 57 72 69 74 65 | 72 20 63 6c 61 73 73 20 |XMLWrite|r class |
|00006250| 63 6f 6e 73 74 72 75 63 | 74 6f 72 20 2a 2f 0d 66 |construc|tor */.f|
|00006260| 75 6e 63 74 69 6f 6e 20 | 58 4d 4c 57 72 69 74 65 |unction |XMLWrite|
|00006270| 72 28 29 20 7b 0d 20 20 | 20 20 2f 2f 20 57 65 20 |r() {. | // We |
|00006280| 61 73 73 75 6d 65 20 66 | 6f 72 20 6e 6f 77 20 74 |assume f|or now t|
|00006290| 68 61 74 20 61 6c 6c 20 | 64 61 74 61 20 69 73 20 |hat all |data is |
|000062a0| 61 6c 72 65 61 64 79 20 | 69 6e 20 49 53 4f 2d 38 |already |in ISO-8|
|000062b0| 38 35 39 2d 31 2e 0d 20 | 20 20 20 74 68 69 73 2e |859-1.. | this.|
|000062c0| 64 61 74 61 20 3d 20 27 | 3c 3f 78 6d 6c 20 76 65 |data = '|<?xml ve|
|000062d0| 72 73 69 6f 6e 3d 22 31 | 2e 30 22 20 65 6e 63 6f |rsion="1|.0" enco|
|000062e0| 64 69 6e 67 3d 22 49 53 | 4f 2d 38 38 35 39 2d 31 |ding="IS|O-8859-1|
|000062f0| 22 3f 3e 27 3b 0d 7d 0d | 0d 2f 2a 20 54 68 65 20 |"?>';.}.|./* The |
|00006300| 58 4d 4c 57 72 69 74 65 | 72 20 63 6c 61 73 73 20 |XMLWrite|r class |
|00006310| 64 65 66 20 2a 2f 0d 58 | 4d 4c 57 72 69 74 65 72 |def */.X|MLWriter|
|00006320| 2e 70 72 6f 74 6f 74 79 | 70 65 20 3d 20 7b 0d 20 |.prototy|pe = {. |
|00006330| 20 20 20 64 61 74 61 3a | 20 27 27 2c 0d 20 20 20 | data:| '',. |
|00006340| 20 0d 20 20 20 20 73 74 | 61 72 74 45 6c 65 6d 65 | . st|artEleme|
|00006350| 6e 74 3a 20 66 75 6e 63 | 74 69 6f 6e 28 65 6c 65 |nt: func|tion(ele|
|00006360| 6d 65 6e 74 29 20 7b 0d | 20 20 20 20 20 20 20 20 |ment) {.| |
|00006370| 74 68 69 73 2e 64 61 74 | 61 20 2b 3d 20 27 3c 27 |this.dat|a += '<'|
|00006380| 20 2b 20 65 6c 65 6d 65 | 6e 74 20 2b 20 27 3e 27 | + eleme|nt + '>'|
|00006390| 3b 0d 20 20 20 20 7d 2c | 0d 0d 20 20 20 20 65 6e |;. },|.. en|
|000063a0| 64 45 6c 65 6d 65 6e 74 | 3a 20 66 75 6e 63 74 69 |dElement|: functi|
|000063b0| 6f 6e 28 65 6c 65 6d 65 | 6e 74 29 20 7b 0d 20 20 |on(eleme|nt) {. |
|000063c0| 20 20 20 20 20 20 74 68 | 69 73 2e 64 61 74 61 20 | th|is.data |
|000063d0| 2b 3d 20 27 3c 2f 27 20 | 2b 20 65 6c 65 6d 65 6e |+= '</' |+ elemen|
|000063e0| 74 20 2b 20 27 3e 27 3b | 0d 20 20 20 20 7d 2c 0d |t + '>';|. },.|
|000063f0| 20 20 20 20 0d 20 20 20 | 20 77 72 69 74 65 3a 20 | . | write: |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.