make sure that batches have the correct "ORDER BY".. same problem in ProducerImages...
authormh <mh>
Sun, 24 Feb 2002 17:01:33 +0000 (17:01 +0000)
committermh <mh>
Sun, 24 Feb 2002 17:01:33 +0000 (17:01 +0000)
source/mircoders/producer/ProducerContent.java
source/mircoders/producer/ProducerImages.java

index 670c2d6..195a3e7 100755 (executable)
@@ -90,7 +90,7 @@ public class ProducerContent extends Producer {
                        //if true produces a single contentitem
                        if(id !=null){
                                whereClause += " AND id="+id;
-                               // I think this avoids a select count(*)...
+                               // this avoids a select count(*)...
                                contentBatchsize=-1;
                        }
                        batchEntityList = contentModule.getContent(whereClause, orderBy, 0,
@@ -129,9 +129,12 @@ public class ProducerContent extends Producer {
                        }//for
                        // if next batch get it...
                        if (batchEntityList.hasNextBatch()){
-                               batchEntityList = contentModule.getByWhereClause(whereClause,
-                                                                                                                                               null, batchEntityList.getNextBatch(),
-                                                                                                                                               contentBatchsize);
+                               //batchEntityList = contentModule.getByWhereClause(whereClause,
+                               //                                                                                                              null, batchEntityList.getNextBatch(),
+                               //                                                                                                              contentBatchsize);
+               batchEntityList = contentModule.getContent(whereClause, orderBy,
+                                                batchEntityList.getNextBatch(),
+                                                contentBatchsize, userEntity);
                        } else {
                                batchEntityList=null;
                        }
index 132c8d3..e18c850 100755 (executable)
@@ -40,6 +40,7 @@ public class ProducerImages extends Producer {
                String              productionPath;
                EntityImages         currentImage;
                EntityList          batchEntityList;
+        String              orderBy = "date desc, webdb_lastchange desc";
 
         int contentBatchsize = Integer.parseInt(MirConfig.getProp("Producer.Content.Batchsize"));
         String imageHost = MirConfig.getProp("Producer.Image.Host");
@@ -52,7 +53,7 @@ public class ProducerImages extends Producer {
                        whereClause += " and id="+id;
                if (force==false) whereClause += " and icon_is_produced='0'";
 
-               batchEntityList = imageModule.getByWhereClause(whereClause, null, 0, contentBatchsize);
+               batchEntityList = imageModule.getByWhereClause(whereClause, orderBy, 0, contentBatchsize);
                theLog.printDebugInfo("whereclause: " + whereClause);
 
 
@@ -98,7 +99,7 @@ public class ProducerImages extends Producer {
                        // if next batch get it...
                        if (batchEntityList.hasNextBatch()){
                                batchEntityList = imageModule.getByWhereClause(whereClause, 
-                                    null, batchEntityList.getNextBatch(),
+                                    orderBy, batchEntityList.getNextBatch(),
                                     contentBatchsize);
                        } else {
                                batchEntityList=null;