public void logHTMLFinish(PrintWriter htmlout,String moduleName, int pageCount, long startTime, long endTime) {
// timing and message to browser
long overall = endTime - startTime;
- long pagesPerMinute=0; float perMinute = overall/60000;
- if (perMinute >0) pagesPerMinute = (long) (pageCount / perMinute);
+ int pagesPerMinute=0; float perMinute = (float)overall/(float)60000;
+ if (perMinute >0) pagesPerMinute = (int) ((float)pageCount / perMinute);
logHTML(htmlout, "Producer."+moduleName+" finished producing: " +
overall + " ms for "+ pageCount+" Pages = " +pagesPerMinute + " pages/min");
public class ProducerFeature extends ProducerList {
-
- public void setAdditional(String key, TemplateModel value) {
- additional.put(key,value);
- }
-
- public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
+ public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
throws StorageObjectException, ModuleException {
orderBy="date desc";
listTemplate = MirConfig.getProp("Producer.FeatureList.Template");
}
whereClause += currentTopic.getId();
fileDesc = currentTopic.getValue("filename").trim();
- setAdditional("topic",HTMLTemplateProcessor.makeSimpleHash(currentTopic));
+ setAdditional("topic",currentTopic);
} catch (Exception e) {
logHTML(htmlout, "problem with feature skipping");
}
handleIt(htmlout,user,force);
}
- public static void main(String argv[]){
- try {
- new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
- } catch(Exception e) {
- System.err.println(e.toString());
- }
- }
+ public static void main(String argv[]){
+ try {
+ new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
+ } catch(Exception e) {
+ System.err.println(e.toString());
+ }
+ }
}
logHTML(htmlout, "Producer.List finished: " + sessionConnectTime + " ms.");
} //end handle
- abstract public void setAdditional(String key, TemplateModel value);
+ public void setAdditional(String key, TemplateModel value) {
+ additional.put(key,value);
+ }
+
}
public class ProducerOpenPosting extends ProducerList {
- public void setAdditional(String key, TemplateModel value) {
- additional.put(key,value);
- }
- public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
- throws StorageObjectException, ModuleException {
+ public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync)
+ throws StorageObjectException, ModuleException
+ {
listTemplate = MirConfig.getProp("Producer.OpenPosting.Template");
whereClause="is_published='1'";
orderBy="date desc, webdb_create desc";
fileDesc="open";
- SimpleScalar title = new SimpleScalar();
- title.setValue("Open-Posting");
setAdditional("topicslist",topicsModule.getTopicsList());
- setAdditional("title",title);
+ setAdditional("title",new SimpleScalar("Open-Posting"));
+ handleIt(htmlout,user,force);
+ }
+
- handleIt(htmlout,user,force);
+ public static void main(String argv[]){
+ try {
+ new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
+ } catch(Exception e) {
+ System.err.println(e.toString());
}
+ }
- public static void main(String argv[]){
- try {
- new ProducerOpenPosting().handle(new PrintWriter(System.out), null,false, false);
- } catch(Exception e) {
- System.err.println(e.toString());
- }
- }
}
startPageModel.put("startspecial", contentModule.getStartArticle());
startPageModel.put("features", contentModule.getFeatures(0,itemsPerPage));
+ /** @todo switch to compressed */
produce(startPageTemplate, producerDocRoot + "/index.shtml", startPageModel, htmlout);
- // Finish
- logHTML(htmlout, "Producer.Startpage finished: " + (
- System.currentTimeMillis() - startTime) + " ms.");
+ // finished
+ logHTMLFinish(htmlout, "Startpage", 1, startTime, System.currentTimeMillis());
+
if(sync==true){
+ logHTML(htmlout, "Producer.Startpage: rsyncing...");
Helper.rsync();
logHTML(htmlout, "Producer.Startpage: rsync done");
}
- /** @todo we should have a link back to startpage here */
}
}
String tinyIcon;
String iconAlt;
- /** @todo couldn't this be in Producer.java and should be named addAdditional,
- * and should be thrown away afterwards? */
- public void setAdditional(String key, TemplateModel value) {
- additional.put(key,value);
- }
-
public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync, String id)
throws StorageObjectException, ModuleException {
where=id;