freemarker
authormh <mh>
Thu, 7 Feb 2002 12:45:57 +0000 (12:45 +0000)
committermh <mh>
Thu, 7 Feb 2002 12:45:57 +0000 (12:45 +0000)
source/mircoders/entity/EntityContent.java

index 8e8a6e9..e37dbb7 100755 (executable)
@@ -167,7 +167,19 @@ public class EntityContent extends Entity
       if (key.equals("to_media")) {
         try {
           System.err.println("ASKED FOR MEDIA");
-          return getUploadedMediaForContent();
+          SimpleList t = getUploadedMediaForContent();
+          //SimpleHash o = t.next();
+
+          if (t == null) {
+            System.err.println("NULL -- LIST "+this.getId());
+          } else {
+            SimpleHash o = (SimpleHash)t.next();
+            System.err.println("SCALAR: "+o.get("url"));
+          }
+            
+          t.rewind();
+          //return getUploadedMediaForContent();
+          return t;
         }
         catch (Exception ex) {
           System.err.println("ASKED EXCE");
@@ -440,7 +452,7 @@ public class EntityContent extends Entity
           //upMediaSimpleHash.put("url", mediaHandler.getURL(upMedia, mediaType));
           // ################# TODO: this is broken cause of field checking
           // in Entity. must find a workaround
-          modelRoot.put("url", mediaHandler.getURL(upMedia, mediaType));
+          modelRoot.put("url", new SimpleScalar(mediaHandler.getURL(upMedia, mediaType)));
           modelRoot.put("is_published", upMedia.getValue("is_published"));
           //upMedia.setValueForProperty("url",
                                     //mediaHandler.getURL(upMedia, mediaType));