blob: d396452aef4036e8c04b5909aac3f656288e527c [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>
Meki Cherkaoui8f173612012-06-06 01:05:40 -07007 <title>NDN Publish</title>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -07008 <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
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070014 <script type="text/javascript" src="Name.js"></script>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070015
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
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070030 <script type="text/javascript" src="PublisherID.js"></script>
31
32 <script type="text/javascript" src="Signature.js"></script>
33
34 <script type="text/javascript" src="SignedInfo.js"></script>
35
36 <script type="text/javascript" src="PublisherPublicKeyDigest.js"></script>
37
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070038 <script type="text/javascript" src="FaceInstance.js"></script>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070039
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070040 <script type="text/javascript" src="ForwardingEntry.js"></script>
41
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070042 <script type="text/javascript" src="encoding/BinaryXMLEncoder.js"></script>
43
44 <script type="text/javascript" src="encoding/BinaryXMLCodec.js"></script>
45
46 <script type="text/javascript" src="encoding/BinaryXMLDecoder.js"></script>
47
48 <script type="text/javascript" src="encoding/DataUtils.js"></script>
49
Meki Cherkaoui8f173612012-06-06 01:05:40 -070050 <script type="text/javascript" src="encoding/EncodingUtils.js"></script>
51
52 <script type="text/javascript" src="lwNDN.js"></script>
53
54
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070055 <script language="JavaScript" type="text/javascript" src="security/KeyManager.js"></script>
56
57 <script language="JavaScript" type="text/javascript" src="securityLib/jsbn.js"></script>
58 <script language="JavaScript" type="text/javascript" src="securityLib/jsbn2.js"></script>
59 <script language="JavaScript" type="text/javascript" src="securityLib/rsa.js"></script>
60 <script language="JavaScript" type="text/javascript" src="securityLib/rsa2.js"></script>
61
62 <script language="JavaScript" type="text/javascript" src="securityLib/sha1.js"></script>
63 <script language="JavaScript" type="text/javascript" src="securityLib/sha256.js"></script>
64 <script language="JavaScript" type="text/javascript" src="securityLib/sha512.js"></script>
65 <script language="JavaScript" type="text/javascript" src="securityLib/md5.js"></script>
66 <script language="JavaScript" type="text/javascript" src="securityLib/ripemd160.js"></script>
67 <script language="JavaScript" type="text/javascript" src="securityLib/base64.js"></script>
68
69 <script language="JavaScript" type="text/javascript" src="securityLib/rsapem-1.1.js"></script>
70 <script language="JavaScript" type="text/javascript" src="securityLib/rsasign-1.2.js"></script>
71 <script language="JavaScript" type="text/javascript" src="securityLib/asn1hex-1.1.js"></script>
72 <script language="JavaScript" type="text/javascript" src="securityLib/x509-1.1.js"></script>
73
74
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070075 <script type="text/javascript">
76 function run(){
77
78 var ContentName = document.getElementById('contentname').value;
79
Meki Cherkaoui09c15572012-04-28 14:42:18 -070080 var Content = document.getElementById('content').value;
81
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070082 //createRoute('borges.metwi.ucla.edu', 9695);
83
Meki Cherkaoui8f173612012-06-06 01:05:40 -070084
Meki Cherkaoui09c15572012-04-28 14:42:18 -070085
86
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070087 ///////////////////////////////////////
88 //createRoute('localhost', 9695);
89
Meki Cherkaoui09c15572012-04-28 14:42:18 -070090 //createRoute('131.179.141.15', 9695);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070091 //createRoute('borges.metwi.ucla.edu', 9695);
92
93 //content object
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070094 //var co = queryPrefix( Name );
Meki Cherkaoui09c15572012-04-28 14:42:18 -070095
Meki Cherkaoui8f173612012-06-06 01:05:40 -070096 var connector = new lwNDN('127.0.0.1', 9695);
Axel Colin de Verdiered363e632012-06-06 05:16:43 -070097 //var connector = new lwNDN('131.179.141.15', 9695);
98
Meki Cherkaoui8f173612012-06-06 01:05:40 -070099
100 var co = connector.put( ContentName, Content );
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700101
102 ///////////////////////////////////////
103
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700104 /*var output ="";
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700105
106 if(co==-1)
107 output+= "NO CONTENT FOUND"
108 else if (co==-2)
109 output+= "CONTENT NAME IS EMPTY"
110 else{
Jeff Thompsone85ff1d2012-09-29 21:21:57 -0700111 if(co.name!=null && co.Name.components!=null){
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700112 output+= "NAME: ";
113
114 for(var i=0;i<co.Name.Components.length;i++){
115 output+= "/"+ toString(co.Name.Components[i]);
116 }
117 output+= "<br />";
118 output+= "<br />";
119 }
120
Jeff Thompson86aea882012-09-29 17:32:48 -0700121 if(co.content !=null){
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700122 output += "CONTENT(ASCII): "+ toString(co.Content);
123
124 output+= "<br />";
125 output+= "<br />";
126 }
127 if(co.Content !=null){
128 output += "CONTENT(hex): "+ toHex(co.Content);
129
130 output+= "<br />";
131 output+= "<br />";
132 }
Jeff Thompsone85ff1d2012-09-29 21:21:57 -0700133 if(co.signature !=null && co.signature.signature!=null){
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700134
Jeff Thompsone85ff1d2012-09-29 21:21:57 -0700135 output += "SIGNATURE(hex): "+ toHex(co.signature.signature);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700136
137 output+= "<br />";
138 output+= "<br />";
139 }
Jeff Thompsone85ff1d2012-09-29 21:21:57 -0700140 if(co.signedInfo!=null && co.SignedInfo.locator!=null && co.SignedInfo.Locator.Key!=null){
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700141
142 output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
143
144 output+= "<br />";
145 output+= "<br />";
146
147 }
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700148 }*/
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700149
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700150 //document.getElementById('result').innerHTML = output;
151 document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
152
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700153 }
154
155 </script>
156
157</head>
158<body >
159 <form>
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700160 <div>
161 <p>Please Enter a Content Name:</p>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700162
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700163 <input id="contentname" type="text" name="CONTENTNAME" value="/demo/message" />
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700164
165 Please Enter the Content:<br />
166
Axel Colin de Verdierecb039102012-06-06 08:57:19 -0700167 <textarea id="content" cols="40" rows="5" name="CONTENT" >This works!</textarea>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700168
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700169 <br />
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700170 </div>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700171 </form>
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700172 <div>
173 <button onclick="run()">Publish</button>
174 </div>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700175 <div >
176 <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
177 </applet>
178 </div>
179
180 <p id="result"></p>
181
182</body>
183</html>