rem: res.data.action = this.href(req.action); res.data.title = gettext("Export layout {0}", this.title); res.data.body = this.renderSkinAsString("download"); res.handlers.context.renderSkin("page"); 
add: var data = new HopObject; data.images = new HopObject; this.images.forEach(function() { var keys = ["name", "width", "height", "description", "contentLength", "thumbnailName", "thumbnailWidth", "thumbnailHeight"]; var image = new HopObject; for each (var key in keys) { image[key] = this[key]; data.images.add(image); } }); data.origin = this.metadata.get("origin") || this.href(); data.originator = this.metadata.get("originator") || session.user.name; data.originated = this.metadata.get("originated") || new Date; var xml = new java.lang.String(Xml.writeToString(data)); zip.addData(xml.getBytes("UTF-8"), "data.xml"); zip.close();  res.contentType = "application/zip"; res.setHeader("Content-Disposition", "attachment; filename=" + this.site.name + "-layout.zip"); res.writeBinary(zip.getData()); 
context: Layout.prototype.export_action = function() {   var mode;   if (mode = req.postParams.mode) {      //try {         var zip = new helma.Zip();         this.exportToZip(zip);         this.images.exportToZip(zip, mode);         this.skins.exportToZip(zip, mode);         zip.addData(new java.lang.String({            source: this.href(),            created: new Date,            creator: session.user.name,            mode: mode         }.toSource()).getBytes("UTF-8"), "export.js");         zip.close();         res.contentType = "application/zip";         res.setHeader("Content-Disposition",                "attachment; filename=" + this.name + ".zip");         res.writeBinary(zip.getData());         //res.redirect(this.href());      /*} catch (ex) {         res.message = ex;         app.log(ex);      }*/   }   res.data.action = this.href(req.action);   res.data.title = gettext("Export layout {0}", this.title);   res.data.body = this.renderSkinAsString("download");   res.handlers.context.renderSkin("page");   return;};
meta: 993	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/993/3efbd63046d0de34a59bbe00c11a37b157f1b745/Layout.js/clean/code/Layout/Layout.js