diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-10-01 16:33:57 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-10-02 18:13:30 -0400 |
commit | b7097fc8c9096e3e8bf4a01edc6d7274c9c4cac0 (patch) | |
tree | aeb0d79cf1dc9feea61a261cdd985c3b64033b40 /install/static/entity.js | |
parent | aa7ecb6f5ff234fa9001bbea3ebe2e5360656139 (diff) | |
download | freeipa-b7097fc8c9096e3e8bf4a01edc6d7274c9c4cac0.tar.gz freeipa-b7097fc8c9096e3e8bf4a01edc6d7274c9c4cac0.tar.xz freeipa-b7097fc8c9096e3e8bf4a01edc6d7274c9c4cac0.zip |
Entity association configuration.
The ipa_entity_set_association_definition() has been added to configure
the association between 2 entitites. By default the associator is
BulkAssociator and the method is add_member. The entities have been
updated to use the right configurations.
The ipa_cmd() has been modified to detect IPA errors and invoke the
error handler.
A bug in refresh_on_success() has been fixed as well.
Diffstat (limited to 'install/static/entity.js')
-rw-r--r-- | install/static/entity.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/install/static/entity.js b/install/static/entity.js index 5be67a39..820c5670 100644 --- a/install/static/entity.js +++ b/install/static/entity.js @@ -1,5 +1,6 @@ /* Authors: * Pavel Zuna <pzuna@redhat.com> + * Endi S. Dewata <edewata@redhat.com> * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information @@ -23,6 +24,7 @@ var ipa_entity_search_list = {}; var ipa_entity_add_list = {}; var ipa_entity_details_list = {}; +var ipa_entity_association_list = {}; /* use this to track individual changes between two hashchange events */ var window_hash_cache = {}; @@ -42,6 +44,11 @@ function ipa_entity_set_details_definition(obj_name, data) ipa_entity_details_list[obj_name] = data; } +function ipa_entity_set_association_definition(obj_name, data) +{ + ipa_entity_association_list[obj_name] = data; +} + function ipa_entity_setup(container) { var id = container.attr('id'); @@ -151,7 +158,17 @@ function _ipa_entity_setup(jobj) { column: attr + '_' + enroll_obj_name } ]; - var frm = new AssociationList(obj_name, pkey, enroll_obj_name, columns, jobj); + + var association = ipa_entity_association_list[obj_name]; + var association_config = association ? association[enroll_obj_name] : null; + var associator = association_config ? association_config.associator : null; + var method = association_config ? association_config.method : null; + + var frm = new AssociationList( + obj_name, pkey, enroll_obj_name, columns, jobj, + associator, method + ); + ipa_entity_generate_views(obj_name, jobj, switch_view); frm.setup(); }; |