0N/A<?
xml version="1.0" encoding="UTF-8"?>
0N/A ! This work is licensed under the Creative Commons 0N/A ! Attribution-NonCommercial-NoDerivs 3.0 Unported License. 0N/A ! To view a copy of this license, visit 0N/A ! or send a letter to Creative Commons, 444 Castro Street, 0N/A ! Suite 900, Mountain View, California, 94041, USA. 0N/A ! You can also obtain a copy of the license at 0N/A ! See the License for the specific language governing permissions 0N/A ! and limitations under the License. 0N/A ! If applicable, add the following below this CCPL HEADER, with the fields 0N/A ! enclosed by brackets "[]" replaced with your own identifying information: 1472N/A ! Portions Copyright [yyyy] [name of copyright owner] 0N/A ! Copyright 2012-2015 ForgeRock AS. 1879N/A<
refentry xml:
id='make-ldif-template-5' 1879N/A version='5.0' xml:
lang='en' 1879N/A <
info><
copyright><
year>2012-2015</
year><
holder>ForgeRock AS.</
holder></
copyright></
info>
0N/A <
refmiscinfo class="software">OpenDJ</
refmiscinfo>
0N/A <
refmiscinfo class="version"><?
eval ${
docTargetVersion}?></
refmiscinfo>
0N/A <
refpurpose>template file for the make-ldif command</
refpurpose>
0N/A <
synopsis># Comment lines start with #.
0N/A# Notice that this synopsis includes blank lines after entries.
0N/A# In the same way you would use blank lines after entries in normal LDIF,
0N/A# leave empty lines after "entries" in template files.
0N/A# Optionally include classes that define custom tags.
0N/A# must be on the class path when you run make-ldif.
0N/A# Optionally define constants used in the template.
0N/A# To reference constants later, put brackets around the name: [constant-name]
0N/Adefine <
replaceable>constant-name</
replaceable>=<
replaceable>value</
replaceable>
0N/A# Define branches by suffix DN, such as the following:
0N/A# ou=People,dc=example,dc=com
0N/A# ou=Groups,dc=example,dc=com
0N/A# make-ldif generates the necessary object class definitions and RDNs.
0N/A# A branch can have subordinateTemplates that define templates to use for
0N/A# A branch can have additional attributes generated on the branch entry. See
0N/A# the Description below for more information on specifying attribute values.
0N/Abranch: <
replaceable>suffix-dn</
replaceable>
0N/A[subordinateTemplate: <
replaceable>template-name</
replaceable>:<
replaceable>number</
replaceable>
0N/A[<
replaceable>attribute</
replaceable>: <
replaceable>attr-value</
replaceable>
0N/A# Define entries using templates.
0N/A# A template can extend another template.
0N/A# A template defines the RDN attribute(s) used for generated entries.
0N/A# A template can have a subordinateTemplate that defines a template to use for
0N/A# the generated entries.
0N/A# A template then defines attributes. See the Description below for more
0N/A# information on specifying attribute values.
4132N/Atemplate: <
replaceable>template-name</
replaceable>
0N/A[extends: <
replaceable>template-name</
replaceable>]
0N/ArdnAttr: <
replaceable>attribute</
replaceable>[+<
replaceable>attribute</
replaceable> ...]
0N/A[subordinateTemplate: <
replaceable>template-name</
replaceable>:<
replaceable>number</
replaceable>]
0N/A[<
replaceable>attribute</
replaceable>: <
replaceable>attr-value</
replaceable>
0N/A <
title>Description</
title>
0N/A <
para>Template files specify how to build LDIF. They allow you to define
0N/A variables, insert random values from other files, and generally build
0N/A arbitrarily large LDIF files for testing purposes. You pass template files
0N/A to the <
command>make-ldif</
command> command when generating LDIF.</
para>
0N/A <
para>The Synopsis above shows the layout for a <
command>make-ldif</
command>
0N/A template file. This section focuses on what you can do to specify entry
0N/A attribute values, called <
replaceable>attr-value</
replaceable> in the Synopsis
0N/A <
title>Specifying Attribute Values</
title>
0N/A <
para>When specifying attribute values in <
command>make-ldif</
command>
0N/A templates, you can use static text and constants that you have defined,
0N/A enclosing names for constants in brackets, <
literal>[myConstant]</
literal>.
0N/A You can use more than one constant per line, as in the following
0N/A <
programlisting language="ldif" 0N/A >description: Description for [org] under [suffix]</
programlisting>
0N/A <
para>You can also use two kinds of tags when specifying attribute values.
0N/A One kind of tag gets replaced with the value of another attribute in the
0N/A generated entry. Such tags are delimited with braces, <
literal>{ }</
literal>.
0N/A For example, if your template includes definitions for first name and last
0N/A name attributes:</
para>
0N/A <
programlisting language="ldif">givenName: <first>
0N/Asn: <last></
programlisting>
0N/A <
para>Then you can define a mail attribute that uses the values of both
0N/A attributes, and an initials attribute that takes the first character
0N/A <
programlisting language="ldif">mail: {givenName}.{sn}@[myDomain]
0N/Ainitials: {givenName:1}{sn:1}</
programlisting>
0N/A <
para>The other kind of tag is delimited with <
literal><</
literal>
0N/A and <
literal>></
literal>, as shown above in the example with
0N/A <
literal><first></
literal> and <
literal><last></
literal>.
0N/A Tag names are not case sensitive. Many tags can take arguments separated
0N/A by colons, <
literal>:</
literal>, from the tag names within the tag.</
para>
0N/A <
para>Use backslashes to escape literal start tag characters (<
literal 0N/A >< [ {</
literal>) as shown in the following example, and to escape literal
0N/A end tag characters within tags (<
literal>> ] }</
literal>).</
para>
0N/A <
programlisting language="ldif" 0N/A >scimMail: \{"emails": \[\{"value": "{mail}", "type": "work", "primary": true}]}
0N/Axml: \<id>{uid}\</id></
programlisting>
0N/A <
para>OpenDJ supports the following tags.</
para>
0N/A <
term><DN></
term>
0N/A <
para>The DN tag gets replaced by the distinguished name of the current
0N/A entry. An optional integer argument specifies the subcomponents of the DN
0N/A to generate. For example, if the DN of the entry is
0N/A <
literal>uid=bjensen,ou=People,dc=example,dc=com</
literal>
0N/A <
literal><DN:1></
literal> gets replaced by
0N/A <
literal>uid=bjensen</
literal>, and <
literal><DN:-2></
literal> gets
0N/A replaced by <
literal>dc=example,dc=com</
literal>.</
para>
0N/A <
term><File></
term>
0N/A <
para>The File tag gets replaced by a line from a text file you specify.
0N/A The File tag takes a required argument, the path to the text file, and an
0N/A optional second argument, either <
literal>random</
literal> or
0N/A <
literal>sequential</
literal>. For the file argument, either you specify
0N/A an absolute path to the file such as
0N/A a path relative to the
0N/A <
literal><file:streets></
literal>. For the second argument,
0N/A if you specify <
literal>sequential</
literal> then lines from the file are
0N/A read in sequential order. Otherwise, lines from the file are read in
0N/A random order.</
para>
0N/A <
term><First></
term>
0N/A <
para>The first name tag gets replaced by a random line from
0N/A Combinations of generated first and last names are unique, with integers
0N/A appended to the name strings if not enough combinations are
0N/A <
term><GUID></
term>
0N/A <
para>The GUID tag gets replaced by a 128-bit, type 4 (random) universally
0N/A unique identifier, such as
0N/A <
literal>f47ac10b-58cc-4372-a567-0e02b2c3d479</
literal>.</
para>
0N/A <
term><IfAbsent></
term>
0N/A <
para>The IfAbsent tag takes as its first argument the name of another
0N/A attribute, and optionally as its second argument a value to use. This tag
0N/A causes the attribute to be generated only if the named attribute is not
0N/A present on the generated entry. Use this tag when you have used
0N/A <
literal><Presence></
literal> to define another attribute that is
0N/A not always present on generated entries.</
para>
0N/A <
term><IfPresent></
term>
0N/A <
para>The IfPresent takes as its first argument the name of another
0N/A attribute, and optionally as its second argument a value to use. This tag
0N/A causes the attribute to be generated only if the named attribute is also
0N/A present on the generated entry. Use this tag when you have used
0N/A <
literal><Presence></
literal> to define another attribute that is
0N/A sometimes present on generated entries.</
para>
0N/A <
term><Last></
term>
0N/A <
para>The last name tag gets replaced by a random line from
0N/A Combinations of generated first and last names are unique, with integers
0N/A appended to the name strings if not enough combinations are
0N/A <
term><List></
term>
0N/A <
para>The List tag gets replaced by one of the values from the list of
0N/A arguments you provide. For example,
0N/A <
literal><List:bronze:silver:gold></
literal> gets replaced with
0N/A <
literal>bronze</
literal>, <
literal>silver</
literal>, or
0N/A <
literal>gold</
literal>.</
para>
0N/A <
para>You can weight arguments to ensure some arguments are selected more
0N/A often than others. For example, if you want two bronze for one silver
0N/A <
literal><List:bronze;2:silver;1:gold;1></
literal>.</
para>
0N/A <
term><ParentDN></
term>
0N/A <
para>The ParentDN tag gets replaced by the distinguished name of the
0N/A parent entry. For example, if the DN of the entry is
0N/A <
literal>uid=bjensen,ou=People,dc=example,dc=com</
literal>,
0N/A <
literal><ParentDN></
literal> gets replaced by
0N/A <
literal>ou=People,dc=example,dc=com</
literal>.</
para>
0N/A <
term><Presence></
term>
0N/A <
para>The Presence tag takes a percent argument. It does not get replaced
0N/A by a value itself, but instead results in the attribute being generated
0N/A on the percentage of entries you specify in the argument. For example,
0N/A <
literal>description: <Presence:50>A description</
literal> generates
0N/A <
literal>description: A description</
literal> on half the entries.</
para>
0N/A <
term><Random></
term>
0N/A <
para>The Random tag lets you generate a variety of random numbers and
0N/A strings. The Random tag has the following subtypes, which you include
0N/A as arguments, that is <
literal><Random:<
replaceable 0N/A >subtype</
replaceable>></
literal>.</
para>
0N/A <
para><
literal>alpha:<
replaceable>length</
replaceable></
literal></
para>
0N/A <
para><
literal>alpha:<
replaceable>minlength</
replaceable>:<
replaceable 0N/A >maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>numeric:<
replaceable>length</
replaceable></
literal></
para>
0N/A <
para><
literal>numeric:<
replaceable>minvalue</
replaceable>:<
replaceable 0N/A >maxvalue</
replaceable></
literal></
para>
0N/A <
para><
literal>numeric:<
replaceable>minvalue</
replaceable>:<
replaceable 0N/A >maxvalue</
replaceable>:<
replaceable>format</
replaceable></
literal>,
0N/A where <
replaceable>format</
replaceable> is a
0N/A <
para><
literal>alphanumeric:<
replaceable>length</
replaceable></
literal></
para>
0N/A <
para><
literal>alphanumeric:<
replaceable>minlength</
replaceable>:<
replaceable 0N/A >maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>chars:<
replaceable>characters</
replaceable>:<
replaceable 0N/A >length</
replaceable></
literal></
para>
0N/A <
para><
literal>chars:<
replaceable>characters</
replaceable>:<
replaceable 0N/A >minlength</
replaceable>:<
replaceable>maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>hex:<
replaceable>length</
replaceable></
literal></
para>
0N/A <
para><
literal>hex:<
replaceable>minlength</
replaceable>:<
replaceable 0N/A >maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>base64:<
replaceable>length</
replaceable></
literal></
para>
0N/A <
para><
literal>base64:<
replaceable>minlength</
replaceable>:<
replaceable 0N/A >maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>month</
literal></
para>
0N/A <
para><
literal>month:<
replaceable>maxlength</
replaceable></
literal></
para>
0N/A <
para><
literal>telephone</
literal>, a telephone number starting with
0N/A the country code <
literal>+1</
literal></
para>
1080N/A <
para>The RDN tag gets replaced with the RDN of the entry. Use this
0N/A in the template after you have specified <
literal>rdnAttr</
literal> so
0N/A that the RDN has already been generated when this tag is replaced.</
para>
0N/A <
para>An optional integer argument specifies the subcomponents of the RDN
0N/A <
term><Sequential></
term>
0N/A <
para>The Sequential tag gets replaced by a sequentially increasing
0N/A generated integer. The first optional integer argument specifies the
0N/A starting number. The second optional boolean argument specifies whether
0N/A to start over when generating entries for a new parent entry. For example,
0N/A <
literal><Sequential>:42:true</
literal> starts counting from 42,
0N/A and starts over when the parent entry changes from
0N/A <
literal>o=Engineering</
literal> to <
literal>o=Marketing</
literal>.</
para>
0N/A <
term><_DN></
term>
0N/A <
para>The _DN tag gets replaced by the DN of the current entry with
0N/A underscores in the place of commas.</
para>
4132N/A <
term><_ParentDN></
term>
4132N/A <
para>The _ParentDN tag gets replaced by the DN the parent entry with
4132N/A underscores in the place of commas.</
para>
0N/A <
title>Examples</
title>
0N/A <
para>The following example generates 10 organization units, each containing
113N/A <
programlisting language="plain"><
![CDATA[define suffix=dc=example,dc=com 1541N/AsubordinateTemplate: orgunit:[numorgs] 3910N/Adescription: This is the People container 3910N/AtelephoneNumber: +33 00010002 0N/AsubordinateTemplate: person:[numusers] 0N/Aou: Org-<sequential:0> 0N/AobjectClass: organizationalUnit 0N/Adescription: This is the {ou} organizational unit 0N/AobjectClass: organizationalPerson 0N/AobjectClass: inetOrgPerson 0N/Ainitials: {givenName:1}<random:chars:ABCDEFGHIJKLMNOPQRSTUVWXYZ:1>{sn:1} 0N/AemployeeNumber: <sequential:0> 0N/Auid: user.{employeeNumber} 0N/Amail: {uid}@[maildomain] 0N/AuserPassword: password 0N/AtelephoneNumber: <random:telephone> 0N/AhomePhone: <random:telephone> 0N/Apager: <random:telephone> 0N/Amobile: <random:telephone> 0N/Astreet: <random:numeric:5> <file:streets> Street 0N/ApostalCode: <random:numeric:5> 0N/ApostalAddress: {cn}${street}${l}, {st} {postalCode} 0N/Adescription: This is the description for {cn}.]]></
programlisting>
3910N/A <
para><
link xlink:
href="reference#make-ldif-1" 0N/A >make-ldif</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry></
link