|
===Last_Modified_On=== - Date when this structure item was last modified
|
|
-__tiki_structure_item_attrib__ (primary key is structure_item_id in combination with attrib_name - this is not good since attrib_name is varchar and not not integer):
|
-structure_item_id, attrib_name, attrib_value
|
+__tiki_structure_item_position__ (primary_key is combination of tiki_structure_id, tiki_structure_item_id and pos): |
+structure_id, structure_item_id, pos, parent_id |
|
-===Attrib_name=== - name of the additional attribute (specific to certain structures). This can be: "trackback_to", "trackback_from"
|
-
|
-===Attrib_value=== - arbitrary data value
|
-
|
-__tiki_structure_pos__ (primary_key is combination of tiki_structure_id and tiki_structure_item_id):
|
-structure_id, structure_item_id, parent_id, pos
|
+This table is used to link structure items to actual structure that they belong to and describes how those items are positioned inside the structure |
|
===Structure_id=== - integer used to specify one structure. Equvalent to:
|
tiki_structures: root_structure_id, tiki_nexus_menu_items: menu_id, tiki_blog_posts: blog_id, tiki_categorized_objects: category_id
|
|
-===Parent_id=== - integer specifying top level for multi-level menus & structures; Equivalent to:
|
+===Parent_id=== - integer specifying top level for multi-level menus & structures; Equivalent to: |
tiki_structures: parent_id, tiki_nexus_menu_items: parent_id
|
|
===Pos=== - integer which specifies position of the menu relates to ALL other items (no matter what level, within same level highier position is displayed lower and parent_id must have position that is lower then any child). Equivalent to:
|
tiki_structures: pos, tiki_nexus_menu_items: po
|
|
--=New Structure & Structure Type Tables=-
|
-__tiki_structure__ (primary key is structure_id):
|
-structure_id, user_id, structure_name, structure_description, parent_id, created_on, last_modified_on
|
+__tiki_structure_attrib_names__ -(primary key is structure_attrib_name_id): |
+structure_attrib_name_id, attrib_name, structure_type_id |
|
-===Structure_id=== - integer used to specify one structure. Equvalent to:
|
- tiki_structures: structure_id, tiki_nexus_menu: menu_id, tiki_blog: blog_id, tiki_categories: category_id
|
+This table specifies additional attributes that can be added for specific structure_items by some structure types that need this. Each type would register its own list of additional attribute names when package for that structure type is installed. |
|
-===User_Id=== - integer specifying which user created this structure (good for user-specific menus too!). Equivalent to:
|
- tiki_blogs: user_id
|
+===Structure_Attrib_Name_ID=== - ID for this attribute name |
|
-===Structure_Name=== - short name for this structure. Equivalent to:
|
- tiki_blogs: title, tiki_categories: name, tiki_nexus_menu: title
|
+===Attrib_name=== - Name of the attribute, such as "trackback_to" and "trackback_from" for blogs |
|
-===Structure_Description=== - longer description of the structure. Equivalent to:
|
- tiki_blogs: description, tiki_categories: description, tiki_nexus_menu: description
|
+===Structure_Type_ID=== - ID for type of structure that uses these attribute, see tiki_structure_types tables |
|
-===Parent_Id=== - describes highier-level this this is one linked to. This can be used with categories although it would be better to replace with linking of multiple items into multi-layer structure, so- consider it reserved for the future for now. Equivalent to:
|
- tiki_categories: parent_id
|
+__tiki_structure_item_attrib__ (primary key is combination of structure_item_id and structure_attrib_name_id): |
+structure_item_id, structure_attrib_name_id, attrib_value |
|
-===Created_On=== - date when the structure was originally created on. Equivalent to:
|
- tiki_blogs: created
|
+This table is used to specify additional structure item attributes |
|
-===Last_Modified_On=== - data when structure was last modified on. Equivalent to:
|
- tiki_blogs: last_modified
|
+===Attrib_value=== - arbitrary data value |
|
-__tiki_structure_types__ (primary key is structure_type_id):
|
-structure_type_id, description, handler_class, handler_package, handler_file
|
-
|
-Note: ''See tiki_content_types for reference as to how handler_class, handler_packages, handler_file would be used''
|
+--- |
|
-__tiki_structure_objects__ (primary key is structure_object_id):
|
-structure_object_id, structure_id, structure_type_id
|
-
|
-Note: ''There is one-one correspondence from structure_object_id and actual object_id (such as blog_id or nexus_menu_id) that is using the structure. However not all objects that use this structure may have their own object table and since multiple of the same type of objects could be created that use the same strucuture, there is a need for unique structure_object_id. Additionally if structure_object_id was not there and for example nexus_menu was referring directly to structure_id, it would have created a problem when menu is deleted as then you have to specifically check if there are any other menus using the same structure before deleting from tiki_structure_objects table''
|
+Below is SQL code to retrieve data for list of items in the structure when its id is specified as STRUCTURE-ID. It shows that it still can be done with one database operation just like it was for single item tables (such as nexus_menu_items or tiki_blog_posts): |
+ |
+SELECT tiki_structure_item.structure_item_id, tiki_structure_item.item_type, tiki_structure_item.item_id, tiki_structure_item.url, tiki_structure_item.name, tiki_structure_item.description, tiki_structure_item_position.pos, tiki_structure_item_position.parent_id FROM tiki_structure_item, tiki_structure_item_position WHERE tiki_structure_item_position.stucture_item_id = tiki_structure.structure_item_id AND tiki_structure_item_position.structure_id = STRUCTURE-ID ORDER BY tiki_structure_item_position.pos |
|
+-=Updated Tables for Specific Objects that use Structures=- |
__tiki_blogs__ (replaces original, primary key is blog_id):
|
-blog_id, structure_object_id, public, posts, max_posts, hits, activity, heading, use_find, use_title, add_data, add_poster, allow_comments
|
+blog_id, structure_object_id, content_id, public, posts, max_posts, hits, activity, heading, use_find, use_title, add_data, add_poster, allow_comments |
+ |
+Note: ''blog is a very special structure that is a content object in its own right, especially since comments are allowed with it, so has its own content_id field in the table; note also that blog post is also a separate content type'' |
|
__tiki_nexus_menu__ (replaces original, primary key is menu_id):
|
menu_id, structure_object_id, plugin_guid, title, description, menu_type, editable
|