- Timestamp:
- 2013-01-08T14:13:09+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in
r26593 r26596 1 #! @FULL_PERL_EXE@-w1 #!/cygdrive/c/strawberry/perl/bin/perl -w 2 2 3 3 # Need to specify the full path of Perl above, e.g. for Windows something like … … 181 181 } 182 182 183 url += "&p.showExpediteeAttributes=1"; 184 183 //url += "&p.showExpediteeAttributes=1"; 184 185 185 186 /* load iframe with document drawn from Greenstone collection */ 186 187 iframe.src = url; … … 228 229 */ 229 230 231 //get assocfilepath from xml 232 var xmlUrl = iframe.src + "&o=xml"; 233 234 var assoc = getAssocFilePath(xmlUrl); 235 230 236 var expFrameTree = htmlToExpeditee(gsContent); 231 237 … … 239 245 var params = "c=" + collect; 240 246 if (site.match(/\\w/)) { 241 params += "&site=" + site;247 params += "&site=" + site; 242 248 } 249 243 250 params += "&a=generate-frame&fn=" + frameID; 244 251 params += "&json=" + escape(expFrame); 252 253 //add an assocfilepath parameter 254 255 if(assoc !== null && assoc !== undefined){ 256 params += "&assoc=" + assoc; 257 } 245 258 246 259 var clHtml = urlPostSync(url,params); 247 260 248 261 if (!clHtml.match(/html-to-expeditee saved frame/)) { 249 262 alert("Error processing url: " + url); 250 263 } 251 264 … … 274 287 } 275 288 276 url += "&p.showExpediteeAttributes=1";289 //url += "&p.showExpediteeAttributes=1"; 277 290 278 291 iframe.src = url; … … 288 301 289 302 } 303 304 function getAssocFilePath(xmlUrl){ 305 var assoc = ""; 306 307 \$.ajax({ 308 type: "GET", 309 async: false, 310 url: xmlUrl, 311 dataType: "xml", 312 success: function(xml){ 313 314 315 \$(xml).find('metadata').each(function(){ 316 317 var name = \$(this).attr('name'); 318 319 if(name === 'assocfilepath'){ 320 if(assoc === ""){ 321 assoc = \$(this).text(); 322 //console.log(assoc); 323 } 324 325 } 326 }); 327 328 } 329 330 }); 331 332 return assoc; 333 } 290 334 291 335 </script>
Note:
See TracChangeset
for help on using the changeset viewer.