rem: var counter = 0; var lastId = 0; var rows = db.executeRetrieval("select max(SKIN_ID) as max, count(*) " + "as amount from AV_SKIN"); rows.next() var max = rows.getColumnItem("max"); var amount = rows.getColumnItem("amount"); rows.release(); while (lastId < max) { lastId = exportSkins("select SKIN_ID, SITE_ALIAS, LAYOUT_ALIAS, " + "SKIN_PROTOTYPE, SKIN_NAME, SKIN_SOURCE from AV_SITE, AV_LAYOUT, " + "AV_SKIN where SKIN_F_LAYOUT = LAYOUT_ID and LAYOUT_F_SITE = " + "SITE_ID and SKIN_ID > " + lastId + " order by SKIN_ID limit 100;"); counter += 100; app.logger.info("Exported " + counter + " of " + amount + " skins"); app.logger.info("Current ID: " + lastId + " of " + max); 
add: /* createTags(id, "Story"); createHubs(id, "Story"); createTags(id, "Image"); createHubs(id, "Image"); return; */  var max = root.size(); for (var i=1; i<=max; i+=1) { var site = root.get(i-1); app.logger.info("Tagging stories of site " + site._id + " ``" + site.alias + "'' (" + i + " of " + max + ")"); createTags(site._id, "Story"); createHubs(site._id, "Story"); createTags(site._id, "Image"); createHubs(site._id, "Image"); continue;  var smax = site.stories.size(); counter = 0; for (var n=0; n<smax; n+=1) { var story = site.stories.get(n); if (story.topic) {  story.tags.add(new TagJoin(story.topic, story, site, story.modifier || story.creator)); story.content.set("tags", story.topic); res.commit(); } } 
context:    app.invokeAsync(null, function() {      var counter = 0;      var lastId = 0;      var rows = db.executeRetrieval("select max(SKIN_ID) as max, count(*) " +            "as amount from AV_SKIN");      rows.next()      var max = rows.getColumnItem("max");      var amount = rows.getColumnItem("amount");      rows.release();      while (lastId < max) {         lastId = exportSkins("select SKIN_ID, SITE_ALIAS, LAYOUT_ALIAS, " +               "SKIN_PROTOTYPE, SKIN_NAME, SKIN_SOURCE from AV_SITE, AV_LAYOUT, " +               "AV_SKIN where SKIN_F_LAYOUT = LAYOUT_ID and LAYOUT_F_SITE = " +               "SITE_ID and SKIN_ID > " + lastId + " order by SKIN_ID limit 100;");         counter += 100;         app.logger.info("Exported " + counter + " of " + amount + " skins");         app.logger.info("Current ID: " + lastId + " of " + max);      }   }, [], -1);
meta: 993	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/993/d46237ae5555045222f493137c5c51dbcd7b4033/conversion.js/clean/compatibility/Global/conversion.js