Hi folks,
I'm new to module building and am working on a dynamic org chart module, a node type that displays an org chart via Graphviz with data pulled dynamically from LDAP/Active Directory.
I already am using ldap_integration and profile module to pull in the data for a phone directory.
My questions:
1. where in the module should I place code that actually queries user profiles and converts profile data (there is a reportsTo field that defines relationships) to graphviz dot syntax? Functionally, it would need to happen when a new node is created, or an existing node is updated. Should I add a custom function in the module for pulling this data based on the "top" user, and then call that function in hook_insert and hook_update?
2. data storage - in my install file, I create a new table (orgchart) with nid, vid, top, and depth. How should I be storing the "top" data - username or uid?. Does there need to be some kind of index or foriegn key to relate "top" to the record in the users table?
Thanks in advance,