MMBase taglib 1.1.0 documentation

 

This is the MMBase taglib reference documention. 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. al '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 (new!) | containerreferrer (new!) | contextreader | contextreferrer | contextwriter | fieldprovider | fieldreferrer | functiontag (new!) | listprovider | listreferrer | nodeprovider | nodereferrer | querycontainer (new!) | querycontainerreferrer (new!) | writer | writerreferrer
ageconstraint (new!) | aliasconstraint (new!) | aliaslist | attachment | booleanfunction (new!) | cancel | changed | cloud | commit | compare | composite (new!) | constraint (new!) | content (new!) | context | countrelations | createalias | createnode | createrelation | deletealias | deletenode | depth (new!) | distinct (new!) | even | field | fieldinfo | fieldlist | first | formatter | function (new!) | functioncontainer (new!) | grow (new!) | hasrelations | image | import | include | index | info | isempty | isgreaterthan | islessthan | isnotempty | last | leaffile | leafinclude | list | listcondition | listcontainer (new!) | listfunction (new!) | listnodes | listnodescontainer (new!) | listrelations | listrelationscontainer (new!) | locale | log | maxnumber (new!) | maychangecontext | maycreate | maycreaterelation | maydelete | maywrite | nextbatches (new!) | node | nodefunction (new!) | nodeinfo | nodelistfunction (new!) | notpresent | odd | offset (new!) | onshrink (new!) | param | present | previousbatches (new!) | redirect (new!) | related | relatedcontainer (new!) | relatednode | relatednodes | relatednodescontainer (new!) | remove | removeitem (new!) | setcontext | setfield | shrink (new!) | size | sortorder (new!) | stringlist (new!) | time | timer | transaction | tree (new!) | treecontainer | treefile | treeinclude | unrelatednodes (new!) | url | voidfunction (new!) | write | xslt
info about the syntax of this document
toc
`cloudprovider' tags Cloudprovider tags provide a cloud to their body. Also a `transaction' is a kind of cloud.
see alsocloudreferrer
tags of this typecloud | transaction
toc
`cloudreferrer' tags A cloud referrer tag is a tag that needs to live in the body of a cloud tag. This means that it can use MMBase data.
see alsocloud | cloudprovider
attributes
  • cloud
    Which cloud to use. If the tag is living in more than one cloud tag, and you want to refer to another then the direct parent.
tags of this typecreatenode | createrelation | list | unrelatednodes | listnodes | maycreate | maycreaterelation | deletenode | node | transaction | treeinclude | leafinclude | include | treefile | leaffile | url
toc
`clusternodeprovider' tags A clusternode provider makes an MMBase Cluster Node available to its body. A cluster nodes 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 have a body which is evaluated or not depending on certain attributes or on the surrounding tags.
attributes
  • inverse
    Turns the condition around, such that precisely the inverse will happen. This attribute is of course false on default. You can set it to true.
    true
    false
tags of this typebooleanfunction | changed | isgreaterthan | islessthan | compare | even | first | hasrelations | isempty | isnotempty | last | listcondition | maychangecontext | maycreate | maycreaterelation | maydelete | maywrite | odd | notpresent | present
toc
`container' tags Container tags can be referrenced by container-refferers. (since: MMBase-1.7)
tags of this typefunctioncontainer | listrelationscontainer | listnodescontainer | relatednodescontainer | listcontainer | relatedcontainer |
toc
`containerreferrer' tags A containerreferrer is a tag that can use information provided by some container tag. (since: MMBase-1.7)
attributes
  • container
    Refer to the container with this id. If you want to explicitily not refer to any container (e.g. function-tags on node), then you can specify an non-existing id.
tags of this typebooleanfunction | function | listfunction | nodefunction | nodelistfunction | list | unrelatednodes | listnodes | relatednodes | size | constraint | composite | ageconstraint | aliasconstraint | maxnumber | offset | distinct | sortorder | nextbatches | previousbatches | related | voidfunction
toc
`contextreader' tags A contextreader is a contextwriter, but besides writing itself to the context, it can also read itself back from the context.
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 | hasrelations | list | listfunction | unrelatednodes | listnodes | listrelations | nextbatches | deletenode | node | nodefunction | nodelistfunction | onshrink | previousbatches | related | relatednodes | removeitem | shrink | stringlist | time | tree | treecontainer | voidfunction | xslt
toc
`contextreferrer' tags Contextreferrer tags refer to the context. This means that (most of) their attributes can contain `context' variables (referred to by '$'). All tags are contextreferrers or specializations of it.
see alsocontext
attributes
  • context
    If you want to get it from another context than the direct parent.
tags of this typelist | related | unrelatednodes | listnodes | relatednodes | cloud | deletenode | node | field | function | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | fieldlist | aliaslist | countrelations | hasrelations | listrelations | xslt | time | stringlist | nextbatches | previousbatches | removeitem | tree | treecontainer | grow | onshrink | shrink | depth | info | context | createrelation | createnode | setfield | transaction | fieldinfo | nodeinfo | write | treeinclude | leafinclude | include | treefile | leaffile | url | redirect | image | attachment | relatednode | size | index | formatter | import | notpresent | present | redirect | timer
toc
`contextwriter' tags A contextwriter is a contextreferrer, but it can also write itself to the context (using the id 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 | context | list | related | unrelatednodes | listnodes | relatednodes | cloud | deletenode | node | field | function | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | fieldlist | aliaslist | countrelations | hasrelations | listrelations | xslt | time | stringlist | nextbatches | previousbatches | removeitem | tree | treecontainer | grow | onshrink | shrink | depth | createnode | createrelation | fieldinfo | image | index | info | nodeinfo | redirect | relatednode | setfield | size | transaction | treeinclude | leafinclude | include | treefile | leaffile | url | write
toc
`fieldprovider' tags Fieldprovider tags provide a field to their body. The 'value' of the field is not necessary filled, but a fieldprovider still has some use then, e.g. to get the 'guiname' of a field (which considers language).
see alsofieldreferrer
tags of this typefield | fieldlist
toc
`fieldreferrer' tags A tag that can live in the body of a fieldprovider tag.
see alsofieldprovider
attributes
  • field
    If the tag is living in more than one fieldprovider, and you don't need the direct parent.
tags of this typefield | fieldinfo | fieldlist | setfield
toc
`functiontag' tags

Evaluates 'function' on e.g. a node or something else. It is determined from which the function must be taken by the 'nodemanager', 'set' and 'module' attributes, of which precisely one or none must be present. If none of those is present, the function is supposed to be a 'node' function and the tag works as a 'node referrer'. Otherwise it works as a function from a 'nodemanager' 'set' or 'module' respectively.

Parameters of the function are supplied with the 'referids' attribute, or by a surrounding 'functioncontainer' tag with param sub-tags.

The several tags of these type differ only in the way they deal with the function value. E.g. a 'boolean' function works as a 'condition' tag (evaluating the body if the function value is 'true' and not evaluating the body if it is false).

(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 'set' from which the function must be taken. These are a kind of static functions (no object is associated with them). These 'sets' of functions are a bit like namespaces.
  • module
    The name of the module on which the function must be evaluated.
  • referids
    Similar to 'referids' attribute of mm:url, a simply way to provide (named) arguments to the function.
    see: referids attribute of url
nodereferrer attributes
tags of this typebooleanfunction | function | listfunction | nodefunction | nodelistfunction | voidfunction
toc
`listprovider' tags A list provider has a body which is evaluated repeatedly. If a list is a contextwriter, then in the body of the list a list item is in the context, and afterwards a 'List', which can normally be reused with the 'referid' of some list.
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)


    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).
    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.
tags of this typealiaslist | fieldlist | list | listfunction | unrelatednodes | listnodes | nextbatches | nodelistfunction | previousbatches | related | relatednodes | stringlist
toc
`listreferrer' tags A listreferrer tag has to live in the body of list tags.
attributes
  • list
    Which list to use, if the tag is in the body of more than one list, and you don't need 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.
tags of this typelist | related | createnode | createrelation | unrelatednodes | listnodes | listrelations | deletenode | node | nodefunction | nodelistfunction | relatednode | relatednodes | tree
toc
`nodereferrer' tags A nodereferrer tag is a tag that can (needs to) live in the body of a node provider, and uses the node provided by the node provider tag.
attributes
  • node
    Which node to use. You can use this attribute if your Nodereferrer is living in more than one nodeprovider, and you don't need the direct parent.
tags of this typealiaslist | attachment | countrelations | createalias | deletealias | field | fieldlist | function | voidfunction | booleanfunction | listfunction | nodelistfunction | nodefunction | hasrelations | image | listrelations | listrelationscontainer | maychangecontext | maydelete | maywrite | nextbatches | deletenode | node | nodeinfo | previousbatches | related | relatedcontainer | relatednodes | setcontext | setfield | stringlist | tree
toc
`querycontainer' tags A 'Query' container is a container for one of the 'node list' tags (listproviders that are nodeprovider too). A query container is actually a wrapper for a 'Query' on the database. If a 'node list tag' (a tag that is both listprovider as nodeprovider) is inside a corresponding 'nodelist container', it will use the query. (since: MMBase-1.7)
see alsolistprovider | nodeprovider | list | listnodes | querycontainerreferrer
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 typeageconstraint | aliasconstraint | composite | constraint | distinct | list | unrelatednodes | listnodes | maxnumber | nextbatches | offset | previousbatches | relatednodes | size | sortorder
toc
`writer' tags A writer is a tag that can produce output. Normally the default will be to write to the page, unless the tag has a body. All tag which produce output themselves are 'writers'.
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
  • write
    Whether to write to the page or not. Normally the default value will suffice.
    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.
    ppAs 'p', but no br-tags are produces
    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
    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 \").
    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.
    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)
    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: content
tags of this typealiaslist | attachment | countrelations | depth | field | fieldinfo | formatter | function | image | index | info | listfunction | nextbatches | nodeinfo | previousbatches | shrink | size | stringlist | time | treeinclude | leafinclude | include | treefile | leaffile | url | write
toc
`writerreferrer' tags A writerreferrer 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:ageconstraint> In MMBase object 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 tags give easy access to this functionality. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer
attributes
  • 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 wich. This is not needed for listnodes and relatednodes containers (and probably would be a 'number' field otherwise).
    see: 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
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
toc
<mm:aliaslist> This is a list which can only live under a NodeProvider. In the body you can use the `writer' functionality to actually write out the 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: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
toc
<mm:booleanfunction> Gets the function value of function `name' from surrounding nodeprovider. The function value is supposed to be Boolean, and this tags acts as a 'condition' tag. (since: MMBase-1.7)
see alsonode | function | listfunction
condition attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
functiontag attributes
nodereferrer attributes
containerreferrer attributes
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'.
    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 usernames here (comma separated)

    It can also be used in combination with the 'password' attribute, in which case authentication will happen by that.


  • 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 login 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 usefull 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 apge' 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 itselve 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 attibute 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 wil 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" whey 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.
  • 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 explicitely, because it is good that you are aware of the consequences.

    A page using a non-anymous 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 implemenation 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.
  • authenticate
    The authentication module which must be used by the security system. The default is "name/password", which will do in most cases.
    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.
    local Get a local cloud
    rmi://... RMMCI cloud.
    rmi://www.mmbase.org/remotecontext
  • jspvar
    The name of the JSP variable to export by 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 There are more examples, but not in this document.
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' or `referid2' must be present.)
    The value to which you want to compare, this is always a String.
  • valueset (Either `value', 'valueset' or `referid2' 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' or `referid2' 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
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>
    
toc
<mm:composite> Combines constraints with a conditional operator. (since: MMBase-1.7)
see alsoconstraint | listnodescontainer | listcontainer | querycontainer | ageconstraint
attributes
  • operator
    The operator to be used in the comparison. Defaults to 'AND'
    OR
    AND
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:constraint> Applies a constraint to the query of the surrounding nodelist container. (since: MMBase-1.7)
see alsolistnodescontainer | listcontainer | querycontainer | ageconstraint
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.
  • 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 seperated String of values. You can also refer to some list with 'referid' (e.g. to a nodelist tag)
    NULLTests wether the value of the field is NULL (or NOT NULL if inverse="true"). The 'value' attributes are ignored.
querycontainerreferrer attributes
containerreferrer attributes
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.

(since: MMBase-1.7)
see alsocloud | time | locale
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
  • jspvar
  • type

    The Content-Type of this page.

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

    Content-TypeDefault escaperDefault postprocessorDefault encoding
    text/htmltext/htmlreducespaceNOTSPECIFIED
    text/xmltext/xmlreducespaceNOTSPECIFIED
    audio/x-pn-realaudiononereducespace
    application/smiltext/xmlreducespace
    text/vnd.rn-realtexttext/xmlreducespace
    video/x-ms-wmptext/xmlreducespace
    text/javascriptnonereducespace
    text/cssnonereducespace

  • encoding
    The output text encoding.
    UTF-8
  • expires

    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.


    UTF-8
  • 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.

    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, - . _".

  • 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 explicitely speficy 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:

    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.
    ppAs 'p', but no br-tags are produces
    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
    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 \").
    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.
    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)
    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
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.
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 There are more examples, but not in this document.
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 bodycontent 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:deletealias>

Lives in a NodeProvider. Deletes the bodycontent 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: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
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:field> Gets the field `name' from node `node' (can also be list).
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.

    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.
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)
    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.
    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).
  • options
    Specify additional parameters for the presentation/manipulation of the field.
    datetimeIf the value is a date-time, treat it as a date time combination
    timeIf the value is a date-time, treat it as time only
    dateIf the value is a date-time, treat it as date only
    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)
fieldreferrer 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 stand alone, then you have to supply the type of the node (the name of the `node manager').
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 genetric 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 logicly 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
example 1
See the example for tag 'nodeinfo'.
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:formatter> This tag performs XSL and other transformations.
see alsoxslt
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 basicly, 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.


    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.
    escapexmlEscapes characters which make something XML. This way you can easily present XML in XHTML pages
    escapexmlprettySimilar 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.
  • 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.

contextreferrer attributes
writer attributes
toc
<mm:function> Gets the function value of function `name' from surrounding nodeprovider. The function value is available as a writer. (since: MMBase-1.7)
see alsonode | booleanfunction | listfunction | voidfunction
writer attributes
functiontag attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
containerreferrer attributes
example 1
<mm:function name="gui" escape="none" />
    
toc
<mm:functioncontainer> Surrounds a function tag, provides a container for parameters and function results. (since: MMBase-1.7)
see alsofunction | functiontag | param
attributes
container 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:hasrelations> Whether this nodes has relations. It also returns true if there are relations which you may not see. (in contradiction to 'countrelations')
see alsosize | countrelations |
condition attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
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)
  • 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
  • element
    see: element attribute of node
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
    If this object is required to be present. If it has to be present, then the present tag will always evaluate. If nothing can be found by externid and a default value in the body is missing too, then an exception will follow if required is true.
  • reset

    On default, this tag will throw an exception if the id to be registered is registered already. This will protect you against accidentely 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 includes and list bodies).


    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.
    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 usefull. 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 usefull. 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
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' URL's, 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' URL's, 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. If this will do the trick for you then it is perhaps best to use this rather then the mm:include tag.

See JSP Syntax Reference

see alsoparam | url
attributes
  • debug
    For debugging you can print the used URL in the page as comments..
    noneNo debugging on the page (default)
    htmlUse html 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 documenation 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 explicitely 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 | attribute attribute of write
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
<mm:include page="codesamples/index.jsp.1" />
    
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:previousbatched.
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'.
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.

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: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 There are more examples, but not in this document.
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 contextvar, 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: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: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
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
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer 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: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 automaticly).
    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
more examples There are more examples, but not in this document.
toc
<mm:listfunction> Gets the function value from surrounding functionprovider. The function value is supposed to be Collection, and this tags acts as a 'listprovider' and 'writer' tag. (since: MMBase-1.7)
see alsonode | booleanfunction | function | functioncontainer | nodelistfunction
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> 
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 sortorderds 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
querycontainer attributes
container attributes
more examples There are more examples, but not in this document.
toc
<mm:listrelations> List the relations belonging to this nodes. Relations are nodes too.
see alsorelatednode
attributes
  • type
    Only list the relations where the other node is of this type.
  • role
    Only list the relations which are of this role.
  • searchdir (since: MMBase-1.7)
    Only list the relations in this direction.
  • max (since: MMBase-1.7)
    see: max attribute of list
  • offset (since: MMBase-1.7)
    see: offset attribute of list
nodeprovider attributes
nodereferrer attributes
contextreader attributes
contextwriter attributes
contextreferrer 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
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).

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.

see alsocloud | time | content
attributes
  • language
    A two letter language code according to ISO 639.
    nl
    en
  • country
    A two letter country code according to ISO 3166.
    BE
    GB
  • jspvar
    A jspvar of type Locale can be created.
more examples There are more examples, but not in this document.
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.
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: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: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:maywrite> Check if node may be changed.
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: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
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' must be supplied. If none of them, then the node refers to a parent NodeProvider. )
    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
    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!
  • 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 code 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
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
  • 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.
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' from surrounding nodeprovider. The function value is supposed to be NodeList, and this tags acts as a 'listprovider' tag and 'nodeprovider'. (since: MMBase-1.7)
see alsonode | booleanfunction | function | functioncontainer | listfunction
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:param> Adds a parameter to the parent parameterprovider Tag.
see alsourl | include | functioncontainer | referids attribute of url | referids attribute of functioncontainer
attributes
  • name
    The name of the parameter.
  • value
    The value of the parameter. Is this attribute is missing, then the body of the param tag is used.
  • 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 casted 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
toc
<mm:redirect>

As mm:url but redirects to the generated URL.

(since: MMBase-1.7)
attributes
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
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. (since: MMBase-1.7)
see alsolistnodes | querycontainerreferrer
attributes
querycontainer attributes
container attributes
more examples There are more examples, but not in this document.
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>
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: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.
contextwriter attributes
contextreferrer attributes
fieldreferrer attributes
nodereferrer attributes
example 1
See the example for tag 'createnode'.
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

    UP
    DOWN
querycontainerreferrer attributes
containerreferrer attributes
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"

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.
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 EPOC (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 EPOC. 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 symbolicly 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 speficied 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).
    :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)).
    seconds This is the default. Times are produced to 'second' accuracy (the maximum in MMBase).
    minutes
    hours
    days
    weeks
    months
    years
  • 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 There are more examples, but not in this document.
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
    If 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 genericly. 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.

(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
attributes
nodeprovider 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 unsuccesfull 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 queryreferrer 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 | queryreferrer
attributes
attributes
contextreader attributes
contextwriter attributes
contextreferrer attributes
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
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
See the example for tag 'leafinclude'.
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
attributes
writer attributes
contextwriter attributes
contextreferrer attributes
cloudreferrer attributes
example 1
See the example for tag 'leafinclude'.
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>

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
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.
  • 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.
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: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
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 'inline' XSL with this. (EXPERIMENTAL)
see alsoformatter
contextreader attributes
contextwriter attributes
contextreferrer attributes
more examples There are more examples, but not in this document.
 

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

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.