|
| toc |
| `cloudprovider' tags
Cloud provider tags provide a cloud to their body. Also a
`transaction' is a kind of cloud.
|
| see also | cloudreferrer |
| tags of this type | cloud | form | transaction |
| toc |
| `clusternodeprovider' tags
A clusternode provider makes an MMBase Cluster Node available to its
body. A cluster node is in fact a combination of nodes. You can
get a real node with a sub node tag with the `element'
attribute.
|
| see also | element attribute of node |
| nodeprovider attributes |
|
| tags of this type | list | related |
| toc |
| `fieldprovider' tags
Field provider tags provide a field to their body. The `value' of
the field is not necessary filled, but a field provider can for example
be used to get the `guiname' of a field (based on the current locale).
The locale for which the gui information is shown, can be set using the 'locale' tag, or
it can be set on the 'content' tag.
|
| see also | fieldreferrer | locale | content |
| tags of this type | field | fieldlist |
| toc |
| `fieldreferrer' tags
A tag that can live in the body of a field provider tag, it refers to the parent fieldprovider.
|
| see also | fieldprovider |
| attributes |
-
field
If the tag is living in more than one field provider, and you don't want the direct parent,
then you use this attribute to refer to it.
|
| tags of this type | field | fieldinfo | fieldlist | setfield |
| toc |
| `nodeprovider' tags
A node provider makes an MMBase Node available to its body.
|
| attributes |
-
jspvar
A jspvar of type Node can be created.
-
commitonclose
(since: MMBase-1.8)
Whether the node must be committed after evaluation of the body. The
default is true.
| true |
If 'commit on close' is true for a NodeProvider, and the current tag (perhaps using
'referid') made changes to it, then on the close of the tag, the 'commit' method of the
Node is called. That means that if there are invalid values, an exception may occur.
|
| false |
If 'commit on close' is false for a NodeProvider, and the current tag (perhaps using
'referid') made changes to it, then on the close of the tag, the 'commit' method of the
Node is called. That means that if there are invalid values, an exception may occur.
|
|
| tags of this type | list | related | createnode | createrelation | unrelatednodes | listnodes | listrelations | deletenode | node | nodefunction | nodelistfunction | relatednode | relatednodes | tree |
| toc |
| <mm:ageconstraint>
In MMBase, objects on default do not have a `creation time' field. But the `number' field can
be used to estimate the age (in days), because for every day a `day mark' is remembered. This
tag gives easy access to this functionality.
Note that in MMBase 1.8 it is possible to define creation and lastmodified time
fields of DATETIME database type. Age-constraints can then also be accomplished by constraints
on the date parts of such a field.
(since: MMBase-1.7)
|
| see also | listnodescontainer | listcontainer | part attribute of constraint |
| attributes |
-
element
(since: MMBase-1.8)
If the surrounding nodelist container is a list container then the constraint can be on the
several elements from the path. With this attribute you must indicate to which. This is not
needed for listnodes and relatednodes containers.
see: listcontainer | listnodescontainer
-
field
If the surrounding nodelist container is a list container then the constraint can be on the
several elements from the path. With this attribute you must indicate to which. This is not
needed for listnodes and relatednodes containers (and probably would be a `number' field otherwise).
This attribute is deprecated in favour of 'element'.
see: element attribute of ageconstraint | listcontainer | listnodescontainer
-
minage
(since: MMBase-1.7)
Minimal age of the object in days.
-
maxage
Maximal age of the object in days.
-
inverse
Inverses the constraint. So adds a NOT.
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<mm:listnodescontainer type="typedef">
<mm:ageconstraint maxage="100" />
<mm:listnodes>
<mm:field name="name" />
</mm:listnodes>
</mm:listnodescontainer>
|
| toc |
| <mm:aliasconstraint>
Pinpoints one of the elements to an alias.
(since: MMBase-1.7)
|
| see also | listnodescontainer | listcontainer |
| attributes |
-
element
see: listcontainer | listnodescontainer
-
name
The name of the alias, or (since MMBase-1.8) a list of possible aliases.
-
inverse
Inverses the constraint. So adds a NOT.
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<%-- list all portals except the two portals with alias 'portalhome' and 'portalkids' --%>
<mm:listnodescontainer type="portals">
<mm:aliasconstraint name="portalhome,portalkids" inverse="true" />
<mm:listnodes>
<mm:field name="title" />
</mm:listnodes>
</mm:listnodescontainer>
|
| toc |
| <mm:aliaslist>
This is a list which can only live under a NodeProvider, to iterate through all aliases of the
Node. In the body you can use the `writer' functionality to actually write out current alias.
|
| nodereferrer attributes |
|
| writer attributes |
|
| listprovider attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:listnodes type="list">
<mm:field name="title" />
has the following aliases:
<mm:aliaslist>
<mm:write /> <mm:last inverse="true">,</mm:last>
</mm:aliaslist><br/>
</mm:listnodes>
|
| toc |
| <mm:attachment>
Returns an URL to the attachment servlet. This is a NodeReferrer
and consequently has to live as a child of a (attachment) node.
Using this tag makes your pages more portable to other system,
and hopefully less sensitive for future changes in how the
attachment servlet works.
|
| attributes |
|
| nodereferrer attributes |
|
| writer attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:listnodes type="attachments">
<a href="<mm:attachment />">Download</a>
</mm:listnodes>
|
| toc |
| <mm:cloud>The cloud tag initializes the cloud to use. |
| attributes |
-
name
The name of the cloud. On default it is `mmbase'. The default will normally suffice, so
you don't need not use this attribute.
-
username
The authentication name to use (account). When used together with
e.g. the method="http" option, validation only succeeds if
the username equals this attribute. In this case it is also possible to
supply a list of user names here (comma separated)
It can also be used in combination with the `password' attribute, in which case
authentication will happen automatically with the specified credentials.
-
logon
Synonym to `username'
see: username attribute of cloud
-
rank
The required rank. This is another way to force a special user when using several
methods. Often, you should use this attribute in combination with some `method' attribute,
because if the `current' cloud (of the session) does not have a user of at least this
required rank, then it needs to know how to log in again then. If there is no method in that
case, then the body will be skipped, and no error will be shown (This behaviour may be
useful to `check' a cloud only).
-
loginpage
You can use the loginpage attribute to specify the (relative) path to a security login page.
i.e.:
<mm:cloud name="mmbase" loginpage="login.jsp">
...
</mm:cloud>
The attribute has effect whenever someone who is not already logged on to the cloud requests the page containing the cloud tag.
In that case, the tag checks whether the page has been called with a predefined set of parameters.
If the page was called with the `command' parameter set to `login', the tag assumes a request is being made to log on using the parameters passed.
The actual names of the parameter passed differs by security method chosen, which is defined by the `authenticate' attribute.
For instance, with authenticate method `username/password', the following additional parameters are recognized:
- cloud: similar to the cloudtag's `name' attribute
- username: similar to the cloudtag's `username' attribute
- password: similar to the cloudtag's `password' attribute
If login succeeds, the page continues and displays normally. If the login fails, or if no `command=login' attribute was specified, the request is redirected to the page specified in the attribute.
This `login page' can then take care of authentication, i.e. by displaying a form that allows the user to enter and submit the appropriate parameters (username/password) back to the originally called page.
The page may also implement its own method of authentication.
The `command=login' parameter has no effect when the loginpage attribute was not specified.
The page should link page to the page which is supplied in the reference parameter.
The login page itself should have a parameter `command' with value `login', `authenticate' with the authentication method which is wanted.
Additional parameters will be passed to the underlying security implementation.
A simple login page could contain the following jsp-code:
<%@ taglib uri="http://www.mmbase.org/mmbase-taglib-1.0" prefix="mm"%>
<html>
<mm:import externid="referrer" required="true" />
<mm:import externid="reason">please</mm:import>
<mm:write referid="reason">
<mm:compare value="failed">
<font color="red">Failed to log in. Try again</font>
</mm:compare>
</mm:write>
<form method="post" action="<mm:url page="$referrer" />" >
<input type="hidden" name="command" value="login">
<input type="hidden" name="cloud" value="mmbase"><!-- also default -->
<input type="hidden" name="authenticate" value="name/password">
<input type="text" name="username" value="">
<br />
<input type="password" name="password" value="">
<br />
<input type="submit" name="Login" value="login">
</form>
</html>
When a user is logged in, a call in that page, with parameter `command' and value `logout'
causes the user to be logged out.
There are different situations on which the cloud tag with the attribute loginpage can react, they are:
-
scenario 1 : not logged-in, no parameter with value login:
Stop current page processing, show the login.jsp, which is
a form with parameter command with value login. Parameters
can be specified inside a form. When the button submit is
pressed, this parameters will be send to the referencing
page (foo.jsp). The login page will be called with a
`reference' attribute containing this page's URL, and a
`reason' attribute `please'.
-
scenario 2 : not logged-in, a parameter with value login:
The parameters will be retrieved from the request. These
parameters will be passed to the security
(CloudContext.getCloud(cloud, authenticate,
otherparameters)), and the cloud retrieved will be stored
inside the context.(from now you are logged in) Page
processing of foo.jsp will continue, unless the
authentications failed, because then again is redirected
to the login page, but this time with `reason' `failed'.
-
scenario 3: logged-in Page foo.jsp will simply be
processed. (Unless e.g. the `logon' attribute is not
satisfied).
-
scenario 4: logged-in with parameter command with value
logout The cloud in the session will be removed (you are
now logged out) and we can continue here from scenario
1. Can also be done with method='logout'.
-
password
The password to use to logon to the cloud. Always consider using method="pagelogon" when you
use this attribute, because the default method will otherwise be "sessionlogon". Then, the
resulting cloud-object is written to the session, and the visitor of your page can abuse
this to gain authorisation also on other pages.
You could also use 'class' authentication to avoid all passwords in JSP-code.
-
pwd
Synonym to `password'
see: password attribute of cloud
-
method
Describes how to get the authentication information. The default behaviour is as described in `asis'.
| http |
Use http protocol to ask name and password
from the user. If the `username' attribute is specified too, then
logging on will fail if the user does not use that
username. The `password' (or `pwd') attribute will be ignored.
|
| logout |
When using `http' to log on, the browser will store name and
password. If you want to log on again, you have to `logout' first.
In this case the `realm' of the http authentication will be
changed, and you obtain a new possibility to log on after
that. The cloud you obtain is anonymous.
|
| anonymous |
Ignore the `logon' attribute and create (or reuse) a cloud with an anonymous user.
|
| asis |
Ignore the `logon' attribute and reuse the cloud as
it is in the session, or create an `anonymous' cloud, if there is not cloud in the
session.
|
| pagelogon |
This method should be used together with the "password" attribute, to indicate that the
resulting cloud should only be available to the current page, and not to the session.
|
| sessionlogon |
This method can be used together with "password" attribute, to indicate that the
resulting cloud must be written in the session, and can be picked up with method="asis"
in another page. Visitors of the page using the login-method should be trusted, because
they could perhaps exploit this cloud-object in the session.
For backwards compatibility reasons this method is the default method if you use the
`password' attribute, but a warning will be logged to encourage to state this
explicitly, because it is good that you are aware of the consequences.
A page using a non-anonymous cloud in the session should not be cached publicly, that is
another reason to use `pagelogon'.
|
| delegate |
Delegates logging in to the security's authentication implementation itself. The current
request and response objects are given as credentials (e.g. to redirect to an external
authentication server). You can also be authenticated only based on class (if in
classauthentication.xml this jsp's class was mentioned).
|
| sessiondelegate |
As delegate, only the resulting cloud is written to the session (and can be picked up
with `asis'). This should only be used if the user is trusted (and not e.g. when using
`class' security, because then the class is trusted, rather then the user).
|
-
sessionname
The name the cloud must get in the session. Using this it is possible to avoid retyping
your password when switching between two sites which both use http authentication, but
don't share users.
You can also use a different sessionname for editor pages, so that editors need to log in
separately on the front-end, which makes it easier for them to see how pages look for
normal users.
-
authenticate
The authentication module which must be used by the security system. The default is
"name/password", which will do in many cases. Other values are often needed when
method="delegate" or method="sessiondelegate".
| name/password |
The most common authentication method. You somehow have to supply a name/password combination.
|
| class |
This can be used in combination with method="delegate". The 1.8 class security (which
can be installed in 1.7) feature can recognize this, and supply a cloud based on the class name of
this jsp.
|
-
uri
The uri in case the cloud has to be retrieved using the RMMCI. This makes it possible to
display remote content.
| local |
Get a local cloud.
|
| rmi://... |
RMMCI cloud.
|
| rmi://www.mmbase.org/remotecontext | |
-
jspvar
The name of The JSP variable to create that contains a reference to the cloud.
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| cloudprovider attributes | |
|
example 1 |
<!-- Show titles of all news articles from user kamer
(which are in pool kamer_pool) only to user kamer -->
<mm:cloud jspvar="cloud" logon="kamer" method="http">
logged on as: <bean:write name="cloud" property="user.identifier" /><br />
<mm:node number="kamer_pool" id="my_node">
<mm:related paths="news" orderby="number" directions="DOWN">
<mm:first>
<!-- show a small heading,
which also contains the node-number of the pool -->
<mm:field node="my_node" name="number" />:
<mm:field name="number" />
<mm:fieldinfo type="guiname" />
</mm:field>:
<mm:field name="title" />
<mm:fieldinfo type="guiname" />
</mm:field>:
</mm:first>
<mm:field name="number" />: <mm:field name="title" /><br />
</mm:related>
</mm:node>
</mm:list>
</mm:cloud>
|
|
example 2 |
<!-- To logon on as a different user on my_page.jsp,
make a ref to a page -->
<mm:cloud method="logout" />
<% response.sendRedirect("http://my_host/my_page.jsp"); %>
|
| more examples |
example 3
example 4
example 5 |
| toc |
| <mm:composite>
Combines constraints with a conditional operator.
(since: MMBase-1.7)
|
| see also | constraint | listnodescontainer | listcontainer | querycontainer | ageconstraint |
| attributes |
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
The following code lists all users with username 'admin' or 'test'.
<mm:listnodescontainer type="people">
<mm:composite operator="OR">
<mm:constraint field="username" value="admin" operator="LIKE" />
<mm:constraint field="username" value="test" operator="LIKE" />
</mm:composite>
<mm:listnodes>
<mm:field name="username" /> <br />
</mm:listnodes>
</mm:listnodescontainer>
|
| toc |
| <mm:constraint>
Applies a constraint to the query of the surrounding nodelist container.
(since: MMBase-1.7)
|
| see also | listnodescontainer | listcontainer | querycontainer | ageconstraint | composite |
| attributes |
-
field
The field to which the constraint must be applied.
-
field2
Another field the field is to be compared with.
-
value
The value the field is to be compared with.
-
referid
The value the field is to be compared.
-
value2
Needed for BETWEEN operator.
-
referid2
Needed for BETWEEN operator.
-
inverse
Inverses the constraint. So adds a NOT.
-
casesensitive
Changes the given constraint's `case sensitivity' (if applicable). Default it is false.
-
part
(since: MMBase-1.8)
Designates a part of a date field to compare.
| CENTURY | |
| YEAR | |
| MONTH | |
| QUARTER | |
| WEEK | |
| DAY | |
| DAYOFYEAR | |
| DAYOFMONTH | |
| DAYOFWEEK | |
| HOUR | |
| MINUTE | |
| SECOND | |
-
operator
The operator to be used in the comparison. Defaults to `='
| EQUAL | |
| = | |
| LESS | |
| < | |
| LESS_EQUAL | |
| <= | |
| GREATER | |
| > | |
| GREATER_EQUAL | |
| >= | |
| LIKE | |
| BETWEEN | Should also use value2 or referid2 |
| IN | The value can be a comma separated String of values. You can also refer to some list with `referid' (e.g. to a nodelist tag) |
| NULL | Tests whether the value of the field is NULL (or NOT NULL if inverse="true"). The `value' attributes are ignored. |
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<mm:listnodescontainer type="people">
<mm:composite operator="OR">
<mm:constraint field="username" value="admin" operator="LIKE" />
<mm:constraint field="username" value="test" operator="LIKE" />
</mm:composite>
<mm:listnodes>
<mm:field name="username" /> <br />
</mm:listnodes>
</mm:listnodescontainer>
|
| toc |
| <mm:distinct>
Makes the surrounding query `distinct'.
(since: MMBase-1.7)
|
| see also | listnodescontainer | listcontainer |
| attributes |
-
value
`true' (default) or `false'.
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<mm:listcontainer path="mags,news,people" fields="mags.title,people.firstname">
<!-- This will return 5 identical rows -->
<mm:list>
<mm:field name="mags.title" /> - <mm:field name="people.firstname" />
</mm:list>
<mm:distinct />
<!-- This returns one row -->
<mm:list>
<mm:field name="mags.title" /> - <mm:field name="people.firstname" />
</mm:list>
</mm:listcontainer>
|
| toc |
| <mm:exception>
(since: MMBase-1.9)
|
| toc |
| <mm:field>
Gets the field `name' from node `node' (can also be list providing nodes).
|
| see also | fieldinfo | fieldlist | node |
| attributes |
-
name
The name of the field to get. It could also be field-like `functions' which can be
recognized by the appearing of parentheses. Which functions are available is principally
dependent on the node-type. Functions can also be accessed more cleanly by `function' tags.
When this attribute is missing, then the field is copied
from a parent FieldProvider (e.g. another field tag), which
must be present then.
| title | Returns the value of the field `title' |
| gui() | Returns an html `GUI' representation of the node. It is nicer to use the mm:function tag for this |
| gui(handle) | Returns an html `GUI' representation of the field `handle'. It is nicer to use the mm:function tag for this. |
| cache(s(100)) | Only for images. Returns the icache node number of a image rescaled to 100. It is nicer to use the mm:function tag for this. |
| html(body) | Returns the body field converted to (bad) HTML. It is nicer to use the attribute escape="p" for this. |
| wrap(title,10) | Wraps the title to 10 chars. |
-
notfound
(since: MMBase-1.8)
If the node doesn't have the given field, what to do then?
| skip|skipbody | Simply skip the body if the field is not available |
| message | Simply write to the page that the field it not available |
| throw|throwexception | Throw an exception if the field is not available (default) |
| null|providenull |
Provides null as the value for the field
|
| log |
Like 'skip' but logs a message.
|
|
| writer attributes |
|
| fieldreferrer attributes |
|
| fieldprovider attributes | |
| nodereferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
See the example for tag `node'.
|
| toc |
| <mm: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: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 also | tree related tags | shrink |
| attributes | |
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| toc |
| <mm:hasfield>
Checks only whether certain field is available. To make it possible to make more generic code.
(since: MMBase-1.8)
|
| attributes |
-
name
Name of the field.
-
nodetype
(since: MMBase-1.8.4)
|
| condition attributes |
|
| nodereferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:listnodes type="object">
<mm:hasfield name="title">
Title of node <mm:field name="number" /> (<mm:nodeinfo type="type" />): <mm:field name="title" />
</mm:hasfield>
</mm:listnodes>
|
| toc |
| <mm:hasnode>
Checks only whether certain node is available. To make it possible to make more generic code. It has the same working as <mm:node number="abc" notfound="skipbody" />
(since: MMBase-1.8)
|
| attributes |
-
number
Number (or alias) of the node.
|
| condition attributes |
|
| cloudreferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:hasnode number="some-alias">
<mm:node number="some-alias">
Hello world
</mm:node>
</mm:hasnode>
|
| toc |
| <mm:hasnodemanager>
Checks only whether certain nodemanager is available. To make it possible to make more generic code.
(since: MMBase-1.8)
|
| attributes |
-
name
Name of the node-manager.
|
| condition attributes |
|
| cloudreferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:hasnodemanager name="people">
<mm:listnodes type="people">
<mm:field name="firstname" />
</mm:listnodes>
</mm:hasnodemanager>
|
| toc |
| <mm:hasrelationmanager>
Checks only whether certain relation manager is available. To make it possible to make more generic code.
(since: MMBase-1.8)
|
| attributes |
-
sourcemanager
Name of the source node-manager (defaults to 'object').
For convenience, one may also specify a node here (using $), in which case the nodes nodemanager is requested.
-
destinationmanager
Name of the destination node-manager (default to 'object').
For convenience, one may also specify a node here (using $), in which case the nodes nodemanager is requested.
-
role
Role of the relation manager.
|
| condition attributes |
|
| cloudreferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| toc |
| <mm:image>
Returns an URL to the image servlet. This is a NodeReferrer
and consequently has to live as a child of a (image) node.
Using this tag makes your pages more portable to other system,
and hopefully less sensitive for future changes in how the
image servlet works.
|
| attributes |
-
template
A `transformation' template.
In the font option, mm: stands for `mmbase configuration
directory'. In this way it is easy to make sure that fonts
are available.
| s(100x100) | |
| s(200x200!)+font(mm:fonts/Arial.ttf)+fill(ffffff)+pointsize(20)+gravity(NorthEast)+text(0,20,'MM Base') | |
| s(180)+modulate(120,0)+gamma(1/1/2)+bordercolor(8c9c23)+border(10x0) | |
| s(200)+fill(ffffff)+circle(20,20 30,30) | |
| s(200x200!)+part(100,100,150,150) | |
| s(200)+fill(ffffff)+draw(rectangle 100,100 150,150)+dia+flipx | |
| s(200)+colorizehex(f01010) | |
| s(200)+f(gif)+paint(10) | |
| s(100x100>) | Fit to 100x100 if it is bigger |
-
mode
What to produce.
| url | An URL to the image (default) |
| attributes | The attributes 'src' 'height' and 'width' for the img-tag of HTML. |
| img | A img-tag of HTML |
-
element
(since: MMBase-1.7.4)
see: element attribute of node
-
width
This width is used for a re-size of the image when no `transformation' template is provided.
-
height
This height is used for a re-size of the image when no `transformation' template is provided.
-
crop
Defines if an image should be cropped when no `transformation' template is provided.
The image will be cropped when it does not fit the re-size area defined by the
height and width attributes.
| begin | The re-size area will be positioned at the left top corner. |
| middle | The re-size area will be positioned in the middle. |
| end | The re-size area will be positioned at the right bottom corner. |
-
styleClass
Class attribute of html img-tag.
Only applied when mode=img.
-
style
Style attribute of html img-tag.
Only applied when mode=img.
-
align
Align attribute of html img-tag.
Only applied when mode=img.
-
border
Border attribute of html img-tag.
Only applied when mode=img.
-
hspace
Hspace attribute of html img-tag.
Only applied when mode=img.
-
vspace
Vspace attribute of html img-tag.
Only applied when mode=img.
-
alt
(since: MMBase-1.8.5)
Alt attribute of html img-tag.
Only applied when mode=img.
|
| nodereferrer attributes |
|
| writer attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
<mm:node number="<%= image_number %>">
<img src="<mm:image template="s(100)" />" width="100" border="0">
</mm:node>
|
| toc |
| <mm:last>Can be used in a list to determine if this is the
last item in the list. |
| see also | first |
| condition attributes |
|
| listreferrer attributes |
|
|
example 1 |
See the example for tag `first'.
|
| toc |
| <mm:leafconstraints>
Lives in a tree-container tag. Constraints inside this tag are not defined as normal tree
constraints but as 'leaf' constraint, which means that they are only taken into constraint
on the 'leafs' of the tree.
Practically, this means that it can be used to search a tree.
(since: MMBase-1.8.0)
|
| see also | tree related tags | querycontainerreferrer |
| attributes |
-
on
Decides whether the leaf-constraint is going to work on the template, or on the trunk.
| template |
The constraints in this tag will be applied on all the new branches of the tree when they
are still 'leafs', so it applies to the template for that (determined by the attributes of
treecontainer)
|
| trunk |
The constraints in this tag will be applied to the trunk query, which is normally defined
by the surrounding nodequery container of the treecontainer.
This makes it possible to also consider the trunk when searing a tree.
|
|
| attributes | |
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| toc |
| <mm: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 also | listnodes | listcontainer | element attribute of node |
| attributes |
-
nodes
Comma-separated list of node numbers that should be used as start nodes. The start nodes don't
have to be a member of the first node manager in the path. For example, if the start nodes
belong to the second node manager in a path with a length of three node managers, traversals
will go into two directions at the same time. All traversals that make up a complete path
are returned. If a node belongs to the last node manager in a path traversals will go from
right to left starting at the last node manager. All start nodes specified in this attribute
have to belong to the same node manager. Nodes that belong to a different node manager than
the first node are ignored In case this attribute is not specified all nodes from the first
node manager in the path are used as start nodes.
-
path (
`path' or `referid' is mandatory.
)
A comma-separated list of node managers which specifies the path
that should be followed. It is possible to explicitly specify a
relation manager that should be used to go from one node to an other. If
no relation manager is specified between two node managers, all possible
relation managers that can be used to go to the next specified node in
the path are followed. It is possible to add a digit (0-9) to the
node manager name and refer to this node manager with his name and this
digit appended. This can be useful if a node manager is used more than
once in a path.
| mags | |
| mags,news | |
| mags,related,news | |
| mags,news,images | |
| mags,related,news,related,images | |
| pools,pools0,urls | |
| pools1,pools2,urls,pools3 | |
-
fields
Comma-separated list of fields that should be made available in the
page. The fields are selected from attributes of the corresponding node
managers defined in type. It is required to append a prefix to
each field listed e.g. fields="mags.title,news.title".
-
constraints
Constraints to prevent records from being included in the returned list.
These constraints follow the syntax of the SQL where clause. It's a good
practice to use uppercase letters for the operators and lowercase letters
for the field names. There are also a (new) `constraint' tags, which are more flexible
(especially when constructing the constraints automatically).
see: constraint
| url.number = 100 | !=, <, >, <= and >= can also be used |
| person.name = `admin' | |
| person.email IS NULL | indicating 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 NULL | indicating 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.
-
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:listfunction>
Gets the function value for function `name'. The function value is supposed to be
Collection, and this tags acts as a `listprovider' and `writer' tag, iterating over all
entries of the resulting collection.
For more information about how function tags work generally see the the `functiontag' entry
of this reference.
(since: MMBase-1.7)
|
| see also | node | booleanfunction | function | functioncontainer | nodelistfunction |
| attributes |
-
add
(since: MMBase-1.9)
-
retain
(since: MMBase-1.9)
-
remove
(since: MMBase-1.9)
-
max
The maximum number of times to iterate.
-
offset
How many items must be skipped before iterating
-
listdelimiter
see: listdelimiter attribute of import
|
| listprovider attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| functiontag attributes |
|
| nodereferrer attributes |
|
| containerreferrer attributes |
|
| writer attributes |
|
|
example 1 |
<mm:listnodes type="mediasources" max="10">
<mm:function name="mimetype" />: <mm:function name="format" />
<ul>
<mm:listfunction name="urls" jspvar="uc">
<li><%= ((org.mmbase.applications.media.urlcomposers.URLComposer)uc).getURL() %></li>
</mm:listfunction>
</ul>
</mm:listnodes>
|
| more examples |
example 2 |
| toc |
| <mm:listnodescontainer>
Surrounds a listnodes tag and provides a query object.
(since: MMBase-1.7)
|
| see also | listnodes | querycontainerreferrer |
| attributes |
-
type
see: type attribute of listnodes
-
path
Though a relatednodescontainer is to query real nodes (so not clusternodes), this does not
mean that there can only one node type in the query. Only one element of this path is
actually queried, but constraints and sort orders can be applied to the other ones.
see: path attribute of list
-
searchdirs
Per element in the path you can indicate an alternative `searchdir' (source, destination or both)
-
element
The `element' of the path to be queried. This defaults to the first element, but the other
ones can be pointed to as well.
see: element attribute of node
-
id
Id for reference by subtags and reuse.
-
nodes
(since: MMBase-1.7.1)
see: nodes attribute of list
-
clone
(since: MMBase-1.8.6)
This is the same as 'referid' attribute, but ensures that the query is cloned first, so the original query remains unchanged.
The query will implicitely be cloned, also when using 'referid', when changes are made to an already 'used' query.
-
markused
(since: MMBase-1.8.6)
If this attribute is used (and set to 'true') then the query will be marked 'used' in the
doEndTag. This ensures that the query cannot be changed before cloning it.
|
| querycontainer attributes |
|
| container attributes | |
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| more examples |
example 1 |
| toc |
| <mm:listrelations>
List the relations belonging to this nodes. Relations are nodes too.
|
| see also | relatednode |
| attributes |
|
| nodeprovider attributes |
|
| nodereferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| listprovider attributes |
|
|
example 1 |
<mm:listnodes type="news">
<mm:field name="title" />
<mm:listrelations role="posrel" type="page">
is news item <mm:field name="pos" /> on page
<mm:relatednode><mm:field name="title" /></mm:relatednode>
</mm:listrelations>
<br/>
</mm:listnodes>
|
| toc |
| <mm:maycreate>
Check if node may be created.
|
| attributes |
|
| 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 also | createrelation |
| 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:maywrite>
Check if node may be changed.
|
| attributes |
|
| 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 also | previousbatches | offset | maxnumber | referids attribute of url | write | index |
| attributes |
-
max
The maximum number of batches to be produces. For really huge result, even the number of
batches can be too large, so you want to limit it. You should also use it (max="1") if you
only want to implement a `next page' button.
-
maxtotal
In stead of `max' you could also use maxtotal. The tag will calculate how many batches
`previousbatches' did need, and if that is zero, there can be `maxtotal' next batches. If it
is more then zero, nextbatches will get less. If there are both many next batches and
previous batches, then they get both the half of `maxtotal' batches.
-
indexoffset
The produced indexes can be used as page numbers. Default this page-numbering starts at 0,
with this you can change it, e.g. set it to 1.
|
| nodereferrer attributes |
|
| writer attributes |
|
| listprovider attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<mm:relatednodescontainer type="responses">
<mm:maxnumber value="12" />
<mm:offset value="${offset}" />
<mm:previousbatches indexoffset="1">
<mm:link referids="r.s@s,_@offset,n">
<a href="${_}"><mm:index /></a>
</mm:link>
<jsp:text>, </jsp:text>
</mm:previousbatches>
<span class="current"><mm:index offset="1"/></span>
<mm:nextbatches indexoffset="1">
<jsp:text>, </jsp:text>
<mm:link referids="r.s@s,_@offset,n">
<a href="${_}"><mm:index /></a>
</mm:link>
</mm:nextbatches>
</mm:relatednodescontainer>
|
| toc |
| <mm:node>
A tag to make a node available. Normally it will enclose some field tags, but it is also
possible to only write to the context, or to a JSP variable.
|
| attributes |
-
number (
`number', `element' or `referid' specify the node. If none of them is given then the node
refers to a parent NodeProvider, and simply mirrors it, which can e.g. be useful to assign
it a (new) id. The 'parent' node-provider can also be determined by use of the '_node'
variable. This last behaviour can be enforced using node="" as attribute (which can be useful
e.g. in tag-file fragments).
)
The node number or alias identifying this node in MMBase.
-
notfound
What to do if the node is not found. The default is to throw an exception.
| skip|skipbody | Simply skip the body if the node is not found |
| message | Just say in the page that the node was not found |
| throw|throwexception | Throw an exception if the node is not found |
| null|providenull |
Will not throw an exception, but will evaluate the body,
simply providing `null' as node. This will probably lead to
other (less clear) exceptions. But if you prefer it that
way, it is possible. Use on own risk!
|
| log |
Like 'skip' but also logs a message.
|
-
element (Either `number', `element' or `referid' must be supplied.)
The name of a node field of the current node. This can for instance be the `rnumber' field
of a relation, the `destination' field of an oalias, etc. A common use is to specify the
name of the node manager to identify a node in a list or related list tag (clusternode
providers). In this case, the nodemanager name behaves like a special virtual node field of
the surrounding cluster node, indicating the individual nodes that make up the cluster node.
see: clusternodeprovider
|
| nodeprovider attributes |
|
| nodereferrer attributes |
|
| cloudreferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
|
example 1 |
Assume that node with number has a field title.
Then the following can be used to
access the value of title:
<mm:node number="456">
<mm:field name="title" write="true" />
</mm:node>
|
| toc |
| <mm: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 also | tree related tags | depth | shrink |
| attributes | |
| contextreader 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 also | list | 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: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 also | listrelations |
| 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 also | list | 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:relation>
(since: MMBase-1.9)
|
| toc |
| <mm:selectnode>
(since: MMBase-1.9)
|
| toc |
| <mm:setcontext>
Change the context of a node. This has nothing to do with the
`contexts' of the taglib, but with security. With every node a
`context' is associated (in fact the `owner' field is currently
used for this), by which is is determined who may do what to
it.
You'll need this if you are creating an editor and want to add
the possibility to change the rights on a node.
|
| attributes |
-
name
In stead of giving the name of the context in the body, you can also
indicate it with this parameter.
|
| nodereferrer attributes |
|
| toc |
| <mm:sortorder>
(since: MMBase-1.7)
|
| see also | listnodescontainer | listcontainer | orderby attribute of list |
| attributes |
-
field
On which field to sort.
-
direction
Whether to sort ascending ('UP') or descending ('DOWN'), defaults to UP.
-
part
(since: MMBase-1.8)
Designates a part of a date field to sort on.
| CENTURY | |
| YEAR | |
| MONTH | |
| QUARTER | |
| WEEK | |
| DAY | |
| DAYOFYEAR | |
| DAYOFMONTH | |
| DAYOFWEEK | |
| HOUR | |
| MINUTE | |
| SECOND | |
-
casesensitive
(since: MMBase-1.8)
Whether to sort case-sensitively or not. This is only relevant for String type fields. On
the database level a case insensitive sort will typically result in a sort of the uppercased
field (unless e.g. the database sorts case insensitively on default). This defaults to
false, because probably you want that.
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
| toc |
| <mm:tree>
The Tree Tag makes it possible to show a piece of the MMBase cloud generically. This tag never
works alone. Firstly, it will try to find a surrounding `treecontainer' tag, which defines the
`starting query' and other the properties of this tree. If there is no surrounding
tree-container tag, then it can also use one of the other node list containers
(relatednodescontainer and listnodescontainer) to define the `starting' query. If also that
does not succeed then it will start looking for any surrounding node-provider (such as
relatednodes, listnodes and node) and will use the provided node as a base for the starting
query of the tree.
If you want to define the surrounding node-provider with a container, then you can use the
'node' attribute to enforce it to use the node-provider and not it's container.
(since: MMBase-1.7)
|
| see also | tree related tags | treecontainer | relatednodescontainer | listnodescontainer | nodeprovider |
| attributes |
-
type
The tree will grow with path-elements of this type.
see: type attribute of relatednodes
-
role
The path-elements will be connected by relations with this role.
see: role attribute of relatednodes
-
searchdir
This is the directions in which the relations must be followed (destination or source).
see: searchdir attribute of relatednodes
-
maxdepth
To avoid coming into an infinite loop (which is possible because mmbase data is not actually structured as a tree, but as
a `network' of nodes), there should always be a `maximal' depth to which relations are followed. This defaults to 5.
see: orderby attribute of treecontainer
-
orderby
(since: MMBase-1.7.1)
It is possible to order the elements of a level of a tree by using the `orderby' field. If
you wish to order using the fieldvalue of the relation from one level to another, prefix the
field with the builder name or role(for example: "categories.title" or "posrel.pos"). You
can order by more fields, by comma-separating their names.
see: orderby attribute of list
-
directions
(since: MMBase-1.7.1)
Sort orders for the `orderby' arguments (comma separated `up' and `down'). This list may be
shorter than the list of `orderby'. Missing directions are defaulted to the last specified one.
see: directions attribute of list
-
max
(since: MMBase-1.8.1)
see: max attribute of list
-
varStatus
(since: MMBase-1.8.6)
see: varStatus attribute of listprovider
-
varBranchStatus
(since: MMBase-1.8.6)
This provides information about the current looping status of the current branch. If e.g. you want to know if the current node
is the last of the 'branch', then you could use 'varBranchStatus="branch"'> ... ${branch.last}.
see: varStatus attribute of listprovider
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
| nodeprovider attributes |
|
| listprovider attributes |
|
| nodereferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| toc |
| <mm:treecontainer>
The treecontainer tag is a the `container' tag for the tree-tag. It searches on the same way
as the tree tag itself for a `starting query', the only difference being that it will not
itself look for a surrounding tree-container (so, it will look parent node-list-containers and
if unsuccessfully for a parent node-providers).
Just as for example in the relatednodescontainer the attributes define how the `starting'
query must be extended. The essential difference for `trees' though, is that it will happen
recursively. So the surrounding querycontainerreferrer tags like `mm:constraint' will work
only on a kind of `template' query, and will then be applied repeatedly.
The use of treecontainer, tree and its subtags can perhaps most easily be explained by an
example, which can be find on the page about tree related tags.
(since: MMBase-1.7.1)
|
| see also | tree related tags | querycontainerreferrer |
| attributes |
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
| contextreader attributes |
|
| contextwriter attributes |
|
| contextreferrer attributes |
|
| nodereferrer attributes |
|
| toc |
| <mm:typeconstraint>
Pinpoints one of the elements to a certain type, which can be useful in some cases.
(since: MMBase-1.8)
|
| see also | listnodescontainer | listcontainer |
| attributes |
-
element
see: listcontainer | listnodescontainer
-
name
A list of nodemanager names.
-
descendants
Whether nodes of descendant types of the given node-managers must be included too. Defaults
to true.
-
inverse
Inverses the constraint. So adds a NOT.
|
| querycontainerreferrer attributes | |
| containerreferrer attributes |
|
|
example 1 |
<mm:listnodescontainer type="object">
<mm:typeconstraint name="images,attachments"/>
<mm:listnodes>
<mm:function name="gui" />
</mm:listnodes>
</mm:listnodescontainer>
|
| |