return createURLLinks(haystack, title, imageRoot, extImage);
}
- /**
- * this routine takes text in url format and makes
- * an image link removing any "illegal" html tags
- * @param haystack, the url
- * @param title, the image alt text, can be null
- * @param height, height of the image
- * @param width, width of the image
- * @return a String containing the url
- */
- public static String createIMGLinks(String haystack, String title,
- String height,String width) {
- String wh="";
- if ( (height != null) && (width != null) )
- {
- wh = "width=\""+width+"\" height=\""+height+"\"";
- }
- if (title != null) {
- title = removeHTMLTags(title);
- return re_url.substituteAll(haystack,
- "<img hspace=\"10\" vspace=\"6\" "+
- "align=\"left\" src=\"$0\" "+wh+
- " alt=\""+title+"\"/> <br><i>"+
- title+"</i>");
- } else {
- return re_url.substituteAll(haystack,
- "<img hspace=\"10\" vspace=\"6\" "+
- "align=\"left\" src=\"$0\" "+wh+
- " alt=\"\"/> ");
- }
- }
-
-
/**
* deleteForbiddenTags
* this method deletes all <script>, <body> and <head>-tags
if (key!=null) {
if (key.equals("big_icon"))
returnValue=getBigIcon();
- else if (key.equals("list"))
- returnValue=getListView();
+ else if (key.equals("descr"))
+ returnValue=getDescr();
else
returnValue=super.getValue(key);
}
return new SimpleScalar(getValue(key));
}
+ // @todo all these methods should be merged into 1
+ // and the MediaHandler should be cached somehow.
private String getBigIcon()
{
MirMedia mediaHandler=null;
return null;
}
- private String getListView()
+ private String getDescr()
{
MirMedia mediaHandler=null;
Entity mediaType=null;
try {
mediaType = getMediaType();
mediaHandler = MediaHelper.getHandler( mediaType );
- return mediaHandler.getListView(this, mediaType);
+ return mediaHandler.getDescr();
} catch (Exception ex) {
- theLog.printWarning("-- getUrl: could not fetch data "
+ theLog.printWarning("-- getDescr: could not fetch data "
+ this.getClass().toString()+" "+ ex.toString());
}
return null;
}
-
}
return theList;
}
- public String getListView(Entity ent, Entity mediaTypeEnt)
- {
- //String title = ent.getValue("title")+
- // " - "+mediaTypeEnt.getValue("name")+" "+
- // ent.getValue("size")+" Bytes";
- return getBigIcon();
- }
-
public boolean isVideo()
{
- return false;
+ return false;
}
public boolean isAudio()
{
- return false;
+ return false;
}
public boolean isImage()
{
- return false;
+ return false;
+ }
+
+ public String getDescr()
+ {
+ return "";
}
}
return icon_data;
}
- public String getListView(Entity ent, Entity mediaTypeEnt)
- {
- //String title = ent.getValue("title");
- return StringUtil.createIMGLinks(
- MirConfig.getProp("Producer.ProductionHost")+ent.getValue("icon_path"),
- null, ent.getValue("icon_height"), ent.getValue("icon_width"));
- }
-
public SimpleList getURL(Entity ent, Entity mediaTypeEnt)
{
SimpleList theList = new SimpleList();
return true;
}
+ public String getDescr()
+ {
+ return "";
+ }
+
}
}
+ public String getDescr()
+ {
+ return "Mp3 audio";
+ }
+
}
return MirConfig.getProp("Producer.RealMedia.Path");
}
+ public String getDescr()
+ {
+ return "RealMedia Audio";
+ }
+
}
return MirConfig.getProp("Producer.RealMedia.Path");
}
+ public String getDescr()
+ {
+ return "RealMedia Video";
+ }
+
}
<p>
<img src="/img/${media["big_icon"]}" border="0" alt="">
<a href="${audio["publish_server"]}${audio["publish_path"]}">
- ${audio["title"]}</a>
+ ${audio["title"]} - ${media["descr"]}</a>
</p>
</list>
</list>
<p>
<img src="/img/${media["big_icon"]}" border="0" alt="">
<a href="${video["publish_server"]}${video["publish_path"]}">
- ${video["title"]}</a>
+ ${video["title"]} - ${media["descr"]}</a>
</p>
</list>
</list>
<p>
<img src="/img/${media["big_icon"]}" border="0" alt="">
<a href="${other["publish_server"]}${other["publish_path"]}">
- ${other["title"]}</a>
+ ${other["title"]} - ${media["descr"]}</a>
</p>
</list>
</list>
<tr>
<td width="100%" valign="top">
<!--- articles --->
- <list contentlist as i>
+ <list data.contentlist as i>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h3>${i.title}</h3>
<h4><i>${i.creator}, ${i.webdb_create_formatted}</i></h4>
<p>
- <if i.to_media_audio >
- ${i.to_media_audio[0]["list"]}
- </if>
- <if i.to_media_video >
- ${i.to_media_video[0]["list"]}
- </if>
- <if i.to_media_other >
- ${i.to_media_other[0]["list"]}
- </if>
- <p>
- <if i.to_media_images >
- ${i.to_media_images[0]["list"]}
- </if>
+ <if i.to_media_audio >
+ <img src="/img/${i.to_media_audio[0]["big_icon"]}">
+ </if>
+ <if i.to_media_video >
+ <img src="/img/${i.to_media_video[0]["big_icon"]}">
+ </if>
+ <if i.to_media_other >
+ <img src="/img/${i.to_media_other[0]["big_icon"]}">
+ </if>
+ <p>
+ <if i.to_media_images >
+ <img src="${i.to_media_images[0]["icon_path"]}"
+ width="${i.to_media_images[0]["icon_width"]}"
+ height="${i.to_media_images[0]["icon_height"]}"
+ border=0 alt="${i.to_media_images[0]["title"]}">
+ </if>
${i.description}</p>
<p align="right">[<a href="${config.producerDocRoot}${i.publish_path}${i.id}.shtml">read</a>]</p>
</td>
<h3>${s.title}</h3>
<h4><i>${s.creator}, ${s.webdb_create_formatted}</i></h4>
<p>
- <if s.to_media_audio && s.to_media_audio[0]["is_published"]=="1">
- ${s.to_media_audio[0]["list"]}
+ <if s.to_media_audio >
+ <img src="/img/${s.to_media_audio[0]["big_icon"]}">
</if>
- <if s.to_media_video && s.to_media_video[0]["is_published"]=="1">
- ${s.to_media_video[0]["list"]}
+ <if s.to_media_video >
+ <img src="/img/${s.to_media_video[0]["big_icon"]}">
</if>
- <if s.to_media_other && s.to_media_other[0]["is_published"]=="1">
- ${s.to_media_other[0]["list"]}
+ <if s.to_media_other >
+ <img src="/img/${s.to_media_other[0]["big_icon"]}">
</if>
<p>
- <if s.to_media_images && s.to_media_images[0]["is_published"]=="1">
- ${s.to_media_images[0]["list"]}
+ <if s.to_media_images >
+ <img src="${s.to_media_images[0]["icon_path"]}"
+ width="${s.to_media_images[0]["icon_width"]}"
+ height="${s.to_media_images[0]["icon_height"]}"
+ border=0 alt="${s.to_media_images[0]["title"]}">
</if>
${s.description_parsed} </p>
<p align="right">[<a href="${config.producerDocRoot}${s.publish_path}${s.id}.shtml">read</a>]</p>
<h3>${i.title}</h3>
<h4><i>${i.creator}, ${i.webdb_create_formatted}</i></h4>
<p>
- <if i.to_media_audio && i.to_media_audio[0]["is_published"]=="1">
- ${i.to_media_audio[0]["list"]}
+ <if i.to_media_audio >
+ <img src="/img/${i.to_media_audio[0]["big_icon"]}">
</if>
- <if i.to_media_video && i.to_media_video[0]["is_published"]=="1">
- ${i.to_media_video[0]["list"]}
+ <if i.to_media_video >
+ <img src="/img/${i.to_media_video[0]["big_icon"]}">
</if>
- <if i.to_media_other && i.to_media_other[0]["is_published"]=="1">
- ${i.to_media_other[0]["list"]}
+ <if i.to_media_other >
+ <img src="/img/${i.to_media_other[0]["big_icon"]}">
</if>
<p>
- <if i.to_media_images && i.to_media_images[0]["is_published"]=="1">
- ${i.to_media_images[0]["list"]}
+ <if i.to_media_images >
+ <img src="${i.to_media_images[0]["icon_path"]}"
+ width="${i.to_media_images[0]["icon_width"]}"
+ height="${i.to_media_images[0]["icon_height"]}"
+ border=0 alt="${i.to_media_images[0]["title"]}">
</if>
${i.description_parsed} </p>
<p align="right">[<a href="${config.producerDocRoot}${i.publish_path}${i.id}.shtml">read</a>]</p>
<h3>${data.special.title}</h3>
<h4><i>${data.special.creator}, ${data.special.webdb_create_formatted}</i></h4>
<p>
- <if special.to_media_audio && special.to_media_audio[0]["is_published"]=="1">
- ${data.special.to_media_audio[0]["list"]}
- </if>
- <if special.to_media_video && special.to_media_video[0]["is_published"]=="1">
- ${data.special.to_media_video[0]["list"]}
- </if>
- <if special.to_media_other && special.to_media_other[0]["is_published"]=="1">
- ${data.special.to_media_other[0]["list"]}
- </if>
- <p>
- <if special.to_media_images && special.to_media_images[0]["is_published"]=="1">
- ${data.special.to_media_images[0]["list"]}
- </if>
+ <if data.special.to_media_audio >
+ <img src="/img/${data.special.to_media_audio[0]["big_icon"]}">
+ </if>
+ <if data.special.to_media_video >
+ <img src="/img/${data.special.to_media_video[0]["big_icon"]}">
+ </if>
+ <if data.special.to_media_other >
+ <img src="/img/${data.special.to_media_other[0]["big_icon"]}">
+ </if>
+ <p>
+ <if data.special.to_media_images >
+ <img src="${data.special.to_media_images[0]["icon_path"]}"
+ width="${data.special.to_media_images[0]["icon_width"]}"
+ height="${data.special.to_media_images[0]["icon_height"]}"
+ border=0 alt="${data.special.to_media_images[0]["title"]}">
+ </if>
${data.special.description_parsed} </p>
<p align="right">[<a href="${config.producerDocroot}${data.special.publish_path}${data.special.id}.shtml">read</a>]</p>
</td>
<h3>${i.title}</h3>
<h4><i>${i.creator}, ${i.webdb_create_formatted}</i></h4>
<p>
- <if i.to_media_audio && i.to_media_audio[0]["is_published"]=="1">
- ${i.to_media_audio[0]["list"]}
- </if>
- <if i.to_media_video && i.to_media_video[0]["is_published"]=="1">
- ${i.to_media_video[0]["list"]}
- </if>
- <if i.to_media_other && i.to_media_other[0]["is_published"]=="1">
- ${i.to_media_other[0]["list"]}
- </if>
- <p>
- <if i.to_media_images && i.to_media_images[0]["is_published"]=="1">
- ${i.to_media_images[0]["list"]}
- </if>
+ <if i.to_media_audio >
+ <img src="/img/${i.to_media_audio[0]["big_icon"]}">
+ </if>
+ <if i.to_media_video >
+ <img src="/img/${i.to_media_video[0]["big_icon"]}">
+ </if>
+ <if i.to_media_other >
+ <img src="/img/${i.to_media_other[0]["big_icon"]}">
+ </if>
+ <p>
+ <if i.to_media_images >
+ <img src="${i.to_media_images[0]["icon_path"]}"
+ width="${i.to_media_images[0]["icon_width"]}"
+ height="${i.to_media_images[0]["icon_height"]}"
+ border=0 alt="${i.to_media_images[0]["title"]}">
+ </if>
${i.description_parsed}</p>
<p align="right">[<a href="${config.producerDocroot}${i.publish_path}${i.id}.shtml">read</a>]</p>
</td>