- while (batchEntityList != null) {
- for(int i=0;i<batchEntityList.size();i++) {
- currentContent = (EntityContent)batchEntityList.elementAt(i);
- try {
- String date = currentContent.getValue("date");
- String year = date.substring(0,4);
- String month = date.substring(4,6);
- htmlFileName = producerDocRoot
- + "/" + year + "/" + month + "/" +
- currentContent.getValue("id") + ".shtml";
- //produce html
- boolean retVal = produce(contentTemplate, htmlFileName,
- currentContent, htmlout);
- sessionConnectTime = new java.util.Date().getTime() - startTime;
- if (retVal == true &&
- !"1".equals(currentContent.getValue("is_produced")))
- currentContent.setProduced(true);
- } catch(Exception e) {
- logHTML(htmlout, "Producer.Content ERROR while producing content ID:"
- + currentContent.getId()+",skipping it :: "+e.toString());
- theLog.printError("Producer.Content ERR while producing content ID: "
- + currentContent.getId() +",skipping it :: "
- +e.toString());
- }
-
- }//for
-
- if (batchEntityList.hasNextBatch()){
- batchEntityList =
- contentModule.getContent(whereClause, orderBy,
- batchEntityList.getNextBatch(),
- contentBatchsize, userEntity);
- } else {
- batchEntityList=null;
+ for(int i=0;i<batchEntityList.size();i++) {
+ currentContent = (EntityContent)batchEntityList.elementAt(i);
+
+ try {
+
+ SimpleHash mergeData=new SimpleHash();
+ mergeData.put("content", currentContent);
+ String date = currentContent.getValue("date");
+ String year = date.substring(0,4);
+ String month = date.substring(4,6);
+ htmlFileName = producerDocRoot + "/" + year + "/" + month + "/" +
+ currentContent.getValue("id") + ".shtml";
+
+ //produce html
+ boolean retVal = produce(contentTemplate, htmlFileName, mergeData, htmlout);
+ if ( retVal ) currentContent.setProduced(true);
+
+ }
+ catch(Exception e)
+ {
+ String errorText = "Producer.Content ERROR while producing content ID:"
+ + currentContent.getId()+", skipping it :: "+e.toString();
+ logHTML(htmlout, errorText);
+ theLog.printError(errorText);