From: idfx Date: Wed, 29 Aug 2001 16:36:03 +0000 (+0000) Subject: 1-n-relation content to topic X-Git-Tag: prexmlproducerconfig~593 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=198a670a8d27f18357e201bf0ec797239b627cd6;p=mir.git 1-n-relation content to topic --- diff --git a/source/mircoders/servlet/ServletModuleContent.java b/source/mircoders/servlet/ServletModuleContent.java index f6c3a829..a4e04658 100755 --- a/source/mircoders/servlet/ServletModuleContent.java +++ b/source/mircoders/servlet/ServletModuleContent.java @@ -180,7 +180,7 @@ public class ServletModuleContent extends ServletModule if (withValues.get("creator").toString().equals("")) withValues.put("creator","Anonym"); String id = mainModule.add(withValues); - DatabaseContentToTopics.getInstance().setTopics(id,req.getParameter("to_topic")); + DatabaseContentToTopics.getInstance().setTopics(id,req.getParameterValues("to_topic")); //theLog.printDebugInfo(":: content :: inserted"); _showObject(id, req, res); } @@ -295,7 +295,8 @@ public class ServletModuleContent extends ServletModule if (idParam == null) throw new ServletModuleException("Falscher Aufruf: (id) nicht angegeben"); HashMap withValues = getIntersectingValues(req, DatabaseContent.getInstance()); - String topic_id = req.getParameter("to_topic"); + //String topic_id = req.getParameter("to_topic"); + String[] topic_id = req.getParameterValues("to_topic"); String content_id = req.getParameter("id"); // withValues.put("publish_path", StringUtil.webdbDate2path((String)withValues.get("date"))); if(user != null) withValues.put("user_id", user.getId()); @@ -308,7 +309,7 @@ public class ServletModuleContent extends ServletModule withValues.put("creator","Anonym"); //theLog.printDebugInfo("updating. "); String id = mainModule.set(withValues); - DatabaseContentToTopics.getInstance().setTopics(req.getParameter("id"),req.getParameter("to_topic")); + DatabaseContentToTopics.getInstance().setTopics(req.getParameter("id"),topic_id); //theLog.printDebugInfo("update done. "); String whereParam = req.getParameter("where"); String orderParam = req.getParameter("order"); @@ -334,8 +335,14 @@ public class ServletModuleContent extends ServletModule SimpleHash mergeData = HTMLTemplateProcessor.makeSimpleHash(entContent); EntityList topicToContent = DatabaseContentToTopics.getInstance().getTopics(entContent); if (topicToContent!=null && topicToContent.size()>0){ - Entity topics = (EntityTopics)topicToContent.elementAt(0); - mergeData.put("to_topic",topics.getId()); + theLog.printDebugInfo("topicanzahl: "+topicToContent.size()); + Entity topics = null; + SimpleList topicList = new SimpleList(); + for(int i=0;i - @@ -54,10 +53,10 @@ p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} >${s.value} - + + >${t.value} + diff --git a/templates-dist/en/content.template b/templates-dist/en/content.template index 5d15a488..21810f20 100755 --- a/templates-dist/en/content.template +++ b/templates-dist/en/content.template @@ -18,7 +18,6 @@ p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} - @@ -54,9 +53,9 @@ p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} >${s.value} - - + >${t.value}