6330N/A<?
xml version="1.0" encoding="UTF-8"?>
6330N/A ! This work is licensed under the Creative Commons 6330N/A ! Attribution-NonCommercial-NoDerivs 3.0 Unported License. 6330N/A ! To view a copy of this license, visit 6330N/A ! or send a letter to Creative Commons, 444 Castro Street, 6330N/A ! Suite 900, Mountain View, California, 94041, USA. 6330N/A ! You can also obtain a copy of the license at 6330N/A ! See the License for the specific language governing permissions 6330N/A ! and limitations under the License. 6330N/A ! If applicable, add the following below this CCPL HEADER, with the fields 6330N/A ! enclosed by brackets "[]" replaced with your own identifying information: 6330N/A ! Portions Copyright [yyyy] [name of copyright owner] 6330N/A ! Copyright 2012 ForgeRock AS 6330N/A ! Portions Copyright 2013 Jens Elkner 6330N/A version="5.0" xml:
lang="en" 6330N/A <
refentrytitle>make-ldif-template</
refentrytitle>
6330N/A <
refname>make-ldif-template</
refname>
6330N/A <
refpurpose>template file for the make-ldif command</
refpurpose>
6330N/A# Comment lines start with #.
6330N/A# Optionally include classes that define custom tags.
6330N/A# must be on the class path when you run make-ldif.
6330N/A# Optionally define constants used in the template.
6330N/A# To reference constants later, put brackets around the name:
6330N/Adefine <
replaceable>constant-name</
replaceable>=<
replaceable>value</
replaceable>
6330N/A# Define branches by suffix DN, such as such as the following
6330N/A# ou=People,dc=example,dc=com
6330N/A# ou=Groups,dc=example,dc=com
6330N/A# make-ldif generates the necessary object class definitions and RDNs.
6330N/A# A branch can have subordinateTemplates that define templates to use for
6330N/A# A branch can have additional attributes generated on the branch entry.
6330N/A# See the Description below for more information on specifying attribute
6330N/Abranch: <
replaceable>suffix-dn</
replaceable>
6330N/A[subordinateTemplate: <
replaceable>template-name</
replaceable>:<
replaceable>number</
replaceable>
6330N/A[<
replaceable>attribute</
replaceable>: <
replaceable>attr-value</
replaceable>
6330N/A# Define entries using templates.
6330N/A# A template can extend another template.
6330N/A# A template defines the RDN attribute(s) used for generated entries.
6330N/A# A template can have a subordinateTemplate that defines a template to use
6330N/A# for the generated entries.
6330N/A# A template then defines attributes. See the Description below for more
6330N/A# information on specifying attribute values.
6330N/Atemplate: <
replaceable>template-name</
replaceable>
6330N/A[extends: <
replaceable>template-name</
replaceable>]
6330N/ArdnAttr: <
replaceable>attribute</
replaceable>[+<
replaceable>attribute</
replaceable> ...]
6330N/A[subordinateTemplate: <
replaceable>template-name</
replaceable>:<
replaceable>number</
replaceable>]
6330N/A[<
replaceable>attribute</
replaceable>: <
replaceable>attr-value</
replaceable>
6330N/ATemplate files specify how to build LDIF. They allow you to define variables,
6330N/Ainsert random values from other files, and generally build arbitrarily large
6330N/ALDIF files for testing purposes. You pass template files to the
6330N/A<
command>make-ldif</
command> command when generating LDIF.
6330N/AThe Synopsis above shows the layout for a <
command>make-ldif</
command> template
6330N/Afile. This section focuses on what you can do to specify entry attribute values,
6330N/Acalled <
replaceable>attr-value</
replaceable> in the Synopsis section.
6330N/A <
title>Specifying Attribute Values</
title>
6330N/AWhen specifying attribute values in <
command>make-ldif</
command> templates, you
6330N/Acan use static text and constants that you have defined, enclosing names for
6330N/Aconstants in brackets, <
literal>[myConstant]</
literal>. You can use more than
6330N/Aone constant per line, as in the following example.
6330N/A <
programlisting>description: Description for [org] under [suffix]</
programlisting>
6330N/AYou can also use two kinds of tags when specifying attribute values. One kind of
6330N/Atag gets replaced with the value of another attribute in the generated entry.
6330N/ASuch tags are delimited with braces, <
literal>{ }</
literal>. For example, if
6330N/Ayour template includes definitions for first name and last name attributes:
6330N/A <
programlisting>givenName: <first>
6330N/Asn: <last></
programlisting>
6330N/AThen you can define a mail attribute that uses the values of both attributes,
6330N/Aand an initials attribute that takes the first character of each.
6330N/A <
programlisting>mail: {givenName}.{sn}@[myDomain]
6330N/Ainitials: {givenName:1}{sn:1}</
programlisting>
6330N/AThe other kind of tag is delimited with <
literal><</
literal> and
6330N/A<
literal>></
literal>, as shown above in the example with
6330N/A<
literal><first></
literal> and <
literal><last></
literal>. Tag names
6330N/Aare not case sensitive. Many tags can take arguments separated by colons
6330N/A(<
literal>:</
literal>) from the tag names within the tag.
6330N/AUse backslashes to escape literal start tag characters
6330N/A(<
literal>< [ {</
literal>) as shown in the following example, and to escape
6330N/Aliteral end tag characters within tags (<
literal>> ] }</
literal>).
6330N/A <
programlisting>scimMail: \{"emails": \[\{"value": "{mail}", "primary": true\}\]\}
6330N/Axml: \<id\>{uid}\</id\></
programlisting>
6330N/AOpenDJ supports the following tags:
6330N/AThe DN tag gets replaced by the distinguished name of the current entry. An
6330N/Aoptional integer argument specifies the subcomponents of the DN to generate. For
6330N/Aexample, if the DN of the entry is
6330N/A<
literal>uid=bjensen,ou=People,dc=example,dc=com</
literal>
6330N/A<
literal><DN:1></
literal> gets replaced by
6330N/A<
literal>uid=bjensen</
literal>, and <
literal><DN:-2></
literal> gets
6330N/Areplaced by <
literal>dc=example,dc=com</
literal>.
6330N/AThe File tag gets replaced by a line from a text file you specify. The File tag
6330N/Atakes a required argument, the path to the text file, and an optional second
6330N/Aargument, either <
literal>random</
literal> or <
literal>sequential</
literal>. For
6330N/Athe file argument, either you specify an absolute path to the file such as
6330N/Asuch as <
literal><file:streets></
literal>. For the second argument, if you
6330N/Aspecify <
literal>sequential</
literal> then lines from the file are read in
6330N/Asequential order. Otherwise, lines from the file are read in random order.
6330N/AThe first name tag gets replaced by a random line from
6330N/Aof generated first and last names are unique, with integers appended to the
6330N/Aname strings if not enough combinations are available.
6330N/AThe GUID tag gets replaced by a 128-bit, type 4 (random) universally unique
6330N/Aidentifier, such as <
literal>f47ac10b-58cc-4372-a567-0e02b2c3d479</
literal>.
6330N/A <
term><IfAbsent></
term>
6330N/AThe IfAbsent tag takes as its first argument the name of another attribute, and
6330N/Aoptionally as its second argument a value to use. This tag causes the attribute
6330N/Ato be generated only if the named attribute is not present on the generated
6330N/Aentry. Use this tag when you have used <
literal><Presence></
literal> to
6330N/Adefine another attribute that is not always present on generated entries.
6330N/A <
term><IfPresent></
term>
6330N/AThe IfPresent takes as its first argument the name of another attribute, and
6330N/Aoptionally as its second argument a value to use. This tag causes the attribute
6330N/Ato be generated only if the named attribute is also present on the generated
6330N/Aentry. Use this tag when you have used <
literal><Presence></
literal> to
6330N/Adefine another attribute that is sometimes present on generated entries.
6330N/AThe last name tag gets replaced by a random line from
6330N/Agenerated first and last names are unique, with integers appended to the name
6330N/Astrings if not enough combinations are available.
6330N/AThe List tag gets replaced by one of the values from the list of arguments you
6330N/Aprovide. For example, <
literal><List:bronze:silver:gold></
literal> gets
6330N/Areplaced with <
literal>bronze</
literal>, <
literal>silver</
literal>, or
6330N/AYou can weight arguments to ensure some arguments are selected more often than
6330N/Aothers. For example, if you want two bronze for one silver and one gold, use
6330N/A<
literal><List:bronze;2:silver;1:gold;1></
literal>.
6330N/A <
term><ParentDN></
term>
6330N/AThe ParentDN tag gets replaced by the distinguished name of the parent entry.
6330N/AFor example, if the DN of the entry is
6330N/A<
literal>uid=bjensen,ou=People,dc=example,dc=com</
literal>,
6330N/A<
literal><ParentDN></
literal> gets replaced by
6330N/A<
literal>ou=People,dc=example,dc=com</
literal>.
6330N/A <
term><Presence></
term>
6330N/AThe Presence tag takes a percent argument. It does not get replaced by a value
6330N/Aitself, but instead results in the attribute being generated on the percentage
6330N/Aof entries you specify in the argument. For example,
6330N/A<
literal>description: <Presence:50>A description</
literal> generates
6330N/A<
literal>description: A description</
literal> on half the entries.
6330N/A <
term><Random></
term>
6330N/AThe Random tag lets you generate a variety of random numbers and strings. The
6330N/ARandom tag has the following subtypes, which you include as arguments, that is
6330N/A<
literal><Random:<
replaceable>subtype</
replaceable>></
literal>.
6330N/A<
literal>alpha:<
replaceable>length</
replaceable></
literal>
6330N/A<
literal>alpha:<
replaceable>minlength</
replaceable>:<
replaceable 6330N/A>maxlength</
replaceable></
literal>
6330N/A<
literal>numeric:<
replaceable>length</
replaceable></
literal>
6330N/A<
literal>numeric:<
replaceable>minvalue</
replaceable>:<
replaceable 6330N/A>maxvalue</
replaceable></
literal>
6330N/A<
literal>numeric:<
replaceable>minvalue</
replaceable>:<
replaceable 6330N/A>maxvalue</
replaceable>:<
replaceable>format</
replaceable></
literal>, where
6330N/A<
literal>alphanumeric:<
replaceable>length</
replaceable></
literal>
6330N/A<
literal>alphanumeric:<
replaceable>minlength</
replaceable>:<
replaceable 6330N/A>maxlength</
replaceable></
literal>
6330N/A<
literal>chars:<
replaceable>characters</
replaceable>:<
replaceable 6330N/A>length</
replaceable></
literal>
6330N/A<
literal>chars:<
replaceable>characters</
replaceable>:<
replaceable 6330N/A>minlength</
replaceable>:<
replaceable>maxlength</
replaceable></
literal>
6330N/A<
literal>hex:<
replaceable>length</
replaceable></
literal>
6330N/A<
literal>hex:<
replaceable>minlength</
replaceable>:<
replaceable 6330N/A>maxlength</
replaceable></
literal>
6330N/A<
literal>base64:<
replaceable>length</
replaceable></
literal>
6330N/A<
literal>base64:<
replaceable>minlength</
replaceable>:<
replaceable 6330N/A>maxlength</
replaceable></
literal>
6330N/A<
literal>month:<
replaceable>maxlength</
replaceable></
literal>
6330N/A<
literal>telephone</
literal>, a telephone number starting with the country code
6330N/AThe RDN tag gets replaced with the RDN of the entry. Use this in the template
6330N/Aafter you have specified <
literal>rdnAttr</
literal> so that the RDN has already
6330N/Abeen generated when this tag is replaced.
6330N/AAn optional integer argument specifies the subcomponents of the RDN to generate.
6330N/A <
term><Sequential></
term>
6330N/AThe Sequential tag gets replaced by a sequentially increasing generated integer.
6330N/AThe first optional integer argument specifies the starting number. The second
6330N/Aoptional boolean argument specifies whether to start over when generating
6330N/Aentries for a new parent entry. For example,
6330N/A<
literal><Sequential>:42:true</
literal> starts counting from 42, and
6330N/Astarts over when the parent entry changes from <
literal>o=Engineering</
literal>
6330N/Ato <
literal>o=Marketing</
literal>.
6330N/AThe _DN tag gets replaced by the DN of the current entry with underscores in the
6330N/A <
term><_ParentDN></
term>
6330N/AThe _ParentDN tag gets replaced by the DN the parent entry with underscores in
6330N/AThe following example generates 10 organization units, each containing 50
6330N/A <
programlisting language="ldif"><
![CDATA[ 6330N/Adefine suffix=dc=example,dc=com 6330N/AsubordinateTemplate: orgunit:[numorgs] 6330N/Adescription: This is the People container 6330N/AtelephoneNumber: +33 00010002 6330N/AsubordinateTemplate: person:[numusers] 6330N/AobjectClass: organizationalUnit 6330N/Adescription: This is the {ou} organizational unit 6330N/AobjectClass: organizationalPerson 6330N/Ainitials: {givenName:1}<random:chars:ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1} 6330N/AemployeeNumber: <sequential:0> 6330N/AtelephoneNumber: <random:telephone> 6330N/AhomePhone: <random:telephone> 6330N/Astreet: <random:numeric:5> <file:streets> Street 6330N/ApostalCode: <random:numeric:5> 6330N/ApostalAddress: {cn}${street}${l}, {st} {postalCode} 6330N/Adescription: This is the description for {cn}. 6330N/AAn example for an ldif template.
6330N/A <
refentrytitle>make-ldif</
refentrytitle>
6330N/A <
xi:
include href="common.xml" xpointer='xpointer(//manvolnum[@name="v1m"])'/>
6330N/A <
refentrytitle>opendj</
refentrytitle>