X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmircoders%2Fproducer%2FProducerFeature.java;h=fad618412e4fa84318830f37776c9f0dad3ef3cb;hb=da42e74d0c6b75838051fec1cb8d3f267a890ded;hp=3df75f93e5686d1a2ecaf8fd76ef28591ba14e60;hpb=635db236fe78484b5f7f0158ad8054b189bf7a79;p=mir.git diff --git a/source/mircoders/producer/ProducerFeature.java b/source/mircoders/producer/ProducerFeature.java index 3df75f93..fad61841 100755 --- a/source/mircoders/producer/ProducerFeature.java +++ b/source/mircoders/producer/ProducerFeature.java @@ -7,42 +7,40 @@ import java.sql.*; import freemarker.template.*; -import webdb.misc.*; -import webdb.storage.*; -import webdb.module.*; -import webdb.entity.*; - +import mir.misc.*; +import mir.storage.*; import mir.module.*; import mir.entity.*; -import mir.storage.*; +import mircoders.module.*; +import mircoders.entity.*; +import mircoders.storage.*; -public class ProducerFeature extends ProducerList { - - public void setAdditional(String key, TemplateModel value) { - additional.put(key,value); - } +public class ProducerFeature extends ProducerList { - 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 = Configuration.getProperty("Producer.FeatureList.Template"); + listTemplate = MirConfig.getProp("Producer.FeatureList.Template"); EntityList featureEntityList = featureModule.getByWhereClause("","title", -1); - SimpleList featureList = HTMLTemplateProcessor.makeSimpleList(featureEntityList); 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",HTMLTemplateProcessor.makeSimpleHash(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 +48,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()); + } + } +}