SimpleHash startPageModel;
SimpleList contentList;
String currentMediaId;
- SimpleHash imageHash = new SimpleHash();
+ EntityList imageEntityList;
+ SimpleList mediaList;
+ SimpleHash contentHash;
// get the topiclist
entityList = topicsModule.getByWhereClause("","title",-1);
SimpleList startItemList = HTMLTemplateProcessor.makeSimpleList(entityList);
for (int i=0; i < entityList.size();i++) {
currentContent = (EntityContent)entityList.elementAt(i);
- currentMediaId = currentContent.getValue("to_media");
- if (currentMediaId!=null && !currentMediaId.equals("")) {
- imageHash.put(currentMediaId, HTMLTemplateProcessor.makeSimpleHash(imageModule.getById(currentMediaId)));
+ //fetching/setting the images
+ imageEntityList = DatabaseContentToMedia.getInstance().getImages(currentContent);
+ if (imageEntityList!=null && imageEntityList.getCount()>=1) {
+ try{
+ mediaList = HTMLTemplateProcessor.makeSimpleList(imageEntityList);
+ contentHash = (SimpleHash)startItemList.get(i);
+ contentHash.put("to_media", mediaList);
+ } catch (Exception e){}
}
}
// get the breaking news
// only the first 5
+ // todo: the number of breaking_news items have to be configurable
ModuleBreaking breakingModule = new ModuleBreaking(DatabaseBreaking.getInstance());
entityList = breakingModule.getByWhereClause(null,"webdb_create desc",0,5);
SimpleList breakingList = HTMLTemplateProcessor.makeSimpleList(entityList);
whereClause="is_published=true AND to_article_type=2";
orderBy="date desc, webdb_create desc";
entityList = contentModule.getContent(whereClause, orderBy, 0, itemsPerPage);
+ SimpleList featureList = HTMLTemplateProcessor.makeSimpleList(entityList);
for (int i=0; i < entityList.size();i++) {
currentContent = (EntityContent)entityList.elementAt(i);
- /**
- if (currentContent.get("is_html").equals("0")) {
- currentContent.put("content_data",StringUtil.createHTML((String)currentContent.get("content_data"),imageRoot,mailLinkName,extLinkName,intLinkName));
- currentContent.put("description",StringUtil.createHTML((String)currentContent.get("description"),imageRoot,mailLinkName,extLinkName,intLinkName));
- }
- */
- currentMediaId = currentContent.getValue("to_media");
- if (currentMediaId!=null && !currentMediaId.equals("")) {
- imageHash.put(currentMediaId, HTMLTemplateProcessor.makeSimpleHash(imageModule.getById(currentMediaId)));
+ //fetching/setting the images
+ imageEntityList = DatabaseContentToMedia.getInstance().getImages(currentContent);
+ if (imageEntityList!=null && imageEntityList.getCount()>=1) {
+ try{
+ mediaList = HTMLTemplateProcessor.makeSimpleList(imageEntityList);
+ contentHash = (SimpleHash)featureList.get(i);
+ contentHash.put("to_media", mediaList);
+ } catch (Exception e){}
}
}
- SimpleList itemList = HTMLTemplateProcessor.makeSimpleList(entityList);
// Zusaetzlich Informationen
startPageModel = new SimpleHash();
- startPageModel.put("breaking", breakingList);
+ startPageModel.put("breakingnews", breakingList);
startPageModel.put("topics", topicList);
startPageModel.put("newswire", newsWireList);
- startPageModel.put("start", startItemList);
- startPageModel.put("items", itemList);
- startPageModel.put("images", imageHash);
+ startPageModel.put("startspecial", startItemList);
+ startPageModel.put("features", featureList);
htmlFileName = producerDocRoot + "/index.shtml";
<td align="left" valign="top">
<table width="457" border="0" cellpadding="0" cellspacing="2" height="100%">
<tr>
- <td width="457" valign="top"> <!--- start-special ---> <list start as s>
+ <td width="457" valign="top">
+ <!--- start-special --->
+ <list startspecial as s>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h3>${s.title}</h3>
<h4><i>${s.creator}, ${s.webdb_create_formatted}</i></h4>
- <p> <if images[s.to_media] && images[s.to_media]["is_published"]=="1">
- <img src="${images[s.to_media]["icon_path"]}" width="${images[s.to_media]["icon_width"]}" height="${images[s.to_media]["icon_height"]}" alt="" align="left" vspace="8" hspace="8">
- </if> ${s.description} </p>
- <p align="right">[<a href="${producerDocRoot}${s.publish_path}${s.id}.shtml">read</a>]</p>
+ <p> <if s.to_media && s.to_media[0]["is_published"]=="1">
+ <img src="${s.to_media[0]["icon_path"]}" width="${s.to_media[0]["icon_width"]}" height="${s.to_media[0]["icon_height"]}" alt="${s.to_media[0]["title"]}" align="left" vspace="8" hspace="8">
+ </if>
+ ${s.description} </p>
+ <p align="right">[<a href="${config.docroot}${s.publish_path}${s.id}.shtml">read</a>]</p>
</td>
</tr>
</table>
</list>
- <!--- start-special ---> <br>
- <!--- features ---> <list items as i>
+ <!--- start-special --->
+ <br>
+ <!--- features --->
+ <list features 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 images[i.to_media] && images[i.to_media]["is_published"]=="1">
- <img src="${images[i.to_media]["icon_path"]}" width="${images[i.to_media]["icon_width"]}" height="${images[i.to_media]["icon_height"]}" alt="" align="left" vspace="8" hspace="8">
+ <p> <if i.to_media && i.to_media[0]["is_published"]=="1">
+ <img src="${i.to_media[0]["icon_path"]}" width="${i.to_media[0]["icon_width"]}" height="${i.to_media[0]["icon_height"]}" alt="${i.to_media[0]["title"]}" align="left" vspace="8" hspace="8">
</if> ${i.description} </p>
- <p align="right">[<a href="${producerDocRoot}${i.publish_path}${i.id}.shtml">read</a>]</p>
+ <p align="right">[<a href="${config.docroot}${i.publish_path}${i.id}.shtml">read</a>]</p>
</td>
</tr>
</table>
</tr>
</table>
</td>
- <td width=1 bgcolor="#000000"><img src="images/1pixel.gif" width="1" height="1"></td>
+ <td width=1 bgcolor="#000000">
+ <img src="images/1pixel.gif" width="1" height="1">
+ </td>
<td width="150" bgcolor="#666666" valign="top" align="left">
<table width="150" border="0" cellspacing="2" cellpadding="0">
<tr>
- <td> <!-- newswire -->
+ <td>
+ <!-- newswire -->
<p>
<list newswire as n>
<img alt="[Text]" border="0" height="10" src="/images/text_small.gif" width="12">
- <a href="${producerDocRoot}${n.publish_path}${n.id}.shtml"><b>${n.title}</b></a><br>
+ <a href="${config.docroot}${n.publish_path}${n.id}.shtml"><b>${n.title}</b></a><br>
<font size="-2"><b></b>${n.webdb_create_formatted}</font><br>
<br>
</list>
</td>
</tr>
</table>
-<p> </p>
</body>
</html>