withValues.put("is_published","0");
if (!withValues.containsKey("is_html"))
withValues.put("is_html","0");
- if (withValues.get("creator").toString().equals(""))
- withValues.put("creator","Anonym");
+
+// ML: this is not multi-language friendly and this can be done in a template
+// if (withValues.get("creator").toString().equals(""))
+// withValues.put("creator","Anonym");
+
+
String id = mainModule.add(withValues);
DatabaseContentToTopics.getInstance().setTopics(id,req.getParameterValues("to_topic"));
//theLog.printDebugInfo(":: content :: inserted");
withValues.put("is_published","0");
if (!withValues.containsKey("is_html"))
withValues.put("is_html","0");
- if (withValues.get("creator").toString().equals(""))
- withValues.put("creator","Anonym");
+
+// ML: this is not multi-language friendly and this can be done in a template
+// if (withValues.get("creator").toString().equals(""))
+// withValues.put("creator","Anonym");
+
//theLog.printDebugInfo("updating. ");
String id = mainModule.set(withValues);
DatabaseContentToTopics.getInstance().setTopics(req.getParameter("id"),topic_id);
logger.printError("IndyNLProducerLocalizer.setupContentFactory: Exception "+t.getMessage());
}
- contentNode.addVerb( "all", "is_published='1'", "" );
- contentNode.addVerb( "new", "is_published='1' and is_produced='f'", "" );
+ contentNode.addVerb( "all", "is_published='1' and article_type<>${articletype.trashed} and article_type<>${articletype.static}", "" );
+ contentNode.addVerb( "new", "is_published='1' and is_produced='f' and article_type<>${articletype.trashed} and article_type<>${articletype.static}", "" );
aProducerNode.addSubNode( contentNode );
}
try {
aProducerNode.addSubNode(
new EntityListProducerNode("newswire", DatabaseContent.getInstance(), ContentAdapterDefinition.getInstance(),
- "is_published='1' and to_article_type = 1", "date desc, webdb_create desc", 40, 0,
+ "is_published='1' and to_article_type in (${articletype.newswire, articletype.promotednewswire})", "date desc, webdb_create desc", 40, 0,
new EntityListProducerNode("languages", DatabaseLanguage.getInstance(), LanguageAdapterDefinition.getInstance(),
"", "code", 10, 0,
new CompositeProducerNode( new ProducerNode[] {
)
),
new EntityListProducerNode("features", DatabaseContent.getInstance(), ContentAdapterDefinition.getInstance(),
- "is_published='1' and to_article_type = 2", "date desc, webdb_create desc", 10, 0,
+ "is_published='1' and to_article_type in ( ${articletype.feature}, ${articletype.promotednewswire})", "date desc, webdb_create desc", 10, 0,
new EntityListProducerNode("breaking", DatabaseBreaking.getInstance(), BreakingAdapterDefinition.getInstance(),
"", "webdb_create desc", 5, 0,
new EntityEnumeratingProducerNode( "language", DatabaseLanguage.getInstance(), LanguageAdapterDefinition.getInstance(), "code='nl'", "",
try {
topicPageNode =
new EntityBatchingProducerNode( "articles", "batch", DatabaseContent.getInstance(), ContentAdapterDefinition.getInstance(),
- "is_published='1' and to_article_type = ${articletype.newswire} and id in (select content_id from content_x_topic where topic_id = ${topic.id})", "date asc, webdb_create asc", 6, 5, 0,
+ "is_published='1' and to_article_type in (${articletype.newswire, articletype.promotednewswire}) and id in (select content_id from content_x_topic where topic_id = ${topic.id})", "date asc, webdb_create asc", 6, 5, 0,
new EntityListProducerNode("languages", DatabaseLanguage.getInstance(), LanguageAdapterDefinition.getInstance(),
"", "code", 10, 0,
new EntityEnumeratingProducerNode( "language", DatabaseLanguage.getInstance(), LanguageAdapterDefinition.getInstance(), "", "",
ProducerNode node = null;
EntityBatchingProducerNode batchingNode = null;
+ EntityEnumeratingProducerNode enumeratingNode = null;
try {
node =
)
)
);
+ aFactoriesMap.put("features", new NodedProducerFactory( node ) );
}
catch (Throwable t) {
logger.printError("IndyNLProducerLocalizer.setupFactories Exception "+t.getMessage());
}
- aFactoriesMap.put("features", new NodedProducerFactory( node ) );
try {
node =
)
)
);
+ aFactoriesMap.put("featurestest", new NodedProducerFactory( node ) );
}
catch (Throwable t) {
logger.printError("IndyNLProducerLocalizer.setupFactories Exception "+t.getMessage());
}
- aFactoriesMap.put("featurestest", new NodedProducerFactory( node ) );
try {
batchingNode =
new EntityBatchingProducerNode( "comments", "batch", DatabaseComment.getInstance(), CommentAdapterDefinition.getInstance(),
logger.printError("IndyNLProducerLocalizer.setupFactories: Exception "+t.getMessage());
}
+ try {
+ enumeratingNode =
+ new EntityEnumeratingProducerNode( "content", DatabaseContent.getInstance(), ContentAdapterDefinition.getInstance(),
+ new GeneratingProducerNode(
+ "/producer/indymedia.nl/static.template",
+ "${config.storageRoot}/${language.code}/static/${content.edittitle}.shtml"
+ )
+ );
+
+ enumeratingNode.addVerb( "all", "is_published='1' and to_article_type=${articletype.static} and to_language=${language.id} and edittitle<>'' and not edittitle is null", "" );
+ enumeratingNode.addVerb( "new", "is_published='1' and is_produced='f' and to_article_type=${articletype.static} and to_language=${language.id} and edittitle<>'' and not edittitle is null", "" );
+
+ aFactoriesMap.put("staticarticles", new NodedProducerFactory(
+ new EntityEnumeratingProducerNode( "language", DatabaseLanguage.getInstance(), LanguageAdapterDefinition.getInstance(), "", "",
+ new ResourceBundleProducerNode("lang", "bundles.producer_${language.code}",
+ enumeratingNode
+ )
+ )
+ ));
+ }
+ catch (Throwable t) {
+ logger.printError("IndyNLProducerLocalizer.setupFactories: Exception "+t.getMessage());
+ }
}
}