Ok, big merge. here's the new xml-config stuff in action. There's a few
[mir.git] / source / mircoders / producer / ProducerContent.java
index 2123ce7..c198f82 100755 (executable)
@@ -154,8 +154,8 @@ public class ProducerContent extends Producer {
           for (int n=0; n < currentMediaList.size();n++) {
             upMedia = currentMediaList.elementAt(n);
             upMediaSimpleHash = HTMLTemplateProcessor.makeSimpleHash(upMedia);
-            mediaType = ((EntityUploadedMedia)upMedia).getMediaType();
-            //must be a non-existant to_media_type entry..
+            mediaType = ((EntityMedia)upMedia).getMediaType();
+            //in case it's a non-existant to_media_type entry..
             if (mediaType != null) {
               try {
                 mediaHandlerName = mediaType.getValue("classname");
@@ -163,16 +163,15 @@ public class ProducerContent extends Producer {
                 mediaStorageClass = Class.forName("mircoders.storage.Database"+mediaStorageName);
                 mediaHandlerClass = Class.forName("mir.media.MediaHandler"+mediaHandlerName);
                 mediaHandler = (MirMedia)mediaHandlerClass.newInstance();
-                if(!mediaStorageName.equals(new String("UploadedMedia"))) {
-                  Method m = mediaStorageClass.getMethod("getInstance", null);
-                  mediaStorage = (Database)m.invoke(null, null);
-                  //we most likely need further info
-                  upMedia = mediaStorage.selectById(upMedia.getId());
-                }
+                Method m = mediaStorageClass.getMethod("getInstance", null);
+                mediaStorage = (Database)m.invoke(null, null);
+                //we most likely need further info
+                upMedia = mediaStorage.selectById(upMedia.getId());
               } catch (Exception e) {
                 theLog.printError("ProducerStartpage:problem in reflection: "+mediaHandlerName);
               } //end catch
               upMediaSimpleHash.put("url", mediaHandler.getURL(upMedia, mediaType));
+             upMediaSimpleHash.put("type",mediaType.getValue("classname"));
               mediaList.add(upMediaSimpleHash);
             } //end if media_type != null
           } //end for
@@ -201,7 +200,7 @@ public class ProducerContent extends Producer {
         sessionConnectTime = new java.util.Date().getTime() - startTime;
         if (retVal == true && !"1".equals(currentContent.getValue("is_produced")))
             currentContent.setProduced(true);
-      }
+      }//while
 
       if (batchEntityList.hasNextBatch()){
         batchEntityList = contentModule.getContent(whereClause, orderBy, batchEntityList.getNextBatch(),contentBatchsize, userEntity);