blob: 04e402e92934e5db11e459e4a57177fd82de569e [file] [log] [blame]
Meki Cherkaouif441d3a2012-04-22 15:17:52 -07001<?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
54 ///////////////////////////////////////
55 //createRoute('localhost', 9695);
56
57 createRoute('131.179.141.15', 9695);
58 //createRoute('borges.metwi.ucla.edu', 9695);
59
60 //content object
61 var co = queryPrefix( ContentName );
62
63 ///////////////////////////////////////
64
65 var output ="";
66
67 if(co==-1)
68 output+= "NO CONTENT FOUND"
69 else if (co==-2)
70 output+= "CONTENT NAME IS EMPTY"
71 else{
72 if(co.Name!=null && co.Name.Components!=null){
73 output+= "NAME: ";
74
75 for(var i=0;i<co.Name.Components.length;i++){
76 output+= "/"+ toString(co.Name.Components[i]);
77 }
78 output+= "<br />";
79 output+= "<br />";
80 }
81
82 if(co.Content !=null){
83 output += "CONTENT(ASCII): "+ toString(co.Content);
84
85 output+= "<br />";
86 output+= "<br />";
87 }
88 if(co.Content !=null){
89 output += "CONTENT(hex): "+ toHex(co.Content);
90
91 output+= "<br />";
92 output+= "<br />";
93 }
94 if(co.Signature !=null && co.Signature.Signature!=null){
95
96 output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
97
98 output+= "<br />";
99 output+= "<br />";
100 }
101 if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
102
103 output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
104
105 output+= "<br />";
106 output+= "<br />";
107
108 }
109 }
110
111 document.getElementById('result').innerHTML = output;
112 }
113
114 </script>
115
116</head>
117<body >
118 <form>
119 Please Enter a Content Name:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
120 </form>
121 <button onclick="run()">Run!</button>
122 <div >
123 <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
124 </applet>
125 </div>
126
127 <p id="result"></p>
128
129</body>
130</html>