blob: 96ed2524c4255d8955ff324acf7465522bdbc907 [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
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070040 <script type="text/javascript" src="FaceInstance.js"></script>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070041
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070042 <script type="text/javascript" src="ForwardingEntry.js"></script>
43
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070044 <script type="text/javascript" src="encoding/BinaryXMLEncoder.js"></script>
45
46 <script type="text/javascript" src="encoding/BinaryXMLCodec.js"></script>
47
48 <script type="text/javascript" src="encoding/BinaryXMLDecoder.js"></script>
49
50 <script type="text/javascript" src="encoding/DataUtils.js"></script>
51
52 <script type="text/javascript">
53 function run(){
54
55 var ContentName = document.getElementById('contentname').value;
56
Meki Cherkaoui09c15572012-04-28 14:42:18 -070057 var Content = document.getElementById('content').value;
58
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070059 //createRoute('borges.metwi.ucla.edu', 9695);
60
61 createRoute('localhost', 9695);
62
63 registerPrefix(ContentName, Content);
64
Meki Cherkaoui09c15572012-04-28 14:42:18 -070065
66
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070067 ///////////////////////////////////////
68 //createRoute('localhost', 9695);
69
Meki Cherkaoui09c15572012-04-28 14:42:18 -070070 //createRoute('131.179.141.15', 9695);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070071 //createRoute('borges.metwi.ucla.edu', 9695);
72
73 //content object
Meki Cherkaoui09c15572012-04-28 14:42:18 -070074 //var co = queryPrefix( ContentName );
75
76
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070077
78 ///////////////////////////////////////
79
Meki Cherkaoui09c15572012-04-28 14:42:18 -070080 /*var output ="";
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070081
82 if(co==-1)
83 output+= "NO CONTENT FOUND"
84 else if (co==-2)
85 output+= "CONTENT NAME IS EMPTY"
86 else{
87 if(co.Name!=null && co.Name.Components!=null){
88 output+= "NAME: ";
89
90 for(var i=0;i<co.Name.Components.length;i++){
91 output+= "/"+ toString(co.Name.Components[i]);
92 }
93 output+= "<br />";
94 output+= "<br />";
95 }
96
97 if(co.Content !=null){
98 output += "CONTENT(ASCII): "+ toString(co.Content);
99
100 output+= "<br />";
101 output+= "<br />";
102 }
103 if(co.Content !=null){
104 output += "CONTENT(hex): "+ toHex(co.Content);
105
106 output+= "<br />";
107 output+= "<br />";
108 }
109 if(co.Signature !=null && co.Signature.Signature!=null){
110
111 output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
112
113 output+= "<br />";
114 output+= "<br />";
115 }
116 if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
117
118 output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
119
120 output+= "<br />";
121 output+= "<br />";
122
123 }
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700124 }*/
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700125
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700126 //document.getElementById('result').innerHTML = output;
127 document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
128
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700129 }
130
131 </script>
132
133</head>
134<body >
135 <form>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700136
137 Please Enter a Content Name:<br />
138
139 <input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" />
140
141 Please Enter the Content:<br />
142
143 <textarea id="content" cols="40" rows="5" name="CONTENT" value="SUCCESS" >SUCCESS!</textarea>
144
145
146 <br />
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700147 </form>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700148 <button onclick="run()">Publish</button>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700149 <div >
150 <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
151 </applet>
152 </div>
153
154 <p id="result"></p>
155
156</body>
157</html>