From: mh Date: Thu, 7 Feb 2002 10:09:19 +0000 (+0000) Subject: Coding Style cleanup X-Git-Url: http://erislabs.net/gitweb/?p=mir.git;a=commitdiff_plain;h=8a5b49bd80cff1dd32a273acf4433005acce0c6b Coding Style cleanup --- diff --git a/source/mircoders/producer/Producer.java b/source/mircoders/producer/Producer.java index de45e4bc..cb2ead17 100755 --- a/source/mircoders/producer/Producer.java +++ b/source/mircoders/producer/Producer.java @@ -14,22 +14,22 @@ import mircoders.storage.*; 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()); diff --git a/source/mircoders/producer/ProducerContent.java b/source/mircoders/producer/ProducerContent.java index c430f210..b489a9ba 100755 --- a/source/mircoders/producer/ProducerContent.java +++ b/source/mircoders/producer/ProducerContent.java @@ -28,7 +28,8 @@ public class ProducerContent extends Producer { 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()); } @@ -36,18 +37,20 @@ public class ProducerContent extends Producer { - 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(); @@ -67,14 +70,16 @@ public class ProducerContent extends Producer { 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) { @@ -85,21 +90,30 @@ public class ProducerContent extends Producer { 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; } @@ -107,7 +121,8 @@ public class ProducerContent extends Producer { // 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."); } }