MMBase taglib documentation

 

This is the MMBase taglib reference documentation. There is also a taglib tutorial.

In this reference documentation mmbase tags are divided intro groups. Every tag can be a member of several of these groups. There are two kind of groups, which are listed in this reference. The first set of groups define the `areas' or `types' of the tags. There are for example 'security related' tags and 'tree related' tags. The second kind of grouping of tags specifies the way they work. E.g. a tag which is in the group `Writer' always produces some content which could be written to the page, such group of tags often also share common attributes. E.g. all `WriterReferrer' tags need to have a `writer' attribute. This also means that the documentation for such attributes can be found at the documentation for these groups. So the `writer' attribute is documented in the documentation for the `WriterReferrer' group of tags. The `writer' attribute is also mentioned in the documentation of every WriterReferrer, but there is only a link to the WriterReferrer documentation.

This is the group containing all mmbase tags.

 
cloudprovider | cloudreferrer | clusternodeprovider | condition | container | containerreferrer | contextreader | contextreferrer | contextwriter | fieldprovider | fieldreferrer | functiontag | listprovider | listreferrer | nodeprovider | nodereferrer | querycontainer | querycontainerreferrer | writer | writerreferrer
addconstraint | addnode(new) | ageconstraint | aliasconstraint | aliaslist | ${applicationContext} | attachment | booleanfunction | cancel | changed | cloud | cloudinfo | commit | compare | component(new) | composite | constraint | ${contains} | content | context | countrelations | createalias | createnode | createrelation | datatype | deletealias | deletenode | depth | ${directory} | distinct | edit | ${escape} | escape(new) | escaper | even | field | fieldinfo | fieldlist | first | form | formatter | frameworkparam(new) | function | functioncontainer | grow | ${hasalias}(new) | hasalias | hasfield | hasfunction | hasnode | hasnodemanager | haspage | hasrank | hasrelationmanager | hasrelations | hassetting(new) | image | import | include | index | info | instanceof | isempty | isgreaterthan | islessthan | isnotempty | isnull | last | leafconstraints | leaffile | leafinclude | ${link} | link | list | listcondition | listcontainer | listfunction | listnodes | listnodescontainer | listrelations | listrelationscontainer | locale | log | ${managerProperty} | maxnumber | may(new) | maychangecontext | maycreate | maycreaterelation | maydelete | mayread | maywrite | ${moduleProperty} | nextbatches | node | nodefunction | nodeinfo | nodelistfunction | notpresent | odd | offset | onshrink | param | present | previousbatches | ${property} | property | redirect | related | relatedcontainer | relatednode | relatednodes | relatednodescontainer | ${remove} | remove | removeitem | setcontext | setfield | setting(new) | shrink | size | sortorder | ${string}(new) | stringlist | time | timer | transaction | tree | treecontainer | ${treefile} | treefile | treehaspage | treeinclude | ${treelink} | typeconstraint | unrelatednodes | ${url} | url | valid | voidfunction | write | xslt
info about the syntax of this document
toc
`cloudprovider' tags Cloud provider tags provide a cloud to their body. Also a `transaction' is a kind of cloud.
see alsocloudreferrer
tags of this typecloud | form | transaction
toc
`cloudreferrer' tags A cloud referrer tag is a tag that needs to live in the body of a cloud or transaction tag. This means that it can use MMBase data.
see alsocloud | cloudprovider
attributes
  • cloud
    Which cloud to use. This is an optional argument, and if it is omitted then the tag will refer to the direct parent. Only if there is more than one cloud (for instance within a nested transaction tag) you might want to use this attribute to refer to the main cloud.
tags of this typecloudinfo | createnode | createrelation | datatype | escape | hasnode | hasnodemanager | hasrank | hasrelationmanager | hassetting | link | list | unrelatednodes | listnodes | may | maycreate | maycreaterelation | mayread | deletenode | node | setting | form | transaction | link | treefile | leaffile | url
toc
`clusternodeprovider' tags A clusternode provider makes an MMBase Cluster Node available to its body. A cluster node is in fact a combination of nodes. You can get a real node with a sub node tag with the `element' attribute.
see alsoelement attribute of node
nodeprovider attributes
tags of this typelist | related
toc
`condition' tags Condition tags evaluate their body only if a certain condition is met. This condition can be specified sometimes by attributes on the condition tag, or sometimes on the surrounding parent tags.
attributes
  • inverse
    Inverts the condition: the body of the tag will only be executed if the condition does not evaluate to true. This is an optional attribute with its default value set to 'false'.
    true
    false
tags of this typebooleanfunction | changed | isgreaterthan | islessthan | compare | even | first | hasalias | hasfield | hasfunction | hasnode | hasnodemanager | haspage | hasrank | hasrelationmanager | hasrelations | hassetting | instanceof | isempty | isnotempty | isnull | last | listcondition | may | maychangecontext | maycreate | maycreaterelation | maydelete | mayread | maywrite | odd | notpresent | present | treehaspage | valid
toc
`container' tags Container tags can be referred to by container-referrers. (since: MMBase-1.7)
tags of this typefunctioncontainer | listrelationscontainer | listnodescontainer | relatednodescontainer | listcontainer | relatedcontainer |
toc
`containerreferrer' tags A container referrer is a tag that can use information provided by some container tag, or can push information to a container tag. (since: MMBase-1.7)
attributes
  • container
    Refer to the container with this id. If you want to explicitly not refer to any container (e.g. function-tags on node), then you can specify an non-existing id.
tags of this typebooleanfunction | function | hasfunction | listfunction | nodefunction | nodelistfunction | list | unrelatednodes | listnodes | relatednodes | fieldlist | size | constraint | addconstraint | addnode | composite | ageconstraint | aliasconstraint | typeconstraint | maxnumber | offset | distinct | sortorder | nextbatches | previousbatches | tree | treecontainer | related | voidfunction
toc
`contextreader' tags Contextreader tags are tags that can read previous instances from the context using the 'referid' attribute. It also extends from contextwriter, because it can also put information back into the context. This makes it possible to reuse (settings of) certain tags.
see alsocontext
attributes
  • referid
    Reuses a previously defined tag of the same type.
contextwriter attributes
contextreferrer attributes
tags of this typealiaslist | booleanfunction | cloud | countrelations | depth | field | fieldlist | function | grow | hasalias | hasfield | hasfunction | hasnode | hasnodemanager | hasrelationmanager | hasrelations | isnull | leafconstraints | list | listcontainer | listfunction | unrelatednodes | listnodes | listnodescontainer | listrelations | listrelationscontainer | nextbatches | deletenode | node | nodefunction | nodelistfunction | onshrink | previousbatches | related | relatedcontainer | relatednodes | relatednodescontainer | removeitem | shrink | stringlist | time | tree | treecontainer | voidfunction | xslt
toc
`contextreferrer' tags

Context-referrer tags refer to the context. This means that (most of) their attributes can contain `context' variables (referred to by `$'). All tags are context-referrers or specializations of it.

Note that if you use JSP 2, variables can be accessed by ${}. So this also works in MMBase tags. In MMBase 1.7 the JSP2 variables did not coincide with MMBase variables. In MMBase 1.8 they can coincide.

An example is for instance the use: <mm:listnodes type="$nodetype">, here the 'nodetype' variable from the context is referred to.

see alsocontext
attributes
  • context
    If you want to use variables from another context than the direct parent, then you can specify the id of the parent context tag with this attribute, to indicate it.
tags of this typecomponent | list | related | unrelatednodes | listnodes | relatednodes | cloud | deletenode | node | field | isnull | function | hasfunction | hasnodemanager | hasrelationmanager | hasalias | hasnode | hasfield | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | fieldlist | aliaslist | countrelations | hasrelations | listrelations | listrelationscontainer | xslt | time | listnodescontainer | relatednodescontainer | listcontainer | relatedcontainer | stringlist | nextbatches | previousbatches | removeitem | tree | treecontainer | leafconstraints | grow | onshrink | shrink | depth | info | property | context | createrelation | createnode | setfield | form | transaction | fieldinfo | nodeinfo | write | link | treefile | leaffile | url | link | redirect | image | attachment | relatednode | size | index | formatter | functioncontainer | cloudinfo | setting | formatter | import | notpresent | present | redirect | timer | valid
toc
`contextwriter' tags A contextwriter is a contextreferrer, but it can also write itself to the context (using the id attribute). Tags that extend 'contextreader' can then read the information back using the 'referid' attribute.
see alsocontext
attributes
  • id
    With the `id' attribute you define an unique identifier for this context referrer. Nested tags can refer to this directly and other tags by means of a context.
contextreferrer attributes
tags of this typeattachment | cloudinfo | context | list | related | unrelatednodes | listnodes | relatednodes | cloud | deletenode | node | field | isnull | function | hasfunction | hasnodemanager | hasrelationmanager | hasalias | hasnode | hasfield | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | fieldlist | aliaslist | countrelations | hasrelations | listrelations | listrelationscontainer | xslt | time | listnodescontainer | relatednodescontainer | listcontainer | relatedcontainer | stringlist | nextbatches | previousbatches | removeitem | tree | treecontainer | leafconstraints | grow | onshrink | shrink | depth | createnode | createrelation | fieldinfo | formatter | functioncontainer | image | index | info | link | nodeinfo | property | redirect | relatednode | setfield | setting | size | form | transaction | link | treefile | leaffile | url | write
toc
`fieldprovider' tags Field provider tags provide a field to their body. The `value' of the field is not necessary filled, but a field provider can for example be used to get the `guiname' of a field (based on the current locale). The locale for which the gui information is shown, can be set using the 'locale' tag, or it can be set on the 'content' tag.
see alsofieldreferrer | locale | content
tags of this typefield | fieldlist
toc
`fieldreferrer' tags A tag that can live in the body of a field provider tag, it refers to the parent fieldprovider.
see alsofieldprovider
attributes
  • field
    If the tag is living in more than one field provider, and you don't want the direct parent, then you use this attribute to refer to it.
tags of this typefield | fieldinfo | fieldlist | isnull | setfield
toc
`functiontag' tags

A function tag (of which there are many different types) evaluate a function. Functions can be defined in three locations:

  • The nodemanager (for functions located in builder code)
  • A function set
  • A specific class name
Using the 'nodemanager', 'set', and 'module' attributes, you can specify from which location the function should be retrieved. If none of these are given, the function will be a 'node' function and the tag will act as a 'node referrer'.

Parameters to the function can be specified in two ways:

  • By using the 'referids' attribute: these are named variables which are passed on to the function
  • By putting the function call in a 'function container', and by using <mm:param> tags within the function container

The several tags of this type differ only in the way they deal with the function value. E.g. a 'booleanfunction' works as a `condition' tag (evaluating the body if the function value is `true' and not evaluating the body if it is false). A 'nodelistfunction' tag will execute the function and then iterate the body of the tag for all the nodes in the nodelist.

(since: MMBase-1.7)
see alsofunctioncontainer | param
attributes
  • name

    The name of the function to evaluate.


  • nodemanager
    The name of the nodemanager on which the function must be evaluated.
  • set
    The `functionset' from which the function must be taken. These are a kind of static functions (no mmbase object is associated with them). These `sets' of functions are a bit like name-spaces.
  • classname

    The java class name from which the function must be taken. The function will be interpreted as a `bean' function, meaning that you can set parameters with `set' methods, and get function values with any method with no arguments.

    There are two exceptions to this:

    • If the value of the attribute is 'THISPAGE', a method of the current JSP will be called (a 'method function').
    • If the value of the attribute starts with 'THISPAGE.', an inner class of the current JSP will be used as a bean (the name of the inner class is that what follows the dot).


  • module
    The name of the module on which the function must be evaluated.
  • referids
    Similar to `referids' attribute of mm:url, a simple way to provide (named) arguments to the function.
    see: referids attribute of url
nodereferrer attributes
tags of this typebooleanfunction | function | functioncontainer | hasfunction | listfunction | nodefunction | nodelistfunction | voidfunction
toc
`listprovider' tags

A list provider has a body which is evaluated repeatedly, it is mainly just an iterator tag.

When the list is acting as a contextwriter (if the 'id' parameter is specified), then the body is still evaluated but within the body of the tag the variable refers to the current element. Then after evaluation of the tag, the entire list of elements is available in the context with the type 'java.util.List'.

The attributes to tags of this type (comparator, retain, etc.) all have more or less the same behaviour as the methods of the java.util.Collection interface.

see alsolistreferrer
attributes
  • comparator (since: MMBase-1.7)

    Give the class name of a class that implements the java.util.Comparator interface. Give either a fully qualified name, or a single name. When it is a single name the class must be defined as a static inner class in the jsp (see example)

    The Comparator may have a method init(PageContext), which will be called first if it has (since 1.8.1).


    SHUFFLE For shuffling you don't need to implement a comparator (which is principally possible). This will use Collections.shuffle in stead.
    REVERSE This pseudo-comparator simply reverses the order of the list (using Collections.reverse).
    NATURAL Sorts the objects by their natural ordering.
    CASE_INSENSITIVE Sorts Strings case-insensitively.
    MyCollator If you use a value like this, then it will be supposed that this Comparator is implemented in this jsp. E.g.:
    <%!
    /**
     * Comparator to order mmbase nodes on their field named "title".
     */
     static private final Collator DUTCH_COLLATOR = Collator.getInstance(new Locale("nl", "NL"));
     static {
        // PRIMARY strength ignores differences between &eacute; and e, and between e and E
        DUTCH_COLLATOR.setStrength(Collator.PRIMARY);
     }
    
     static public class DutchCaseInsensitiveCollator implements Comparator {
        public int compare(Object o1, Object o2) {
            String title1 = ((org.mmbase.bridge.Node) o1).getStringValue("title");
            String title2 = ((org.mmbase.bridge.Node) o2).getStringValue("title");
            return DUTCH_COLLATOR.compare(title1, title2);
        }
     }
    %>;
    <mm:listnodescontainer>
      <!-- make sure the list is not gigantic, when sorting with
           comparator it happens in memory, not by database! -->
      <mm:ageconstraint maxage="7" />
      <mm:listnodes comparator="DutchCaseInsensitiveCollator">
         ...
      </mm:listnodes>
    </mm:listnodescontainer>
    
    
    nl.myorg.OurComparator You can also use a fully qualified class name.
  • add (since: MMBase-1.8)

    Adds to this list all elements represented by the value of this attribute. The value refers to some taglib variable, like the id of another list, or the id of a node (which is only one element then).

    This method is similar to the behavior of the 'add()' and 'addAll()' methods from the java.util.Collection interface.

    It is also possible to postfix the referid with '?', in which case no error will occur if the variable with this id does not exist.


  • retain (since: MMBase-1.8)

    Removes all the elements from the list, except the ones that are also present in the list which is specified by this attribute.

    This method is similar to the behavior of the 'retainAll()' method from the java.util.Collection interface.

    It is also possible to postfix the referid with '?', in which case no error will occur if the variable with this id does not exist.


  • remove (since: MMBase-1.8)

    Removes all the elements from the list which are present in the object referred by this attribute.

    This method is similar to the behavior of the 'removeAll()' method from the java.util.Collection interface.

    It is also possible to postfix the referid with '?', in which case no error will occur if the variable with this id does not exist.


  • varStatus (since: MMBase-1.9)

    Like varStatus of c:forEach.


tags of this typealiaslist | fieldlist | list | listfunction | unrelatednodes | listnodes | listrelations | nextbatches | nodelistfunction | previousbatches | related | relatednodes | stringlist | tree
example 1
      
<mm:import id="list1" vartype="list">a,b,c,d,e</mm:import>
<mm:import id="list2" vartype="list">c,d,e,f</mm:import>

<mm:stringlist id="list3" referid="list1" add="list2" />
<mm:stringlist id="list4" referid="list1" retain="list2" />
<mm:stringlist id="list5" referid="list1" remove="list2" />

<mm:write referid="list3" /> / <mm:write referid="list4" /> / <mm:write referid="list5" />

      
      This will print the following:
      
a,b,c,d,e,c,d,e,f / c,d,e / a,b
      
    
toc
`listreferrer' tags A listreferrer tag has to live in the body of a list tag (`list providers').
attributes
  • list
    Which list to use, if the tag is in the body of more than one list, and you don't want the direct parent.
tags of this typechanged | even | first | index | last | listcondition | odd | removeitem | size
toc
`nodeprovider' tags A node provider makes an MMBase Node available to its body.
attributes
  • jspvar
    A jspvar of type Node can be created.
  • commitonclose (since: MMBase-1.8)
    Whether the node must be committed after evaluation of the body. The default is true.
    true If 'commit on close' is true for a NodeProvider, and the current tag (perhaps using 'referid') made changes to it, then on the close of the tag, the 'commit' method of the Node is called. That means that if there are invalid values, an exception may occur.
    false If 'commit on close' is false for a NodeProvider, and the current tag (perhaps using 'referid') made changes to it, then on the close of the tag, the 'commit' method of the Node is called. That means that if there are invalid values, an exception may occur.
tags of this typelist | related | createnode | createrelation | unrelatednodes | listnodes | listrelations | deletenode | node | nodefunction | nodelistfunction | relatednode | relatednodes | tree
toc
`nodereferrer' tags A node referrer tag is a tag that lives within the body of a node provider tag, and uses the node provided by the node provider tag.
attributes
  • node
    Which node to use. You can use this attribute if your Node referrer is living in more than one node provider, and you don't want the direct parent.
tags of this typealiaslist | attachment | countrelations | createalias | deletealias | field | fieldinfo | fieldlist | function | hasfunction | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | functioncontainer | hasalias | hasfield | hasrelations | image | instanceof | listrelations | listrelationscontainer | maychangecontext | maydelete | maywrite | nextbatches | deletenode | node | nodeinfo | previousbatches | related | relatedcontainer | relatednodes | relatednodescontainer | setcontext | setfield | stringlist | tree | treecontainer
toc
`querycontainer' tags

A `Query' container is a container for one of the `node list' tags (list providers that are node providers too). A query container is actually a wrapper for a `Query' on the database, to which constraints can be added using the <mm:constraint> tag, sort order can be specified, etc. If a 'node list tag' is inside a corresponding `nodelist container', it will use the query specified by the container.

For examples, have a look at one of the tags of this type.

(since: MMBase-1.7)
see alsolistprovider | nodeprovider | list | listnodes | querycontainerreferrer
attributes
  • cachepolicy (since: MMBase-1.8)
    Determines how results of the query generated by this container are cached.
    neverNever cache the result
    alwaysAlways cache the result (default)
  • id
    Used in conjunction with 'container' attribute of querycontainerreferrers.
    see: container attribute of containerreferrer
  • jspvar (since: MMBase-1.8.1)
    JspVar of the type org.mmbase.bridge.Query.
container attributes
tags of this typelistcontainer | listnodescontainer | listrelationscontainer | relatedcontainer | relatednodescontainer
toc
`querycontainerreferrer' tags Refers to a query container. Normally these kind of tags are `query modifiers'. (since: MMBase-1.7)
see alsoquerycontainer
containerreferrer attributes
tags of this typeaddconstraint | addnode | ageconstraint | aliasconstraint | composite | constraint | distinct | fieldlist | list | unrelatednodes | listnodes | maxnumber | nextbatches | offset | previousbatches | relatednodes | size | sortorder | tree | treecontainer | typeconstraint
toc
`writer' tags A writer is a tag that can produce output. Normally the default will be to written to the page, unless the tag has a body. All tags which produce output themselves are `writers'. This is contrary to tags which don't produce output, but only produce contextual information (e.g. mm:cloud, mm:node), or programmatic tools (e.g. mm:present, mm:import, mm:list)
see alsowrite | writerreferrer
attributes
  • jspvar
    The name of the variable to be created. Normally, but not always, the scope of this variable is the body of the tag. This attribute can never contain context variables.
  • vartype

    The type of the variable to be created. Usually there is a reasonable default for this attribute. This attribute can never contain context variables.

    The value of this is used for the `jspvar' if you create it, but it is also used for the 'context' variables. It is less often essential then, but it is essential to set it right e.g. when you want to use the `isgreaterthan' tag, because strings compare differently than numbers.


    see: isgreaterthan
    Objectjava.lang.Object
    Stringjava.lang.String
    Nodeorg.mmbase.bridge.Node
    Cloudorg.mmbase.bridge.Cloud
    Transactionorg.mmbase.bridge.Transaction
    decimaljava.math.BigDecimal
    Integerjava.lang.Integer
    Vectorjava.util.Vector. It's better to use List, normally.
    Listjava.util.List
    Longjava.lang.Long
    Doublejava.lang.Double
    Floatjava.lang.Float
    Datejava.util.Date
    Fieldorg.mmbase.bridge.Field
    FieldValueorg.mmbase.bridge.FieldValue
    Booleanjava.lang.boolean
    fileitemorg.apache.commons.fileupload.FileItem. Can be used in multipart file uploads (comfortable in combination with EL)
  • write
    Whether to write to the page or not. Normally the default value will suffice. If you don't write to the page, the produced string can e.g. be used by sub tags, or only written to a context variable.
    true
    false
  • escape (since: MMBase-1.7)
    Override the default escape behaviour determined by the surrounding Content-tag.
    Escaper
    text/plainThis equals no escaping
    noneNo escaping
    text/htmlEscapes for use in HTML.
    text/html/attributeEscapes for use in HTML atributes
    text/xmlEscapes for use in XML (or XHTML).
    inlineInterpret as 'enriched' ASCII for 'inline' HTML parts (so no blocks)
    pInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags (everything is enclosed by a p tag, including lists).
    ppAs 'p', but only one sequences of one br-tags are produced
    p-ommit-surroundingas p, but surrounding p /p tags are omitted (you must place them by hand). This can be needed for 'read-more' links.
    pp-ommit-surrounding
    plInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags. Lists (ul tags) are placed outside the paragraphs. As such a block may start or end with an ul tag.
    pplAs 'p2', but only one sequences of one br-tags are produced
    pl-ommit-surroundingas p2, but surrounding p /p tags are omitted (you must place them by hand).
    ppl-ommit-surroundingas pp2, but surrounding p /p tags are omitted (you must place them by hand).
    wikiGenerates piece of XHTML2 compatible XML
    sqlEscapes for use in SQL (escaping of quotes). You will _not_ have to use this if use mm:constraint.
    js-single-quotesEscapes single quotes for use in Javascript (with \').
    js-double-quotesEscapes double quotes for use in Javascript (with ").
    js-both-quotesEscapes both quote types (' and ") for use in Javascript (with \').
    urlEscapes for use in an URL (using escaping with %). When you use mm:url with mm:param tags you will not have to use this.
    urlparamSimilar to 'url' but also escapes '+'
    uppercaseConverts to all uppercase.
    lowercaseConverts to all lowercase.
    identifierReplaces anything which is not alphanumeric by underscores.
    censorFinds and replaces 'forbidden' words.
    swallowEverything disappears
    linksFinds and makes clickable URL's.
    plainlinksFinds and makes clickable URL's, assuming plain/text input.
    figletFilters through the command-line tool 'figlet', which can have amusing results.
    trimmerTrims leading and trailing whitespace
    cp1252 Escapes the CP1252 characters which are not in ISO-8859-1. You don't want to serve your pages as CP1252 (it is not a standard encoding). It is adviceable to do it using UTF-8, but if you really want to use ISO-8859-1, you can create reasonable surrogates by this (nicer then question marks).
    cp1252wrong Escapes the CP1252 characters, but suppose that the String was originally wrongly encoded (CP1252 bytes were incorrectly supposed ISO-8859-1)
    spaceremover Replace 1 or more white space characters by one space, unless, those are the first or last of the string, those are replaced with nothing.
    spaceswallower Removes all whitespace.
    roman This works on integers only, and converts them to a roman numbers (lowercase, so see also 'uppercase'). This works only for natural numbers smaller than 4000.
    rot13 Performs 'rot 13' encoding of the string, to scramble letters. Can be decoded by doing a rot13 again.
    rot5 Performs 'rot 5' encoding of the string. This scrambles the digits.
    md5
    adler32 Performs a 'adler32' checksum.
    crc32 Performs a 'crc32' checksum.
    java Escapes non-ASCII characters to java escape sequences.
    reducespace

    Replaces groups of one and more newlines by one new line, and one or more space by one space. This spares bandwidth and makes the result better readable.

    This is default for most XML-like content types.

    entitiesAny non-ASCII character will be replaced by an XML-entity.
    xmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with cx, gx, hx, jx, sx, ux
    hmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with ch, gh, hh, jh, sh, u
    perl Interpret the complete body as a perl program, and write the result.
    sitestat Rewrites the input to the characters which are alowed in Sitestat keys for page statistics, being: "A-Z, a-z, 0-9, - . _".

    The value can also refer to the id of an escaper tag


    see: content | escaper | format attribute of formatter
tags of this typealiaslist | attachment | cloudinfo | countrelations | depth | field | fieldinfo | formatter | function | image | treeinclude | leafinclude | include | index | info | listfunction | nextbatches | nodeinfo | previousbatches | property | setting | shrink | size | stringlist | time | link | treefile | leaffile | url | write
toc
`writerreferrer' tags A writer referrer tag can live in the body of a writer tag, and use the supplied information.
see alsowriter
attributes
  • writer
    Which writer to use. If the tag is living in more than one writer, and you want to refer to another then the direct parent.
tags of this typeisgreaterthan | islessthan | compare | isempty | isnotempty | time | write
toc
<mm:addconstraint> Applies a constraint to the query of the surrounding nodelist container. (since: MMBase-1.9.1)
see alsolistnodescontainer | listcontainer | querycontainer | ageconstraint | composite
attributes
  • constraint
querycontainerreferrer attributes
containerreferrer attributes
toc
<mm:addnode> (since: MMBase-1.9)
see alsolistnodescontainer | listcontainer | querycontainer
attributes
  • element
    The step to which the nodes must be added
  • number
    The node(s) to be added
querycontainerreferrer attributes
containerreferrer attributes
toc
<mm:ageconstraint>

In MMBase, objects on default do not have a `creation time' field. But the `number' field can be used to estimate the age (in days), because for every day a `day mark' is remembered. This tag gives easy access to this functionality.

Note that in MMBase 1.8 it is possible to define creation and lastmodified time fields of DATETIME database type. Age-constraints can then also be accomplished by constraints on the date parts of such a field.

(since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | part attribute of constraint
attributes
  • element (since: MMBase-1.8)
    If the surrounding nodelist container is a list container then the constraint can be on the several elements from the path. With this attribute you must indicate to which. This is not needed for listnodes and relatednodes containers.
    see: listcontainer | listnodescontainer
  • field
    If the surrounding nodelist container is a list container then the constraint can be on the several elements from the path. With this attribute you must indicate to which. This is not needed for listnodes and relatednodes containers (and probably would be a `number' field otherwise). This attribute is deprecated in favour of 'element'.
    see: element attribute of ageconstraint | listcontainer | listnodescontainer
  • minage (since: MMBase-1.7)
    Minimal age of the object in days.
  • maxage
    Maximal age of the object in days.
  • inverse
    Inverses the constraint. So adds a NOT.
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listnodescontainer type="typedef">
  <mm:ageconstraint maxage="100" />
  <mm:listnodes>
    <mm:field name="name" />
  </mm:listnodes>
</mm:listnodescontainer>
    
toc
<mm:aliasconstraint> Pinpoints one of the elements to an alias. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer
attributes
  • element

    see: listcontainer | listnodescontainer
  • name
    The name of the alias, or (since MMBase-1.8) a list of possible aliases.
  • inverse
    Inverses the constraint. So adds a NOT.
querycontainerreferrer attributes
containerreferrer attributes
example 1
<%-- list all portals except the two portals with alias 'portalhome' and 'portalkids' --%>
<mm:listnodescontainer type="portals">
  <mm:aliasconstraint name="portalhome,portalkids" inverse="true" />
  <mm:listnodes>
    <mm:field name="title" />
  </mm:listnodes>
</mm:listnodescontainer>
toc
<mm:aliaslist> This is a list which can only live under a NodeProvider, to iterate through all aliases of the Node. In the body you can use the `writer' functionality to actually write out current alias.
nodereferrer attributes
writer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:listnodes type="list">
  <mm:field name="title" />
  has the following aliases:
  <mm:aliaslist>
     <mm:write /> <mm:last inverse="true">,</mm:last>
  </mm:aliaslist><br/>
</mm:listnodes>
  
toc
${mm:applicationContext}

Application context

Signature: java.util.Map applicationContext(java.lang.String)

(since: MMBase-1.8.7)
toc
<mm:attachment>

Returns an URL to the attachment servlet. This is a NodeReferrer and consequently has to live as a child of a (attachment) node.

Using this tag makes your pages more portable to other system, and hopefully less sensitive for future changes in how the attachment servlet works.

attributes
nodereferrer attributes
writer attributes
contextwriter attributes
contextreferrer attributes
example 1
 <mm:listnodes type="attachments">
  <a href="<mm:attachment />">Download</a>
</mm:listnodes>
    
toc
<mm:blocks> (since: MMBase-1.9.1)
toc
<mm:booleanfunction>

Gets the function value of function `name'. The function value is supposed to be Boolean, and this tag acts as a `condition' tag.

For more information about how function tags work generally see the the `functiontag' entry of this reference.

(since: MMBase-1.7)
see alsonode | function | listfunction | functiontag
condition attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
functiontag attributes
nodereferrer attributes
containerreferrer attributes
more examples
example 1
<%!
public static boolean booleanFunction() {
    return System.currentTimeMillis() % 2 == 0;
}
%>
<mm:booleanfunction set="THISPAGE" name="booleanFunction" id="yes">
  YES
</mm:booleanfunction>
<mm:booleanfunction referid="yes" inverse="true">
  NO
</mm:booleanfunction>
toc
<mm:cancel> The cancel tag can be used to cancel a transaction.
see alsotransaction
attributes
  • transaction
    The id of the transaction.
example 1
See the example for tag `transaction'.
toc
<mm:changed>

Can be used in a list to determine if this item has changed compared to the previous one. The criteria applies to the first field given in the orderby attribute of the accompanying list. This field should also be included in the fields attribute of a list or related tag, to make the field accessible.

The first item of a list is always considered `changed'.

see alsofirst | listcondition
condition attributes
listreferrer attributes
example 1
See the example for tag `first'.
toc
<mm:cloud>The cloud tag initializes the cloud to use.
attributes
  • name
    The name of the cloud. On default it is `mmbase'. The default will normally suffice, so you don't need not use this attribute.
    mmbase
  • username

    The authentication name to use (account). When used together with e.g. the method="http" option, validation only succeeds if the username equals this attribute. In this case it is also possible to supply a list of user names here (comma separated)

    It can also be used in combination with the `password' attribute, in which case authentication will happen automatically with the specified credentials.


  • logon
    Synonym to `username'
    see: username attribute of cloud
  • rank
    The required rank. This is another way to force a special user when using several methods. Often, you should use this attribute in combination with some `method' attribute, because if the `current' cloud (of the session) does not have a user of at least this required rank, then it needs to know how to log in again then. If there is no method in that case, then the body will be skipped, and no error will be shown (This behaviour may be useful to `check' a cloud only).
    administrator
    basic user
  • loginpage

    You can use the loginpage attribute to specify the (relative) path to a security login page. i.e.:

            
    <mm:cloud name="mmbase" loginpage="login.jsp">
    ...
    </mm:cloud>
            
            
    The attribute has effect whenever someone who is not already logged on to the cloud requests the page containing the cloud tag. In that case, the tag checks whether the page has been called with a predefined set of parameters.

    If the page was called with the `command' parameter set to `login', the tag assumes a request is being made to log on using the parameters passed. The actual names of the parameter passed differs by security method chosen, which is defined by the `authenticate' attribute. For instance, with authenticate method `username/password', the following additional parameters are recognized:

    • cloud: similar to the cloudtag's `name' attribute
    • username: similar to the cloudtag's `username' attribute
    • password: similar to the cloudtag's `password' attribute
    If login succeeds, the page continues and displays normally. If the login fails, or if no `command=login' attribute was specified, the request is redirected to the page specified in the attribute. This `login page' can then take care of authentication, i.e. by displaying a form that allows the user to enter and submit the appropriate parameters (username/password) back to the originally called page. The page may also implement its own method of authentication. The `command=login' parameter has no effect when the loginpage attribute was not specified.

    The page should link page to the page which is supplied in the reference parameter. The login page itself should have a parameter `command' with value `login', `authenticate' with the authentication method which is wanted. Additional parameters will be passed to the underlying security implementation. A simple login page could contain the following jsp-code:

            
    <%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0"  prefix="mm"%>
    <html>
    <mm:import externid="referrer" required="true" />
    <mm:import externid="reason">please</mm:import>
    <mm:write referid="reason">
      <mm:compare value="failed">
        <font color="red">Failed to log in. Try again</font>
      </mm:compare>
    </mm:write>
        <form method="post" action="<mm:url page="$referrer" />" >
        <input type="hidden" name="command" value="login">
        <input type="hidden" name="cloud" value="mmbase"><!-- also default -->
        <input type="hidden" name="authenticate" value="name/password">
    
        <input type="text" name="username" value="">
        <br />
        <input type="password" name="password" value="">
        <br />
        <input type="submit" name="Login" value="login">
    </form>
    </html>
            
            
    When a user is logged in, a call in that page, with parameter `command' and value `logout' causes the user to be logged out.

    There are different situations on which the cloud tag with the attribute loginpage can react, they are:

    • scenario 1 : not logged-in, no parameter with value login: Stop current page processing, show the login.jsp, which is a form with parameter command with value login. Parameters can be specified inside a form. When the button submit is pressed, this parameters will be send to the referencing page (foo.jsp). The login page will be called with a `reference' attribute containing this page's URL, and a `reason' attribute `please'.
    • scenario 2 : not logged-in, a parameter with value login: The parameters will be retrieved from the request. These parameters will be passed to the security (CloudContext.getCloud(cloud, authenticate, otherparameters)), and the cloud retrieved will be stored inside the context.(from now you are logged in) Page processing of foo.jsp will continue, unless the authentications failed, because then again is redirected to the login page, but this time with `reason' `failed'.
    • scenario 3: logged-in Page foo.jsp will simply be processed. (Unless e.g. the `logon' attribute is not satisfied).
    • scenario 4: logged-in with parameter command with value logout The cloud in the session will be removed (you are now logged out) and we can continue here from scenario 1. Can also be done with method='logout'.

  • password

    The password to use to logon to the cloud. Always consider using method="pagelogon" when you use this attribute, because the default method will otherwise be "sessionlogon". Then, the resulting cloud-object is written to the session, and the visitor of your page can abuse this to gain authorisation also on other pages.

    You could also use 'class' authentication to avoid all passwords in JSP-code.


  • pwd
    Synonym to `password'
    see: password attribute of cloud
  • method
    Describes how to get the authentication information. The default behaviour is as described in `asis'.
    http Use http protocol to ask name and password from the user. If the `username' attribute is specified too, then logging on will fail if the user does not use that username. The `password' (or `pwd') attribute will be ignored.
    logout When using `http' to log on, the browser will store name and password. If you want to log on again, you have to `logout' first. In this case the `realm' of the http authentication will be changed, and you obtain a new possibility to log on after that. The cloud you obtain is anonymous.
    anonymous Ignore the `logon' attribute and create (or reuse) a cloud with an anonymous user.
    asis

    Ignore the `logon' attribute and reuse the cloud as it is in the session, or create an `anonymous' cloud, if there is not cloud in the session.

    pagelogon

    This method should be used together with the "password" attribute, to indicate that the resulting cloud should only be available to the current page, and not to the session.

    sessionlogon

    This method can be used together with "password" attribute, to indicate that the resulting cloud must be written in the session, and can be picked up with method="asis" in another page. Visitors of the page using the login-method should be trusted, because they could perhaps exploit this cloud-object in the session.

    For backwards compatibility reasons this method is the default method if you use the `password' attribute, but a warning will be logged to encourage to state this explicitly, because it is good that you are aware of the consequences.

    A page using a non-anonymous cloud in the session should not be cached publicly, that is another reason to use `pagelogon'.

    delegate

    Delegates logging in to the security's authentication implementation itself. The current request and response objects are given as credentials (e.g. to redirect to an external authentication server). You can also be authenticated only based on class (if in classauthentication.xml this jsp's class was mentioned).

    sessiondelegate

    As delegate, only the resulting cloud is written to the session (and can be picked up with `asis'). This should only be used if the user is trusted (and not e.g. when using `class' security, because then the class is trusted, rather then the user).

  • sessionname

    The name the cloud must get in the session. Using this it is possible to avoid retyping your password when switching between two sites which both use http authentication, but don't share users.

    You can also use a different sessionname for editor pages, so that editors need to log in separately on the front-end, which makes it easier for them to see how pages look for normal users.


  • authenticate
    The authentication module which must be used by the security system. The default is "name/password", which will do in many cases. Other values are often needed when method="delegate" or method="sessiondelegate".
    name/password

    The most common authentication method. You somehow have to supply a name/password combination.

    class

    This can be used in combination with method="delegate". The 1.8 class security (which can be installed in 1.7) feature can recognize this, and supply a cloud based on the class name of this jsp.

  • uri
    The uri in case the cloud has to be retrieved using the RMMCI. This makes it possible to display remote content.
    local Get a local cloud.
    rmi://... RMMCI cloud.
    rmi://www.mmbase.org/remotecontext
  • jspvar
    The name of The JSP variable to create that contains a reference to the cloud.
contextreader attributes
contextwriter attributes
contextreferrer attributes
cloudprovider attributes
example 1
<!-- Show titles of all news articles from user kamer
    (which are in pool kamer_pool) only to user kamer -->
<mm:cloud jspvar="cloud" logon="kamer" method="http">
logged on as: <bean:write name="cloud" property="user.identifier" /><br />
<mm:node number="kamer_pool" id="my_node">
  <mm:related paths="news" orderby="number" directions="DOWN">
     <mm:first>
        <!-- show a small heading,
            which also contains the node-number of the pool -->
        <mm:field node="my_node" name="number" />:
        <mm:field name="number" />
            <mm:fieldinfo type="guiname" />
        </mm:field>:
        <mm:field name="title" />
            <mm:fieldinfo type="guiname" />
        </mm:field>:
     </mm:first>
     <mm:field name="number" />: <mm:field name="title" /><br />
  </mm:related>
</mm:node>
</mm:list>
</mm:cloud>
    
example 2
<!-- To logon on as a different user on my_page.jsp,
    make a ref to a page -->
<mm:cloud method="logout" />
<% response.sendRedirect("http://my_host/my_page.jsp"); %>
    
more examples
example 1
<mm:cloud>
   <!-- show some data, in this case, the first 'typedef', 
        because this type is availabe in every MMBase installation -->
   <mm:listnodes type="typedef" max="1">
     <mm:field name="name" /> : <mm:field name="description" />
   </mm:listnodes>
</mm:cloud>
example 1
<mm:cloud method="http" jspvar="cloud">
  logged on as: <%= cloud.getUser().getIdentifier() %><br />
</mm:cloud>
<a href="<mm:url page="logout.jsp" />">logout</a>
example 1
<mm:cloud method="logout" />
<br />
<a href="<mm:url page="cloud.jsp" />">back to cloud.jsp</a>
toc
<mm:cloudinfo> The nodeinfo tag can be used inside a CloudProvider tag, to get certain information about the cloud. (since: MMBase-1.8)
see alsohasrank
attributes
  • type
    nameThe name of the cloud (Usually just `mmbase')
    userThe identifier of the user of this cloud. You can show who is logged in by this.
    rankThe rank of the user of this cloud, as a String
    rankintThe rank of the user of this cloud, as an Integer
    mmbaseversionThe version of the current instance of MMBase to which this cloud refers.
writer attributes
cloudreferrer attributes
contextwriter attributes
contextreferrer attributes
example 1
      You are <mm:cloudinfo type="user" /> (<mm:cloudinfo type="rank" />)
      <mm:hasrank value="administrator">
        You are administrator !!
      </mm:hasrank>
      <mm:hasrank minvalue="administrator" inverse="true">
        You are not administrator!
      </mm:hasrank>
        Cloud: <mm:cloudinfo type="name" />
toc
<mm:commit> The commit tag can be use to commit a transaction.
see alsotransaction
attributes
  • transaction
    The id of the transaction.
example 1
See the example for tag `transaction'.
toc
<mm:compare> Compares the value of a context variable to a String value. Only if they are equal the body is evaluated.
see alsoisempty | isnotempty | isgreaterthan | islessthan
attributes
  • referid
    Which context variable to compare. It this attribute is missing, then the value of the parent `writer' is taken.
  • value (Either `value', `valueset', `referid2' or 'regexp' must be present.)
    The value to which you want to compare, this is always a String.
  • valueset (Either `value', `valueset', `referid2' or 'regexp' must be present.) (since: MMBase-1.7)
    List of values. Compare is done with each, and total result is true if one of them evaluates true.
  • referid2 (Either `value', `valueset', `referid2' or 'regexp' must be present.)
    The value can also be another context variable, which is not necessarily a string. The type (set by `vartype') is taken into account.
    see: vartype attribute of writer
  • regexp (Either `value', `valueset', `referid2' or 'regexp' must be present.) (since: MMBase-1.8)
    Matches value to a regular expression. See javadoc of java.util.regex.Pattern
condition attributes
writerreferrer attributes
example 1
    <mm:import id="carry_out">yes</mm:import>
    <mm:compare referid="carry_out" value="yes">
        Body should be carried out!
    </mm:compare>
    <mm:compare referid="carry_out" value="no">
        Body should not be carried out!
    </mm:compare>
    
example 2

      <mm:compare referid="zipcode" regexp="(?i)[0-9]{4}\s?[a-z]{2}">
         zip-code correct.
      </mm:compare>

    
toc
<mm:component> Renders a component block. (since: MMBase-1.9)
attributes
  • name
    The name of the component of which a block must be rendered.
  • block
    The name of the block which must be rendered. If this is empty, the default block of the component will be rendered.
  • windowstate
  • render
    head
    body
    processor
  • debug
    see: debug attribute of include
contextreferrer attributes
toc
<mm:composite> Combines constraints with a conditional operator. (since: MMBase-1.7)
see alsoconstraint | listnodescontainer | listcontainer | querycontainer | ageconstraint
attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
The following code lists all users with username 'admin' or 'test'.

<mm:listnodescontainer type="people">
  <mm:composite operator="OR">
    <mm:constraint field="username" value="admin" operator="LIKE" />
    <mm:constraint field="username" value="test" operator="LIKE" />
  </mm:composite>
  <mm:listnodes>
    <mm:field name="username" /> <br />
  </mm:listnodes>
</mm:listnodescontainer>
        
toc
<mm:constraint> Applies a constraint to the query of the surrounding nodelist container. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | querycontainer | ageconstraint | composite
attributes
  • field
    The field to which the constraint must be applied.
  • field2
    Another field the field is to be compared with.
  • value
    The value the field is to be compared with.
  • referid
    The value the field is to be compared.
  • value2
    Needed for BETWEEN operator.
  • referid2
    Needed for BETWEEN operator.
  • inverse
    Inverses the constraint. So adds a NOT.
  • casesensitive
    Changes the given constraint's `case sensitivity' (if applicable). Default it is false.
  • part (since: MMBase-1.8)
    Designates a part of a date field to compare.
    CENTURY
    YEAR
    MONTH
    QUARTER
    WEEK
    DAY
    DAYOFYEAR
    DAYOFMONTH
    DAYOFWEEK
    HOUR
    MINUTE
    SECOND
  • operator
    The operator to be used in the comparison. Defaults to `='
    EQUAL
    =
    LESS
    <
    LESS_EQUAL
    <=
    GREATER
    >
    GREATER_EQUAL
    >=
    LIKE
    BETWEENShould also use value2 or referid2
    INThe value can be a comma separated String of values. You can also refer to some list with `referid' (e.g. to a nodelist tag)
    NULLTests whether the value of the field is NULL (or NOT NULL if inverse="true"). The `value' attributes are ignored.
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listnodescontainer type="people">
  <mm:composite operator="OR">
    <mm:constraint field="username" value="admin" operator="LIKE" />
    <mm:constraint field="username" value="test" operator="LIKE" />
  </mm:composite>
  <mm:listnodes>
    <mm:field name="username" /> <br />
  </mm:listnodes>
</mm:listnodescontainer>
    
toc
${mm:contains}

Tests whether a collection contains a certain element. This can be used in JSP 2 expressions.

Signature: boolean contains(java.util.Collection, java.lang.Object)

(since: MMBase-1.8)
example 1
      <c:if test="&#x24;{mm:contains(list, case)}">
    
toc
<mm:content>

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

The content-tag can also provide a default `escaping' behavior for surrounded `writer' tags.

It also tries to set reasonable cache-headers. Make sure to read the documentation of the `expires' attribute.

(since: MMBase-1.7)
see alsocloud | time | locale | expires attribute of content
attributes
  • language
    The language in which this page is supposed to be written. This information is available to sub-tags (like cloud-tag).
    see: language attribute of locale
  • country
    see: country attribute of locale
  • variant (since: MMBase-1.8)
    see: variant attribute of locale
  • timezone (since: MMBase-1.8.1)
    see: timezone attribute of locale
  • jspvar
  • type

    The Content-Type of this page.

    Setting the content-type can also trigger a default `escaper' and `postprocessor'.

    IdContent-TypeDefault escaperDefault postprocessorDefault encoding
    htmltext/htmltext/htmlreducespaceNOTSPECIFIED
    xhtmlapplication/xhtml+xmltext/xmlreducespace
    xmlapplication/xmltext/xmlreducespace
    text/htmltext/htmltext/htmlreducespaceNOTSPECIFIED
    text/xmltext/xmltext/xmlreducespaceNOTSPECIFIED
    application/xmlapplication/xmltext/xmlreducespace
    application/xhtml+xmlapplication/xhtml+xmltext/xmlreducespace
    audio/x-pn-realaudioaudio/x-pn-realaudiononereducespace
    application/smilapplication/smiltext/xmlreducespace
    text/vnd.rn-realtexttext/vnd.rn-realtexttext/xmlreducespace
    video/x-ms-wmpvideo/x-ms-wmptext/xmlreducespace
    text/javascripttext/javascriptnonereducespace
    text/csstext/cssnonereducespace

  • encoding
    The output text encoding. Don't attribute too much value too this. Normally it's better to arrange this with the page-directive of JSP. Certainly this attribute cannot arrange the pageEncoding (or the coding of the JSP source itself).
    UTF-8
  • expires

    Defines when this page expires (in seconds after now). If you set this, this has influence on some http header being set ('Cache-Control' and `Expires'). This default to one minute public-caching if there is no session used on the page, and to no caching otherwise.

    Setting this to 0 has the effect of disabling all proxy-caching.

    If expires is is set to a value greater than 0, and there is a Cloud-tag in the page which wrote a non-anonymous cloud object to the session, then the Cache-Control header is `private', rather than public, because such a situation implies that there is something on the page which is not public.


  • disposition (since: MMBase-1.8.5)
    Provides a proposal filename for the response. The content-disposition of the resonse will be set to 'attachment', and this filename.
  • postprocessor

    If this attribute is set the complete body-result is piped through this. If you specified `type', then a default postprocessor might be defined.

    The following postprocessors can be specified (besides the ones defined with mm:escaper tags).

    Postprocessor
    reducespace

    Replaces groups of one and more newlines by one new line, and one or more space by one space. This spares bandwidth and makes the result better readable.

    This is default for most XML-like content types.

    entitiesAny non-ASCII character will be replaced by an XML-entity.
    xmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with cx, gx, hx, jx, sx, ux
    hmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with ch, gh, hh, jh, sh, u
    perl Interpret the complete body as a perl program, and write the result.
    sitestat Rewrites the input to the characters which are alowed in Sitestat keys for page statistics, being: "A-Z, a-z, 0-9, - . _".

    see: escaper
  • escaper

    The default value of the escape attribute of all writer tags in the body. The values are defined in taglibcontent.xml. Reasonable defaults apply if you explicitly specify a type.

    The `escape' attribute of the surrounded writers can be used to override this. (E.g. if the writer itself produces HTML (e.g. mm:function name="gui"), then you should use escape="none").

    The following `escapers' can be specified (besides the ones defined with mm:escaper tags):

    Escaper
    text/plainThis equals no escaping
    noneNo escaping
    text/htmlEscapes for use in HTML.
    text/html/attributeEscapes for use in HTML atributes
    text/xmlEscapes for use in XML (or XHTML).
    inlineInterpret as 'enriched' ASCII for 'inline' HTML parts (so no blocks)
    pInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags (everything is enclosed by a p tag, including lists).
    ppAs 'p', but only one sequences of one br-tags are produced
    p-ommit-surroundingas p, but surrounding p /p tags are omitted (you must place them by hand). This can be needed for 'read-more' links.
    pp-ommit-surrounding
    plInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags. Lists (ul tags) are placed outside the paragraphs. As such a block may start or end with an ul tag.
    pplAs 'p2', but only one sequences of one br-tags are produced
    pl-ommit-surroundingas p2, but surrounding p /p tags are omitted (you must place them by hand).
    ppl-ommit-surroundingas pp2, but surrounding p /p tags are omitted (you must place them by hand).
    wikiGenerates piece of XHTML2 compatible XML
    sqlEscapes for use in SQL (escaping of quotes). You will _not_ have to use this if use mm:constraint.
    js-single-quotesEscapes single quotes for use in Javascript (with \').
    js-double-quotesEscapes double quotes for use in Javascript (with ").
    js-both-quotesEscapes both quote types (' and ") for use in Javascript (with \').
    urlEscapes for use in an URL (using escaping with %). When you use mm:url with mm:param tags you will not have to use this.
    urlparamSimilar to 'url' but also escapes '+'
    uppercaseConverts to all uppercase.
    lowercaseConverts to all lowercase.
    identifierReplaces anything which is not alphanumeric by underscores.
    censorFinds and replaces 'forbidden' words.
    swallowEverything disappears
    linksFinds and makes clickable URL's.
    plainlinksFinds and makes clickable URL's, assuming plain/text input.
    figletFilters through the command-line tool 'figlet', which can have amusing results.
    trimmerTrims leading and trailing whitespace
    cp1252 Escapes the CP1252 characters which are not in ISO-8859-1. You don't want to serve your pages as CP1252 (it is not a standard encoding). It is adviceable to do it using UTF-8, but if you really want to use ISO-8859-1, you can create reasonable surrogates by this (nicer then question marks).
    cp1252wrong Escapes the CP1252 characters, but suppose that the String was originally wrongly encoded (CP1252 bytes were incorrectly supposed ISO-8859-1)
    spaceremover Replace 1 or more white space characters by one space, unless, those are the first or last of the string, those are replaced with nothing.
    spaceswallower Removes all whitespace.
    roman This works on integers only, and converts them to a roman numbers (lowercase, so see also 'uppercase'). This works only for natural numbers smaller than 4000.
    rot13 Performs 'rot 13' encoding of the string, to scramble letters. Can be decoded by doing a rot13 again.
    rot5 Performs 'rot 5' encoding of the string. This scrambles the digits.
    md5
    adler32 Performs a 'adler32' checksum.
    crc32 Performs a 'crc32' checksum.
    java Escapes non-ASCII characters to java escape sequences.
    reducespace

    Replaces groups of one and more newlines by one new line, and one or more space by one space. This spares bandwidth and makes the result better readable.

    This is default for most XML-like content types.

    entitiesAny non-ASCII character will be replaced by an XML-entity.
    xmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with cx, gx, hx, jx, sx, ux
    hmetodoReplaces ĉ, ĝ, ĥ, ĵ, ŝ, ŭ with ch, gh, hh, jh, sh, u
    perl Interpret the complete body as a perl program, and write the result.
    sitestat Rewrites the input to the characters which are alowed in Sitestat keys for page statistics, being: "A-Z, a-z, 0-9, - . _".

    see: escape attribute of writer | function | escaper
  • unacceptable (since: MMBase-1.8.5)

    What to do if the to-be-produced content-type seems to be unacceptable for the client.


    Like not using the attribute, i.e. send the content anyway.
    CRIPPLE<:message>Try to cripple the type (degrade application/xtml+xml to text/html), until it is acceptable. If not possible the message can be used for the NOT_ACCEPTABLE response
    <:message>Send a NOT_ACCEPTABLE with this message. If message = "_" it will be leaft empty.
toc
<mm:context>

`Contextwriter' tags inside a context tag supplying the `id' attribute register themselves in the context. Other tags can refer to this id. See for example how the createrelation tag works. A special case of a another tag referring to this id is a tag of the same type. Normally with an attribute `referid' you could `repeat' the tag.

With the import tag you can explicitly put things from outside this context into this context, e.g. from the parameter list or from a parent context. It is also possible to put new strings in the context with the import tag.

There are several ways to refer to objects in the context.

When you are adding a new object then the used attribute is `id'.

The `id' of an `external' object like a request parameter is referred to as `externid' (only in the import tag).

If you are reusing the same object, for example you have put a node in the context, and are using it again then an attribute `referid' is used.

If some attribute wants to use the value of an object in the context, and it is an attribute which can refer to the context (which most attributes are), then you can use something like <context-id;>.<object-id>. The `context-id' is optional when you are in the same context, or sub-context. The value of a context variable can be written to the page with the `write' tag. The {}-parentheses are optional too.

And finally there are some attributes which can only refer. For example if some tag has to live as a child of another tag but you want it to refer not to its direct parent, then there should be an attribute with the name of the parent in which you can put the id of the parent which it has to refer to. For example the field tag has an attribute `node'. This kind of referring does not function per the ContextTag, and is only good for finding ancestor tags. Other tags, like the createrelation tag have attributes like `source' and `destination' attributes which also simply contain the node id's. Please find the examples.

In TCP there is a `tag' called `create', which is comparable to `context'.

On default a context has no id. The implicit `page' context also doesn't have. If a context has no id, there is no way of referring to variables of it if you are not in the context itself (or one of the sub-contexts).

see alsocreaterelation
attributes
  • referid (since: MMBase-1.7)
    Pick up existing context.
  • scope (since: MMBase-1.8)
    Pick up existing context.
    page
    request
    session
    application
contextwriter attributes
contextreferrer attributes
example 1
Use a context inside another context (inside the default `context')
                and import parameters:
<mm:import id="hoi">greetings from amsterdam</mm:import>
<mm:import id="alias" externid="hoi" required ="true" />
<mm:context id="other_context">
  <mm:import externid="alias" />
  <mm:write referid="alias" /><br/>
  <mm:import id="hoi_again">greetings from hilversum</mm:import>
  <mm:write referid="hoi_again" />
</mm:context>
more examples
example 1
<mm:import id="hoi" externid="haj" from="parameters" required="true" jspvar="groet" />
example 1
<mm:write referid="hoi" />,
<mm:write referid="hoi" jspvar="greet">
  <%= greet %>
</mm:write>
example 1
<mm:context id="A">  
  <mm:import id="hoi">hola!</mm:import>
  In context A we also create the variable 'hoi'. This time its value
 is 'hola!' </p><p>
  <mm:context id="B">
    Within a 'child' context of A (we named it B), you can write easily the variable
    from the parent context:
	<mm:write referid="hoi" /></p><p>
    Imagine that also in this context B we create a variable 'hoi', so
    that now we already have three variable named 'hoi'.
	<mm:import id="hoi">foobar</mm:import>
    <mm:context id="C">
     Then we could also demonstrate the use of the attribute
	'context'. It is not really necessary but exist for symmetry
	reasons. With it you can indicate in which of the parent contexes
	the write tag must be evaluated: <mm:write context="A"
	referid="hoi" />, <mm:write referid="A.hoi" />, <mm:write
	context="B" referid="hoi" />, <mm:write referid="A.B.hoi" />,
	<mm:write referid="hoi" /> </p>
    <p>The most upper value of the
	variable 'hoi' in this page (the one which was gotten with 'haj')
	is not accessible here in context C, because the implicit page
	context is unnamed and the 'hoi' variables of contextes A and B
	are shielding it.
    </mm:context>
  </mm:context>
</mm:context>
example 1
<mm:write referid="A.B.hoi" />, 
<mm:write referid="A.hoi" />, 
<mm:write referid="hoi" />
toc
<mm:countrelations> Can be used inside a node tag to show the number of relations the node has. The same effect can be reached by a relatednodescontainer tag with a `size' tag in it.
see alsorelatednodescontainer | size
attributes
  • type
    If specified only the number of relations to the type of nodes specified by this attribute are returned.
  • searchdir (since: MMBase-1.7)

  • role (since: MMBase-1.7)

writer attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:listnodes type="list">
    <mm:field name="title" /> has <mm:countrelations /> relation(s)<br/>
</mm:listnodes>
    
toc
<mm:createalias> Lives in a NodeProvider. Creates the body content as an alias for the node.
attributes
  • name
    In stead of giving it in the body, you can also indicate it with this parameter.
nodereferrer attributes
example 1
<mm:listnodes type="list" max="1">
    <mm:createalias>my_list</mm:createalias>
</mm:listnodes>
    
toc
<mm:createnode> Creates a new node.
attributes
  • type
    The type (NodeManager name) of the new node.
    news
    people
nodeprovider attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
 <mm:createnode type="news" id="new_news">
   <mm:setfield name="title">Create node example</mm:setfield>
</mm:createnode>
    
toc
<mm:createrelation> Creates a relation between two nodes.
see alsomaycreaterelation
attributes
  • role
    The role for the new relation.
  • source
    The id of the node which will be on the source side of the relation.
  • destination
    The id of the node which will be on the destination side of the relation.
nodeprovider attributes
cloudreferrer attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:cloud>
<mm:transaction id="my_transaction">
<mm:createnode type="news" id="my_news">
   <mm:setfield name="title">Todays news</mm:setfield>
   <mm:setfield name="subtitle">There happened a lot today</mm:setfield>
</mm:createnode>
<mm:node number="1808" id="my_author" />
<mm:createrelation role="author" source="my_author" destination="my_news" />
</mm:transaction>
</mm:cloud>
    
toc
<mm:datatype>This tag defines a new datatype with a lifetime of the current request. It's body is XML as used in datatypes.xml and builder xml's. (since: MMBase-1.8.7)
see alsodatatype attribute of fieldinfo
attributes
  • base
  • id
  • nodemanager
  • field
cloudreferrer attributes
toc
<mm:deletealias>

Lives in a NodeProvider. Deletes the body content as an alias for the node.

Why should deletealias live in a NodeProvider? That is because on the `bridge', deleteAlias is on Node too.

attributes
  • name
    In stead of giving it in the body, you can also indicate it with this parameter.
nodereferrer attributes
example 1
Delete the alias "my_news" from one of the news nodes:
<mm:listnodes type="news">
    <mm:deletealias name="my_news" />
</mm:listnodes>
    
toc
<mm:deletenode> This tag extends the `node' tag, and is precisely the same. The only difference is that after the body the node will be removed.
attributes
  • deleterelations
    true
    false
attributes
nodeprovider attributes
nodereferrer attributes
cloudreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:listnodes type="list" max="1">
  <mm:maydelete>
    <mm:deletenode deleterelations="true"/>
  </mm:maydelete>
</mm:listnodes>>
  
toc
<mm:depth> Provides the current depth of the tree. The current depth is defined by the surrounding `grow' or `shrink' tag (if present) or the `tree' tag itself otherwise. (since: MMBase-1.7)
see alsotree related tags
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
writer attributes
toc
${mm:directory}

Calculates the directory part of a certain string. If string ends with / the string itself.

Signature: java.lang.String directory(java.lang.String)

(since: MMBase-1.8)
example 1
      <mm:xslt page="${mm:directory(referrer)}/bla.xml" />
    
toc
<mm:distinct> Makes the surrounding query `distinct'. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer
attributes
  • value
    `true' (default) or `false'.
    true
    vale
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listcontainer path="mags,news,people" fields="mags.title,people.firstname">
  <!-- This will return 5 identical rows -->
  <mm:list>
    <mm:field name="mags.title" /> - <mm:field name="people.firstname" />
  </mm:list>
  <mm:distinct />
  <!-- This returns one row -->
  <mm:list>
    <mm:field name="mags.title" /> - <mm:field name="people.firstname" />
  </mm:list>
</mm:listcontainer>
toc
<mm:edit>

Makes the fields it contains in its body 'editable' or reachable for an editor for that matter.

attributes
  • type

    The type of editor you wish to use which should be specified in the tag's resource file. The rest of it is configured using parameters.


more examples
example 1
<mm:edit type="yammeditor">
  <%--
      optional parameters

  <mm:param name="url" value="/yammeditor/yammeditor.jsp" />
  <mm:param name="icon">/mmbase/edit/my_editors/img/mmbase-edit.gif</mm:param>
  --%>
  <mm:node number="default.mags" notfound="skip">
    <h2><mm:field name="title" /></h2>
    <mm:relatednodes role="posrel" orderby="posrel.pos"  type="news">
      <h3><mm:field name="title" /></h3>
      <mm:relatednodes type="people">
        by <mm:field name="email" />
      </mm:relatednodes>
    </mm:relatednodes>
  </mm:node>
</mm:edit>
toc
${mm:escape}

Performs taglib-escaping.

Signature: java.lang.String escape(java.lang.String, java.lang.Object)

(since: MMBase-1.8)
example 1
      <a href="${node.url}" title="${mm:escape('text/html/attribute', node.title)}" .../>
    
toc
<mm:escape> Simply escapes it's body. (since: MMBase-1.9)
attributes
cloudreferrer attributes
toc
<mm:escaper> You can defined 'parameterized' escapers by this. (since: MMBase-1.8)
see alsocontent
attributes
  • id
    By the id the escaper is available.
  • referid
    Reuses the escaper identified by this.
  • type
    What kind of escaper.
    Parameterized EscaperParameters
    regexps Regexp-replacing.
    Parameter nameDescription
    patterns A list of entries describing regular expresions replacements. Replacements happens per word.
    wrap Word wrapping. Works on plain/text, and wraps with newlines. Can be converted to HTML with a chained escaper.
    Parameter nameDescription
    length Length of lines (default to 80).
    substring Take substring.
    Parameter nameDescription
    from
    to
    ellipsis Can be used to put those three dots ('...') at the end of a 'substringed' line.
    paragraphWraps a text in paragraph (p) tags, unless it is empty or that textstarts with a p tag (in which case it is already wrapped). Use this for fields that contain HTML, but for which you are unsure if they have parahraph tags already
    Parameter nameDescription
    class A class name to give to the paragraph tag.
    resourcebundle Replaces the words which are present as key in given resourcebundle with the values. Since resource bundles are localized, this gives a way to translate (mm:write is nearly fmt:message). E.g. mm:write escape="resourcebundle(org.mmbase.datatypes.resources.ordinals)" value="5".
    Parameter nameDescription
    basename
    mode
    locale
    ordinals Replaces numerics with ordinals ('first', 'second'...).
    Parameter nameDescription
    basename
    mode
    locale
    google Explores the request for the 'referer' http header. If this is from google, the google search words are highlighted in the text.
    Parameter nameDescription
    encryption Encrypts or decrypts the given input using a cryptographic algorithm that is specified as a parameter.
    Parameter nameDescription
    key The key used to encrypt the data. eg. AES uses a 128 bit key.
    format The in-/output format of the ecrypted data. 'hex'(default) or 'base64'
    algorithm The algorithm used for the encryption. eg. 'AES'(default), 'DES', 'Blowfish', etc.
    direction The direction of encryption. 'encrypt'(default) or 'decrypt'
    codesample

    Escapes the code between the tags you define.

    This escaper enables the use of two different escapers in one piece of text. It was started to simplify the inclusion of a code snippet in html but can be used for other purposes as well.

    You can specify the tags between which you wish to escape your text, the escaper to use and you can set an escaper for the rest of the text. It needs to be rewritten to support all escapers/transformers. It only supports the escapers p, pp, p-ommit-surrounding, pp-ommit-surrounding, inline, text/html and text/xml for now. All parameters may be ommitted then it defaults to <pre> and 'text/html'. Use it like f.e.:

    <mm:import id="texttext"> This is an example: <% String foo = "bar"; %> </mm:import> <mm:escaper type="codesample" id="testsample" /> <mm:write referid="testtext" escape="testsample" />

    Parameter nameDescription
    starttag The starttag, f.e. <pre>.
    closetag The closetag, f.e. </pre>.
    escapecode The escaper to use between the start- and closetag.
    escaperest The escaper to use on the rest of the text.
    tagstripper

    Changes existing HTML markup.

    Parameter nameDescription
    tags Either XSS or NONE. XSS will strip all tags and attributes which may have been present in the HTML to try cross-site-scripting. NONE will strip all tags, and produce plain text.
    addbrs If true, then newlines are replaced by br-tags. This can be used to make better html from a kind of pseudo-html.
    escapeamps Html 4 entities are resolved. This indicated whether the remaining ampersands must be replaced with &amp;. Default to false. But see also the 'toxml' escaper.
    toxml

    This filters HTML-4, and cleanes it up, so that it is valid XML. At the moment, like tagstrippers(XSS), with escapeamps is true.

    Parameter nameDescription
    tags
    addbrs
    escapeamps

  • inverse
    Turns the escaper arround (so, will call the 'transformBack' methods).
example 1
<mm:escaper id="vervang"><!-- define a new 'escaper' which is a combination of 3 other escapers -->
  <mm:escaper type="regexps">
    <mm:param name="patterns"><!-- the regexps type escapers need a parameter named 'patterns' -->
      <!-- this parameter must be a list of name-value's. We can simply use sub-param-tags for that -->
      <mm:param name="aaa" value="bbb" />
      <mm:param name="ccc" value="ddd" />
    </mm:param>
  </mm:escaper>
  <mm:escaper referid="uppercase" /> <!-- simply reuse an existing one here -->
  <mm:escaper type="substring">
     <mm:param name="from" value="2" />
  </mm:escaper>
</mm:escaper>
<p>
  <mm:write value="aba aaa b ccc " escape="vervang" /><!-- will write A BBB B DDD -->
</p>
toc
<mm:even>Can be used in a list to determine if this is an even item
see alsofirst
condition attributes
listreferrer attributes
example 1
See the example for tag `first'.
toc
<mm:exception> (since: MMBase-1.9)
toc
<mm:field> Gets the field `name' from node `node' (can also be list providing nodes).
see alsofieldinfo | fieldlist | node
attributes
  • name

    The name of the field to get. It could also be field-like `functions' which can be recognized by the appearing of parentheses. Which functions are available is principally dependent on the node-type. Functions can also be accessed more cleanly by `function' tags.

    When this attribute is missing, then the field is copied from a parent FieldProvider (e.g. another field tag), which must be present then.


    titleReturns the value of the field `title'
    gui()Returns an html `GUI' representation of the node. It is nicer to use the mm:function tag for this
    gui(handle)Returns an html `GUI' representation of the field `handle'. It is nicer to use the mm:function tag for this.
    cache(s(100))Only for images. Returns the icache node number of a image rescaled to 100. It is nicer to use the mm:function tag for this.
    html(body)Returns the body field converted to (bad) HTML. It is nicer to use the attribute escape="p" for this.
    wrap(title,10)Wraps the title to 10 chars.
  • notfound (since: MMBase-1.8)

    If the node doesn't have the given field, what to do then?


    skip|skipbodySimply skip the body if the field is not available
    messageSimply write to the page that the field it not available
    throw|throwexceptionThrow an exception if the field is not available (default)
    null|providenull Provides null as the value for the field
    log Like 'skip' but logs a message.
writer attributes
fieldreferrer attributes
fieldprovider attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
See the example for tag `node'.
toc
<mm:fieldinfo>

The fieldinfo tag can be used inside a FieldProvider. It's basic goal is to provide information about the field, though it sometimes can do a little more. It can for example in some case also change the field.

If the parent fieldprovider is a fieldlist then this fieldlist does not always provide a node as well. In that case not every type of information is available.

see alsofield | fieldlist | nodeinfo | cloud
attributes
  • type
    The type of information which must be returned
    nameThe name of the field
    guinameThe GUI name of the field (can be in other language)
    descriptionThe description of the field (can be in other language)
    datatypeA String identifying the datatype of the field
    datatypedescriptionA description for the datatype of the field
    input A form entry for the field. If the surrounding FieldList has an id, the names of the form entries will be prefixed with it, so it is possible to use it for the same fields in the same form more than once. The post of the form should be treated with corresponding mm:fieldinfo type='useinput's.
    useinput

    If you have created a form with type="input" and this form was submitted, then you can use type="useinput", and it will get the request/post parameter produced by "input" and make the right changes to the parent field.

    The necessary externid's for this will be implicitly imported in the context. You don't have to worry about them.

    `useinput' is exceptional because it doesn't really produce any `info' about the field, but rather changes it.

    Can only be used if the parent FieldProvider also provides a Node.

    searchinput A form entry for the field, fit for use for searching. That means that no textareas will be used and such.
    usesearchinput If you have created a form with type="searchinput" and this form was submitted, then you can use this. It will produce a part of a where clause which you can use to construct a whole `where' for the list tag you are going to use.
    reusesearchinput Adds the search query to the surrounding param-handler, like an mm:url.
    value The value of this field. Can only be used if the parent FieldProvider also provides a Node.
    guivalue The guivalue of this field. Can only be used if the parent FieldProvider also provides a Node (can be in other language).
    type The storage type of this field. Which is an integer. You may like typedescription.
    typedescription The storage type of this field, as a string. Like 'string', 'integer', 'long', 'xml'.
    guitype The guitype of this field. The guitype further specializes on the type, and can be found in the guitype field of builder xml's. The combination of type/guitype is used by e.g. the `input' version of this tag, to create feasible HTML input entries.
    check Only checks whether the field's value is valid. If not, that is reported to a parent form tag.
    errors Like 'check', but displays the error messages if not valid.
  • options
    Specify additional parameters for the presentation/manipulation of the field.
    datetime If the value is a date-time, treat it as a date time combination. This is deprecated. In 1.8 you can indicate this with the pattern setting on the datatype.
    time If the value is a date-time, treat it as time only This is deprecated. In 1.8 you can indicate this with the pattern setting on the datatype.
    date If the value is a date-time, treat it as date only. This is deprecated. In 1.8 you can indicate this with the pattern setting on the datatype.
    extra:onchange='doStuff()' if the type is `input' then you might want to add javascript on the onchange (or add other attributes, like `style' or so) This is deprecated. In 1.8 the produces input entries have very precise CSS classing, which can be used to implicitely attach events on load of the window.
    noemptyif the type is `input', then in certain cases (e.g. when using AJAX), you want that never empty textareas are produced
    trimif the type is `useinput', then the value is trimmed first. Used in conjunction with the 'noempty' option on the corresponding input field
  • datatype (since: MMBase-1.8)
    On default, the datatype of the specified field is used. But this can be overridden.
fieldreferrer attributes
nodereferrer attributes
contextwriter attributes
contextreferrer attributes
writer attributes
example 1
See the example for tags `cloud' and `nodeinfo'.
toc
<mm:fieldlist>

A list of fields. A fieldlist can be inside a NodeProvider in which case the NodeManager is found by means of the parent node. It can also be standalone, then you have to supply the type of the node (the name of the `node manager').

If the 'container' attribute is used, then it can refer to one of the 'NodeQueryContainers' which also provide a NodeManager.

see alsofieldinfo | nodeinfo
attributes
  • nodetype
  • fields

    You can specify a comma separated list of fields you want to list too. If you specify this together with the type attribute, these fields will be added (to the end) of the ones defined in that way.

    If a field does not exist, it is ignored if you postfix it with `?'. This makes it possible to make more generic editors, or add optional fields to a nodemanager.


  • type
    The type of fields that should be returned. If not specified, all fields are returned.
    create This results in a list of all `real' fields.
    edit Return only those fields that should appear in the input area of the editor.
    list Return only those fields that should appear in the list area of the editor.
    search Return only those fields that should appear in the search area of the editor.
    all Return all fields.
  • jspvar (since: MMBase-1.7)
    You can make a jspvar of type `Field' of `FieldValue' (only if that is logically possible) available to the body
  • vartype (since: MMBase-1.7)
    The type of the variable to be created.
    field
    fieldvalue
fieldprovider attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
fieldreferrer attributes
nodereferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
See the example for tag `nodeinfo'.
example 2
      <mm:fieldlist nodetype="insrel" id="insrelfields" type="list" />
      <table>
        <mm:listrelationscontainer id="container" role="$role" type="$destination" searchdir="$search">
          <tr>
            <th>${search}</th>
            <th>#</th>
            <mm:fieldlist id="fields" container="container" type="list" remove="insrelfields">
              <th><mm:fieldinfo type="name" /></th>
            </mm:fieldlist>
          </tr>
        </mm:listrelationscontainer>
      </table>
      
    
toc
<mm:first>Can be used in a list to determine if this is the fist item in the list.
condition attributes
listreferrer attributes
example 1
<mm:listnodes type="typedef">
 <mm:first><ul></mm:first>
 <li>
   <mm:field name="name"/> is: <mm:field name="description"/>
   Index: <mm:index />
   <mm:odd>(odd item)</mm:odd>
   <mm:even>(even item)</mm:even>
   <mm:changed>(different from previous item)</mm:changed>
 </li>
 <mm:last></ul></mm:last>
</mm:listnodes>
    
toc
<mm:form> A form tag collects validation from mm:fieldinto type="check" and mm:fieldinfo type="errors". The mm:valid can be used to report the cumulative error state. (since: MMBase-1.8)
see alsofieldinfo | valid
attributes
  • mode
    urlProduces an URL for an HTML form only (available in the body), and (reuses) an MMBase transaction. Only explicit commit/cancel
    form Produces an HTML form, and (reuses) an MMBase transaction. Only explicit commit/cancel (with mm:commit, mm:cancel, or 'commitonclose'). This value is the default
    validateDoes nothing, besides communicating with mm:fieldinfo's and mm:valid's. Does not produce any content. Implicitely cancels the transaction if not committed.
    transaction Does not produce any content. Besides communicating with children fieldinfo's and valid's ehaves like mm:transaction. Only difference is that on default it does not commit on close.
  • page
    to use in action attribute of produced form.
    see: page attribute of url
  • styleClass (since: MMBase-1.8.1)
    If form-tag is produced, you may want to have it a class-attribute too. By the way, it always has an mm_form class.
    see: styleClass attribute of image
  • absolute (since: MMBase-1.9)
    see: absolute attribute of url
attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
cloudprovider attributes
toc
<mm:formatter> This tag performs XSL and other transformations.
see alsoxslt | param
attributes
  • xslt
    Path to the XSLT file which must, relative to the current JSP file. If you want to use default MMBase XSLT's, then you can prefix by `mm:', and searching will begin in the mmbase configuration directory.
  • format

    A few transformations are predefined in MMBase. If they are XSL transformations then you can put your extensions in e.g. xslt/2xhtml.xslt. This xslt can be extended from the `basic' xslt by beginning it with: <xsl:import href="mm:2xhtml.xslt" />.

    So basically, when you do specify the format attribute there can happen two different things:

    • It is a shortcut for certain values for the `xslt' attribute. E.g. format="xhtml" is shorthand for xslt="xstl/2xhtml.xslt".
    • It give access to certain java functionality present in the formatter tag's implementation. It is e.g. senseless to escape XML with a XSL style sheet, when it can be done so easily in Java.


    none No transformation done by this tag itself. Simply writes out the body, it considers the 'escape' attribute though, so this can be used to apply escapers to body-text.
    xhtmlAn XSLT. Transforms nodes or fields to an XHTML presentation.
    richAn XSLT. Transforms mmxf fields to simple text only presentation.
    presentxmlAn XSLT. Tries to make a nice presentation of XML in XHTML, with colors and so on.
    codeAn XSLT. Doesn't work well. To present taglib code.
    escapexml Escapes characters which make something XML. This way you can easily present XML in XHTML pages. This option is obsoleted by the 'escape' attributes of writers.
    escapexmlpretty Similar to escapexml, but the XML is nicely formatted for human consumption first. This required the XML to be valid, otherwise you get an exception.
  • options
    You can give options to the transformation. Parameters can be done with 'referids' or mm:param sub-tags.
  • referids (since: MMBase-1.8)
    Similar to `referids' attribute of mm:url
    see: referids attribute of url
  • wants

    This tags can communicate in two ways with its body. Normally the default way will do what you expect, but occasionally it can be that it doesn't. then this attribute will come in handy.

    If you don't understand this attribute, then don't worry. You will when you need it.


    stringMeans that the tag simply takes its body as a string.
    DOM Means that the tag must contains sub-tags, which can communicate themselves to this formatter tag and are put in a DOM Document (created by org.mmbase.bridge.xml.Generator)
    default

    This is the default, and means that the way in which the formatter tag get its information is determined smartly.

    This means that it is `DOM' iff the body contains only tags which can communicate themselves to this tag, or don't produce output themselves (are not writer tags) and the `format' is an XSLT-format.

  • namespaceaware (since: MMBase-1.8)
    Whether the generated DOM (if that happens) must be created with the name-space http://www.mmbase.org/objects. Defaults to true.
contextwriter attributes
contextreferrer attributes
contextreferrer attributes
writer attributes
toc
<mm:frameworkparam> Adds a parameter to the parent parameterprovider Tag. Param-tags can be nested; like that it is possible to create map-like parameter values. (since: MMBase-1.9)
see alsourl | include | functioncontainer | referids attribute of url | escaper | referids attribute of functioncontainer
attributes
  • name
    The name of the parameter. If this attribute is missing, the value is interpreted as a , separated list of name=value pairs.
  • value
    The value of the parameter. Is this attribute, and 'referid', is missing, then the body of the param tag is used.
  • referid
    The value of the parameter, as referred from the variable context.
  • vartype
    The `vartype' of the parameter. In principle url-parameters should always be string. When using this attribute, the value is first cast to this type. You could e.g. set it to `integer' if you want to ensure the variable is parseable as an integer.
example 1
See the example for tag `url'.
toc
<mm:function>

Gets the function value of function `name'. The function value is available as a writer.

For more information about how function tags work generally see the the `functiontag' entry of this reference.

(since: MMBase-1.7)
see alsonode | booleanfunction | listfunction | voidfunction | functiontag
writer attributes
functiontag attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
containerreferrer attributes
example 1
<mm:function name="gui" escape="none" />
    
more examples
example 1
<mm:listnodes type="object" max="5" orderby="number" directions="down">
  <p>
    Node #<mm:field name="number" />: <mm:function name="gui" escape="none" />
  </p>
</mm:listnodes>
example 1
<%!
public static class MyClass {

  public MyClass() {
  }
  private String p;
  public void setMyParameter(String p) {
    this.p = p;
  }
  public String myfunction() {
   return p;
  }
}
%>
<mm:functioncontainer>
   <mm:param name="myParameter">Kloink</mm:param>
   <mm:function  classname="MyClass" name="myfunction" />
</mm:functioncontainer>
example 1
<mm:functioncontainer>
   <mm:param name="parameter1">Kloink</mm:param>
   <mm:param name="parameter2">5</mm:param>
   <p>
     Some function of the given bean: 
     <mm:function classname="org.mmbase.util.functions.ExampleBean" 
                  name="stringFunction" />
   </p>
   <p>
     Another function of the same bean:
     <mm:function classname="org.mmbase.util.functions.ExampleBean" 
                  name="integerFunction">
       <mm:isgreaterthan value="9">
         <mm:write /> is greater than 9!
       </mm:isgreaterthan>
     </mm:function>
   </p>
</mm:functioncontainer>
example 1
<%!
  public static String myFunction() {
    return "abracadabra";
  }
%>
<mm:function set="THISPAGE" name="myFunction" />
example 1
<mm:import externid="number">7</mm:import>
<mm:function referids="number@parameter2" 
             classname="org.mmbase.util.functions.ExampleBean" 
             name="integerFunction" />
toc
<mm:functioncontainer> Surrounds a function tag, provides a container for parameters and function results. (since: MMBase-1.7)
see alsofunction | param
attributes
functiontag attributes
nodereferrer attributes
container attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:functioncontainer>
  <mm:listnodes id="thisgroup" type="mmbasegroups">
     <mm:param name="grouporuser"><mm:field name="number" /></mm:param>
     <tr>
     <mm:stringlist referid="operations">
        <mm:param name="operation"><mm:write /></mm:param>
        <td <mm:booleanfunction node="currentcontext" name="parentsallow">
               class="parent"
           </mm:booleanfunction>
          >
          <mm:booleanfunction  node="currentcontext" name="maygrant">
          <input type="checkbox" name="<mm:write />:<mm:field name="number" />"
             <mm:booleanfunction node="currentcontext" name="allows">
               checked="checked"
             </mm:booleanfunction>
          />
          </mm:booleanfunction>
          <mm:booleanfunction node="currentcontext" name="maygrant" inverse="true">
            <mm:booleanfunction node="currentcontext" name="allows">
            X
             </mm:booleanfunction>
          </mm:booleanfunction>
        </td>
        </mm:stringlist>
      </tr>
  </mm:listnodes>
</mm:functioncontainer>
toc
<mm:grow> Iterates from previous depth to (not inclusive) current depth. On the first iteration of mm:tree this will iterate one time. Currently there are not upside down trees implemented, which means that this tag now always iterates one or zero times. (since: MMBase-1.7)
see alsotree related tags | shrink
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
${mm:hasalias}

As mm:hasalias

Signature: java.lang.Boolean hasAlias(org.mmbase.bridge.Node, java.lang.String)

(since: MMBase-1.9)
toc
<mm:hasalias>

Checks only whether node has a certain alias.

(since: MMBase-1.8.5)
attributes
  • name
condition attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:hasfield>

Checks only whether certain field is available. To make it possible to make more generic code.

(since: MMBase-1.8)
attributes
  • name
    Name of the field.
  • nodetype (since: MMBase-1.8.4)
condition attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:listnodes type="object">
  <mm:hasfield name="title">
    Title of node <mm:field name="number" /> (<mm:nodeinfo type="type" />): <mm:field name="title" />
  </mm:hasfield>
</mm:listnodes>
toc
<mm:hasfunction>

Checks only whether certain function is available. To make it possible to make more generic code.

(since: MMBase-1.8)
condition attributes
functiontag attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
containerreferrer attributes
example 1
<mm:hasfunction name="index"><mm:function name="index" /></hasfunction>
    
toc
<mm:hasnode>

Checks only whether certain node is available. To make it possible to make more generic code. It has the same working as <mm:node number="abc" notfound="skipbody" />

(since: MMBase-1.8)
attributes
  • number
    Number (or alias) of the node.
condition attributes
cloudreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:hasnode number="some-alias">
  <mm:node number="some-alias">
    Hello world
  </mm:node>
</mm:hasnode>
toc
<mm:hasnodemanager>

Checks only whether certain nodemanager is available. To make it possible to make more generic code.

(since: MMBase-1.8)
attributes
  • name
    Name of the node-manager.
condition attributes
cloudreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:hasnodemanager name="people">
  <mm:listnodes type="people">
    <mm:field name="firstname" />
  </mm:listnodes>
</mm:hasnodemanager>
toc
<mm:haspage>

Checks for the availability of a certain JSP on this server.

(since: MMBase-1.8)
see alsoinclude
attributes
  • page
    The page to check. It must be a JSP on the same server, so it can either be relative to current JSP, or relative to context root (if it starts with '/').
condition attributes
example 1
<mm:haspage page="extra.jsp">
  <mm:include page="extra.jsp" />
</mm:haspage>
toc
<mm:hasrank> Checks for a certain rank. You can use this to hide certain parts of your page if the rank of the user is too low or too high. (since: MMBase-1.8)
see alsocloudinfo
attributes
  • value
    Checks for precisely one certain rank.
  • minvalue
    A minimal value for the rank. If it is `anonymous' then this is no limitation, because anonymous is the lowest possible rank. It can also be specified as an integer.
  • maxvalue
    A maximal value for the rank. If it is `administrator' then this is no limitation, because administrator is the highest possible rank. It can also be specified as an integer.
condition attributes
cloudreferrer attributes
toc
<mm:hasrelationmanager>

Checks only whether certain relation manager is available. To make it possible to make more generic code.

(since: MMBase-1.8)
attributes
  • sourcemanager
    Name of the source node-manager (defaults to 'object'). For convenience, one may also specify a node here (using $), in which case the nodes nodemanager is requested.
  • destinationmanager
    Name of the destination node-manager (default to 'object'). For convenience, one may also specify a node here (using $), in which case the nodes nodemanager is requested.
  • role
    Role of the relation manager.
condition attributes
cloudreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:hasrelations> Whether this nodes has relations. It also returns true if there are relations which you may not see. (in contradiction to `countrelations') (since: MMBase-1.7)
see alsosize | countrelations
condition attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:hassetting> (since: MMBase-1.9)
attributes
  • name
  • component
cloudreferrer attributes
condition attributes
toc
<mm:hiddens> With the referids attribute it produces 'hidden' form-entries. (since: MMBase-1.9)
toc
<mm:image>

Returns an URL to the image servlet. This is a NodeReferrer and consequently has to live as a child of a (image) node.

Using this tag makes your pages more portable to other system, and hopefully less sensitive for future changes in how the image servlet works.

attributes
  • template

    A `transformation' template.

    In the font option, mm: stands for `mmbase configuration directory'. In this way it is easy to make sure that fonts are available.


    s(100x100)
    s(200x200!)+font(mm:fonts/Arial.ttf)+fill(ffffff)+pointsize(20)+gravity(NorthEast)+text(0,20,'MM Base')
    s(180)+modulate(120,0)+gamma(1/1/2)+bordercolor(8c9c23)+border(10x0)
    s(200)+fill(ffffff)+circle(20,20 30,30)
    s(200x200!)+part(100,100,150,150)
    s(200)+fill(ffffff)+draw(rectangle 100,100 150,150)+dia+flipx
    s(200)+colorizehex(f01010)
    s(200)+f(gif)+paint(10)
    s(100x100>)Fit to 100x100 if it is bigger
  • mode

    What to produce.


    urlAn URL to the image (default)
    attributesThe attributes 'src' 'height' and 'width' for the img-tag of HTML.
    imgA img-tag of HTML
  • absolute (since: MMBase-1.9.1)

    Whether the used url will be 'absolute' or not. Defaults to 'server'.


    see: absolute attribute of url
  • disposition (since: MMBase-1.9.1)


    attachmentThe image will be served out as an attachment.
    inlineThe image will be served out inline.
  • element (since: MMBase-1.7.4)
    see: element attribute of node
  • width

    This width is used for a re-size of the image when no `transformation' template is provided.


  • height

    This height is used for a re-size of the image when no `transformation' template is provided.


  • crop

    Defines if an image should be cropped when no `transformation' template is provided. The image will be cropped when it does not fit the re-size area defined by the height and width attributes.


    beginThe re-size area will be positioned at the left top corner.
    middleThe re-size area will be positioned in the middle.
    endThe re-size area will be positioned at the right bottom corner.
  • styleClass

    Class attribute of html img-tag. Only applied when mode=img.


  • style

    Style attribute of html img-tag. Only applied when mode=img.


  • align

    Align attribute of html img-tag. Only applied when mode=img.


  • border

    Border attribute of html img-tag. Only applied when mode=img.


  • hspace

    Hspace attribute of html img-tag. Only applied when mode=img.


  • vspace

    Vspace attribute of html img-tag. Only applied when mode=img.


  • alt (since: MMBase-1.8.5)

    Alt attribute of html img-tag. Only applied when mode=img.


nodereferrer attributes
writer attributes
contextwriter attributes
contextreferrer attributes
example 1
    <mm:node number="<%= image_number %>">
        <img src="<mm:image template="s(100)" />" width="100" border="0">
    </mm:node>
    
toc
<mm:import> To put objects in the context. That is, import a variable from an external source (a parent context, parameters, a form (post parameters) or the session). You can also create a new variable with this.
see alsocontext | write | contextreferrer
attributes
  • id (Either `id' or `externid' or both must be supplied.)
    This is the key by which the object will be registered in the context. This key may not already exist. You must use the remove tag first, if you need to change the value of the registered object. If you do not supply this attribute, it is supposed to have the same value as `externid' which should be present then.
  • externid (Either `id' or `externid' or both must be supplied.)

    The `externid' is the name of an attribute in the session, parameter in the request, or id in the parent context. The value of this thing is imported in the current context, with the id given by the attribute `id'.

    If there is no attribute `externid' then the value of the new object in the context is taken from the body of this import tag. In that way you can create a variable.


  • required
    Whether the object to be imported is required. If nothing can be found by externid and a default value in the body is missing too, then an exception will follow. It is advised to use this on pages which do nothing sensible without a value for this. Typically read-more pages and so on, which simply cannot show anything if they are not informed what to show. This also serves to document the implementation of the JSP, because the imported variables marked as 'required' are at once recognizable as essential for the page's functionality.
  • reset

    On default, this tag will throw an exception if the id to be registered is registered already. This will protect you against accidentally using the same id twice, thus obfuscating your code.

    If though you really want it then you can set the attribute `reset' to true.

    Consider also `scoping' your variables with a mm:context tag (especially useful for static includes).


    see: context
  • from
    Where to search the externid in. On default it is searched in several sources, but you can limit it with this attribute. In this way it is also possible to get different variables with the same name from different sources.
    parent Imports the variable from a parent context.
    page Import the variable from the standard JSP `page context'.
    session Import the variable from the session.
    cookie Import the variable from a user cookie.
    parameters Import the variable from a POST (a simple form) or GET (the URL) parameter.
    multipart If the form is a `multipart' form (enctype="multipart/form-data"), which is necessary e.g. for images, then you can read the results with this. `postparameters' is a synonym for this, but `multipart' is probably a clearer description.
    multipart? As multipart, if that is possible. Ignored otherwise. If you specify 'multipart' but the request is not a multipart post, it would otherwise give an error.
    request There can be attributes set on a request object. These are principally importable into taglib as well. See JavaDoc.
    application There can be attributes set on the `application'.
    this Especially when you use a list of `from' locations, then the `this' location can be useful. It represent the current value, if there is one. Using this implies reset="true" (because of course you want to reset if current value is an option).
    parameters,session You can also specify a list of locations. This one means: If an attribute cannot be found in the parameters, try it in the session.
  • jspvar
    If you specify `jspvar' a JSP-variable with this name will be created too. It is available after the closing of the tag. JSP-variables can also be created with the `write' tag. A write tag has more precise scoping possibilities.
    see: jspvar attribute of writer
  • vartype
    see: vartype attribute of writer
  • escape
    The import tag does not write anything to the page, so for that the `escape' attribute is not useful. The escape attribute from the import tag is therefore used to escape the actual value of the generated taglib variable. You can for example use it to uppercase an URL parameter or so (for searching).
    see: escape attribute of writer
  • listdelimiter (since: MMBase-1.8)
    If the vartype is 'list', but a String is received, then it will be converted to a List of String, using this delimiter. It defaults to a comma.
contextreferrer attributes
example 1
<!-- Create a variable `hoi' from the parameter `haj',
     Generate an exception if this parameter is not present -->
<mm:import id="hoi" externid="haj" from="parameters" required="true" />
example 2
<!-- Create a variable `hoi' from the parameter `haj',
     If this parameter is not present, hoi becomes `hello' -->
<mm:import id="hoi" externid="haj" from="parameters" >hello</mm:import>
example 3
<!-- Create a variable `hoi' with value `hello' -->
<mm:import id="hoi">hello</mm:import>
example 4
<!-- Create a variable `hoi'. The value will come from an external source,
like the parameter list or the session (where ever it is available) -->
<mm:import externid="hoi" />
toc
<mm:include>

Does an include. This tag is rather similar to mm:url, but in stead of returning the url, it returns the page itself. In that respect it is also very similar to jsp:include. The advantage above jsp:include is that this tag is aware of the context parameters and knows the `param' sub tag.

mm:include also can be used to include `external' URLs, so you can `steal' from another server. But be aware that this causes your server to do an http-request itself to another server. It depends on your server's configuration and of its network's setup, if it is allowed to do this.

If this version of MMBase is running on the Orion application server even `internal' URLs, so pointing to files on the same server, will work like this. In other words, Orion will do an http-request to itself. This was the way the include-tag worked always in MMBase 1.5.

You can also consider using the jsp <%@include file="" %>. This will include the code of that page in place and compile it together with your page. So in that aspect it is much different from this tag, which "includes" a stand-alone page. Using the `context' tag you can still give this included file its own scope.

Also 'tagfiles' provide a nice way to make pieces of taglib code generic.

See JSP Syntax Reference

See MMBase documentation on include mechanisms in MMBase taglib..

see alsoparam | url | haspage | treeinclude | leafinclude
attributes
  • referids
    see: referids attribute of url
  • page
    see: page attribute of url
  • component
    see: component attribute of url
  • referid
    see: referid attribute of url
  • debug
    For debugging you can print the used URL in the page as comments..
    noneNo debugging on the page (default)
    htmlUse html comments
    xmlUse XML comments
    cssUse css comments
  • cite
    Whether to `cite' the page. This only works for `relative' urls on the same server. Only also if you have sufficiently rights to do that. Citing means that the page is acquired directly, so without interpreting/compiling by the web-server. Mainly useful for documentation of page-creating/taglib itself.
  • encoding (since: MMBase-1.7.1)
    The encoding of the to-be-included page. If the included page does provide the right information about this, then there should be no need to use this attribute ever. But if it fails, then you can explicitly try to repair it, using this attribute.
  • attributes (since: MMBase-1.7.4)
    Like 'referids', but sets the variables as request attributes.
    see: from attribute of import | request attribute of write
  • notfound (since: MMBase-1.8)
    Specify the behaviour when the file cannot be found. Default is 'message', but you can change this to give an exception for non-existing files that are included.
    skipDo not generate any error if the file cannot be found
    messageJust write a message to the page if the resource could not be found
    exceptionRaise an exception if the file cannot be found
    log Log a warning if the file cannot be found
  • resource (since: MMBase-1.8)
    Specifies any resource relative to the WebRoot ResourceLoader to be included. This is more or less equivalent to using cite="true", and using page="..". The only difference is that, when using this, there are no restrictions (so you can also show resources in WEB-INF). So, never use this with user input.
  • timeout (since: MMBase-1.9)
    For 'external' includes you can indicate a 'timeout' in milliseconds. A _responseCode variable will be produced.
writer attributes
example 1
<mm:include page="codesamples/index.jsp.1" />
    
example 2
      <os:cache>
        <mm:include page="http://site.which.sometimes.does.not.work.com" timeout="200" />
        <c:if test="${_responseCode ne 200}">
          <os:usecached />
        </c:if>
      </os:cache>
    
toc
<mm:index> The index of the current item of the current list. It can also act as a `querycontainerreferrer' in which case the `offset' and `maxnumber' properties of the query are used to calculate the current page (offset/maxnumber). This index can be used in combination with the index-tags inside mm:nextbatches and mm:previousbatches.
see alsofirst | last | nextbatches | previousbatches
attributes
  • offset
    Where do you want to start counting. The default is determined by the list it is in, and for most lists this is 1. It is not one for example in the `batches' lists, because for them `index' is the page.
    see: previousbatches | nextbatches
contextwriter attributes
contextreferrer attributes
writer attributes
listreferrer attributes
example 1
See the example for tag `first'.
example 2
See the example for tag `nextbatches'.
toc
<mm:info>

This tag can be used to call getInfo from Module and NodeManager. The result of `getInfo' is a string which on default is written to the page. Most of this functionality doesn't have much to do with MMBase, and can be acquired with JSP or other taglibs too.

Consider using function tags in stead, which offer greater possibilities and flexibility.

attributes
  • nodemanager
  • module
  • command
    The command which is given
writer attributes
contextwriter attributes
contextreferrer attributes
example 1
a password:     <mm:info nodemanager="users" command="newpassword" />
user hostname:  <mm:info module="info" command="USER-HOSTNAME" />
    
toc
<mm:instanceof> (since: MMBase-1.8.7)
attributes
nodereferrer attributes
condition attributes
toc
<mm:isempty> Checks if parent writer is empty.
see alsoisnotempty
attributes
condition attributes
writerreferrer attributes
example 1
<mm:field name="title">
  <mm:isempty>
    No title!
  </mm:isempty>
  <mm:isnotempty>
    <mm:write />
  </mm:isnotempty>
</mm:field>
     
example 2
<mm:field name="title" write="true">
  <mm:isempty>
    No title!
  </mm:isempty>
</mm:field>
     
more examples
example 1
<mm:field name="subtitle" write="true">
  <mm:isempty>
    <mm:field name="title" />
  </mm:isempty>
</mm:field>
toc
<mm:isgreaterthan> The body evaluated if the compared value is greater. Works for numbers, but also for strings. If you want to evaluate `is greater than or equal' then try <mm:islessthan inverse="true" ... />
see alsoislessthan
attributes
condition attributes
writerreferrer attributes
example 1
<mm:import id="number" vartype="integer" >5</mm:import>
<mm:import id="compare" vartype="integer" >6</mm:import>
<mm:write referid="number">
   <mm:isgreaterthan value="$compare">
       <mm:write /> greater than <mm:write referid="compare" />
   </mm:isgreaterthan>
   <mm:islessthan value="$compare">
       <mm:write /> less than <mm:write referid="compare" />
   </mm:islessthan>
</mm:write>
    
toc
<mm:islessthan> The body evaluated if the compared value is smaller. This is more or less the inverse of isgreaterhan, of course, but not precisely.
see alsoisgreaterthan
attributes
condition attributes
writerreferrer attributes
example 1
See the example for tag `isgreaterthan'.
toc
<mm:isnotempty> Checks if parent writer, or context-var, is not empty.
see alsoisempty
attributes
condition attributes
writerreferrer attributes
example 1
<mm:field name="title">
  <mm:isempty>
    No title!
  </mm:isempty>
  <mm:isnotempty>
    <mm:write />
  </mm:isnotempty>
</mm:field>
     
toc
<mm:isnull>
see alsonode
attributes
  • name
condition attributes
fieldreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:jdbc> A tag to directly excecute SQL on the mmbase database. This is mainly used for hacking around some limitation of mmbase, and should not be used for code meant to be generic. (since: MMBase-1.8.6)
example 1
<mm:jdbc max="2"
         throwexception="true"
         mode="nodes"
         query="select e.number from $PREFIX_emails e
                                     left join $PREFIX_insrel i on e.number = i.dnumber
                                     left join  $PREFIX_mailboxes b  on i.snumber = b.number
                                     where b.number is null">
   <mm:deletenode />
</mm:jdbc>

    
toc
<mm:last>Can be used in a list to determine if this is the last item in the list.
see alsofirst
condition attributes
listreferrer attributes
example 1
See the example for tag `first'.
toc
<mm:leafconstraints>

Lives in a tree-container tag. Constraints inside this tag are not defined as normal tree constraints but as 'leaf' constraint, which means that they are only taken into constraint on the 'leafs' of the tree.

Practically, this means that it can be used to search a tree.

(since: MMBase-1.8.0)
see alsotree related tags | querycontainerreferrer
attributes
  • on
    Decides whether the leaf-constraint is going to work on the template, or on the trunk.
    template The constraints in this tag will be applied on all the new branches of the tree when they are still 'leafs', so it applies to the template for that (determined by the attributes of treecontainer)
    trunk The constraints in this tag will be applied to the trunk query, which is normally defined by the surrounding nodequery container of the treecontainer. This makes it possible to also consider the trunk when searing a tree.
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:leaffile> This tag does the same as LeafIncludeTag, but instead of including the page that was found, it returns the URL for that page. This URL can be displayed using the `write' tag.
see alsoparam | url | leafinclude
attributes
  • objectlist
    The list of objects
  • notfound (since: MMBase-1.8)
    Specify the behaviour when the file cannot be found. Default is 'exception', but you can change this to silently fail if the file does not exist.
    skipDo not generate any error if the file cannot be found
    exceptionRaise an exception if the file cannot be found
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
See the example for tag `leafinclude'.
toc
<mm:leafinclude> This tag does almost exactly the same as TreeInclude. The only difference is when Treeinclude cannot find a file to include. In that case, Leafinclude will use the type of the nodes from the objectlist to find a file to include.
see alsoinclude | leaffile | param | url
attributes
  • objectlist
    The list of objects
attributes
writer attributes
example 1
Object with id `100' is an object from builder `portals'
Object with id `101' is an object from builder `subsites'.

When leafinclude is called with page='page.jsp' and objectlist='101,102',
the following files will be tried to be included, in order of priority:
100/101/page.jsp
100/subsites/page.jsp
portals/subsites/page.jsp.
The default behavior of getSmartPath is that the directory `100' is chosen
for objectid `100'.
Of course, the default behavior of getSmartPath can still be overridden.
    
toc
${mm:link}

Simple version of the 'url' tag, which can be used more concisely directly in a href attribute or so. Using a ThreadLocal pageContext (set by any mmbase tag, so you should e.g. use an mm:cloud or mm:content).

Signature: java.lang.String link(java.lang.String)

(since: MMBase-1.8.5)
see alsourl | link
example 1
      <link media="screen" type="text/css" href="${mm:link('/css/general.css')}" rel="stylesheet" />
    
toc
<mm:link> Like mm:url, but this is a true writer. Which means that it does not write if it has a body. The idea is to use this in conjunction with EL of JSP2. (since: MMBase-1.8)
see alsourl | param | url
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
<mm:link>
  <mm:param name="h">hallo</mm:param>
    Change
</mm:link>
    
toc
<mm:list> Returns a list of (cluster) nodes. Starting at one or more nodes traversals are made according to a specified path of node managers. One traversal makes up one record returned by the list. All possible traversals that can be made starting at one or more nodes of the same type and following a specified path are returned. Additional attributes can be used to exclude records from the returned list or to influence the order of the returned list. Because the returned records can contain more than one node (such a record that contains fields from several `nodes' is referred to as a `clusternode') you will have to prefix the field name with the node manager name and a dot if you want to refer to them.
see alsolistnodes | listcontainer | element attribute of node
attributes
  • nodes
    Comma-separated list of node numbers that should be used as start nodes. The start nodes don't have to be a member of the first node manager in the path. For example, if the start nodes belong to the second node manager in a path with a length of three node managers, traversals will go into two directions at the same time. All traversals that make up a complete path are returned. If a node belongs to the last node manager in a path traversals will go from right to left starting at the last node manager. All start nodes specified in this attribute have to belong to the same node manager. Nodes that belong to a different node manager than the first node are ignored In case this attribute is not specified all nodes from the first node manager in the path are used as start nodes.
  • path ( `path' or `referid' is mandatory. )
    A comma-separated list of node managers which specifies the path that should be followed. It is possible to explicitly specify a relation manager that should be used to go from one node to an other. If no relation manager is specified between two node managers, all possible relation managers that can be used to go to the next specified node in the path are followed. It is possible to add a digit (0-9) to the node manager name and refer to this node manager with his name and this digit appended. This can be useful if a node manager is used more than once in a path.
    mags
    mags,news
    mags,related,news
    mags,news,images
    mags,related,news,related,images
    pools,pools0,urls
    pools1,pools2,urls,pools3
  • fields
    Comma-separated list of fields that should be made available in the page. The fields are selected from attributes of the corresponding node managers defined in type. It is required to append a prefix to each field listed e.g. fields="mags.title,news.title".
  • constraints
    Constraints to prevent records from being included in the returned list. These constraints follow the syntax of the SQL where clause. It's a good practice to use uppercase letters for the operators and lowercase letters for the field names. There are also a (new) `constraint' tags, which are more flexible (especially when constructing the constraints automatically).
    see: constraint
    url.number = 100!=, <, >, <= and >= can also be used
    person.name = `admin'
    person.email IS NULLindicating the email field should be empty
    person.email LIKE `%.org'indication the email should end with .org
    url.number BETWEEN 30 AND 50
    person.name IN ('admin', `anonymous')
    NOT (url.number = 100)
    person.email IS NOT NULLindicating the email field should not be empty
    person.email NOT LIKE `%.org'indication the email should not end with .org
    url.number NOT BETWEEN 30 AND 50
    person.name NOT IN ('admin', `anonymous')
    LOWER(user.name) = `admin'this will also allow `Admin' to be returned
    LENGTH(user.name) > 5 this will only allow name with a length greater than 5 to be returned
    ((number=100) OR (name='admin') AND email LIKE `%.org')Linking constraints together using AND and OR
    name='aaa''bbb' To only retrieve the string aaa'bbb. A single quote can be escaped using it twice for every single occurrence.
  • orderby
    A comma-separated list of field names on which the returned list should be sorted.
  • directions
    A comma-separated list of values indicating whether to sort up (ascending) or down (descending) on the corresponding field in the orderby parameter or null if sorting on all fields should be up. The value DOWN (case insensitive) indicates that sorting on the corresponding field should be down, all other values (including the empty value) indicate that sorting on the corresponding field should be up. If the number of values found in this parameter are less than the number of fields in the orderby parameter, all fields that don't have a corresponding direction value are sorted according to the last specified direction value.
    UP
    DOWN
    UP,DOWN,UP
  • distinct
    If set to `true' or `yes' all records who have exactly the same values will not be added a second time to the returned list.
  • max
    The maximum number of records to return. Can do it also with the maxnumber tag in the container.
    see: maxnumber
  • offset
    The first number of records to skip. Can do it also with the `offset' tag in the container
    see: offset
  • searchdir
    Determines how directionality affects the search. If set to "destination" relations in a path will only be followed if valid relation exist from source to destination. If set to "source" relations in a path will only be followed if valid relations exist from destination to source. To follow all relations ignoring their directionality set this attribute to "all". Any other value for this attribute will follow relations the way they are defined (either source to destination, destination to source or both).
clusternodeprovider attributes
nodeprovider attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:list nodes="123" path="mags,news"
                fields="mags.title,news.number">
  <mm:first>magazine list</mm:first>
  <mm:field name="mags.title" />
</mm:list>
example 2
<mm:list nodes="123" path="mags,posrel,news"
                orderby="posrel.pos" fields="news.title">
  <mm:first>news in this magazine, ordered</mm:first>
  <mm:field name="news.title" />
</mm:list>
example 3
<mm:list path="pools,pools0,urls"
                fields="pools.name,pools0.name,urls.url">
  <mm:field name="pools.name" />
  <mm:field name="pools0.name" />
  <mm:field name="urls.url" />
</mm:list>
toc
<mm:listcondition> Must be used in the body of a list tag. And the body of itself will only be evaluated if some condition is true.
see alsofirst | last | changed | even | odd
attributes
  • value
    The `value' of the condition, in other words what the condition is, described with a string. There is a limited set available now. They are also available as `macro'-tags on this tag.
    first Show only in first row.
    last Show only in last row.
    odd Show only when row number is odd.
    even Show only when row number is even.
    changed Show only when this row differs from the previous row (or when it is the first).
condition attributes
listreferrer attributes
example 1
<mm:listcondition value="first">(first)</mm:listcondition>
is equivalent to: <mm:first>(first)</mm:first>
    
toc
<mm:listcontainer> Surrounds a list tag and provides a query object. (since: MMBase-1.7)
see alsolist | querycontainerreferrer
attributes
  • path
    A path.
  • searchdirs
    For every path element the `searchdir' can be specified. Defaults to the previous searchdir.
  • id
    Id for reference by subtags and reuse.
  • fields
    see: fields attribute of list
  • nodes (since: MMBase-1.7.1)
    see: nodes attribute of list
querycontainer attributes
container attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
more examples
example 1
<!-- 'cluster' nodes -->
<mm:listcontainer path="news,posrel,urls">
  Total number of nodes before constraint: <mm:size /><br />
  <mm:constraint field="news.title" operator="LIKE" value="%xml%" />
  Total number of found nodes: <mm:size /><br />
  <mm:list>
    <mm:field name="news.title" />: <mm:field name="urls.url" /><br />
  </mm:list>
</mm:listcontainer>
toc
<mm:listfunction>

Gets the function value for function `name'. The function value is supposed to be Collection, and this tags acts as a `listprovider' and `writer' tag, iterating over all entries of the resulting collection.

For more information about how function tags work generally see the the `functiontag' entry of this reference.

(since: MMBase-1.7)
see alsonode | booleanfunction | function | functioncontainer | nodelistfunction
attributes
  • add (since: MMBase-1.9)
  • retain (since: MMBase-1.9)
  • remove (since: MMBase-1.9)
  • max
    The maximum number of times to iterate.
  • offset
    How many items must be skipped before iterating
  • listdelimiter
    see: listdelimiter attribute of import
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
functiontag attributes
nodereferrer attributes
containerreferrer attributes
writer attributes
example 1
<mm:listnodes type="mediasources" max="10">
  <mm:function name="mimetype" />:  <mm:function name="format" />
  <ul>
    <mm:listfunction name="urls" jspvar="uc">
      <li><%= ((org.mmbase.applications.media.urlcomposers.URLComposer)uc).getURL() %></li>
    </mm:listfunction>
  </ul>
</mm:listnodes>
more examples
example 1
<%!
public static java.util.List listFunction() {
   return java.util.Arrays.asList(new String[] {"abc", "def", "ghij"});
}
%>
<mm:listfunction set="THISPAGE" name="listFunction">
   <mm:write /><mm:last inverse="true">, </mm:last>
</mm:listfunction>
toc
<mm:listnodes> The listnodes tag can be used to retrieve nodes managed by a certain node manager. The syntax of the attributes are the same as the syntax of the attributes of the list tag except that it is not needed to prefix the field names with node manager names.
see alsolist | relatednodes | listnodescontainer
attributes
cloudreferrer attributes
nodeprovider attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listnodes type="mags"  >
  <mm:first>magazine list</mm:first>
  <mm:field name="title" />
</mm:listnodes>
toc
<mm:listnodescontainer> Surrounds a listnodes tag and provides a query object. (since: MMBase-1.7)
see alsolistnodes | querycontainerreferrer
attributes
  • type
    see: type attribute of listnodes
  • path
    Though a relatednodescontainer is to query real nodes (so not clusternodes), this does not mean that there can only one node type in the query. Only one element of this path is actually queried, but constraints and sort orders can be applied to the other ones.
    see: path attribute of list
  • searchdirs
    Per element in the path you can indicate an alternative `searchdir' (source, destination or both)
  • element
    The `element' of the path to be queried. This defaults to the first element, but the other ones can be pointed to as well.
    see: element attribute of node
  • id
    Id for reference by subtags and reuse.
  • nodes (since: MMBase-1.7.1)
    see: nodes attribute of list
  • clone (since: MMBase-1.8.6)
    This is the same as 'referid' attribute, but ensures that the query is cloned first, so the original query remains unchanged. The query will implicitely be cloned, also when using 'referid', when changes are made to an already 'used' query.
    true
  • markused (since: MMBase-1.8.6)
    If this attribute is used (and set to 'true') then the query will be marked 'used' in the doEndTag. This ensures that the query cannot be changed before cloning it.
    true
querycontainer attributes
container attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
more examples
example 1
<!-- 'real' nodes -->
<mm:listnodescontainer type="news">
  Total number of nodes before constraint: <mm:size /><br />
  <mm:constraint field="title" operator="LIKE" value="%XML%" />
  Total number of found nodes: <mm:size /><br />
  <mm:listnodes>
    <mm:nodeinfo type="gui" /><br />
  </mm:listnodes>
</mm:listnodescontainer>
toc
<mm:listrelations> List the relations belonging to this nodes. Relations are nodes too.
see alsorelatednode
attributes
nodeprovider attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
listprovider attributes
example 1
<mm:listnodes type="news">
    <mm:field name="title" />
    <mm:listrelations role="posrel" type="page">
        is news item <mm:field name="pos" /> on page
        <mm:relatednode><mm:field name="title" /></mm:relatednode>
    </mm:listrelations>
    <br/>
</mm:listnodes>
    
toc
<mm:listrelationscontainer> The query container for the listrelations tag. (since: MMBase-1.7)
see alsolistrelations | relatednode
attributes
querycontainer attributes
container attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:locale>

Sets a locale. Tags living in its body can request the Locale from it, if they need it. A `locale' is more or less like a `language', but it is a little more. E.g. when formatting a date it is needed to know what the conventions are for the order of the fields, and what kind of characters to use to separate them. Another example is the formatting of numbers, which is also ruled by `locale' conventions.

See JavaDoc for Locale class (A little technical, but at least you'll find links to possible languages and countries, and another short description of what a Locale actually is).

Also the fmt tags of JSTL will recognize this setting (since mmbase 1.8).

Since 1.7 there is also a content tag, which is an extension of the locale tag. You could probably just as well use only an mm:content.

The exceptional value 'client' for the 'language' will set the locale to the preference specified by the client.

see alsocloud | time | content
attributes
  • language
    A two letter language code according to ISO 639, or 'client'. If not country attribute is given, then this attribute can also contain the country and variant, like in xml:lang attributes.
    nl
    en
    nl-BE
    en-GB
  • country
    A two letter country code according to ISO 3166.
    BE
    GB
  • variant (since: MMBase-1.8)
    Vendor specific locale variant.
  • timezone (since: MMBase-1.8.1)
    The time-zone for which the time must be shown. Defaults to the server's time-zone.
    Europe/AmsterdamCentral European Time
  • jspvar
    A jspvar of type Locale can be created.
more examples
example 1
<font color="red">A few cool datetime results:</font><br />
<mm:import id="langs" vartype="list">es,de,it,nl,zh,ja,ar,el,he,ru</mm:import>
<mm:aliaslist referid="langs">
<mm:locale language="$_"><mm:time time="now" format=":FULL.FULL" /></mm:locale><br />
</mm:aliaslist>
<font color="red">Only a date:</font><br />
<mm:locale language="fr"><mm:time time="now" format=":LONG" /></mm:locale><br />
<font color="red">Only a time:</font><br />
<mm:locale language="nl"><mm:time time="now" format=":.MEDIUM" /></mm:locale><br />
<font color="red">SimpleDateFormat:</font><br />
<mm:locale language="pl">:<mm:time time="now" format="MMMM yyyy" /></mm:locale><br />
toc
<mm:log> Logs the body or creates a Logger variable in it. You can log to the MMBase log with this. It logs its body on `service' within the category `org.mmbase.PAGE.LOGTAG', followed by the file name of the JSP which is executed.
attributes
  • jspvar
    If this attribute is present, the body will not be logged, but in the body this jspvar is available, which is of the type `Logger'. This can be handy if your page contains a lot of Java code.
  • level (since: MMBase-1.9)
    Only relevant without the jspvar attribute.
example 1
<mm:log>Log this to the log file</mm:log>
Generates something like this in the mmbase log file:
19:16:04,030 SERVICE - 0: Log this to the log file
The 0 is just counter, which starts at 0 on every page.
    
toc
${mm:managerProperty}

Property of a nodeManager.

Signature: java.lang.Object managerProperty(java.lang.String, java.lang.String)

(since: MMBase-1.8.6)
see alsoproperty
toc
<mm:maxnumber> Limits the node list number of iterations, by applying a `limit' to the surrounding query. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | offset | nextbatches
attributes
  • value
    An integer.
    20
    $max
querycontainerreferrer attributes
containerreferrer attributes
toc
<mm:may> (since: MMBase-1.9)
attributes
  • action
  • component
cloudreferrer attributes
condition attributes
toc
<mm:maychangecontext> Check if the context of a node may be changed.
nodereferrer attributes
condition attributes
toc
<mm:maycreate> Check if node may be created.
attributes
  • type
cloudreferrer attributes
condition attributes
example 1
<mm:maycreate type="list">
    <mm:createnode type="list" id="this_list">
        <mm:setfield name="title">Create node example</mm:setfield>
    </mm:createnode>
</mm:maycreate>
    
toc
<mm:maycreaterelation> Check if a relation may be created.
see alsocreaterelation
attributes
cloudreferrer attributes
condition attributes
example 1
<mm:maycreate type="list">
    <mm:createnode type="list" id="this_list">
        <mm:setfield name="title">
            Node with relation to page 97
        </mm:setfield>
    </mm:createnode>
</mm:maycreate>
<mm:node number="97" id="my_page" />
<mm:maycreaterelation role="posrel"
    source="my_page" destination="this_list">
    <mm:createrelation role="posrel"
        source="my_page" destination="this_list" />
</mm:maycreaterelation>
<delete referid="this_list">
<delete referid="my_page">
    
toc
<mm:maydelete> Check if node may be deleted.
see alsodeletenode
nodereferrer attributes
condition attributes
example 1
See the example for tag `deletenode'.
    
toc
<mm:mayread> Check if a node may be read (since: MMBase-1.8.1)
attributes
  • number

  • referid

cloudreferrer attributes
condition attributes
toc
<mm:maywrite> Check if node may be changed.
attributes
  • number

nodereferrer attributes
condition attributes
example 1
<mm:listnodes type="list" max="1">
    <mm:maywrite>
        <mm:setfield name="title">New title</mm:setfield>
    </mm:maywrite>
</mm:listnodes>
    
toc
${mm:moduleProperty}

Property of a module

Signature: java.lang.Object moduleProperty(java.lang.String, java.lang.String)

(since: MMBase-1.8.6)
see alsoproperty
toc
<mm:nextbatches>

This `listprovider' tag provides a way to implement `paging' or `batching' for large search results. It requests the `offset' and `maxnumber' settings of the surrounding querycontainer and calculates the next possible `offsets'. This is done by counting the query result without `maxnumber'. You get an exception if the `maxnumber' or `offset' tags are not used.

As a list, this tag produces Strings, which you could for example use in its body with <write />. These string represents `offsets' which you can use in an url. You can of course also in the normal way give the list an id, and use the `referids' attribute of the url tag.

If you prefer to have a `page' rather then an offset, then the `index' tag can be used. The default `offset' for the index tag is set to let it be `batch numbers'.

(since: MMBase-1.7)
see alsopreviousbatches | offset | maxnumber | referids attribute of url | write | index
attributes
  • max
    The maximum number of batches to be produces. For really huge result, even the number of batches can be too large, so you want to limit it. You should also use it (max="1") if you only want to implement a `next page' button.
  • maxtotal
    In stead of `max' you could also use maxtotal. The tag will calculate how many batches `previousbatches' did need, and if that is zero, there can be `maxtotal' next batches. If it is more then zero, nextbatches will get less. If there are both many next batches and previous batches, then they get both the half of `maxtotal' batches.
  • indexoffset
    The produced indexes can be used as page numbers. Default this page-numbering starts at 0, with this you can change it, e.g. set it to 1.
nodereferrer attributes
writer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:relatednodescontainer type="responses">
  <mm:maxnumber value="12" />
  <mm:offset value="${offset}" />
  <mm:previousbatches indexoffset="1">
    <mm:link referids="r.s@s,_@offset,n">
      <a href="${_}"><mm:index /></a>
    </mm:link>
    <jsp:text>, </jsp:text>
  </mm:previousbatches>
  <span class="current"><mm:index offset="1"/></span>
  <mm:nextbatches indexoffset="1">
    <jsp:text>, </jsp:text>
    <mm:link referids="r.s@s,_@offset,n">
      <a href="${_}"><mm:index /></a>
    </mm:link>
  </mm:nextbatches>
</mm:relatednodescontainer>
    
toc
<mm:node> A tag to make a node available. Normally it will enclose some field tags, but it is also possible to only write to the context, or to a JSP variable.
attributes
  • number ( `number', `element' or `referid' specify the node. If none of them is given then the node refers to a parent NodeProvider, and simply mirrors it, which can e.g. be useful to assign it a (new) id. The 'parent' node-provider can also be determined by use of the '_node' variable. This last behaviour can be enforced using node="" as attribute (which can be useful e.g. in tag-file fragments). )
    The node number or alias identifying this node in MMBase.
  • notfound
    What to do if the node is not found. The default is to throw an exception.
    skip|skipbodySimply skip the body if the node is not found
    messageJust say in the page that the node was not found
    throw|throwexceptionThrow an exception if the node is not found
    null|providenull Will not throw an exception, but will evaluate the body, simply providing `null' as node. This will probably lead to other (less clear) exceptions. But if you prefer it that way, it is possible. Use on own risk!
    log Like 'skip' but also logs a message.
  • element (Either `number', `element' or `referid' must be supplied.)
    The name of a node field of the current node. This can for instance be the `rnumber' field of a relation, the `destination' field of an oalias, etc. A common use is to specify the name of the node manager to identify a node in a list or related list tag (clusternode providers). In this case, the nodemanager name behaves like a special virtual node field of the surrounding cluster node, indicating the individual nodes that make up the cluster node.
    see: clusternodeprovider
nodeprovider attributes
nodereferrer attributes
cloudreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
example 1
Assume that node with number has a field title.
Then the following  can be used to
access the value of title:
<mm:node number="456">
    <mm:field name="title" write="true" />
</mm:node>
     
toc
<mm:nodefunction> Gets the function value of function `name' from surrounding nodeprovider. The function value is supposed to be a Node. (since: MMBase-1.7)
see alsonode | booleanfunction | function | functioncontainer | listfunction
attributes
nodeprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
functiontag attributes
nodereferrer attributes
containerreferrer attributes
toc
<mm:nodeinfo> The nodeinfo tag can be used inside a NodeProvider tag, to get certain information about the node.
attributes
  • type
    typeThe type of the node (the name of it's NodeManager).
    guitypeThe GUI representation of the type (NodeManager) of the node.
    plural_guitypeThe plural GUI representation of the type (NodeManager) of the node.
    descriptionThe description of the type (NodeManager) of the node.
    numberThe node number
    contextThe (security) context of the node
  • nodetype
    Actually, the node-info tag also is the `nodemanager' info tag. If for some reason you need information about a node-manager, without having a node, you can specify it with this attribute.
  • element (since: MMBase-1.8)
    see: element attribute of node
writer attributes
nodereferrer attributes
contextwriter attributes
contextreferrer attributes
example 1
<mm:node number="1645">
Node of type <mm:nodeinfo type="guitype" /><br />
  <mm:fieldlist type="edit">
    <em><mm:fieldinfo type="guiname" /></em>:
        <mm:fieldinfo type="value" /><br />
  </mm:fieldlist>
</mm:node>
toc
<mm:nodelistfunction>

Gets the function value of function `name'. The function value is supposed to be NodeList, and this tags acts as a `listprovider' tag and `nodeprovider'.

For more information about how function tags work generally see the the `functiontag' entry of this reference.

(since: MMBase-1.7)
see alsonode | booleanfunction | function | functioncontainer | listfunction | functiontag
attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
functiontag attributes
nodereferrer attributes
nodeprovider attributes
containerreferrer attributes
toc
<mm:notpresent> Checks if a certain variable is missing in the parent Context tag.
see alsopresent
attributes
condition attributes
contextreferrer attributes
example 1
See the example for tag `present'
toc
<mm:odd>Can be used in a list to determine if this is an odd item
see alsofirst
condition attributes
listreferrer attributes
example 1
See the example for tag `first'.
toc
<mm:offset> Offset the list by applying an `offset' to the surrounding query. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | maxnumber | nextbatches
attributes
  • value
    An integer.
    10
    $offset
querycontainerreferrer attributes
containerreferrer attributes
toc
<mm:onshrink> The body of the tag is remembered for use by the shrink tag, used when shrinking to current depth. See depth-tag for what `current depth' means. This tag iterates from previous depth to current current depth (like grow), but the body is remembered, not executed. (since: MMBase-1.7)
see alsotree related tags | depth | shrink
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:option> Like the HTML option tag, which it produces. It only support also a 'compare' attribute to support added selected="selected" or not. (since: MMBase-1.8.5)
example 1
    <mm:option name="a" value="hoi" compare="${a}" />

    
toc
<mm:param> Adds a parameter to the parent parameterprovider Tag. Param-tags can be nested; like that it is possible to create map-like parameter values.
see alsourl | include | functioncontainer | referids attribute of url | escaper | referids attribute of functioncontainer
attributes
  • name
    The name of the parameter. If this attribute is missing, the value is interpreted as a , separated list of name=value pairs.
  • value
    The value of the parameter. Is this attribute, and 'referid', is missing, then the body of the param tag is used.
  • referid
    The value of the parameter, as referred from the variable context.
  • vartype (since: MMBase-1.7)
    The `vartype' of the parameter. In principle url-parameters should always be string. When using this attribute, the value is first cast to this type. You could e.g. set it to `integer' if you want to ensure the variable is parseable as an integer.
example 1
See the example for tag `url'.
toc
<mm:present> Checks if a certain variable is present in the parent Context tag.
see alsonotpresent
attributes
  • referid
    Which context variable.
condition attributes
contextreferrer attributes
example 1
    <mm:context id="other_context">
      <mm:import id="hoi_again">greetings from hilversum</mm:import>
      <mm:present referid="hoi_again">
        is present in other_context<br />
      </mm:present>
    </mm:context>
    <mm:notpresent referid="hoi_again">
        is not present in default context<br />
    </mm:notpresent>
    
toc
<mm:previousbatches> This is the counterpart of the next-batches tag, which can e.g. be used to implement a `previous page' button. (since: MMBase-1.7)
see alsonextbatches | offset | maxnumber
attributes
nodereferrer attributes
writer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
See the example for tag `nextbatches'.
toc
${mm:property}

Property of the cloud

Signature: java.lang.Object property(java.lang.String)

(since: MMBase-1.8.6)
see alsoproperty
toc
<mm:property> (since: MMBase-1.8.6)
attributes
  • nodemanager
  • module
  • name
    The command which is given
writer attributes
contextwriter attributes
contextreferrer attributes
example 1
     <mm:property nodemanager="images" name="wizard" />
    
toc
<mm:radio> Like the HTML input radio tag, which it produces. It only support also a 'compare' attribute to support added checked="checked" or not. (since: MMBase-1.8.5)
example 1
    <mm:radio name="a" value="hoi" compare="${a}" />

    
toc
<mm:redirect>

As mm:url but redirects to the generated URL.

(since: MMBase-1.7)
attributes
  • referids
    see: referids attribute of url
  • page
    see: page attribute of url
  • referid (since: MMBase-1.7)
    see: referid attribute of url
  • absolute (since: MMBase-1.8)
    Whether or not to produce fully qualified absolute URLs. (http://myhost.nl/context/..). Defaults to false.
    falseDoes nothing special to the url. If 'page' starts with '/' the context is prefixed.
    trueMakes the URL absolute, so it starts with something like http:
    serverMakes the URL absolute on the server, so it starts with /.
    contextMakes the URL absolute on the current servlet context, so it starts with /, but it is not prefixed by the context. The result could e.g. be used as an argument for another url-tag.
contextreferrer attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:related> The related tag is the same as the list tag except that it always needs one or more start nodes from which the node manager will be taken and prefixed to the path specified by the path attribute. By default, the node used is that of the parent node tag.
see alsolist | relatednodes | element attribute of node
attributes
clusternodeprovider attributes
nodeprovider attributes
nodereferrer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
containerreferrer attributes
example 1
<mm:node number="123">
  <mm:related  path="mags,news" fields="mags.title,news.number">
    <mm:first>magazine list</mm:first>
    <mm:field name="mags.title" />
  </mm:related>
</mm:node>
example 2
<mm:node number="456"> <!-- node 456 is of type mags -->
  <mm:field name="title" />
  <mm:related path="news0" fields="mags0.title">
    <mm:first>related magazines</mm:first>
    <mm:field name="mags0.title" />
  </mm:related>
</mm:node>
toc
<mm:relatedcontainer> Surrounds a list tag and provides a query object. (since: MMBase-1.7)
see alsorelated | listcontainer | querycontainerreferrer
attributes
querycontainer attributes
container attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:relatednode> For use under listrelations tag. With this you can easily find the other node (it uses the `snumber' and `dnumber' fields for you.
see alsolistrelations
attributes
  • listrelations
    To refer to another listrelations tag then the direct parent.
nodeprovider attributes
contextwriter attributes
contextreferrer attributes
example 1
See the example for tag `listrelations'.
    
toc
<mm:relatednodes> The relatednodes tag can be used to retrieve nodes of a certain type related to a node of another type. The syntax of the attributes are the same as the syntax of the attributes of the list tag except that it is not needed to prefix the field names with a node manager name. By default, the node used is that of the parent node tag.
see alsolist | listnodes | related | unrelatednodes
attributes
nodeprovider attributes
nodereferrer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:node number="Magazine" >
<mm:relatednodes type="news" >
  <mm:first>news in this magazine</mm:first>
  <mm:field name="title" />
</mm:relatednodes>
toc
<mm:relatednodescontainer> Surrounds a relatednodes tag and provides a query object. Alternatively, it can also surround a listnodes tag (because a relatenodescontainer is a specialized version of a listnodescontainer). (since: MMBase-1.7)
see alsolistnodes | querycontainerreferrer
attributes
querycontainer attributes
container attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
nodereferrer attributes
more examples
example 1
<mm:listnodes type="mags" max="1">
  <mm:relatednodescontainer type="news">
    <mm:sortorder field="number" direction="down" /> <!-- newest first -->
    <mm:relatednodes>
      <mm:nodeinfo type="gui" /><br />
    </mm:relatednodes>
  </mm:relatednodescontainer>
</mm:listnodes>
example 1
<mm:listnodes type="mags" max="1">
  <mm:relatednodescontainer path="posrel,news" element="news">
    <!-- element attribute could be omitted, because defaults to last of path-->
    <mm:sortorder field="posrel.pos" />
    <mm:relatednodes>
      <mm:nodeinfo type="gui" /><br />
    </mm:relatednodes>
  </mm:relatednodescontainer>
</mm:listnodes>
toc
<mm:relation> (since: MMBase-1.9)
toc
${mm:remove}

Removes an object from a Collection (or if the object is a Collection itself, remove all its elements).

Signature: void remove(java.util.Collection, java.lang.Object)

(since: MMBase-1.8)
example 1
      ${mm:remove(list, case)}
    
toc
<mm:remove> Removes an object from the context. Often it is nicer to use `anonymous' contexts to avoid naming conflicts.
see alsocontext
attributes
  • referid
    The id of the variable to be removed>
  • value (since: MMBase-1.8)
    If you specify this attribute, then the referid must refer to a Collection, and only this value is removed from the collection.
  • from (since: MMBase-1.8)
    Using this, you can also remove variables from session, request, page, application.
example 1
     Set variable `a' to something.
     <mm:import id="a">aaaa</mm:import>
     Set the value of a to another value.
     <mm:remove referid="a" /><mm:import id="a">aaab</mm:import>
    
toc
<mm:removeitem> Remove the current item from the surrounding list. Of course this has only effect when the list is `reused' (with referid). (since: MMBase-1.7)
listreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:selectnode> (since: MMBase-1.9)
toc
<mm:setcontext>

Change the context of a node. This has nothing to do with the `contexts' of the taglib, but with security. With every node a `context' is associated (in fact the `owner' field is currently used for this), by which is is determined who may do what to it.

You'll need this if you are creating an editor and want to add the possibility to change the rights on a node.

attributes
  • name
    In stead of giving the name of the context in the body, you can also indicate it with this parameter.
nodereferrer attributes
toc
<mm:setfield> Changes the field `name' from node `node' (can also be list).
see alsocreatenode
attributes
  • name
    The name of the field to set. If this field is not set this tag will look for a surrounding fieldlist tag to retrieve name and node from.
  • referid (since: MMBase-1.8)
    Refers to other field-tag.
  • valueid (since: MMBase-1.8)
    The body of the tag, or the value represented by this referid is used to fill the field's value.
contextwriter attributes
contextreferrer attributes
fieldreferrer attributes
nodereferrer attributes
example 1
See the example for tag `createnode'.
toc
<mm:setting> (since: MMBase-1.9)
attributes
  • name
  • component
cloudreferrer attributes
writer attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:shrink> Iterates from previous depth to (inclusive) current depth. For each depth it provides (as a writer) what was defined with `onshrink'. (since: MMBase-1.7)
see alsotree related tags | tree | onshrink | grow
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
writer attributes
toc
<mm:size> The size of the current list. It can also act as a `querycontainerreferrer' in which case the query of it is used to perform a database count.
contextwriter attributes
contextreferrer attributes
writer attributes
listreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listnodes type="news">
    <mm:first><mm:size /></mm:first>
</mm:listnodes>
    
example 2
<mm:listnodescontainer type="news">
    number of news items: <mm:size />
    <mm:listnodes >
       ....
    </mm:listnodes>
</mm:listnodescontainer>
    
example 3
<mm:list path="news">
    <mm:first><mm:size /></mm:first>
</mm:list>
    
toc
<mm:sortorder> (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | orderby attribute of list
attributes
  • field
    On which field to sort.
  • direction
    Whether to sort ascending ('UP') or descending ('DOWN'), defaults to UP.
    UP
    DOWN
  • part (since: MMBase-1.8)
    Designates a part of a date field to sort on.
    CENTURY
    YEAR
    MONTH
    QUARTER
    WEEK
    DAY
    DAYOFYEAR
    DAYOFMONTH
    DAYOFWEEK
    HOUR
    MINUTE
    SECOND
  • casesensitive (since: MMBase-1.8)
    Whether to sort case-sensitively or not. This is only relevant for String type fields. On the database level a case insensitive sort will typically result in a sort of the uppercased field (unless e.g. the database sorts case insensitively on default). This defaults to false, because probably you want that.
    true
    false
querycontainerreferrer attributes
containerreferrer attributes
toc
${mm:string}

Evaluates an MMBase LocalizedString object using the current locale.

Signature: org.mmbase.util.LocalizedString string(org.mmbase.util.LocalizedString)

(since: MMBase-1.9)
toc
<mm:stringlist>

A simple list iterating some list, coming from the `context. So the `referid' is required for this list. The original list can for example have been produced by the import tag with vartype="list". Since this tag is a 'Writer' tag, you can inside the list access the current string by an mm:write tag without attributes, or by the reference '$_' (or ${_} in EL).

You can also use `aliaslist' for this (as can be done in MMBase 1.6) but that is a bit silly, if you are not actually listing node aliases.

(since: MMBase-1.7)
see alsovartype attribute of import | aliaslist
attributes
  • referid
    This tag can only reuse Lists, so you have to use this attribute.
  • max
    The maximum number of times to iterate.
  • offset
    How many items must be skipped before iterating
nodereferrer attributes
writer attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:time> The time tag can be used for all kind of manipulations regarding times.
see alsolocale
attributes
  • time
    The time attribute specifies the time to be used, this can be done in multiple ways, in order of preference: 1) If the `inputformat' attribute is used, this is used to parse the content of the `time' attribute, one can define `human readable format' like this. 2) Specify the time in seconds from EPOCH (this is the way how MMBase handles times). 3) By using keywords, such as: yesterday, tomorrow, today, now.
  • inputformat
    The inputformat attribute cat be used to specify how the time attribute should be parsed. The comprehensive syntax for this attribute can be found at http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html . Notice that if times have the following form they will be parsed automatically, and this attribute can be omitted: yyyy/MM/dd hh:mm:ss, yyyy/MM/dd, and hh:mm:ss.
  • offset
    The offset attribute can be used to change the time specified with the time attribute. The offset is expressed in seconds.
  • format

    The format attribute specifies how to display the time. If the format attribute is not used the time will be displayed in seconds from EPOCH. The syntax of the format attribute is identical to the syntax of the inputformat attribute. Instead of using the format attribute you can also use the MMBase formatter taglib.

    Alternatively, you can also symbolically indicate how verbosely the date and or time must be presented. You do this by starting this string with a semicolon (:) followed by one or two constants separated by a dot. The first constant is for the date part, the second for the time part. Both these constants can take the following values `FULL', `LONG', `MEDIUM' and `SHORT'.


    y Only the year part of the specified time
    e Day of the week as in integer (7=Saturday, 1=Sunday). This is not done by SimpleDateFormat, because it doesn't support that (Don't ask me why).
    rfc822 Date and time in the format specified in the RFC822, see http://www.faqs.org/rfcs/rfc822.html , which can be handy when creating f.e. RSS-feeds http://blogs.law.harvard.edu/tech/rss that require this format.
    :FULL.FULL Fully specified date and time formatted according to the present Locale.
    :MEDIUM Mediumly verbosely specified localized date.
    MM/dd/yyyy Gives e.g. 11/20/2003.
  • precision (since: MMBase-1.7)

    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)).

    Since MMBase-1.8.2, if the value of this attribute does not evaluate to one of the known units, it will fall back by prefixing with 'duration +' and then feeding it to the MMBase date parser. The specified time will be divided and multiplied by the thusly specified number of seconds since 1970. Specifying e.g. '3 minute' will effectively allow you to specify a preciesion of 3 minutes like this.


    seconds This is the default. Times are produced to `second' accuracy (the maximum in MMBase).
    minutes
    hours
    days
    weeks
    months
    years
    3 minute
    30 second
  • timezone (since: MMBase-1.7)
    The time-zone for which the time must be shown. Defaults to the server's time-zone.
    CETCentral European Time
    GMTGreenwich Mean Time
writer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
writerreferrer attributes
example 1
      <mm:time format="yyyy/MM/dd" /> generates 2002/04/21
    
more examples
example 1
<font color="red">A few cool datetime results:</font><br />
<mm:import id="langs" vartype="list">es,de,it,nl,zh,ja,ar,el,he,ru</mm:import>
<mm:aliaslist referid="langs">
<mm:locale language="$_"><mm:time time="now" format=":FULL.FULL" /></mm:locale><br />
</mm:aliaslist>
<font color="red">Only a date:</font><br />
<mm:locale language="fr"><mm:time time="now" format=":LONG" /></mm:locale><br />
<font color="red">Only a time:</font><br />
<mm:locale language="nl"><mm:time time="now" format=":.MEDIUM" /></mm:locale><br />
<font color="red">SimpleDateFormat:</font><br />
<mm:locale language="pl">:<mm:time time="now" format="MMMM yyyy" /></mm:locale><br />
example 1
keywords:<br />
<mm:time time="tomorrow" format="yyyy/MM/dd HH:mm:ss" /><br />
<mm:time time="saturday" format=":FULL" /><br />
<mm:time time="july" format=":SHORT" /><br />
human readable time indication: <br />
<mm:time time="2002/05/27" format=":FULL"/><br />
<mm:time time="12:34:10"   format=":.FULL" /><br />
<mm:time time="2002/05/27 12:34:10" format=":FULL.FULL" /><br />
Can also override the parsing format: <br />
<mm:time time="2000-11-01" inputformat="y-M-d" format=":FULL"/>
example 1
This example adds 3 days (259200 seconds) to the given time.<br />
<mm:time time="now" offset="259200" format="EEEE d MMM yy" />
example 1
Display yesterday and save it as a jspvar. When no vartype 
is given, the formatted time is stored as String:<br />
<mm:time time="yesterday" format="EEEE d MMMM" 
         jspvar="yesterday" write="true" ><br />
And tomorrow too.
<mm:time time="tomorrow" format="EEEE d MMMM" jspvar="tomorrow"><br />
Use the jspvars in your page:<br />
I want to see all movies between
<%="" + yesterday%> and <%=tomorrow%>.<br />
</mm:time>
</mm:time>
<p>
</p>
When using vartype='date', the actual 'date' object is passed 
around, and can be reused for date-manipulations.
<mm:time id="nice_time" time="2002/04/05 12:34:56"  
         format=":LONG.LONG"  vartype="date" /><br />
Reusing the taglib variable 'nice_time':
<mm:write referid="nice_time" /><br />
<mm:time referid="nice_time" format=":FULL"  /><br />
<mm:time referid="nice_time" format=":FULL.FULL" 
         precision="hours"  /><br />
<mm:time referid="nice_time" vartype="date" jspvar="date">
  <%= date.getClass().getName() %>
</mm:time>
<hr />
<mm:time id="other_time" time="2002/04/05 12:34:56"  
         format=":LONG"   /><br />
<mm:write referid="other_time" /><br />
<mm:write referid="other_time" jspvar="date2">
  <%= date2.getClass().getName() %>
</mm:write>
toc
<mm:timer>

Debug tag for measuring performance. It measures the duration of its body. Child tags can possibly communicate with this tag to measure themselves which will be logged on `debug' level. Total times per tag type are logged on `service' level at the end of the Timer tag (sorted per unique combinations of id and tag type).

This tag should only be used when tuning your page for speed, and removed when you're finished.

attributes
  • name
    Give a name to the timer to easily find it in the log.
contextreferrer attributes
example 1
    <mm:timer name="listnodes timer">
        <mm:listnodes type="list"> </mm:listnodes>
    </mm:timer>
    Generates in mmlog4j.log:
    19:11:26,530 INFO  - Starting timer listnodes timer
    19:11:26,546 INFO  - Timer listnodes timer totals:
         org.mmbase.bridge.jsp.taglib.debug.TimerTag: 16.0 ms
         org.mmbase.bridge.jsp.taglib.ListNodesTag: 16.0 ms
    
toc
<mm:transaction> The transaction tag creates a transaction. A transaction is a group of actions that should be performed as a whole. If one of the things goes wrong, you can roll them back all.
see alsocommit | cancel
attributes
  • name
    The name of the transaction.
    my_transaction
  • jspvar
    The name of the JSP variable to export.
  • commitonclose
    Whether the transaction must be committed after the body. The default is true.
    true
    false
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
cloudprovider attributes
example 1
<h3>Canceling transaction</h3>
<mm:transaction name="mytrans" commitonclose="false">
  <mm:createnode type="news">
    <mm:setfield name="title">Test node, created in transaction, canceled</mm:setfield>
    <mm:setfield name="subtitle"><mm:write referid="curtime" /></mm:setfield>
  </mm:createnode>
  <mm:cancel />
</mm:transaction>
Transaction was canceled, following should not result anything:
<mm:listnodes id="l" type="news" constraints="subtitle = `$curtime'">
  <mm:field name="gui()" />
</mm:listnodes>
<br />
<h3>Committing transaction</h3>
<mm:transaction name="mytranz" jspvar="trans">
  jspvar of type Transaction:
    <%= trans instanceof org.mmbase.bridge.Transaction %><br />
  <mm:createnode type="news">
    <mm:setfield name="title">Test node, created in transaction, commited</mm:setfield>
    <mm:setfield name="subtitle"><mm:write referid="curtime" /></mm:setfield>
  </mm:createnode>
</mm:transaction>
transaction was commited, following should result anything:
<mm:listnodes id="node" type="news" constraints="subtitle = `$curtime'" max="1">
  <mm:field name="html(subtitle)">
    <mm:compare referid2="curtime">
        YES (created node was <mm:field id="nodenumber" name="number" />)
        <mm:write referid="nodenumber" session="testnodenumber" />
        <mm:write referid="node" session="testnode" />
    </mm:compare>
  </mm:field>
   <mm:field name="html(title)" />
</mm:listnodes>
<br />
<h3>Creating relation in transaction</h3>
<mm:transaction name="mytranc">
  <mm:node id="node1" number="$nodenumber" />
  <mm:createnode id="node2" type="news">
     <mm:setfield name="title">
        Test node2 with relation, created in transaction
     </mm:setfield>
     <mm:setfield name="subtitle"><mm:write referid="curtime" /></mm:setfield>
  </mm:createnode>
  <mm:createrelation source="node1" destination="node2" role="related" />
</mm:transaction>
    
toc
<mm:tree>

The Tree Tag makes it possible to show a piece of the MMBase cloud generically. This tag never works alone. Firstly, it will try to find a surrounding `treecontainer' tag, which defines the `starting query' and other the properties of this tree. If there is no surrounding tree-container tag, then it can also use one of the other node list containers (relatednodescontainer and listnodescontainer) to define the `starting' query. If also that does not succeed then it will start looking for any surrounding node-provider (such as relatednodes, listnodes and node) and will use the provided node as a base for the starting query of the tree.

If you want to define the surrounding node-provider with a container, then you can use the 'node' attribute to enforce it to use the node-provider and not it's container.

(since: MMBase-1.7)
see alsotree related tags | treecontainer | relatednodescontainer | listnodescontainer | nodeprovider
attributes
  • type
    The tree will grow with path-elements of this type.
    see: type attribute of relatednodes
  • role
    The path-elements will be connected by relations with this role.
    see: role attribute of relatednodes
  • searchdir
    This is the directions in which the relations must be followed (destination or source).
    see: searchdir attribute of relatednodes
  • maxdepth
    To avoid coming into an infinite loop (which is possible because mmbase data is not actually structured as a tree, but as a `network' of nodes), there should always be a `maximal' depth to which relations are followed. This defaults to 5.
    see: orderby attribute of treecontainer
  • orderby (since: MMBase-1.7.1)
    It is possible to order the elements of a level of a tree by using the `orderby' field. If you wish to order using the fieldvalue of the relation from one level to another, prefix the field with the builder name or role(for example: "categories.title" or "posrel.pos"). You can order by more fields, by comma-separating their names.
    see: orderby attribute of list
  • directions (since: MMBase-1.7.1)
    Sort orders for the `orderby' arguments (comma separated `up' and `down'). This list may be shorter than the list of `orderby'. Missing directions are defaulted to the last specified one.
    see: directions attribute of list
  • max (since: MMBase-1.8.1)
    see: max attribute of list
  • varStatus (since: MMBase-1.8.6)
    see: varStatus attribute of listprovider
  • varBranchStatus (since: MMBase-1.8.6)
    This provides information about the current looping status of the current branch. If e.g. you want to know if the current node is the last of the 'branch', then you could use 'varBranchStatus="branch"'> ... ${branch.last}.
    see: varStatus attribute of listprovider
querycontainerreferrer attributes
containerreferrer attributes
nodeprovider attributes
listprovider attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
toc
<mm:treecontainer>

The treecontainer tag is a the `container' tag for the tree-tag. It searches on the same way as the tree tag itself for a `starting query', the only difference being that it will not itself look for a surrounding tree-container (so, it will look parent node-list-containers and if unsuccessfully for a parent node-providers).

Just as for example in the relatednodescontainer the attributes define how the `starting' query must be extended. The essential difference for `trees' though, is that it will happen recursively. So the surrounding querycontainerreferrer tags like `mm:constraint' will work only on a kind of `template' query, and will then be applied repeatedly.

The use of treecontainer, tree and its subtags can perhaps most easily be explained by an example, which can be find on the page about tree related tags.

(since: MMBase-1.7.1)
see alsotree related tags | querycontainerreferrer
attributes
querycontainerreferrer attributes
containerreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
nodereferrer attributes
toc
${mm:treefile}

Simple version of the 'treefile' tag, which can be used more concisely directly in a href attribute or so.

Signature: java.lang.String treefile(java.lang.String, javax.servlet.jsp.PageContext, java.lang.Object)

(since: MMBase-1.8.4)
see alsotreefile | treelink
toc
<mm:treefile> This tag does the same as TreeIncludeTag, but instead of including the page that was found, it returns the URL for that page.
see alsoparam | url | treeinclude | leafinclude
attributes
  • objectlist
    The list of objects
  • notfound (since: MMBase-1.8)
    Specify the behaviour when the file cannot be found. Default is 'exception', but you can change this to silently fail if the file does not exist.
    skipDo not generate any error if the file cannot be found
    exceptionRaise an exception if the file cannot be found
    logLog a message if the file cannot be found
    messageWrite message if the file cannot be found
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
See the example for tag `leafinclude'.
toc
<mm:treehaspage>

Checks for the availability of a certain JSP on this server, using tree-like functionality

(since: MMBase-1.8.6)
see alsotreeinclude
attributes
  • page
  • objectlist
condition attributes
toc
<mm:treeinclude>

This tag is an implementation of the `TREEPART' scan command. There are two parameters: `objectlist' and `page'. The objectlist is a `,' separated list of objects, the `page' is the page to be included. (inherited from the extended `URL' tag)

This tag is similar in behavior as the `include' tag, but it will try several different paths to find a `best matching' file to include. An example:

objectlist="1,2,3,4", page="doh.jsp" The treeinclude tag will first try to include `/1/2/3/4/doh.jsp', if that file is not available, it will try `/1/2/3/doh.jsp', etc. etc. Besides the directory `/1/2/3/4', all directories starting with the object number will match. This means that the following paths will all work with the given parameters:

  • /1blaat/2random/3tekst/4kiekeboe/doh.jsp
  • /1/2/3/4ditiseentest/doh.jsp
  • /1/2/3/4alfabeta/doh.jsp
In case there are multiple paths that match for a given level (compare the last two entries of the list above), the one that comes alphabetically first will be chosen. This behavior is specified in the `getSmartPath()' method in MMObjectBuilder.

The naming schema mentioned above (number postfixed with a random string) can be overridden by a builder. For instance, if object with number 1 is actually a `portal' object, and the `portal' builder defines the `getSmartPath' method, the following files (in order of importance, as soon as one of the files exists this one will be taken) will be included:

  • /myportal/2random/3tekst/4kiekeboe/doh.jsp
  • /myportal/2/3/4ditiseentest/doh.jsp
  • /myportal/2/3/4alfabeta/doh.jsp

see alsoinclude | treefile | leafinclude | param | url
attributes
  • objectlist
    The list of objects
attributes
writer attributes
example 1
See the example for tag `leafinclude'.
toc
${mm:treelink}

Simple version of the 'treefile' tag, which can be used more concisely directly in a href attribute or so. It uses the ThreadLocal pageContext.

Signature: java.lang.String treelink(java.lang.String, java.lang.Object)

(since: MMBase-1.8.5)
see alsotreefile
toc
<mm:typeconstraint> Pinpoints one of the elements to a certain type, which can be useful in some cases. (since: MMBase-1.8)
see alsolistnodescontainer | listcontainer
attributes
  • element

    see: listcontainer | listnodescontainer
  • name
    A list of nodemanager names.
  • descendants
    Whether nodes of descendant types of the given node-managers must be included too. Defaults to true.
  • inverse
    Inverses the constraint. So adds a NOT.
querycontainerreferrer attributes
containerreferrer attributes
example 1
<mm:listnodescontainer type="object">
  <mm:typeconstraint name="images,attachments"/>
  <mm:listnodes>
    <mm:function name="gui" />
  </mm:listnodes>
</mm:listnodescontainer>
toc
<mm:unrelatednodes> The same as `listnodes' only the results of a `relatednodes' (without attributes) are subtracted. (since: MMBase-1.7)
see alsolistnodes | relatednodes
attributes
attributes
cloudreferrer attributes
nodeprovider attributes
listprovider attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
querycontainerreferrer attributes
containerreferrer attributes
toc
${mm:url}

Simple version of the 'url' tag, which can be used more concisely directly in a href attribute or so.

Signature: java.lang.String url(java.lang.String, javax.servlet.jsp.PageContext)

(since: MMBase-1.8.2)
see alsourl | link | link
example 1
      <link media="screen" type="text/css" href="${mm:url('/css/general.css', pageContext)}" rel="stylesheet" />
    
toc
<mm:url>

Returns an URL with parameters from the context. Parameters can be specified in three ways:

  • Simply write it in the `page' attribute (with ? and &amp; (or simply & if you don't produce XHTML), you can use the $-notation to refer to context variable values.
  • Use the `referids' attribute to specify a list of context variables to add to the URL. The disadvantage is that you can't use another name for the parameter then the name of the variable.
  • Use `mm:param' sub-tags.

This tag also takes care of the `application' context if you start the page attribute with `/'. This makes your applications better portable.

It also does an URLEncode, which can be necessary if the browsers does not support cookies and your page needs the session.

You don't need it for URLs outside your application server application. It is very advisable to use it otherwise.

By use of the servlet context init parameter mmbase.taglib.url.makerelative (value `true'), you can change the behaviour of all url-tags, to make them generate url's relative to the current page.

see alsoparam | image | link | url
attributes
  • referids

    Specify which parameters. A comma separated list of context variable id's.

    Since MMBase-1.7 you can also rename the variable on the fly. Putting a variable `a' as `b' in the url can be done with `a@b' (generating b=<value of a> in stead of a=<value of a>)

    If a context variable does not exist, it is ignored if you postfix it with `?'. This makes it possible to make more general includes, while maintaining syntax checking as much as possible.


  • page
    The url to refer to. If not specified, then it becomes the result of getRequestURI.
  • block
    The block to create an URL to. This can only be used from within MMBase components, where the current component block needs to generate a link to another block of the same component.
  • referid (since: MMBase-1.7)
    Reuses another mm:url (via its id). You can add extra parameters then, or simply make another link (this last thing could also be done with mm:write). This attribute cannot be used together with the `page' attribute.
  • escapeamps
    Whether or not to escape &'s in the query string. According to XHTML is must. But perhaps you don't want XHTML but something else. Default it is true.
  • encode (since: MMBase-1.8)
    Whether or not to encode the url. According to the servlet specification all urls should be encoded, but this also adds a session id to the url when cookies are not supported. Many web servers can not handle them and prevent caching of static resources. Default it is true.
  • absolute (since: MMBase-1.8)
    Whether or not to produce fully qualified absolute URLs. (http://myhost.nl/context/..). Defaults to false.
    falseDoes nothing special to the url. If 'page' starts with '/' the context is prefixed.
    trueMakes the URL absolute, so it starts with something like http:
    serverMakes the URL absolute on the server, so it starts with /.
    contextMakes the URL absolute on the current servlet context, so it starts with /, but it is not prefixed by the context. The result could e.g. be used as an argument for another url-tag.
  • internal (since: MMBase-1.9)

  • process (since: MMBase-1.9.1)

writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
<mm:url referids="a?,name@b,c" page="codesamples/index.jsp">
 <mm:param name="page" value="home" />
</mm:url>
    generates e.g. : codesamples/index.jsp?page=home&b=jan&c=5
    
toc
<mm:valid> The body evaluates if the current validation status of a surround form tag is valid. (since: MMBase-1.8)
see alsofieldinfo | form
attributes
  • form
    If another form that the first form parent must be used, this attribute can be used.
contextreferrer attributes
condition attributes
toc
<mm:voidfunction> If you want to use a function with `void' result (or want to ignore the result), then you can use this tag for the function. (since: MMBase-1.7)
see alsofunctioncontainer | function | booleanfunction | listfunction
functiontag attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
containerreferrer attributes
more examples
example 1
<mm:listnodes type="object" max="5" orderby="number" directions="down">
  <p>
    Node #<mm:field name="number" />: [<mm:voidfunction name="gui" />]
  </p>
</mm:listnodes>
toc
<mm:write>

The write tag can be used to `export' context variables to something else. When you only specify what variable (with the `referid' or `value' attribute), then this tag writes to the page (therefore it is named `write'), unless it has a body, in which case the information is simply available to other tags in the body (like another write tag without attributes).

This is the behavior of `writer' tags, and this tag is the most basic version of that. Being a `writer' tag it also supports the `jspvar' attribute with which you can make a JSP variable available in the body.

In addition to this basic `writer' functionality, the `write' tag itself can also write context variables to other storage locations, like the session and in cookies.

see alsoimport
attributes
  • referid
    The key of the variable to get. If it is missing (and value is missing), then the parent Writer tag is written (if it exist).
  • value
    The value to write. In this you can use context variables with "$", the advantage of this attribute above the referid attribute is that you can combine variables and add some text of your own. The disadvantages relate to complexity and efficiency.
  • session

    You can also put things into the session with this. The value of this attribute becomes the key of the session variable.

    At some other point you can pick up the variable again with the import tag (so then the `externid' attribute of import corresponds to the `session' attribute of write).


    see: from attribute of import
  • cookie
    Writing things to cookie is also possible. Analogous to writing to the session.
  • request (since: MMBase-1.7.4)
    With this you can set an attribute on the current request. Analogous to writing to the session.
  • application (since: MMBase-1.7.4)
    With this you can set an attribute on the current `application'. Analogous to writing to the session.
writer attributes
writerreferrer attributes
contextwriter attributes
contextreferrer attributes
example 1
<!-- write the variable `hoi' to the page -->
<mm:write referid="hoi" />
example 2
<!-- Create a JSP-variable `greet' from context variable `hoi', write
     `greet' uppercased to the page -->
<mm:write referid="hoi" jspvar="greet"><%= greet.toUpperCase() %></mm:write>
example 3
<mm:write referid="a" session="abc" />
<mm:import id="b" externid="abc" from="session" />

<!-- would copy the value of `a' to `b'. -->
toc
<mm:xslt>

This tag must live as a sub-tag of Formatter. You can add `in line' XSL with this. If the surrounding <xsl:stylesheet tag is missing, something like the following one is automatically added (actually it is a bit more complex)


   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:mm="org.mmbase.bridge.jsp.taglib.functions.Functions"
                   xmlns:taglib="org.mmbase.bridge.jsp.taglib.functions.Functions"
                   xmlns:node="org.mmbase.bridge.util.xml.NodeFunction"
                   xmlns:o="http://www.mmbase.org/xmlns/objects"
                   xmlns:mmxf="http://www.mmbase.org/xmlns/mmxf"
                   extension-element-prefixes="mm taglib node"
                   exclude-result-prefixes="node mmxf o mm taglib node"
                   version="1.0">

   ...
   </xsl:stylesheet>

      

Which means that you have access to some functions (see Javadoc of 'Functions'too, which main goal is to provide the `escape' method:


   <xsl:value-of select="mm:escape('p', mytag)"
                         disable-output-escaping="yes" />

      

Which provides the same functionality as the `escape' attribute of writes inside XSLT.

see alsoformatter | escape attribute of writer | formatter | escape attribute of writer
attributes
  • version (since: MMBase-1.8.5)
    If <xsl:stylesheet> is produced, the value of the 'version' attribute. Defaults to "1.0".
contextreader attributes
contextwriter attributes
contextreferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
more examples
example 1
<mm:formatter escape="none">
  <mm:node />
  <mm:xslt>
    <xsl:import href="xslt/2xhtml.xslt" />
    <xsl:template match="o:field[@name='title']" >
      <h1><font color="blue">
        <xsl:value-of select="." />
      </font></h1>
    </xsl:template>
  </mm:xslt>
</mm:formatter>
example 1
<mm:formatter escape="none">
  <mm:node />
  <mm:xslt>
    <xsl:import href="xslt/2xhtml.xslt" />
    <xsl:template match="o:field[@name='title']" >
      <h1><font color="blue">
        <xsl:value-of select="." />
      </font></h1>
    </xsl:template>
  </mm:xslt>
</mm:formatter>
 

This document lists the current tags implemented for MMBase (version )

Attributes in red are required.

blue entries are no tags, but describe a group of tags. Tags can belong to several groups.

If a tag definition contains a body section this means that the tag might do something with the content of the body.