From b2745f97c7c95b7fed2765c7ec2265939b0f2972 Mon Sep 17 00:00:00 2001 From: idfx Date: Mon, 24 Sep 2001 13:39:01 +0000 Subject: [PATCH] some fixes: images, producerdocroot, ... --- source/mircoders/producer/ProducerStartPage.java | 42 ++++++++++++++---------- templates-dist/producer/content.template | 2 +- templates-dist/producer/navigation.template | 4 +-- templates-dist/producer/openposting.template | 2 +- templates-dist/producer/startpage.template | 35 ++++++++++++-------- templates-dist/producer/topiclist.template | 2 +- 6 files changed, 50 insertions(+), 37 deletions(-) diff --git a/source/mircoders/producer/ProducerStartPage.java b/source/mircoders/producer/ProducerStartPage.java index fdae5203..5b478b73 100755 --- a/source/mircoders/producer/ProducerStartPage.java +++ b/source/mircoders/producer/ProducerStartPage.java @@ -56,7 +56,9 @@ public class ProducerStartPage extends Producer { SimpleHash startPageModel; SimpleList contentList; String currentMediaId; - SimpleHash imageHash = new SimpleHash(); + EntityList imageEntityList; + SimpleList mediaList; + SimpleHash contentHash; // get the topiclist entityList = topicsModule.getByWhereClause("","title",-1); @@ -78,14 +80,20 @@ public class ProducerStartPage extends Producer { 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); @@ -94,29 +102,27 @@ public class ProducerStartPage extends Producer { 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"; diff --git a/templates-dist/producer/content.template b/templates-dist/producer/content.template index 13583dcf..ee37be17 100755 --- a/templates-dist/producer/content.template +++ b/templates-dist/producer/content.template @@ -12,7 +12,7 @@ diff --git a/templates-dist/producer/navigation.template b/templates-dist/producer/navigation.template index ae44de76..af58891a 100755 --- a/templates-dist/producer/navigation.template +++ b/templates-dist/producer/navigation.template @@ -2,7 +2,7 @@
- ${t.title} + ${t.title}

@@ -18,4 +18,4 @@ -

\ No newline at end of file +

diff --git a/templates-dist/producer/openposting.template b/templates-dist/producer/openposting.template index f22dc2ca..1e5312a0 100755 --- a/templates-dist/producer/openposting.template +++ b/templates-dist/producer/openposting.template @@ -12,7 +12,7 @@
- +
diff --git a/templates-dist/producer/startpage.template b/templates-dist/producer/startpage.template index 7501769e..242811c0 100755 --- a/templates-dist/producer/startpage.template +++ b/templates-dist/producer/startpage.template @@ -48,31 +48,36 @@ - +
- + -
+ + +

${s.title}

${s.creator}, ${s.webdb_create_formatted}

-

- - ${s.description}

-

[read]

+

+ ${s.to_media[0][ + + ${s.description}

+

[read]

-
- + +
+ +

${i.title}

${i.creator}, ${i.webdb_create_formatted}

-

- +

+ ${i.to_media[0][ ${i.description}

-

[read]

+

[read]

@@ -83,15 +88,18 @@
+ + -
+ +

[Text] - ${n.title}
+ ${n.title}
${n.webdb_create_formatted}

@@ -106,6 +114,5 @@

-

 

diff --git a/templates-dist/producer/topiclist.template b/templates-dist/producer/topiclist.template index 28796680..9dd28bf8 100755 --- a/templates-dist/producer/topiclist.template +++ b/templates-dist/producer/topiclist.template @@ -12,7 +12,7 @@ -- 2.11.0
- +