On Nov 25, 2003, at 12:03 PM, Rob Vermeulen wrote:



We also will add a Function implementation for functions which are more or
less stand alone (plus a way in taglib to call them). These functions are
defined in XMLs (in config/functions) , and can call any java functionality
(using reflection). They can be grouped in 'sets' (like namespaces). Think
of e.g. a 'forum' set of functions like 'removeThread', 'addForum' etc...



I really like the idea of this hack, but i would like to have a firm idea of the hack before voting.


Your email discusses the use of functions in taglibs, how are you going to implement this ?
Something like:


<mm:node>
  <mm:function name="function name">
     <mm:parameter name="parameter name">value</mm:parameter>
  </mm:function>
</mm:node>


Ill leave if upto mihxil to give better examples but it looks something like this for a 'set' function :


<mm:functioncontainer referids="forumid">
        <mm:param name="pagesize" value="9" />
        <mm:listfunction set="forums" name="getThread">
                name of thread <mm:field name="name" />
                id of thread  <mm:field name="id" />
        </mm:listfunction>
</mm:functioncontainer>



The thing that interests me even more is how do you want to implement this in the MMCI ?
Which extra methods are required and on which classes ?


You are also talking about xml definitions for the functions. Is it also possible to use reflection instead of making additional xml files that are a description of the actual classes ? Could you give an example of such a xml file, and where are you going to store these files ?


This is not part of this 'hack' vote, it only defines how the tags and methods will be updated supporting several ways of adding functions, I personally am for defining the functions upfront but others seem to want a full 'magical' reflection way. I am more than happy to create a sepr. thread/topic discussing this and have added 4 screenshots of the functions editors based on xml we (submarine) uses.


------ example found in a function set file see screenshots -----

<function name="getTranslations">
<description>Get the translations for the given keyword</description>
<type>class</type>
<class>org.mmbase.module.MultiLanguageGui</class>
<method>getTranslations</method>
<param name="setname" type="String" description="Name of the language set" />
<param name="keyword" type="String" description="Keyword we want within the languageset" />
<return type="NodeList">
<field name="name" type="String" description="Langauge code of the translation" />
<field name="value" type="String" description="Translation for the asked keyword" />
</return>
</function>


----------------

(can't attach images to the list so here are a few url's)

http://www.submarine.nl/mmbase/images/fun1.jpg
http://www.submarine.nl/mmbase/images/fun2.jpg
http://www.submarine.nl/mmbase/images/fun3.jpg
http://www.submarine.nl/mmbase/images/fun4.jpg


I also saw editors with which you can make the xml definitions, are they part of this vote ?

again this is a _possible_ use of the things that are part of the vote, so no the xml's are not part of the vote but i will update all my stuff to use the 1.7 (if hack is accepted) and
put it into the speeltuin open for discussion and part of a new vote (after the 1.7.0 release). The goal of the hack is not to 'solve' functions in one blow but to update the tags/core to allow for us to add them as a seperate download along 1.7.x until we all agree on one (or more) ways.


Daniel.




Reply via email to