#########################################################################
# LDAP Synchronization Connector (LSC) - http://lsc-project.org         #
# Main configuration file                                               #
#########################################################################
# Most configuration parameters for LSC are in this file.
# All configuration files are located in this directory (etc)
#
# Configuration layout:
# - etc/ (this directory)
#	- lsc.properties (this file)
#		main configuration file
#	- logback.xml
#		configure logging to console, files and CSV/LDIF output
#	- sql-map-config.xml
#	- sql-map-config.d/
#		- <name>.xml
# 
# For ldap2ldap connectors, you only need to configure this file and
# logback.xml.
#########################################################################

##############################
# Destination LDAP directory #
##############################
# This section is mandatory since all synchronizations currently go to an LDAP directory.

# Connection URL. This must include a valid LDAP context.
dst.java.naming.provider.url = ldap://localhost:1389/dc=admbnet,dc=be

# Authentication type.
# "none" causes an anonymous bind. "simple" performs a standard bind.
dst.java.naming.security.authentication = simple

# Bind DN to use if authentication type is "simple"
dst.java.naming.security.principal = cn=Directory Manager

# Bind password to use if authentication type is "simple"
dst.java.naming.security.credentials = XXXX

# Follow referrals in searches?
# Allowed values are "ignore", "follow".
dst.java.naming.referral = ignore

# Dereference aliases in searches?
# Allowed values are "never", "search", "find", "always"
dst.java.naming.ldap.derefAliases = never

# Standard properties. These should not be changed.
dst.java.naming.factory.initial = com.sun.jndi.ldap.LdapCtxFactory
dst.java.naming.ldap.version = 3

#########################
# Source LDAP directory #
#########################
# This section can safely be deleted if you are not using ldap2ldap synchronization.

# Connection URL. This must include a valid LDAP context.
src.java.naming.provider.url = ldap://172.16.200.151:389/DC=admbnet,DC=be

# Authentication type.
# "none" causes an anonymous bind. "simple" performs a standard bind.
src.java.naming.security.authentication = simple

# Bind DN to use if authentication type is "simple"
# tijdelijk 1 ou voor test redenenen, de andere ou's moeten er nog bij komen.
src.java.naming.security.principal = CN=oidadmin,OU=DBA,ou=LAN-WAN,ou=informatica,DC=admbnet,DC=be

# Bind password to use if authentication type is "simple"
src.java.naming.security.credentials = XXXX

# Follow referrals in searches?
# Allowed values are "ignore", "follow".
src.java.naming.referral = ignore

# Dereference aliases in searches?
# Allowed values are "never", "search", "find", "always"
src.java.naming.ldap.derefAliases = never

# Standard properties. These should not be changed.
src.java.naming.factory.initial = com.sun.jndi.ldap.LdapCtxFactory
src.java.naming.ldap.version = 3

src.java.naming.ldap.pageSize = 1000

#######################
# Tasks configuration #
#######################
# This section defines the synchronization tasks for LSC.

# List of defined tasks, seperated by commas
# Hier geef je de volgorde van de tasks op. Meerdere tasks is dus mogelijk.
# BVB
# lsc.tasks = FirstTask, SecondTask
lsc.tasks = Informatica, Afwezigheidscontrole

# Java class name for the LDAP objectClass to compare source and destination objects
# This should be the LDAP objectClass of entries in the destination directory
lsc.tasks.Informatica.bean = org.lsc.beans.SimpleBean

# Construct a DN for new entries in the destination directory
# This is a JavaScript expression, and can access any utility functions and the srcBean.
# It should be relative to the LDAP context specified in dst.java.naming.provider.url
lsc.tasks.Informatica.dn = "cn=" + srcBean.getAttributeValueById("samaccountname").toUpperCase() + ",cn=users"

# Java class name for the service to read objects from the source
# Either "org.lsc.jndi.SimpleJndiSrcService" for ldap2ldap, or
# "org.lsc.service.SimpleJdbcSrcService" for db2ldap
# According to which service you use here, you only need *one* of the following sections
lsc.tasks.Informatica.srcService = org.lsc.jndi.SimpleJndiSrcService

### SimpleJndiSrcService parameters
# The parameters in this section only apply to the SimpleJndiSrcService
# This section can safely be deleted if you are not using ldap2ldap synchronization.

# Base DN for searches in the directory
lsc.tasks.Informatica.srcService.baseDn = OU="Informatica"

# Filter to list all entries to synchronize
# Dit type is een standaard en zal normaal niet wijzigen.  samaccounttype=805306368
lsc.tasks.Informatica.srcService.filterAll = (&(objectClass=user)(sAMAccountType=805306368)(samaccountname=inflspe))

# Attributes to read from all entries used to match objects between source and destination
lsc.tasks.Informatica.srcService.pivotAttrs = samaccountname 

# Filter to read one entry to synchronize, based on pivotAttrs above
# This filter may contain one or several pivotAttrs defined above, like "{attributeName}"
lsc.tasks.Informatica.srcService.filterId = (samaccountname={samaccountname})

# Attributes to read from each entry used to read and write data
lsc.tasks.Informatica.srcService.attrs = sn objectClass displayName name samaccountname department mail mobile userprincipalname 
### END of SimpleJndiSrcService parameters

# Java class name for the service to read and write objects in the destination
# Usually "org.lsc.jndi.SimpleJndiDstService".
lsc.tasks.Informatica.dstService = org.lsc.jndi.SimpleJndiDstService

### SimpleJndiDstService parameters
# The parameters in this section only apply to the SimpleJndiDstService

# Base DN for searches in the directory
lsc.tasks.Informatica.dstService.baseDn = cn=users

# Filter to list all entries to synchronize
# Al de users die de class orcladuser hebben moet je synchroniseren. De andere zijn pure OpenDj users.
lsc.tasks.Informatica.dstService.filterAll = (&(objectClass=orcladuser)(sAMAccountType=805306368)(cn=inflspe))

# Attributes to read from all entries used to match objects between source and destination
lsc.tasks.Informatica.dstService.pivotAttrs = samaccountname 

# Filter to read one entry to synchronize, based on pivotAttrs above
# This filter may contain one or several pivotAttrs defined above, like "{attributeName}"
lsc.tasks.Informatica.dstService.filterId = (samaccountname={samaccountname})

# Attributes to read from each entry used to read and write data
lsc.tasks.Informatica.dstService.attrs = sn objectClass displayName name samaccountname orclsamaccountname department mail mobile userprincipalname orcluserprincipalname uid nationalidnumber nationalidnumbervalidated

### END of SimpleJndiDstService parameters

#############################
# Syncoptions configuration #
#############################
# This section defines synchronization rules for each task, attribute by attribute

# Define the implementation to use. PropertiesBasedSyncOptions is usually what you want.
# The only current alternative is ForceSyncOptions, which don't take any configuration.
lsc.syncoptions.Informatica = org.lsc.beans.syncoptions.PropertiesBasedSyncOptions

# Set default behavior for all attributes not explicitly specified below
# Available actions are:
#	- K for Keep: don't change existing values in the destination
#		(create and default values from syncoptions may be applied, though)
#	- F for Force: replace values in the destination with our values
#		(from source, or force values in syncoptions)
#	- M for Merge: add values to multi-valued attributes
#		(from source, or create/default/force values in syncoptions)
# See documentation at http://lsc-project.org/wiki/documentation/1.2/configuration/syncoptions
#3 mogelijkheden : K = Keep data. F = laat wijzigingen toe aan de data (update,create,delete). M = Merge 
lsc.syncoptions.Informatica.default.action = F

# Set default delimiter for multiple values for an attribute.
# This is normally a semi-colon (;) but can be problematic when writing complex JavaScript
lsc.syncoptions.Informatica.default.delimiter = $

# syncoption for the samaccountname attribute: force update, and put value from source in capitals
lsc.syncoptions.Informatica.samaccountname.force_value = srcBean.getAttributeValueById("samaccountname").toUpperCase()

lsc.syncoptions.Informatica.sn.default_value = srcBean.getAttributeValueById("displayName")

# syncoption for the ds-pwp-password-policy-dn attribute: provide a password policy,
lsc.syncoptions.Informatica.ds-pwp-password-policy-dn.default_value = "cn=AD PTA Policy,cn=Password Policies,cn=config"

lsc.syncoptions.Informatica.objectclass.force_value = "top"$"person"$"organizationalPerson"$"user"$"orcladuser"$"userattributeclass"

lsc.syncoptions.Informatica.orclsamaccountname.create_value = srcBean.getAttributeValueById("samaccountname")
lsc.syncoptions.Informatica.uid.create_value = srcBean.getAttributeValueById("samaccountname")
lsc.syncoptions.Informatica.orcluserprincipalname.create_value = srcBean.getAttributeValueById("mail")
lsc.syncoptions.Informatica.nationalidnumber.create_value = " "
lsc.syncoptions.Informatica.nationalidnumbervalidated.create_value = " "

*******************************
* Afwezigheidscontrole   *
*******************************

lsc.tasks.Afwezigheidscontrole.bean = org.lsc.beans.SimpleBean
lsc.tasks.Afwezigheidscontrole.dn = "cn=" + srcBean.getAttributeValueById("samaccountname").toUpperCase() + ",cn=users"
lsc.tasks.Afwezigheidscontrole.srcService = org.lsc.jndi.SimpleJndiSrcService
lsc.tasks.Afwezigheidscontrole.srcService.baseDn = OU="ADMB Afwezigheidscontrole"
lsc.tasks.Afwezigheidscontrole.srcService.filterAll = (&(objectClass=user)(sAMAccountType=805306368)(samaccountname=inflspe))
lsc.tasks.Afwezigheidscontrole.srcService.pivotAttrs = samaccountname 
lsc.tasks.Afwezigheidscontrole.srcService.filterId = (samaccountname={samaccountname})
lsc.tasks.Afwezigheidscontrole.srcService.attrs = sn objectClass displayName name samaccountname department mail mobile userprincipalname 
lsc.tasks.Afwezigheidscontrole.dstService = org.lsc.jndi.SimpleJndiDstService
lsc.tasks.Afwezigheidscontrole.dstService.baseDn = cn=users
lsc.tasks.Afwezigheidscontrole.dstService.filterAll = (&(objectClass=orcladuser)(cn=inflspe))
lsc.tasks.Afwezigheidscontrole.dstService.pivotAttrs = samaccountname 
lsc.tasks.Afwezigheidscontrole.dstService.filterId = (samaccountname={samaccountname})
lsc.tasks.Afwezigheidscontrole.dstService.attrs = sn objectClass displayName name samaccountname orclsamaccountname department mail mobile userprincipalname orcluserprincipalname uid krbprincipalname nationalidnumber nationalidnumbervalidated
lsc.syncoptions.Afwezigheidscontrole = org.lsc.beans.syncoptions.PropertiesBasedSyncOptions
lsc.syncoptions.Afwezigheidscontrole.default.action = F
lsc.syncoptions.Afwezigheidscontrole.default.delimiter = $
lsc.syncoptions.Afwezigheidscontrole.samaccountname.force_value = srcBean.getAttributeValueById("samaccountname").toUpperCase()
lsc.syncoptions.Afwezigheidscontrole.sn.default_value = srcBean.getAttributeValueById("displayName")
lsc.syncoptions.Afwezigheidscontrole.ds-pwp-password-policy-dn.default_value = "cn=AD PTA Policy,cn=Password Policies,cn=config"
lsc.syncoptions.Afwezigheidscontrole.objectclass.force_value = "top"$"person"$"organizationalPerson"$"user"$"orcladuser"$"userattributeclass"
lsc.syncoptions.Afwezigheidscontrole.orclsamaccountname.create_value = srcBean.getAttributeValueById("samaccountname")
lsc.syncoptions.Informatica.uid.create_value = srcBean.getAttributeValueById("samaccountname")
lsc.syncoptions.Informatica.orcluserprincipalname.create_value = srcBean.getAttributeValueById("mail")
lsc.syncoptions.Afwezigheidscontrole.nationalidnumber.create_value = " "
lsc.syncoptions.Afwezigheidscontrole.nationalidnumbervalidated.create_value = " "
