- 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);
- }
-
- }//for
-
+ if (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);
+ }
+ pageCount++;
+ }//for
+ }