1 package mircoders.producer;
8 import freemarker.template.*;
15 import mircoders.module.*;
16 import mircoders.entity.*;
17 import mircoders.storage.*;
21 public class ProducerFeature extends ProducerList {
24 public void setAdditional(String key, TemplateModel value) {
25 additional.put(key,value);
28 public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
29 throws StorageObjectException, ModuleException {
31 listTemplate = MirConfig.getProp("Producer.FeatureList.Template");
32 EntityList featureEntityList = featureModule.getByWhereClause("","title", -1);
33 SimpleList featureList = HTMLTemplateProcessor.makeSimpleList(featureEntityList);
35 whereClause="is_published!=true AND to_article_type=0 AND id IN (";
36 for(int i=0; i < featureEntityList.size(); i++){
39 EntityTopics currentTopic = (EntityTopics)featureEntityList.elementAt(i);
40 EntityList contentEntityList = DatabaseContentToTopics.getInstance().getContent(currentTopic);
44 whereClause += currentTopic.getId();
45 fileDesc = currentTopic.getValue("filename").trim();
46 setAdditional("topic",HTMLTemplateProcessor.makeSimpleHash(currentTopic));
47 } catch (Exception e) {
48 logHTML(htmlout, "problem with feature skipping");
54 handleIt(htmlout,user,force);
57 public static void main(String argv[]){
59 new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
60 } catch(Exception e) {
61 System.err.println(e.toString());