first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / source / mircoders / module / ModuleContent.java
index e78502d..d6b8c93 100755 (executable)
@@ -28,17 +28,40 @@ public class ModuleContent extends AbstractModule
 
        public ModuleContent() {
                super();
-               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
+               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Content.Logfile"));
        }
 
        public ModuleContent(StorageObject theStorage) {
                this.theStorage = theStorage;
-               if (theLog == null) theLog = Logfile.getInstance(this.getClass().getName());
+               if (theLog == null) theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Module.Content.Logfile"));
        }
 
        //
        // methoden, um an ContentEntities zu kommen
 
+  public EntityList getFeatures(int offset, int limit) throws ModuleException
+  {
+    return getContent("is_published=true AND to_article_type=2", "date desc, webdb_create desc",
+                      offset, limit);
+  }
+
+  public EntityList getNewsWire(int offset, int limit) throws ModuleException
+  {
+    return getContent("is_published=true AND to_article_type = 1",
+                                    "date desc, webdb_create desc",offset,limit);
+  }
+
+  public EntityList getStartArticle() throws ModuleException
+  {
+    EntityList returnList = getContent("is_published=true AND to_article_type=4",
+                                        "date desc, webdb_create desc",0,1);
+    //if no startspecial exists
+    if (returnList==null || returnList.size()==0)
+      returnList = getContent("is_published=true AND to_article_type=3",
+                              "date desc, webdb_create desc",0,1);
+
+    return returnList;
+  }
 
        public EntityList getContent(HashMap searchValues, boolean concat, int offset, EntityUsers user)
                throws ModuleException {