blob: 85eaafa9ca92169f1014cebd7cec91ee8672b8a0 [file] [log] [blame]
Axel Colin de Verdiered363e632012-06-06 05:16:43 -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 Publish</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 <script type="text/javascript" src="FaceInstance.js"></script>
41
42 <script type="text/javascript" src="ForwardingEntry.js"></script>
43
44 <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" src="encoding/EncodingUtils.js"></script>
53
54 <script type="text/javascript" src="lwNDN.js"></script>
55
56
57 <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
77 <script type="text/javascript">
78 function run(){
79
80 var ContentName = document.getElementById('contentname').value;
81
82 var Content = document.getElementById('content').value;
83
84 //createRoute('borges.metwi.ucla.edu', 9695);
85
86
87
88
89 ///////////////////////////////////////
90 //createRoute('localhost', 9695);
91
92 //createRoute('131.179.141.15', 9695);
93 //createRoute('borges.metwi.ucla.edu', 9695);
94
95 //content object
96 //var co = queryPrefix( ContentName );
97
98 var connector = new lwNDN('127.0.0.1', 9695);
99
100 var co = connector.put( ContentName, Content );
101
102 ///////////////////////////////////////
103
104 /*var output ="";
105
106 if(co==-1)
107 output+= "NO CONTENT FOUND"
108 else if (co==-2)
109 output+= "CONTENT NAME IS EMPTY"
110 else{
111 if(co.Name!=null && co.Name.Components!=null){
112 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
121 if(co.Content !=null){
122 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 }
133 if(co.Signature !=null && co.Signature.Signature!=null){
134
135 output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
136
137 output+= "<br />";
138 output+= "<br />";
139 }
140 if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
141
142 output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
143
144 output+= "<br />";
145 output+= "<br />";
146
147 }
148 }*/
149
150 //document.getElementById('result').innerHTML = output;
151 document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
152
153 }
154
155 </script>
156
157</head>
158<body >
159 <form>
160
161 Please Enter a Content Name:<br />
162
163 <input id="contentname" type="text" name="CONTENTNAME" value="/meki" />
164
165 Please Enter the Content:<br />
166
167 <textarea id="content" cols="40" rows="5" name="CONTENT" value="cherkaoui" >cherkaoui</textarea>
168
169 <br />
170
171 </form>
172 <button onclick="run()">Publish</button>
173 <div >
174 <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
175 </applet>
176 </div>
177
178 <p id="result"></p>
179
180</body>
181</html>