From 227a71cccd77c8fc4158be86167a61c08a66a7bd Mon Sep 17 00:00:00 2001 From: zapata Date: Sun, 28 Apr 2002 15:56:58 +0000 Subject: [PATCH] - open posting localizer now in use for updating startpage / content after an open posting. - some small fixes here and there... --- source/mir/misc/HTMLTemplateProcessor.java | 4 +- source/mir/misc/MirConfig.java | 14 +- source/mir/producer/Producer.java | 1 - source/mir/producer/ProducerFactory.java | 2 +- .../basic/FreemarkerGeneratorLocalizer.java | 2 - .../basic/MirBasicOpenPostingLocalizer.java | 8 + .../localizer/basic/MirBasicProducerLocalizer.java | 51 +++- source/mircoders/producer/CompositeProducer.java | 27 +++ .../producer/CompositeProducerFactory.java | 53 +++++ source/mircoders/producer/ContentProducer.java | 260 ++++++++++----------- source/mircoders/producer/ProducerMedia.java | 1 + .../mircoders/servlet/ServletModuleOpenIndy.java | 77 +++--- 12 files changed, 301 insertions(+), 199 deletions(-) create mode 100755 source/mircoders/producer/CompositeProducer.java create mode 100755 source/mircoders/producer/CompositeProducerFactory.java diff --git a/source/mir/misc/HTMLTemplateProcessor.java b/source/mir/misc/HTMLTemplateProcessor.java index c2f10f23..b30f4b73 100755 --- a/source/mir/misc/HTMLTemplateProcessor.java +++ b/source/mir/misc/HTMLTemplateProcessor.java @@ -62,8 +62,8 @@ public final class HTMLTemplateProcessor { openAction = MirConfig.getProp("Producer.OpenAction"); productionHost = MirConfig.getProp("Producer.ProductionHost"); - videoHost = MirConfig.getProp("Producer.VideoHost"); - audioHost = MirConfig.getProp("Producer.AudioHost"); + videoHost = MirConfig.getProp("Producer.Video.Host"); + audioHost = MirConfig.getProp("Producer.Audio.Host"); imageHost = MirConfig.getProp("Producer.Image.Host"); imagePath = MirConfig.getProp("Producer.Image.Path"); producerDocRoot = MirConfig.getProp("Producer.DocRoot"); diff --git a/source/mir/misc/MirConfig.java b/source/mir/misc/MirConfig.java index a64f4cfb..a3e91991 100755 --- a/source/mir/misc/MirConfig.java +++ b/source/mir/misc/MirConfig.java @@ -73,7 +73,14 @@ public class MirConfig extends Configuration { * @return a String containing the prop. value */ public static String getProp(String propName) { - return (String)configHash.get(propName); + String result = (String)configHash.get(propName); + + if (result==null) + throw new ConfigException("config property '"+propName+"' not available!"); + + + + return result; } /** @@ -83,12 +90,11 @@ public class MirConfig extends Configuration { * @return a String containing the prop.value */ public static String getPropWithHome(String propName) { - return (String)configHash.get("Home") + - (String)configHash.get(propName); + return getProp("Home") + getProp(propName); } /** - * Returns the property asked for iin raw Object form by + * Returns the property asked for iin raw Object form by * pulling it out a HashMap * @param a String containing the property name (key) * @return an Object containing the prop.value diff --git a/source/mir/producer/Producer.java b/source/mir/producer/Producer.java index 2f550dec..be9415a0 100755 --- a/source/mir/producer/Producer.java +++ b/source/mir/producer/Producer.java @@ -1,7 +1,6 @@ package mir.producer; import java.io.*; -import mir.servlet.*; public interface Producer { public void produce( PrintWriter aLogger ) throws ProducerException; diff --git a/source/mir/producer/ProducerFactory.java b/source/mir/producer/ProducerFactory.java index 38691a34..401c25e2 100755 --- a/source/mir/producer/ProducerFactory.java +++ b/source/mir/producer/ProducerFactory.java @@ -4,6 +4,6 @@ import java.util.*; public interface ProducerFactory { public Producer makeProducer(String aVerb) throws ProducerException; - public Iterator verbs() throws ProducerException; + public Iterator verbs(); } diff --git a/source/mircoders/localizer/basic/FreemarkerGeneratorLocalizer.java b/source/mircoders/localizer/basic/FreemarkerGeneratorLocalizer.java index 0af3d6a3..fa5d3892 100755 --- a/source/mircoders/localizer/basic/FreemarkerGeneratorLocalizer.java +++ b/source/mircoders/localizer/basic/FreemarkerGeneratorLocalizer.java @@ -21,8 +21,6 @@ public class FreemarkerGeneratorLocalizer implements MirGeneratorLocalizer { prepareTemplate(template); - // ML: check for null! - return new FreemarkerGenerator(template); }; diff --git a/source/mircoders/localizer/basic/MirBasicOpenPostingLocalizer.java b/source/mircoders/localizer/basic/MirBasicOpenPostingLocalizer.java index 87219ddd..1e566d18 100755 --- a/source/mircoders/localizer/basic/MirBasicOpenPostingLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicOpenPostingLocalizer.java @@ -1,12 +1,20 @@ package mircoders.localizer.basic; import mircoders.localizer.*; +import mircoders.global.*; public class MirBasicOpenPostingLocalizer implements MirOpenPostingLocalizer { public void afterContentPosting() { + MirGlobal.producerEngine().addTask("content", "new"); + MirGlobal.producerEngine().addTask("openposting", "new"); + MirGlobal.producerEngine().addTask("startpage", "all"); + + MirGlobal.producerEngine().addTask("synchronization", "run"); } public void afterCommentPosting() { + MirGlobal.producerEngine().addTask("content", "new"); + MirGlobal.producerEngine().addTask("synchronization", "run"); } } diff --git a/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java b/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java index 7089b0ed..00c1f0e3 100755 --- a/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java +++ b/source/mircoders/localizer/basic/MirBasicProducerLocalizer.java @@ -19,32 +19,59 @@ public class MirBasicProducerLocalizer implements MirProducerLocalizer { return producerFactories; }; - protected void setupFactories(Map aFactoriesMap ) { - - aFactoriesMap.put( - "content", + protected void setupContentFactory(CompositeProducerFactory aContentFactory) { + aContentFactory.addFactory( new ContentProducerFactory( MirGlobal.getConfigProperty("Producer.Content.Template"), "bundles.admin", MirGlobal.getConfigProperty("Producer.StorageRoot"), ".shtml", Integer.parseInt(MirGlobal.getConfigProperty("Producer.Content.Batchsize")))); + } - aFactoriesMap.put("oldstartpage", new OldProducerAdapterFactory(new ProducerStartPage())); - aFactoriesMap.put("images", new OldProducerAdapterFactory(new ProducerImages())); - aFactoriesMap.put("navigation", new OldProducerAdapterFactory(new ProducerNavigation())); - aFactoriesMap.put("openposting", new OldProducerAdapterFactory(new ProducerOpenPosting())); - aFactoriesMap.put("topics", new OldProducerAdapterFactory(new ProducerTopics())); - - aFactoriesMap.put("startpage", new StartPageProducerFactory( + protected void setupStartPageFactory(CompositeProducerFactory aStartPageFactory) { + aStartPageFactory.addFactory( + new StartPageProducerFactory( MirGlobal.getConfigProperty("Producer.StartPage.Template"), "bundles.admin", MirGlobal.getConfigProperty("Producer.StorageRoot") + "/index.shtml", MirGlobal.getConfigIntegerProperty("Producer.StartPage.Items"), MirGlobal.getConfigIntegerProperty("Producer.StartPage.Newswire"))); + } + protected void setupSynchronizationFactory(CompositeProducerFactory aSynchronizationFactory) { if(MirGlobal.getConfigBooleanProperty("Rsync")){ - aFactoriesMap.put("sync", new ScriptCallProducerFactory(MirGlobal.getConfigProperty("Rsync.Script.Path"))); + aSynchronizationFactory.addFactory( + new ScriptCallProducerFactory(MirGlobal.getConfigProperty("Rsync.Script.Path"))); } + else { + NullProducerFactory nullFactory = new NullProducerFactory(); + nullFactory.addVerb("run"); + aSynchronizationFactory.addFactory(nullFactory); + } + } + + protected void setupFactories(Map aFactoriesMap ) { + + CompositeProducerFactory factory; + + factory=new CompositeProducerFactory(); + setupContentFactory(factory); + aFactoriesMap.put("content", factory); + + factory=new CompositeProducerFactory(); + setupStartPageFactory(factory); + aFactoriesMap.put("startpage", factory); + + factory=new CompositeProducerFactory(); + setupSynchronizationFactory(factory); + aFactoriesMap.put("synchronization", factory); + + aFactoriesMap.put("oldstartpage", new OldProducerAdapterFactory(new ProducerStartPage())); + aFactoriesMap.put("images", new OldProducerAdapterFactory(new ProducerImages())); + aFactoriesMap.put("navigation", new OldProducerAdapterFactory(new ProducerNavigation())); + aFactoriesMap.put("openposting", new OldProducerAdapterFactory(new ProducerOpenPosting())); + aFactoriesMap.put("topics", new OldProducerAdapterFactory(new ProducerTopics())); + }; } diff --git a/source/mircoders/producer/CompositeProducer.java b/source/mircoders/producer/CompositeProducer.java new file mode 100755 index 00000000..d444d160 --- /dev/null +++ b/source/mircoders/producer/CompositeProducer.java @@ -0,0 +1,27 @@ +package mircoders.producer; + +import java.util.*; +import java.io.*; +import mir.producer.*; + +public class CompositeProducer implements mir.producer.Producer { + + List producers; + + public CompositeProducer() { + producers = new Vector(); + } + + public void addProducer(mir.producer.Producer aProducer) { + producers.add(aProducer); + } + + public void produce( PrintWriter aLogger ) throws ProducerException { + Iterator i; + + i=producers.iterator(); + + while (i.hasNext()) + ((mir.producer.Producer) i.next()).produce(aLogger); + } +} diff --git a/source/mircoders/producer/CompositeProducerFactory.java b/source/mircoders/producer/CompositeProducerFactory.java new file mode 100755 index 00000000..2ef4a273 --- /dev/null +++ b/source/mircoders/producer/CompositeProducerFactory.java @@ -0,0 +1,53 @@ +package mircoders.producer; + +import java.util.*; +import mir.entity.*; +import mir.producer.*; +import mircoders.storage.*; + +public class CompositeProducerFactory implements ProducerFactory { + Map factories; // verb -> Vector ( ProducerFactory ) + + public CompositeProducerFactory() { + factories = new HashMap(); + } + + private List factoriesForVerb(String aVerb) { + List result; + + result=(List) factories.get(aVerb); + + if (result==null) { + result=new Vector(); + + factories.put(aVerb, result); + } + + return result; + } + + public void addFactory(ProducerFactory aFactory) { + Iterator i; + + i=aFactory.verbs(); + + while (i.hasNext()) { + factoriesForVerb((String) i.next()).add(aFactory); + } + } + + public mir.producer.Producer makeProducer(String aVerb) throws ProducerException { + CompositeProducer result = new CompositeProducer(); + + Iterator i=factoriesForVerb(aVerb).iterator(); + + while (i.hasNext()) + result.addProducer(((ProducerFactory) i.next()).makeProducer(aVerb)); + + return result; + } + + public Iterator verbs() { + return factories.keySet().iterator(); + } +} diff --git a/source/mircoders/producer/ContentProducer.java b/source/mircoders/producer/ContentProducer.java index df65c32e..428331b4 100755 --- a/source/mircoders/producer/ContentProducer.java +++ b/source/mircoders/producer/ContentProducer.java @@ -1,130 +1,130 @@ -package mircoders.producer; - -import java.io.*; -import java.util.*; - -import mir.misc.*; -import mir.entity.*; -import mir.producer.*; -import mir.generator.*; - -import mircoders.localizer.*; -import mircoders.global.*; -import mircoders.entity.*; - -import org.apache.struts.util.MessageResources; - -// @todo ML: the file that gets generated should be better configurable - -public class ContentProducer implements mir.producer.Producer { - - private String generatorIdentifier; - private String resourceBundle; - - private String outputFilePrefix; - private String outputFilePostfix; - - EntityBrowser browser; - - public ContentProducer( - EntityBrowser aBrowser, - String aGeneratorIdentifier, - String aResourceBundle, - String anOutputFilePrefix, - String anOutputFilePostfix) { - - browser = aBrowser; - generatorIdentifier=aGeneratorIdentifier; - resourceBundle=aResourceBundle; - outputFilePrefix=anOutputFilePrefix; - outputFilePostfix=anOutputFilePostfix; - } - - public void produce( PrintWriter aLogger ) throws ProducerException { - EntityContent content; - - Map configMap = new HashMap(); - Map generationValues = new HashMap(); - Map dataMap = new HashMap(); - String fileName; - - - - configMap.put("producerDocRoot", MirGlobal.getConfigProperty("Producer.DocRoot")); - configMap.put("storageRoot", MirGlobal.getConfigProperty("Producer.StorageRoot")); - configMap.put("productionHost", MirGlobal.getConfigProperty("Producer.ProductionHost")); - configMap.put("openAction", MirGlobal.getConfigProperty("Producer.OpenAction")); - configMap.put("docRoot", MirGlobal.getConfigProperty("RootUri")); - configMap.put("now", StringUtil.date2readableDateTime(new GregorianCalendar())); - configMap.put("videoHost", MirGlobal.getConfigProperty("Producer.Video.Host")); - configMap.put("audioHost", MirGlobal.getConfigProperty("Producer.Audio.Host")); - configMap.put("imageHost", MirGlobal.getConfigProperty("Producer.Image.Host")); - configMap.put("imagePath", MirGlobal.getConfigProperty("Producer.Image.Path")); - configMap.put("mirVersion", MirGlobal.getConfigProperty("Mir.Version")); - configMap.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() ); - generationValues.put("config", configMap); - - MessageResources messages = MessageResources.getMessageResources(resourceBundle); - generationValues.put("lang", new MessageMethodModel(null, messages) ); - generationValues.put("data", dataMap); - - - - try { - Generator generator = MirGlobal.localizer().generators().makeGenerator(generatorIdentifier); - - aLogger.println("ContentProducer.produce:
"); - aLogger.println("generatorIdentifier = " + generatorIdentifier + "
"); - - while (browser.hasNext()) { - content = (EntityContent) browser.next(); - dataMap.put("content", content); - - String date = content.getValue("date"); - - fileName = outputFilePrefix + "/" + - date.substring(0,4) + "/" + date.substring(4,6) + "/" + - content.getValue("id") + outputFilePostfix; - - aLogger.println("fileName = " + fileName + "
"); - - try { - File file = new File(fileName); - - File dir = new File(file.getParent()); - if (!dir.exists()){ - dir.mkdirs(); - } - - FileWriter fileWriter = new FileWriter(file); - PrintWriter printWriter = new PrintWriter(fileWriter); - - aLogger.println("generating: " + fileName + "
"); - - generator.generate(printWriter, generationValues, aLogger); - printWriter.close(); - fileWriter.close(); - content.setProduced(true); - - aLogger.println("done generating: " + fileName + "
"); - } - catch (Exception e) { - aLogger.println("exception while generating " + fileName + ":
"); - aLogger.println(e.getMessage() + "
"); - e.printStackTrace(aLogger); - aLogger.flush(); - } - } - } - catch (Exception e) { - aLogger.println("exception while generating:
"); - aLogger.println(e.getMessage() + "
"); - e.printStackTrace(aLogger); - aLogger.flush(); - } - - aLogger.println("ContentProducer.produce: done
"); - - } - -} +package mircoders.producer; + +import java.io.*; +import java.util.*; + +import mir.misc.*; +import mir.entity.*; +import mir.producer.*; +import mir.generator.*; + +import mircoders.localizer.*; +import mircoders.global.*; +import mircoders.entity.*; + +import org.apache.struts.util.MessageResources; + +// @todo ML: the file that gets generated should be better configurable + +public class ContentProducer implements mir.producer.Producer { + + private String generatorIdentifier; + private String resourceBundle; + + private String outputFilePrefix; + private String outputFilePostfix; + + EntityBrowser browser; + + public ContentProducer( + EntityBrowser aBrowser, + String aGeneratorIdentifier, + String aResourceBundle, + String anOutputFilePrefix, + String anOutputFilePostfix) { + + browser = aBrowser; + generatorIdentifier=aGeneratorIdentifier; + resourceBundle=aResourceBundle; + outputFilePrefix=anOutputFilePrefix; + outputFilePostfix=anOutputFilePostfix; + } + + public void produce( PrintWriter aLogger ) throws ProducerException { + EntityContent content; + + Map configMap = new HashMap(); + Map generationValues = new HashMap(); + Map dataMap = new HashMap(); + String fileName; + + + + configMap.put("producerDocRoot", MirGlobal.getConfigProperty("Producer.DocRoot")); + configMap.put("storageRoot", MirGlobal.getConfigProperty("Producer.StorageRoot")); + configMap.put("productionHost", MirGlobal.getConfigProperty("Producer.ProductionHost")); + configMap.put("openAction", MirGlobal.getConfigProperty("Producer.OpenAction")); + configMap.put("docRoot", MirGlobal.getConfigProperty("RootUri")); + configMap.put("now", StringUtil.date2readableDateTime(new GregorianCalendar())); + configMap.put("videoHost", MirGlobal.getConfigProperty("Producer.Video.Host")); + configMap.put("audioHost", MirGlobal.getConfigProperty("Producer.Audio.Host")); + configMap.put("imageHost", MirGlobal.getConfigProperty("Producer.Image.Host")); + configMap.put("imagePath", MirGlobal.getConfigProperty("Producer.Image.Path")); + configMap.put("mirVersion", MirGlobal.getConfigProperty("Mir.Version")); + configMap.put("compressWhitespace", new freemarker.template.utility.CompressWhitespace() ); + generationValues.put("config", configMap); + + MessageResources messages = MessageResources.getMessageResources(resourceBundle); + generationValues.put("lang", new MessageMethodModel(null, messages) ); + generationValues.put("data", dataMap); + + + + try { + Generator generator = MirGlobal.localizer().generators().makeGenerator(generatorIdentifier); + + aLogger.println("ContentProducer.produce:
"); + aLogger.println("generatorIdentifier = " + generatorIdentifier + "
"); + + while (browser.hasNext()) { + content = (EntityContent) browser.next(); + dataMap.put("content", content); + + String date = content.getValue("date"); + + fileName = outputFilePrefix + "/" + + date.substring(0,4) + "/" + date.substring(4,6) + "/" + + content.getValue("id") + outputFilePostfix; + + aLogger.println("fileName = " + fileName + "
"); + + try { + File file = new File(fileName); + + File dir = new File(file.getParent()); + if (!dir.exists()){ + dir.mkdirs(); + } + + FileWriter fileWriter = new FileWriter(file); + PrintWriter printWriter = new PrintWriter(fileWriter); + + aLogger.println("generating: " + fileName + "
"); + + generator.generate(printWriter, generationValues, aLogger); + printWriter.close(); + fileWriter.close(); + content.setProduced(true); + + aLogger.println("done generating: " + fileName + "
"); + } + catch (Exception e) { + aLogger.println("exception while generating " + fileName + ":
"); + aLogger.println(e.getMessage() + "
"); + e.printStackTrace(aLogger); + aLogger.flush(); + } + } + } + catch (Exception e) { + aLogger.println("exception while generating:
"); + aLogger.println(e.getMessage() + "
"); + e.printStackTrace(aLogger); + aLogger.flush(); + } + + aLogger.println("ContentProducer.produce: done
"); + + } + +} diff --git a/source/mircoders/producer/ProducerMedia.java b/source/mircoders/producer/ProducerMedia.java index a44dc43e..efb0f764 100755 --- a/source/mircoders/producer/ProducerMedia.java +++ b/source/mircoders/producer/ProducerMedia.java @@ -76,6 +76,7 @@ abstract public class ProducerMedia extends Producer { e.toString()); logHTML(htmlout, "problem with media id: "+currentMedia.getId()+ " failed!: "+e.toString()); + e.printStackTrace(htmlout); } } diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index 4148b353..3cd43f6b 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -24,6 +24,8 @@ import mircoders.entity.*; import mircoders.storage.*; import mircoders.module.*; import mircoders.producer.*; +import mircoders.global.*; +import mircoders.localizer.*; /* * ServletModuleOpenIndy - @@ -66,7 +68,7 @@ public class ServletModuleOpenIndy extends ServletModule themenModule = new ModuleTopics(DatabaseTopics.getInstance()); imageModule = new ModuleImages(DatabaseImages.getInstance()); defaultAction="addposting"; - + } catch (StorageObjectException e) { theLog.printError("servletmoduleopenindy could not be initialized"); @@ -93,7 +95,7 @@ public class ServletModuleOpenIndy extends ServletModule session.setAttribute("passwd",passwd); mergeData.put("passwd", passwd); } - + mergeData.put("aid", aid); deliver(req, res, mergeData, commentFormTemplate); } @@ -114,16 +116,16 @@ public class ServletModuleOpenIndy extends ServletModule // ok, collecting data from form try { HashMap withValues = getIntersectingValues(req, DatabaseComment.getInstance()); - + //no html in comments(for now) for (Iterator i=withValues.keySet().iterator(); i.hasNext(); ){ String k=(String)i.next(); String v=(String)withValues.get(k); - + withValues.put(k,StringUtil.removeHTMLTags(v)); } withValues.put("is_published","1"); - + //checking the onetimepasswd if(passwdProtection.equals("yes")){ HttpSession session = req.getSession(false); @@ -137,7 +139,7 @@ public class ServletModuleOpenIndy extends ServletModule } session.invalidate(); } - + // inserting into database String id = mainModule.add(withValues); theLog.printDebugInfo("id: "+id); @@ -145,13 +147,8 @@ public class ServletModuleOpenIndy extends ServletModule if(id==null){ deliver(req, res, new SimpleHash(), commentFormDupeTemplate); } - - // producing new page - new ProducerContent().handle(null, null, true, false, aid); - // sync the server - int exitValue = Helper.rsync(); - theLog.printDebugInfo("rsync:"+exitValue); + MirGlobal.localizer().openPostings().afterCommentPosting(); // redirecting to url // should implement back to article @@ -173,7 +170,7 @@ public class ServletModuleOpenIndy extends ServletModule public void addposting(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException { SimpleHash mergeData = new SimpleHash(); - + // onetimepasswd if(passwdProtection.equals("yes")){ String passwd = this.createOneTimePasswd(); @@ -182,7 +179,7 @@ public class ServletModuleOpenIndy extends ServletModule session.setAttribute("passwd",passwd); mergeData.put("passwd", passwd); } - + String maxMedia = MirConfig.getProp("ServletModule.OpenIndy.MaxMediaUploadItems"); String numOfMedia = req.getParameter("medianum"); if(numOfMedia==null||numOfMedia.equals("")){ @@ -190,7 +187,7 @@ public class ServletModuleOpenIndy extends ServletModule } else if(Integer.parseInt(numOfMedia) > Integer.parseInt(maxMedia)) { numOfMedia = maxMedia; } - + int mediaNum = Integer.parseInt(numOfMedia); SimpleList mediaFields = new SimpleList(); for(int i =0; i 0) { try{ DatabaseContentToTopics.getInstance().setTopics(cid,to_topicsArr); @@ -307,7 +304,7 @@ public class ServletModuleOpenIndy extends ServletModule throw new ServletModuleException("smod - openindy :: insposting: setting content_x_topic failed: "+e.toString()); } //end try } //end if - + // if op contains uploaddata String mediaId=null; int i=1; @@ -360,7 +357,7 @@ public class ServletModuleOpenIndy extends ServletModule HashMap mediaValues = new HashMap(); theLog.printInfo("CONTENT TYPE IS: "+contentType); - + if (contentType.equals("text/plain") || contentType.equals("application/octet-stream")) { contentModule.deleteById(cid); @@ -391,7 +388,7 @@ public class ServletModuleOpenIndy extends ServletModule MirMedia mediaHandler; Database mediaStorage; ProducerMedia mediaProducer; - + //if we didn't find an entry matching the //content-type int the table. if (mediaTypesList.size() == 0) { @@ -401,7 +398,7 @@ public class ServletModuleOpenIndy extends ServletModule Entity mediaType = null; Entity mediaType2 = null; - + // find out if we an exact content-type match if so take it. // otherwise try to match majortype/* // @todo this should probably be moved to DatabaseMediaType -mh @@ -458,7 +455,7 @@ public class ServletModuleOpenIndy extends ServletModule //were done with mpReq at this point, dereference it. //as it contains mucho mem. -mh 01.10.2001 mpReq=null; - + //we got this far, associate the media to the article mediaEnt.setValueForProperty("is_published","1"); mediaEnt.update(); @@ -483,22 +480,8 @@ public class ServletModuleOpenIndy extends ServletModule //dereference mp. -mh mp=null; - // producing openpostinglist - new ProducerOpenPosting().handle(null,null,false,false); - // producing new page - new ProducerContent().handle(null, null, false, false,cid); - //if direct op producing startpage - if (directOp.equals("yes")) new ProducerStartPage().handle(null,null); - - //produce the topicPages if set - //should be more intelligent - //if(setTopic==true) new ProducerTopics().handle(null,null); - - // sync the server - //should be configureable - int exitValue = Helper.rsync(); - theLog.printDebugInfo("rsync: "+exitValue); + MirGlobal.localizer().openPostings().afterContentPosting(); } catch (IOException e) { throw new ServletModuleException("IOException: "+ e.toString());} catch (StorageObjectException e) { throw new ServletModuleException("StorageObjectException" + e.toString());} @@ -517,7 +500,7 @@ public class ServletModuleOpenIndy extends ServletModule +", we do not support this mime-type. " +"Error One or more files of unrecognized type. Sorry"); } - + protected String createOneTimePasswd(){ Random r = new Random(); int random = r.nextInt(); @@ -527,7 +510,7 @@ public class ServletModuleOpenIndy extends ServletModule String returnString = ""+l; return returnString.substring(5); } - + } -- 2.11.0