abstract public class Producer {
- protected static String producerDocRoot = MirConfig.getProp("Producer.DocRoot");
+ protected static String producerDocRoot = MirConfig.getProp("Producer.DocRoot");
protected static String producerStorageRoot = MirConfig.getProp("Producer.StorageRoot");
- protected static String producerProductionHost = MirConfig.getProp("Producer.ProductionHost");
- protected static String producerOpenAction = MirConfig.getProp("Producer.OpenAction");;
- protected static Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home") + "/" + MirConfig.getProp("Producer.Logfile"));
- protected static ModuleTopics topicsModule;
+ protected static String producerProductionHost = MirConfig.getProp("Producer.ProductionHost");
+ protected static String producerOpenAction = MirConfig.getProp("Producer.OpenAction");;
+ protected static Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home") + "/" + MirConfig.getProp("Producer.Logfile"));
+ protected static ModuleTopics topicsModule;
protected static ModuleLinksImcs linksImcsModule;
- protected static ModuleSchwerpunkt schwerpunktModule;
- protected static ModuleFeature featureModule;
- protected static ModuleContent contentModule;
- protected static ModuleImages imageModule;
- protected static ModuleUploadedMedia uploadedMediaModule;
+ protected static ModuleSchwerpunkt schwerpunktModule;
+ protected static ModuleFeature featureModule;
+ protected static ModuleContent contentModule;
+ protected static ModuleImages imageModule;
+ protected static ModuleUploadedMedia uploadedMediaModule;
static {
// init
- try {
+ try {
contentModule = new ModuleContent(DatabaseContent.getInstance());
topicsModule = new ModuleTopics(DatabaseTopics.getInstance());
linksImcsModule = new ModuleLinksImcs(DatabaseLinksImcs.getInstance());
System.out.println(MirConfig.getProp("Producer.DocRoot"));
try {
- new ProducerContent().handle(new PrintWriter(System.out), null, false,false);
+ new ProducerContent().handle(new PrintWriter(System.out), null,
+ false,false);
} catch(Exception e) {
System.err.println(e.toString());
}
- 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 {
handle(htmlout,user,force,sync,null);
}
-
- public void handle(PrintWriter htmlout, EntityUsers user, boolean force, boolean sync, String id)
+ public void handle(PrintWriter htmlout, EntityUsers user, boolean force,
+ boolean sync, String id)
throws StorageObjectException, ModuleException {
String contentTemplate = MirConfig.getProp("Producer.Content.Template");
- int contentBatchsize = Integer.parseInt(MirConfig.getProp("Producer.Content.Batchsize"));
+ int contentBatchsize =
+ Integer.parseInt(MirConfig.getProp("Producer.Content.Batchsize"));
long sessionConnectTime = 0;
long startTime = (new java.util.Date()).getTime();
if(id !=null){
whereClause += " AND id="+id;
}
- batchEntityList = contentModule.getContent(whereClause, orderBy, 0, contentBatchsize, userEntity);
+ batchEntityList = contentModule.getContent(whereClause, orderBy, 0,
+ contentBatchsize, userEntity);
} else {
whereClause="is_produced='0' AND is_published='1'";
//if true produces a single contentitem
if(id !=null){
whereClause += " AND id="+id;
}
- batchEntityList = contentModule.getContent(whereClause, orderBy, 0, contentBatchsize, userEntity);
+ batchEntityList = contentModule.getContent(whereClause, orderBy, 0,
+ contentBatchsize, userEntity);
}
while (batchEntityList != null) {
String year = date.substring(0,4);
String month = date.substring(4,6);
htmlFileName = producerDocRoot
- + "/" + year + "/" + month + "/" + currentContent.getValue("id") + ".shtml";
+ + "/" + year + "/" + month + "/" +
+ currentContent.getValue("id") + ".shtml";
//produce html
- boolean retVal = produce(contentTemplate, htmlFileName, currentContent, htmlout);
+ boolean retVal = produce(contentTemplate, htmlFileName,
+ currentContent, htmlout);
sessionConnectTime = new java.util.Date().getTime() - startTime;
- if (retVal == true && !"1".equals(currentContent.getValue("is_produced")))
+ if (retVal == true &&
+ !"1".equals(currentContent.getValue("is_produced")))
currentContent.setProduced(true);
} catch(Exception e) {
- logHTML(htmlout, "Producer.Content ERROR while producing content ID: " + currentContent.getId()+",skipping it :: "+e.toString());
- theLog.printError("Producer.Content ERROR while producing content ID: " + currentContent.getId() +",skipping it :: "+e.toString());
+ logHTML(htmlout, "Producer.Content ERROR while producing content ID:"
+ + currentContent.getId()+",skipping it :: "+e.toString());
+ theLog.printError("Producer.Content ERR while producing content ID: "
+ + currentContent.getId() +",skipping it :: "
+ +e.toString());
}
}//for
if (batchEntityList.hasNextBatch()){
- batchEntityList = contentModule.getContent(whereClause, orderBy, batchEntityList.getNextBatch(),contentBatchsize, userEntity);
+ batchEntityList =
+ contentModule.getContent(whereClause, orderBy,
+ batchEntityList.getNextBatch(),
+ contentBatchsize, userEntity);
} else {
batchEntityList=null;
}
// timing and message to browser
sessionConnectTime = new java.util.Date().getTime() - startTime;
- logHTML(htmlout, "Producer.Content finished: " + sessionConnectTime + " ms.");
+ logHTML(htmlout, "Producer.Content finished: " + sessionConnectTime +
+ " ms.");
}
}