Re: building an admin tree with varying node types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thodoris wrote:

How are your groups linked with your users? Does every user has a GroupId in his record?

Does this question has to do with building an html tree or it is about the best database schema that helps to construct and retrieve a tree faster?

My users-table is linked to the groups-table via a link table (2 fields, 1 field in primary key).

This question is about how to manage "virtual" or "smart" node-items. Node-items that represent something in another table, that will likely change in that table. Like 'users' and 'groups' in the CMS.

The solution i'm trying now is to have certain root-nodes that get populated by a custom php abstraction layer. Every node has a type, linking it to rights-management settings (and other things later i assume). And every node has a 'target'. That links 1-to-many to records in tree_target_identifiers table. That table lists fields like table_name, key1_name, key1_value_int, key1_value_vc, etc. I have fields for 2 keys defined in that table.

Now the clue of this question is what to do when the user-list changes.
With my current solution, unless the user is actually deleted from the system, i wont have to make any changes to the admin tree, since the admin tree will get most of the 'data' for any node from the target tables, whether that be 'users', 'groups' or 'articles'. If the user gets deleted, i could find-and-delete-the-corresponding-node, or i could rebuild that section of the tree (wont do that coz of resources and potential tree size). But in any case the code that deletes a user, group, article, or any other object under the tree's management, will have to call code to update the tree aswell..
Sometimes theres just no way around hard work ;)

I've yet to experiment with nested trees and moving items between the nodes..


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux