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