get rid of deprecated makeSimpleList and makeSimpleHash usage. this should be it...
[mir.git] / source / mircoders / producer / ProducerFeature.java
1 package mircoders.producer;
2
3 import java.io.*;
4 import java.lang.*;
5 import java.util.*;
6 import java.sql.*;
7
8 import freemarker.template.*;
9
10 import mir.misc.*;
11 import mir.storage.*;
12 import mir.module.*;
13 import mir.entity.*;
14
15 import mircoders.module.*;
16 import mircoders.entity.*;
17 import mircoders.storage.*;
18
19
20
21 public class ProducerFeature extends ProducerList {
22
23   public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
24                 throws StorageObjectException, ModuleException {
25                 orderBy="date desc";
26                 listTemplate = MirConfig.getProp("Producer.FeatureList.Template");
27                 EntityList featureEntityList = featureModule.getByWhereClause("","title", -1);
28                 boolean first=true;
29                 whereClause="is_published!=true AND to_article_type=0 AND id IN (";
30                 for(int i=0; i < featureEntityList.size(); i++){
31
32             try {
33                 EntityTopics currentTopic = (EntityTopics)featureEntityList.elementAt(i);
34                 EntityList contentEntityList = DatabaseContentToTopics.getInstance().getContent(currentTopic);
35                 if(first==false) {
36                     whereClause += ",";
37                 }
38                 whereClause += currentTopic.getId();
39                 fileDesc = currentTopic.getValue("filename").trim();
40                 setAdditional("topic",currentTopic);
41             } catch (Exception e) {
42                 logHTML(htmlout, "problem with feature skipping");
43             }
44
45                         first = false;
46                 }
47                 whereClause += ")";
48                 handleIt(htmlout,user,force);
49         }
50
51   public static void main(String argv[]){
52     try {
53       new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
54     } catch(Exception e) {
55       System.err.println(e.toString());
56     }
57   }
58 }