]project-open[ : @This Wiki
Portrait

Welcome, Unregistered Visitor

Contact ·  Index · Login · Register
 

Contents

Remote Training
Support
SaaS Service

4 registered users
 in last 24 hours

OpenACS Relationship Tables

"Relationships" are generic N x M mapping between OpenACS objects.

Relationships can have parameters associated, constraints on the object types of both sides of the relationship and being objects themselves, they can be subject to permissions themselves.


 

­ 

Table

Cols

Rows

Description

[acs_rel_roles]

3

10

List of relationship "roles". Example: A user may be related to a company in the role "Employee".

[acs_rel_types]

9

12

Each row in acs_rel_types represents a type of relationship between objects. For example, the following DML statement:

insert into acs_rel_types
  (rel_type,
   object_type_one, role_one, min_n_rels_one, max_n_rels_one,
   object_type_two, role_two, min_n_rels_two, max_n_rels_two)
 values
  ('employment',
   'person', 'employee', 0, null,
   'company', 'employer', 0, null)

defines an "employment" relationship type that can be expressed in in natural language as: A person may be the employee of zero or more companies, and a company may be the employer of zero or more people.

[acs_rels]

4

1838

The acs_rels table is essentially a generic mapping table for acs_objects. Once we come up with a way to associate attributes with relationship types, we could replace many of the ACS 3.x mapping tables like user_content_map, user_group_map, and user_group_type_modules_map with this one table. Much application logic consists of asking questions like "Does object X have a relationship of type Y to object Z?" where all that differs is X, Y, and Z. Thus, the value of consolidating many mapping tables into one is that we can provide a generic API for defining and querying relationships. In addition, we may need to design a way to enable "type_specific" storage for relationships (i.e., foreign key columns for one-to-many relationships and custom mapping tables for many-to-many relationships), instead of only supporting "generic" storage in the acs_rels table. This would parallel what we do with acs_attributes.

[composition_rels]

1

17

Relationships of type "composition rel". These are relationships between groups, indicating that one group is included in another group.

[group_rels]

3

9

Stores the relationship types available for use by each group. Only relationship types in this table are offered for adding relations. Note that there is no restriction that says groups can only have relationship types specified for their group type. The group_type_rels table just stores defaults for groups of a new type.

[group_type_rels]

3

9

Stores the default relationship types available for use by groups of a given type. We May want to generalize this table to object_types and put it in the relationships sql file, though there is no need to do so right now.

[membership_rels]

2

638

Sub-class of acs_rels, describing the relationship of users being member of a group.

[rel_constraints]

5

0

Defines relational constraints. The relational constraints system is intended to support applications in modelling and applying constraint rules on inter-party relatinships based on relational party segmentation.

[rel_segments]

4

2

Defines relational segments. Each relational segment is a pair of group_id / rel_type, or, in english, the parties that have a relation of type rel_type to group_id.

­

Please take a moment to complete this form to help us improve our service.

Note:
Please only provide feedback in regards to content this page shows. For support inquiries please refer either to the Community Support forum at Sourceforge or check out our 'Professional Support'

Did this page help you to achieve your goal?

 Yes  No  Don't know

Please provide us with comments to improve this page:

How useful is the information?

 1  2  3  4  5
Not
useful
      Extremely
useful
 
  

Explore

Installers
Demo Server
Modules & Functionality
Packages
Business Processes supported
FAQ's

Help

Getting started
User Manuals
Configuration Manuals
Community Support
Professional Support

News

News
Twitter
RSS Community / Sourceforge
Register for Newsletter

Get in touch

Contact
Register



Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Generic License - Privacy Policy