Template Parser

This information is only available in English.

This document will describe the behavior and options for the Template Parser, which renders the estos MetaDirectory web server templates. It will provide you with a brief introduction to how the parser handles commands and which options will be available with the command. Even if short samples have been included, you will understand the context much better when you look closer at the templates provided along with estos MetaDirectory.

Parser Behavior

All white space will be deleted when parsing the template file.
If you feel you are in need of a white space use instead.
This was done to increase the page transfer rate.

Command Composition

Each parser command has the following organization:
 
<!-- < fieldname attribute="value" attribute="value" att..>-->
 
Fieldname describes the database field. The attributes indicate how the field, the data and the associated field name must be parsed.

Known estos MetaDirectory databasefields
CommandDatabase fieldLDAP field
<!-- <Databasename/> -->Database namedatabaseName
<!-- <Distinguishedname/> -->Distinguished namedistinguishedName
<!-- <DatabaseID/> -->DatabaseIDentryIDDB
<!-- <StoreID/> -->StoreIDentryIDStore
<!-- <EntryID/> -->EntryIDentryID
<!-- <Displayname/> -->Display namedisplayName
<!-- <Firstname/> -->First namegivenName
<!-- <Lastname/> -->Last namesn
<!-- <Title/> -->Titletitle
<!-- <Company/> -->Companycompany
<!-- <Department/> -->Departmentdepartment
<!-- <Officeroomnumber/> -->Office room numberphysicalDeliveryOfficeName
<!-- <Businessaddressstreet/> -->Company street addressstreetAddress
<!-- <Businessaddresspostalcode/> -->Company ZIP codepostalCode
<!-- <Businessaddresscity/> -->Company cityl
<!-- <Businessaddressstate/> -->Company statest
<!-- <Businessaddresscountry/> -->Company countryc
<!-- <Privateaddressstreet/> -->Personal street addressprivateAddressStreet
<!-- <Privateaddresspostalcode/> -->Personal ZIP codeprivateAddressPostalCode
<!-- <Privateaddresscity/> -->Personal cityprivateAddressCity
<!-- <Privateaddressstate/> -->Personal stateprivateAddressState
<!-- <Privateaddresscountry/> -->Personal countryprivateAddressCountry
<!-- <Otheraddressstreet/> -->Miscellaneous street addressotherAddressStreet
<!-- <Otheraddresspostalcode/> -->Miscellaneous ZIP codeotherAddressPostalCode
<!-- <Otheraddresscity/> -->Miscellaneous cityotherAddressCity
<!-- <Otheraddressstate/> -->Miscellaneous stateotherAddressState
<!-- <Otheraddresscountry/> -->Miscellaneous countryotherAddressCountry
<!-- <EMail/> -->Emailmail
<!-- <EMail2/> -->E-Mail 2mail2
<!-- <EMail3/> -->E-Mail 3mail3
<!-- <SIPadress/> -->SIP addresssipAddress
<!-- <WebpageURL/> -->Web page URLurl
<!-- <Phonebusiness/> -->Company phonetelephoneNumber
<!-- <Phonebusiness2/> -->Secondary company phoneotherTelephone
<!-- <Companymaintelephone/> -->Company main telephonetelephoneNumberCompanyMain
<!-- <Assistanttelephone/> -->Assistant's telephonetelephoneAssistant
<!-- <Phonehome/> -->Home phonehomephone
<!-- <Phonehome2/> -->Secondary home phoneotherHomePhone
<!-- <Primarytelephone/> -->Primary telephonetelephonePrimary
<!-- <Phonemobile/> -->Cell phonemobile
<!-- <Cartelephone/> -->Car telephonetelephoneCar
<!-- <Radiotelephone/> -->Radio telephonetelephoneRadio
<!-- <Phonepager/> -->Pager phone numberpager
<!-- <Callbacktelephone/> -->Callback telephonetelephoneCallback
<!-- <ISDNtelephone/> -->ISDN telephonetelephoneISDN
<!-- <TTYTTDtelephone/> -->TTYTTD telephonetelephoneTTYTTD
<!-- <Facsimilebusiness/> -->Company fax numberfacsimileTelephoneNumber
<!-- <Facsimilehome/> -->Home fax numberotherFacsimileTelephoneNumber
<!-- <CustomerID/> -->Customer IDcustomerid
<!-- <Directweblink/> -->Direct web linkdirectWebLink
<!-- <Directopencontact/> -->Direct open contactdirectOpenContact
<!-- <Comment/> -->Commentinfo
<!-- <Custom0/> -->Custom 0custom0
<!-- <Custom1/> -->Custom 1custom1
<!-- <Custom2/> -->Custom 2custom2
<!-- <Custom3/> -->Custom 3custom3
<!-- <Custom4/> -->Custom 4custom4
<!-- <Custom5/> -->Custom 5custom5
<!-- <Custom6/> -->Custom 6custom6
<!-- <Custom7/> -->Custom 7custom7
<!-- <Custom8/> -->Custom 8custom8
<!-- <Custom9/> -->Custom 9custom9
<!-- <ContactURL/> -->URL for editing the contactcontactURL
<!-- <ContactURLDescription/> -->Description for the 1. contactURLcontactURLDescription
<!-- <ContactURL2/> -->Secondary URL for opening the contactcontactURL2
<!-- <ContactURLDescription2/> -->Secondary contact URL descriptioncontactURLDescription2
<!-- <ContactURL3/> -->Tertiary URL for opening the contactcontactURL3
<!-- <ContactURLDescription3/> -->Tertiary contact URL descriptioncontactURLDescription3
<!-- <ContactPictureMeta/> -->Will embed the picture for this contactjpegPhoto
<!-- <ContactPicturePath/> -->Contains a path to the picture, if configured from the replicatorimagePath


Parser Commands and Attributes
CommandPotential ValuesDescription
fieldvalue 0/1
<!-- <LastName fieldvalue="1"/> -->
Smith

The parser drops the associated field value

fieldname 0/1
<!-- <LastName fieldname="1"/> -->
Last name

The parser drops the associated field name in the language corresponding to the page the user is viewing

skipifemptyvalue 0/1
<!-- <LastName skipifemptyvalue="1" fieldname="1" fieldvalue="1"/> -->
If LastName exists in the database:
Last name:Smith

If LastName is empty the parser will not add "Last name:" to the output

formatvalue The parser will format the field value according to the format specified by the possible values
plain
<!-- <Company fieldvalue="1" formatvalue="plain" /> -->
+4912345678
phonelink
<!-- <Phonebusiness fieldvalue="1" formatvalue="phonelink" /> -->
+4912345678

The phonelink handler can be defined from the estos MetaDirectory Administrator.

maillink
<!-- <EMail fieldvalue="1" formatvalue="maillink" /> -->
info@estos.com
siplink
<!-- <Custom0 fieldvalue="1" formatvalue="siplink" /> -->
info@estos.com
httplink
<!-- <WebPageURL fieldvalue="1" formatvalue="httplink" /> -->
http://www.estos.com
uri
<!-- <WebPageURL fieldvalue="1" formatvalue="uri" /> -->
Format an href plainly, without additional formatting.
uriblank
<!-- <WebPageURL fieldvalue="1" formatvalue="uriblank" /> -->
Format an href with target='_blank', without additional formatting.
custom
<!-- <Custom0 formatvalue="custom" customformat="<a href='http://intranet/accounting/opencontact.php?%value%&view=1'>Open customer accounting</a>"/> -->
Open customer accounting

You can easily connect your web-based CRM software using custom links
You can use the following placeholders to get the appropriate data:

  • %name% - for the field name
  • %value% - for the field value
  • %phonelink% - for the dial handler prefix
prefix any
apart <!-- or -->
<!-- <LastName fieldname="1" prefix="<b>"/> -->
Last name

The parser will add a prefix to the value and/or name content

suffix any
apart <!-- or -->
<!-- <LastName fieldvalue="1" suffix="..."/> -->
Smith...

The parser will add a suffix to the value and/or name content

prefixname any
apart <!-- or -->
<!-- <LastName fieldname="1" prefixname="->"/> -->
->Last name

The parser will add a prefix to the name of the database field

suffixname any
apart <!-- or -->
<!-- <LastName fieldname="1" fieldvalue="1" suffixname=": "/> -->
Last name: Smith

The parser will add a suffix to the name of the database field

prefixvalue any
apart <!-- or -->
<!-- <LastName fieldname="1" fieldvalue="1" prefixvalue=": "/> -->
Last name: Smith

The parser will add a prefix to the value of the database field

suffixvalue any
apart <!-- or -->
<!-- <LastName fieldvalue="1" suffixvalue="..."/> -->
Smith...

The parser will add a suffix to the value of the database field

prefixvaluenotempty any
apart <!-- or -->
<!-- <LastName fieldname="1" fieldvalue="1" prefixvaluenotempty=": "/> -->
Last name: Smith

The parser will add a prefix to the value of the database field, if it is not empty

suffixvaluenotempty any
apart <!-- or -->
<!-- <LastName fieldvalue="1" suffixvaluenotempty="..."/> -->
Smith...

The parser will add a suffix to the value of the database field, if it is not empty

configvalue any
apart <!-- or -->
<!-- <fullresulttemplate configvalue="fullresult"/> -->
This attribute contains a special configuration value for the server. This attribute is used to configure of mail page template.
limitvaluelength Integer 1 - n
<!-- <LastName fieldvalue="1" limitvaluelength="32"/> -->
Limits the length of the result value.

Conditional statements
TagDescription
if
<!-- <if condition="1"/> -->
The condition is evaluated and the following text block will be included if the statement evaluates to 1.
All fields from the template parser will be available in the statement.

Examples:
<!-- <if condition="UserAgent=='*Mozilla*'"/> -->
<!-- <endif/> -->
<!-- <if condition="Lastname=='Anders*' AND Firstname=='Tom*'"/> -->
<!-- <endif/> -->
elseif
<!-- <elseif condition="1"/> -->
The condition is evaluated and the following text block will be included if the statement evaluates to 1.

Examples:
<!-- <if condition="UserAgent=='*Mozilla*'"/> -->
<!-- <elseif condition="UserAgent=='*Opera*''"/> -->
<!-- <endif/> -->
else
<!-- <else/> -->
The following text block will be included, if the corresponding IF-statement did not evaluate to 1.

Examples:
<!-- <if condition="UserAgent=='*Mozilla*'"/> -->
<!-- <else/> -->
<!-- <endif/> -->
endif
<!-- <endif/> -->
Indicates the end of the IF-condition block.

Version 4.0