first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / source / mircoders / producer / ProducerFeature.java
index ef9d633..09f8383 100755 (executable)
@@ -20,12 +20,7 @@ import mircoders.storage.*;
 
 public class ProducerFeature extends ProducerList {
 
-
-       public void setAdditional(String key, TemplateModel value) {
-               additional.put(key,value);
-       }
-
-       public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
+  public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
                throws StorageObjectException, ModuleException {
                orderBy="date desc";
                listTemplate = MirConfig.getProp("Producer.FeatureList.Template");
@@ -34,15 +29,19 @@ public class ProducerFeature extends ProducerList {
                boolean first=true;
                whereClause="is_published!=true AND to_article_type=0 AND id IN (";
                for(int i=0; i < featureEntityList.size(); i++){
-                       if(first==false) {
-                               whereClause += ",";
-                       }
 
-                       EntityTopics currentTopic = (EntityTopics)featureEntityList.elementAt(i);
-                       EntityList contentEntityList = DatabaseContentToTopics.getInstance().getContent(currentTopic);
-                       whereClause += currentTopic.getId();
-                       fileDesc = currentTopic.getValue("filename").trim();
-                       setAdditional("topic",currentTopic);
+            try {
+                EntityTopics currentTopic = (EntityTopics)featureEntityList.elementAt(i);
+                EntityList contentEntityList = DatabaseContentToTopics.getInstance().getContent(currentTopic);
+                if(first==false) {
+                    whereClause += ",";
+                }
+                whereClause += currentTopic.getId();
+                fileDesc = currentTopic.getValue("filename").trim();
+                setAdditional("topic",currentTopic);
+            } catch (Exception e) {
+                logHTML(htmlout, "problem with feature skipping");
+            }
 
                        first = false;
                }
@@ -50,11 +49,11 @@ public class ProducerFeature extends ProducerList {
                handleIt(htmlout,user,force);
        }
 
-       public static void main(String argv[]){
-               try {
-                       new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
-               } catch(Exception e) {
-                       System.err.println(e.toString());
-               }
-       }
-}
\ No newline at end of file
+  public static void main(String argv[]){
+    try {
+      new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
+    } catch(Exception e) {
+      System.err.println(e.toString());
+    }
+  }
+}