*** empty log message ***
[mir.git] / source / mircoders / entity / EntityContent.java
index a07ed3e..39dfc58 100755 (executable)
@@ -178,16 +178,16 @@ public class EntityContent extends Entity
           return getUploadedMediaForNewswire();
         }
         catch (Exception ex) {
-          theLog.printWarning("-- getUploadedMediaForContent: could not fetch data " + ex.toString());
+          theLog.printWarning("-- getUploadedMediaForNewswire: could not fetch data " + ex.toString());
           throw new TemplateModelException(ex.toString());
         }
       }
       else if (key.equals("to_media_list")) {
         try {
-          return getUploadedMediaForContent();
+          return getUploadedMediaForList();
         }
         catch (Exception ex) {
-          theLog.printWarning("-- getUploadedMediaForContent: could not fetch data " + ex.toString());
+          theLog.printWarning("-- getUploadedMediaForList: could not fetch data " + ex.toString());
           throw new TemplateModelException(ex.toString());
         }
       }
@@ -339,7 +339,7 @@ public class EntityContent extends Entity
       SimpleList          mediaListImages = new SimpleList();
       SimpleList          mediaListVideo = new SimpleList();
       SimpleList          mediaListOther = new SimpleList();
-      EntityMedia         upMedia;
+      Entity              upMedia;
       Entity              mediaType;
       SimpleHash          upMediaSimpleHash;
       Class               mediaHandlerClass=null,mediaStorageClass;
@@ -348,9 +348,9 @@ public class EntityContent extends Entity
       Database            mediaStorage=null;
 
       for (int n=0; n < currentMediaList.size();n++) {
-        upMedia = (EntityMedia)currentMediaList.elementAt(n);
+        upMedia = currentMediaList.elementAt(n);
         upMediaSimpleHash = HTMLTemplateProcessor.makeSimpleHash(upMedia);
-        mediaType = upMedia.getMediaType();
+        mediaType = ((EntityMedia)upMedia).getMediaType();
         //must be a non-existant to_media_type entry..
         if (mediaType != null) {
           mediaHandlerName = mediaType.getValue("classname");
@@ -367,9 +367,11 @@ public class EntityContent extends Entity
           }
 
           //we most likely need further info
-          upMedia = (EntityMedia)mediaStorage.selectById(upMedia.getId());
+          upMedia = mediaStorage.selectById(upMedia.getId());
           try {
-           upMediaSimpleHash.put("url", mediaHandler.getListView(upMedia, mediaType));
+            String url = mediaHandler.getListView(upMedia, mediaType);
+            upMediaSimpleHash.put("url", url);
+            theLog.printDebugInfo("url is "+  url);
           }
           catch (Exception ex) {
             throw new TemplateModelException(ex.toString());
@@ -389,10 +391,10 @@ public class EntityContent extends Entity
           } //end if is_published
         } //end if media_type != null
       } //end for
-      returnHash.put("to_media_audio", mediaListAudio);
-      returnHash.put("to_media_images", mediaListImages);
-      returnHash.put("to_media_video", mediaListVideo);
-      returnHash.put("to_media_other", mediaListOther);
+      returnHash.put("media_audio", mediaListAudio);
+      returnHash.put("media_images", mediaListImages);
+      returnHash.put("media_video", mediaListVideo);
+      returnHash.put("media_other", mediaListOther);
     } //end if currentMediaList != null
     return returnHash;
  }