Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display LDIF contents in a Tree Hierarchy

 
raga menon
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nathan,

Thanks for your reply.

In my ldif file each and every dn ends with dc=foo, dc=bar. how could i parse this and make it as Root node and child nodes and properties of each dn is displayed by splitting the frame. in one frame all Root dn, child dn should be display in a tree hierarchy and in another frame if i click on root node the its porperties are displayed on another frame.(properties are createtimestamp, dc,modifiersname etc.. )

for example following is LDIF file :

dn: dc=foo,dc=bar
createTimestamp: 20060530115557.500Z
dc: foo
modifiersName: cn=Directory Manager
creatorsName: cn=Directory Manager
modifyTimestamp: 20060530115557.500Z
objectclass: top
objectclass: domain

dn: ou=services,dc=foo,dc=bar
createTimestamp: 20060530120040.274Z
modifiersName: cn=Directory Manager
modifyTimestamp: 20060530120040.274Z
creatorsName: cn=Directory Manager
ou: services
objectclass: top
objectclass: organizationalunit

dn: ou=aaa,ou=services,dc=foo,dc=bar
createTimestamp: 20060530120053.649Z
modifiersName: cn=Directory Manager
modifyTimestamp: 20060530121725.967Z
creatorsName: cn=Directory Manager
ou: aaa
description: Dialin Services
objectclass: organizationalUnit

dn: ou=clients,ou=aaa,ou=services,dc=foo,dc=bar
createTimestamp: 20060530120103.852Z
modifiersName: cn=Directory Manager
modifyTimestamp: 20060530120103.852Z
creatorsName: cn=Directory Manager
ou: clients
objectclass: organizationalUnit
objectclass: top

dn: ou=servers,ou=aaa,ou=services,dc=foo,dc=bar
createTimestamp: 20060530120103.868Z
modifiersName: cn=Directory Manager
modifyTimestamp: 20060530120103.868Z
creatorsName: cn=Directory Manager
ou: servers
objectclass: organizationalUnit
objectclass: top

dn: ou=users,ou=aaa,ou=services,dc=foo,dc=bar
createTimestamp: 20060530120103.852Z
modifiersName: cn=Directory Manager
modifyTimestamp: 20060530120103.852Z
creatorsName: cn=Directory Manager
ou: users
objectclass: organizationalUnit
objectclass: top

------------------------------------------------

and i need to display the following Tree

dc=foo,dc=bar
|
dn: ou=services,dc=foo,dc=bar
|
dn: ou=aaa,ou=services,dc=foo,dc=bar
|
dn: ou=clients,ou=aaa,ou=services,dc=foo,dc=bar
dn: ou=servers,ou=aaa,ou=services,dc=foo,dc=bar
dn: ou=users,ou=aaa,ou=services,dc=foo,dc=bar
----------------------------------------------

please let me know how to do this

Thanks,

Raga Menon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic