// build sql-statement
+
+ /** @todo count sql string should only be assembled if we really count
+ * see below at the end of method //rk */
+
if (wc != null && wc.length() == 0) {
wc = null;
}
try {
con = getPooledCon();
stmt = con.createStatement();
- // counting rows
-
- /** @todo select count(*) should be optimized:
- * 1. it should take place after select statement because in some
- * cases it is not necessary anymore.
- * 2. it is only needed if entitylist needs information about how
- * many datasets there are overall
- *
- * optimization:
- *
- * if we manage to have the full information about allData already
- * with the select statement, then we set it in entitylist, other
- * wise we fetch it. /rk
- * */
-
-
// hier select
rs = executeSql(stmt, selectSql.toString());
public EntityList getBreakingNews() {
EntityList returnList = null;
try {
- EntityList entityList = getByWhereClause(null,"webdb_create desc",0,5);
- returnList = entityList;
+ returnList = getByWhereClause(null,"webdb_create desc",0,5);
}
catch (Exception ex) {
theLog.printWarning("--getBreakingNews(): could not fetch Breaking News" + ex.toString());
public void handle(PrintWriter htmlout, EntityUsers user, boolean force,boolean sync)
throws StorageObjectException, ModuleException
{
+ long startTime = System.currentTimeMillis();
printHTML(htmlout, "Producer.StartPage: started");
- long sessionConnectTime = 0;
- long startTime = (new java.util.Date()).getTime();
- String nowWebdbDate = StringUtil.date2webdbDate(new GregorianCalendar());
- EntityList entityList;
-
- // get the newswire
- entityList = contentModule.getNewsWire(0,newsPerPage);
- SimpleList newsWireList = HTMLTemplateProcessor.makeSimpleList(entityList);
- // get the startarticle
- entityList = contentModule.getStartArticle();
- SimpleList startItemList = HTMLTemplateProcessor.makeSimpleList(entityList);
- // get the features
- entityList = contentModule.getFeatures(0,itemsPerPage);
- SimpleList featureList = HTMLTemplateProcessor.makeSimpleList(entityList);
-
SimpleHash startPageModel = new SimpleHash();
// breaking news
ModuleBreaking breakingModule = new ModuleBreaking(DatabaseBreaking.getInstance());
startPageModel.put("breakingnews", breakingModule.getBreakingNews());
-
startPageModel.put("topics", topicsModule.getTopicsList());
- startPageModel.put("newswire", newsWireList);
- startPageModel.put("startspecial", startItemList);
- startPageModel.put("features", featureList);
+ startPageModel.put("newswire", contentModule.getNewsWire(0,newsPerPage));
+ startPageModel.put("startspecial", contentModule.getStartArticle());
+ startPageModel.put("features", contentModule.getFeatures(0,itemsPerPage));
produce(startPageTemplate, producerDocRoot + "/index.shtml", startPageModel, htmlout);
// Finish
- sessionConnectTime = new java.util.Date().getTime() - startTime;
- logHTML(htmlout, "Producer.Startpage finished: " + sessionConnectTime + " ms.");
+ logHTML(htmlout, "Producer.Startpage finished: " + (
+ System.currentTimeMillis() - startTime) + " ms.");
if(sync==true){
Helper.rsync();
logHTML(htmlout, "Producer.Startpage: rsync done");
}
+ /** @todo we should have a link back to startpage here */
}
}