Config updated
[mir.git] / source / mircoders / servlet / ServletModuleOpenIndy.java
index fe76052..573cd3b 100755 (executable)
@@ -181,6 +181,7 @@ public class ServletModuleOpenIndy extends ServletModule
   {
     SimpleHash mergeData = new SimpleHash();
     boolean setMedia=false;
+               boolean setTopic = false;
 
     try {
       WebdbMultipartRequest mp = new WebdbMultipartRequest(req);
@@ -227,7 +228,7 @@ public class ServletModuleOpenIndy extends ServletModule
       theLog.printDebugInfo("id: "+cid);
       //insert was not successfull
       if(cid==null){
-        //How do we know that it was not succesful cause of a 
+        //How do we know that it was not succesful cause of a
         //dupe, what if it failed cause of "No space left on device"?
         //Or is there something I am missing? Wouldn't it be better
         //to have an explicit dupe check and then insert? I have no
@@ -237,10 +238,12 @@ public class ServletModuleOpenIndy extends ServletModule
       }
 
       String[] to_topicsArr = mp.getParameterValues("to_topic");
-      if (to_topicsArr != null && to_topicsArr.length > 0) {
+      
+                       if (to_topicsArr != null && to_topicsArr.length > 0) {
         try{
           DatabaseContentToTopics.getInstance().setTopics(cid,to_topicsArr);
-          theLog.printError("setting content_x_topic success");
+               setTopic = true;
+                                       theLog.printError("setting content_x_topic success");
         } catch (Exception e) {
           theLog.printError("setting content_x_topic failed");
           contentModule.deleteById(cid);
@@ -264,20 +267,20 @@ public class ServletModuleOpenIndy extends ServletModule
         //if the client browser sent us unknown (text/plain is default)
         //or if we got application/octet-stream, it's possible that
         //the browser is in error, better check against the file extension
-        if (contentType.equals("text/plain") || 
+        if (contentType.equals("text/plain") ||
             contentType.equals("application/octet-stream")) {
-            /** 
+            /**
              * This is just a temporary way to get the content-type via
              * the .extension , we could maybe use a magic method, by looking
              * at the header (first few bytes) of the file. (like the file(1)
              * command).
-             * The Oreilly method  relies on the content-type that the client 
+             * The Oreilly method  relies on the content-type that the client
              * browser sends and that sometimes is application-octet stream with
              * broken/mis-configured browsers.
-             * 
-             * The map file should be Mir/content-types.properties, it's the 
-             * default Sun Java file with some additional entries that it did 
-             * not have. So if you support a new media type you have to make 
+             *
+             * The map file should be Mir/content-types.properties, it's the
+             * default Sun Java file with some additional entries that it did
+             * not have. So if you support a new media type you have to make
              * sure that it is in this file -mh
              */
             contentType = FileUtil.guessContentTypeFromName(fileName);
@@ -289,7 +292,7 @@ public class ServletModuleOpenIndy extends ServletModule
 
         theLog.printError("CONTENT TYPE IS: "+contentType);
         
-        if (contentType.equals("text/plain") || 
+        if (contentType.equals("text/plain") ||
             contentType.equals("application/octet-stream")) {
           throw new ServletModuleUserException("One or more files of unrecognized types");
         }
@@ -309,7 +312,7 @@ public class ServletModuleOpenIndy extends ServletModule
 
         //the where clause to find the media_type entry
         //from the content-type.
-        //we use the media type entry to lookup the 
+        //we use the media type entry to lookup the
         //media Handler/Storage classes
         String wc = " mime_type='"+contentType+"'";
 
@@ -384,6 +387,10 @@ public class ServletModuleOpenIndy extends ServletModule
       //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();