X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fdevelopers-guide%2Fproducers.xml;h=d3b15a317a876c200a06edadc772575e1948a303;hb=9de97ede8f56fa793e0a846ae80d401090db00b4;hp=fef45910cb91c430742240adbcc35fcdc66a66ed;hpb=bf1af476664f7e9263f760705a0a7d35b5dea5d0;p=mir.git diff --git a/doc/developers-guide/producers.xml b/doc/developers-guide/producers.xml index fef45910..d3b15a31 100755 --- a/doc/developers-guide/producers.xml +++ b/doc/developers-guide/producers.xml @@ -1,13 +1,23 @@ The producer framework +Please read the presentation of the producers concept +for an introduction.
How to use the <filename>producers.xml</filename> file - [FIXME: this should be in the user's guide, not here] + [FIXME: this should be in the admin's guide, not here] + + +Please check the standard producers.xml file +for two fully commented, real-world examples : +the <nodedefinition name="Language"> node +and the <producer name="articles"> node. +
Introduction - With Mir, it is now possible to set up arbitrary producers using an xml file. + Mir allows admins to fully configure the producer tasks and set up + arbitrary producers through the producers.xml file. @@ -20,15 +30,12 @@ A producer is defined using a Producer tag: - <producer name="content"/> - - - would define a producer named content. - - + + This would define a producer named content. + In a producer, verbs must be defined. Verbs are sub-tasks of a producer. @@ -44,7 +51,7 @@ <producer name="content"/> - would define a producer with verbs named all and new. + This would define a producer with verbs named all and new. And also the specific nodes and their relationship should be specified: @@ -224,7 +231,7 @@ inside the producers.xml file. Sub tags parameters a list describing the arguments the "function" must be given - definition the actual body of the function, containing the code that should be executed. Note that this may contain a <sub/> tag that is replaced by the child nodes of the calling node (FIXME is this true???) + definition the actual body of the function, containing the code that should be executed. Note that this may contain a <sub/> tag that is replaced by the child nodes of the calling node. @@ -348,6 +355,21 @@ inside the producers.xml file. + Name GenerateMedia + Purpose +The generateMedia node instructs the media handler associated with the media to +"reproduce" the media. In practice this can mean generate an icon from an image, +writing an image from the database to the web root, or create an m3u file or so. +Media handling is limited at this moment, but a serious +redesign is planned right after 1.1 + + + + Arguments + + key FIXME??? + + Name DeleteFile Purpose Delete a file @@ -371,13 +393,25 @@ inside the producers.xml file. Name Resource - Purpose Make a message resource bundle available + Purpose Make a message resource bundle available. In other words, this defines a function that can be used in expressions to reference a bundle. Arguments - key The variable in which the bundle will be stored + key The name of the function. bundle The bundle to use language (optional) The specific language to use + + Example + + + <Resource bundle="bundles.producer" key="lang" language="en"/> + + This makes the english language producer bundle available + through the "lang()" function. One + can then use expressions like ${lang("page.title")} to + refer to a that value. + + @@ -413,7 +447,21 @@ inside the producers.xml file. key The variable containing the article + Name IndexContent + Purpose adds/updates content to the search index (search engine) + + Arguments + + key The variable containing the article (FIXME????) + pathToIndex (FIXME????) + + Name UnIndexContent + Purpose removes content from the search index (search engine) + + Arguments + key The variable containing the article (FIXME????) + pathToIndex (FIXME????)
@@ -421,13 +469,13 @@ inside the producers.xml file.
How the producer framework is implemented -A Producer is a set of tasks, scripted in xml. Producers allow -mir installations to have their own actions that can be called for -instance when a new article is posted. Originally producers were -mostly used to generate pages, but they are used for a lot of -other tasks such as pulling rss feeds for the global wire on -indymedia.org. Producers are added and configured through the -producers.xml file. + + + + + + + The xml nodes contained within a <producer> @@ -435,10 +483,10 @@ tag in the producers.xml file define a small program. This program (or script) may contain constructs such as if clauses, loops and variables... The program is parsed into a -tree of ProducerNodes (figure). The root of this tree is defined in a -NodedProducer (which is the only class that currently implements -the Producer interface). When the Producer is executed, the -produce methods of each node are recursively called, effectively +tree of ProducerNodes (figure). The root of this tree is defined in a +NodedProducer (which is the only class that currently implements +the Producer interface). When the producer is executed, the +produce() methods of each node are recursively called, effectively executing the program as it was scripted.
A producer in the <filename>producer.xml</filename> file is parsed into a tree of <classname>ProducerNodes</classname>