In the last months 1.7 has made big improvements. I think the time as come
to request for tests.

As the leader and main implementor of the taglib project I'd like to request
to test the 1.7 version of taglib.

Two things are needed:

- Backwards compatibility tests. Upgrade the test-version of your
  complicated site using taglib to 1.7 and see if it still works. And if
  not, why not. The new taglib should be backwards-compatible with the 1.6
  taglib, besides small points which were eiter undocumented or evidently
  wrong (and I hope nobody used). 


- Evaluating/testing of new features. New features are marked with 'since
  MMBase-1.7' in the documetnation.

  I like you to try them out, and report if they are actually useful and
  well-chosen.

  New features on existing tags and small extensions are:

    - comparator attribute on list tags.
      Applies a java-comparator to sort the list.


    - mm:createnode makeuniques='true'
      The 'unique' fields are automaticly filled with a unique value to
      start with

    - mm:fieldlist jspvar='field'
      You can make a jspvar of type 'Field' of 'FieldValue' (only if that is logicly 
possible) available to the body

    - mm:redirect
       As mm:url but redirects to the generated URL.
    
    - mm:compare valueset="a,b,c"
      List of values. Compare is done with each, and total result is true if one of 
them evaluates true.
    
    - mm:countrelations searchdir="source|destination" role="posrel"
   
    - mm:listrelations searchdir
  
    - mm:time precision=".."
        Specifies the 'precision' of the produced time. Times are rounded off to the 
beginning of
        the specified unit. This can have several purposes. One of them being that 
such a rounded of
        time can be used in queries, without resulting to much different queries 
('now' with a
        precision of minutes, will e.g. result a new 'now' only once a minute, so a 
query with a
        constraint containing 'now' has to be redone only once a minute (in stead of 
every
        second)).
  
    - mm:unrelatednodes
      The inverse of mm:relatednodes
    
    - mm:stringlist
      
    - mm:removeitem
       Remove the current item from the surrounding list. Of course this has
       only effect when the list is 'reused' (with referid)

    - mm:relatednodes role="posrel" type="news" orderby="posrel.pos"
      Much wanted, works in 1.7


  But the major improvements lay on the following terrains, and I
  request extra attention for these

    - mm:content, 'escape' attribute on every 'writer' tag.

       The content tag is meant to put around your whole page, and set general 
properties, like
       language, taglib behaviour, content type.

       I find mm:content especially useful to provide a default 'escaper'
       and a 'postprocessor'.
       
       Both are specified by classes in taglibcontent.xml (available as
       resource in mmbase.jar)

       The default default escaper is dependent on the content-type. For
       text/html e.g. the default escaper would be 'text/html' which then
       causes html-escaping only (< -> &lt; and so on)

       I find interesting a default escaper like 'inline'. This does besides
       html escaping a simple ascii-to-html conversion (a bit like the 'html'
       function). It produces 'inline' xhtml2 code. 

       If a writer is on the place of a xhtml block then there is the
       possibility to use a richter ascii-to-html conversion which I named
      'p'  (because it normally will generate a bunch of 'p' tags.
   
       This can be used with the 'escape' attribute on the writer tag
       mm:field. E.g.:
       
        <mm:field name="body" escape="p" />

       which performs a similar function as the older 
       <mm:field name="html(body)" /> but produces better xhtml.

       If you use escaper="inline" and escape="p" consequently then you have a
       simple form  of rich-text on your site (providing paragraphs, hard
       breaks, emphasis and lists)

     
       Another interesting feature is the 'postprocessor' of mm:content. 
       The complete page can be filtered with this (or chain of this).
       'reducespace' is a nice one because it removes new lines until there
       are no empty lines any more, which makes the 'page source' on the
       client a whole lot easier to read and prettier to see.


       For 'escapers' and 'postprocessors' more can and are defined. We need nice
       and  stable features. Think of some!
        
       current escapers: text/plain, none, text/html, text/html/attribute,
                         text/xml, inline, p, sql, uppercase, censor,
                         swallow, figlet

       current postprocessors: reducespace, entities, xmetodo, hmetodo, perl
  


    - container/containerreferrer tags
      The concept of tags acquiring information of surrounding tags
      (referrer/provider pairs) is well known. For the new taglib there are 
      new ones:
          

    - function tags, and 'functioncontainer'.

      Currently working on nodes only.
      There are three tags now:
      -mm:function Returns the function as 'writer'. (so writes a string to
                  the page, or if a body then you can use writerreferrers)
       mm:listfunction The function returns a list. The body is iterated.
       mm:booleanfunction  Evaluates the body if the function returns True.

       mm:functioncontainer Can contain mm:params for the function tags
                            inside.
                            It also has a argumentsdefinition attribute
                            which will certainly have to dissappear but I did
                            not have anything else

      Example use of the function tags can be found in the cloud-context
      security editors.

   - nodelistcontainer tags and nodelistcontainerreferrer tags
     Every list tag: mm:list, mm:related, mm:listnodes, mm:relatednodes
     received a 'container' counterpart:
     mm:listcontainer, mm:relatedcontainer, mm:listnodescontainer,
     mm:relatednodescontainer (all are generally 'nodelistcontainers')

     If a list tag is inside its container tag, it does not require
     attributes anymore.

     The 'Query' needed for the list tag is now assembled with the
     container, its attributes and a whole bunch of subtags of it
     ('nodelistcontainerreferrers').

     An example would pehraps clarify much:

     <mm:relatednodescontainer path="news,publishtimes" element="news"> <!-- first of 
path is actual default 'element' but for the example -->
        <mm:offset    value="5" />
        <mm:maxnumber value="10" />
        <mm:time id="now" time="now" precision="minutes" write="false" />
        <mm:constraint field="publishtimes.begin" operator="LESS" value="$now"  />
        <mm:constraint field="publishtimes.end"   operator="GREATER" value="$now"  />
        <mm:sortorder  field="publishtimes.begin" direction="up" />
        <mm:relatednodes id="article">
           <mm:first>
            etc..

     <mm:size /> inside a nodelistcontainer will actually perform a 'count'
     query. 

     Also mm:previousbatches and mm:nextbatches are
     nodelistcontainerreferrers and provide an easy way to 'page' your query.
     This feature is used e.g. by the jsp-editors.


That summarizes I think the new features. This post can perhaps be used as a
base to extend the taglib documentation but I think it might be a nice idea
if somebody else actually does it, because that might result clearer text.


If you like to help, you need to update a test 1.6 installation or to
install a new 1.7.

For 1.7 you need jdk1.4. I tested mainly on tomcat 4.1.27  / mysql / hsql / postgresql

Upgrading to 1.7 should go more or less like this (necessary files can be
found on http://www.mmbase.org/download/builds/2003-<tomonth>-<today>)

========
Upgrade:
========
[1.7.0]
- Replace mmbase.jar with the new jars. 
  - if you used editwizards, place mmbase-editwizard.jar (from
    mmbase-editwizard.zip)

  - if you used community, place mmbase-community.jar (from
    mmbase-community.zip)
    You can remove mmcommunity-taglib.tld too and place this in web.xml in stead:
    <taglib>
      <taglib-uri>http://www.mmbase.org/mmcommunity-taglib-1.0</taglib-uri>
      <taglib-location>/WEB-INF/lib/mmbase-community.jar</taglib-location>
    </taglib>

-  Replace all shipped jsps too (e.g. mmeditors, mmexamples, mmadmin)
   - The editwizard jsp and xsls are in mmbase-editwizard.zip now. 

- remove WEB-INF/mmbase-taglib.tld and write in web.xml in stead:
  <taglib>
    <taglib-uri>http://www.mmbase.org/mmbase-taglib-1.0</taglib-uri>
    <taglib-location>/WEB-INF/lib/mmbase.jar</taglib-location>
  </taglib>

- Clean the working directory of your app-server (to recompile jsp's)



Michiel


-- 
Michiel Meeuwissen 
Mediapark C101 Hilversum  
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
 [] ()

Reply via email to