blob: 9cf6433af99a55e8fdfd91cfb2d563bc62a279e5 [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
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
Meki Cherkaoui8f173612012-06-06 01:05:40 -070052 <script type="text/javascript" src="encoding/EncodingUtils.js"></script>
53
54 <script type="text/javascript" src="lwNDN.js"></script>
55
56
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070057 <script language="JavaScript" type="text/javascript" src="security/KeyManager.js"></script>
58
59 <script language="JavaScript" type="text/javascript" src="securityLib/jsbn.js"></script>
60 <script language="JavaScript" type="text/javascript" src="securityLib/jsbn2.js"></script>
61 <script language="JavaScript" type="text/javascript" src="securityLib/rsa.js"></script>
62 <script language="JavaScript" type="text/javascript" src="securityLib/rsa2.js"></script>
63
64 <script language="JavaScript" type="text/javascript" src="securityLib/sha1.js"></script>
65 <script language="JavaScript" type="text/javascript" src="securityLib/sha256.js"></script>
66 <script language="JavaScript" type="text/javascript" src="securityLib/sha512.js"></script>
67 <script language="JavaScript" type="text/javascript" src="securityLib/md5.js"></script>
68 <script language="JavaScript" type="text/javascript" src="securityLib/ripemd160.js"></script>
69 <script language="JavaScript" type="text/javascript" src="securityLib/base64.js"></script>
70
71 <script language="JavaScript" type="text/javascript" src="securityLib/rsapem-1.1.js"></script>
72 <script language="JavaScript" type="text/javascript" src="securityLib/rsasign-1.2.js"></script>
73 <script language="JavaScript" type="text/javascript" src="securityLib/asn1hex-1.1.js"></script>
74 <script language="JavaScript" type="text/javascript" src="securityLib/x509-1.1.js"></script>
75
76
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070077 <script type="text/javascript">
78 function run(){
79
80 var ContentName = document.getElementById('contentname').value;
81
Meki Cherkaoui09c15572012-04-28 14:42:18 -070082 var Content = document.getElementById('content').value;
83
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070084 //createRoute('borges.metwi.ucla.edu', 9695);
85
Meki Cherkaoui8f173612012-06-06 01:05:40 -070086
Meki Cherkaoui09c15572012-04-28 14:42:18 -070087
88
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070089 ///////////////////////////////////////
90 //createRoute('localhost', 9695);
91
Meki Cherkaoui09c15572012-04-28 14:42:18 -070092 //createRoute('131.179.141.15', 9695);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070093 //createRoute('borges.metwi.ucla.edu', 9695);
94
95 //content object
Meki Cherkaoui09c15572012-04-28 14:42:18 -070096 //var co = queryPrefix( ContentName );
97
Meki Cherkaoui8f173612012-06-06 01:05:40 -070098 var connector = new lwNDN('127.0.0.1', 9695);
Axel Colin de Verdiered363e632012-06-06 05:16:43 -070099 //var connector = new lwNDN('131.179.141.15', 9695);
100
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700101
102 var co = connector.put( ContentName, Content );
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700103
104 ///////////////////////////////////////
105
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700106 /*var output ="";
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700107
108 if(co==-1)
109 output+= "NO CONTENT FOUND"
110 else if (co==-2)
111 output+= "CONTENT NAME IS EMPTY"
112 else{
113 if(co.Name!=null && co.Name.Components!=null){
114 output+= "NAME: ";
115
116 for(var i=0;i<co.Name.Components.length;i++){
117 output+= "/"+ toString(co.Name.Components[i]);
118 }
119 output+= "<br />";
120 output+= "<br />";
121 }
122
123 if(co.Content !=null){
124 output += "CONTENT(ASCII): "+ toString(co.Content);
125
126 output+= "<br />";
127 output+= "<br />";
128 }
129 if(co.Content !=null){
130 output += "CONTENT(hex): "+ toHex(co.Content);
131
132 output+= "<br />";
133 output+= "<br />";
134 }
135 if(co.Signature !=null && co.Signature.Signature!=null){
136
137 output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
138
139 output+= "<br />";
140 output+= "<br />";
141 }
142 if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
143
144 output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
145
146 output+= "<br />";
147 output+= "<br />";
148
149 }
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700150 }*/
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700151
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700152 //document.getElementById('result').innerHTML = output;
153 document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
154
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700155 }
156
157 </script>
158
159</head>
160<body >
161 <form>
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700162 <div>
163 <p>Please Enter a Content Name:</p>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700164
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700165 <input id="contentname" type="text" name="CONTENTNAME" value="/demo/message" />
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700166
167 Please Enter the Content:<br />
168
Axel Colin de Verdierecb039102012-06-06 08:57:19 -0700169 <textarea id="content" cols="40" rows="5" name="CONTENT" >This works!</textarea>
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700170
Meki Cherkaoui09c15572012-04-28 14:42:18 -0700171 <br />
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700172 </div>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700173 </form>
Axel Colin de Verdiere2758c462012-06-06 08:50:05 -0700174 <div>
175 <button onclick="run()">Publish</button>
176 </div>
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700177 <div >
178 <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
179 </applet>
180 </div>
181
182 <p id="result"></p>
183
184</body>
185</html>