Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 1 | <?xml version = "1.0" encoding="utf-8" ?>
|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
| 3 | "DTD/xhtml1-strict.dtd">
|
| 4 | <html xmlns = "http://www.w3.org/1999/xhtml">
|
| 5 |
|
| 6 | <head>
|
| 7 | <title>NDN Request Example</title>
|
| 8 | <script type="text/javascript" src="java_socket_bridge.js"></script>
|
| 9 |
|
| 10 | <script type="text/javascript" src="CCNProtocolDTags.js"></script>
|
| 11 |
|
| 12 | <script type="text/javascript" src="CCNTime.js"></script>
|
| 13 |
|
| 14 | <script type="text/javascript" src="ContentName.js"></script>
|
| 15 |
|
| 16 | <script type="text/javascript" src="ContentObject.js"></script>
|
| 17 |
|
| 18 | <script type="text/javascript" src="DateFormat.js"></script>
|
| 19 |
|
| 20 | <script type="text/javascript" src="Exclude.js"></script>
|
| 21 |
|
| 22 | <script type="text/javascript" src="ExcludeAny.js"></script>
|
| 23 |
|
| 24 | <script type="text/javascript" src="ExcludeComponent.js"></script>
|
| 25 |
|
| 26 | <script type="text/javascript" src="Interest.js"></script>
|
| 27 |
|
| 28 | <script type="text/javascript" src="KeyLocator.js"></script>
|
| 29 |
|
| 30 | <script type="text/javascript" src="KeyName.js"></script>
|
| 31 |
|
| 32 | <script type="text/javascript" src="PublisherID.js"></script>
|
| 33 |
|
| 34 | <script type="text/javascript" src="Signature.js"></script>
|
| 35 |
|
| 36 | <script type="text/javascript" src="SignedInfo.js"></script>
|
| 37 |
|
| 38 | <script type="text/javascript" src="PublisherPublicKeyDigest.js"></script>
|
| 39 |
|
| 40 |
|
| 41 | <script type="text/javascript" src="encoding/BinaryXMLEncoder.js"></script>
|
| 42 |
|
| 43 | <script type="text/javascript" src="encoding/BinaryXMLCodec.js"></script>
|
| 44 |
|
| 45 | <script type="text/javascript" src="encoding/BinaryXMLDecoder.js"></script>
|
| 46 |
|
| 47 | <script type="text/javascript" src="encoding/DataUtils.js"></script>
|
| 48 |
|
| 49 | <script type="text/javascript">
|
| 50 | function run(){
|
| 51 |
|
| 52 | var ContentName = document.getElementById('contentname').value;
|
| 53 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 54 | var Content = document.getElementById('content').value;
|
| 55 |
|
| 56 |
|
| 57 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 58 | ///////////////////////////////////////
|
| 59 | //createRoute('localhost', 9695);
|
| 60 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 61 | //createRoute('131.179.141.15', 9695);
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 62 | //createRoute('borges.metwi.ucla.edu', 9695);
|
| 63 |
|
| 64 | //content object
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 65 | //var co = queryPrefix( ContentName );
|
| 66 |
|
| 67 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 68 |
|
| 69 | ///////////////////////////////////////
|
| 70 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 71 | /*var output ="";
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 72 |
|
| 73 | if(co==-1)
|
| 74 | output+= "NO CONTENT FOUND"
|
| 75 | else if (co==-2)
|
| 76 | output+= "CONTENT NAME IS EMPTY"
|
| 77 | else{
|
| 78 | if(co.Name!=null && co.Name.Components!=null){
|
| 79 | output+= "NAME: ";
|
| 80 |
|
| 81 | for(var i=0;i<co.Name.Components.length;i++){
|
| 82 | output+= "/"+ toString(co.Name.Components[i]);
|
| 83 | }
|
| 84 | output+= "<br />";
|
| 85 | output+= "<br />";
|
| 86 | }
|
| 87 |
|
| 88 | if(co.Content !=null){
|
| 89 | output += "CONTENT(ASCII): "+ toString(co.Content);
|
| 90 |
|
| 91 | output+= "<br />";
|
| 92 | output+= "<br />";
|
| 93 | }
|
| 94 | if(co.Content !=null){
|
| 95 | output += "CONTENT(hex): "+ toHex(co.Content);
|
| 96 |
|
| 97 | output+= "<br />";
|
| 98 | output+= "<br />";
|
| 99 | }
|
| 100 | if(co.Signature !=null && co.Signature.Signature!=null){
|
| 101 |
|
| 102 | output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
|
| 103 |
|
| 104 | output+= "<br />";
|
| 105 | output+= "<br />";
|
| 106 | }
|
| 107 | if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
|
| 108 |
|
| 109 | output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
|
| 110 |
|
| 111 | output+= "<br />";
|
| 112 | output+= "<br />";
|
| 113 |
|
| 114 | }
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 115 | }*/
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 116 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 117 | //document.getElementById('result').innerHTML = output;
|
| 118 | document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
|
| 119 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 120 | }
|
| 121 |
|
| 122 | </script>
|
| 123 |
|
| 124 | </head>
|
| 125 | <body >
|
| 126 | <form>
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 127 |
|
| 128 | Please Enter a Content Name:<br />
|
| 129 |
|
| 130 | <input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" />
|
| 131 |
|
| 132 | Please Enter the Content:<br />
|
| 133 |
|
| 134 | <textarea id="content" cols="40" rows="5" name="CONTENT" value="SUCCESS" >SUCCESS!</textarea>
|
| 135 |
|
| 136 |
|
| 137 | <br />
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 138 | </form>
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame^] | 139 | <button onclick="run()">Publish</button>
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 140 | <div >
|
| 141 | <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
|
| 142 | </applet>
|
| 143 | </div>
|
| 144 |
|
| 145 | <p id="result"></p>
|
| 146 |
|
| 147 | </body>
|
| 148 | </html> |