2010-09-16 09:28:07 -05:00
|
|
|
/* Authors:
|
|
|
|
* Pavel Zuna <pzuna@redhat.com>
|
2010-10-01 16:33:57 -05:00
|
|
|
* Endi S. Dewata <edewata@redhat.com>
|
2010-09-16 09:28:07 -05:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; version 2 only
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js, details.js, search.js, add.js */
|
|
|
|
|
|
|
|
var ipa_entity_search_list = {};
|
|
|
|
var ipa_entity_add_list = {};
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
//moving this to details
|
|
|
|
//var ipa_entity_details_list = {};
|
2010-10-01 16:33:57 -05:00
|
|
|
var ipa_entity_association_list = {};
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-09-30 15:37:33 -05:00
|
|
|
/* use this to track individual changes between two hashchange events */
|
|
|
|
var window_hash_cache = {};
|
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
function ipa_entity_set_search_definition(obj_name, data)
|
|
|
|
{
|
|
|
|
ipa_entity_search_list[obj_name] = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
function ipa_entity_set_add_definition(obj_name, data)
|
|
|
|
{
|
|
|
|
ipa_entity_add_list[obj_name] = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
function ipa_entity_set_details_definition(obj_name, data)
|
|
|
|
{
|
|
|
|
ipa_entity_details_list[obj_name] = data;
|
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_entity_get_details_sections(obj_name)
|
|
|
|
{
|
|
|
|
var sections = ipa_entity_details_list[obj_name];
|
|
|
|
if (sections) return sections;
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2010-10-01 16:33:57 -05:00
|
|
|
function ipa_entity_set_association_definition(obj_name, data)
|
|
|
|
{
|
|
|
|
ipa_entity_association_list[obj_name] = data;
|
|
|
|
}
|
|
|
|
|
2010-10-06 16:24:58 -05:00
|
|
|
|
|
|
|
function ipa_details_only_setup(container){
|
|
|
|
ipa_entity_setup(container, 'details');
|
|
|
|
}
|
|
|
|
|
|
|
|
function ipa_entity_setup(container, unspecified)
|
2010-09-16 09:28:07 -05:00
|
|
|
{
|
2010-09-30 15:37:33 -05:00
|
|
|
var id = container.attr('id');
|
|
|
|
|
|
|
|
var state = id + '-facet';
|
2010-10-06 16:24:58 -05:00
|
|
|
var facet = $.bbq.getState(state, true) || unspecified || 'search';
|
2010-09-30 15:37:33 -05:00
|
|
|
var last_facet = window_hash_cache[state];
|
|
|
|
|
|
|
|
if (facet != last_facet) {
|
2010-10-06 16:24:58 -05:00
|
|
|
_ipa_entity_setup(container,unspecified);
|
2010-09-30 15:37:33 -05:00
|
|
|
window_hash_cache[state] = facet;
|
|
|
|
|
|
|
|
} else if (facet == 'search') {
|
|
|
|
state = id + '-filter';
|
|
|
|
var filter = $.bbq.getState(state, true);
|
|
|
|
var last_filter = window_hash_cache[state];
|
|
|
|
if (filter == last_filter) return;
|
|
|
|
|
|
|
|
_ipa_entity_setup(container);
|
|
|
|
window_hash_cache[state] = filter;
|
|
|
|
|
|
|
|
} else if (facet == 'details') {
|
|
|
|
state = id + '-pkey';
|
|
|
|
var pkey = $.bbq.getState(state, true);
|
|
|
|
var last_pkey = window_hash_cache[state];
|
|
|
|
if (pkey == last_pkey) return;
|
|
|
|
|
|
|
|
_ipa_entity_setup(container);
|
|
|
|
window_hash_cache[state] = pkey;
|
|
|
|
|
|
|
|
} else if (facet == 'associate') {
|
|
|
|
state = id + '-enroll';
|
|
|
|
var enroll = $.bbq.getState(state, true);
|
|
|
|
var last_enroll = window_hash_cache[state];
|
|
|
|
if (enroll == last_enroll) return;
|
|
|
|
|
|
|
|
_ipa_entity_setup(container);
|
|
|
|
window_hash_cache[state] = enroll;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function _ipa_entity_setup(container, unspecified) {
|
2010-09-30 15:37:33 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
function reset_on_click() {
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_reset(container);
|
2010-09-16 09:28:07 -05:00
|
|
|
return (false);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
function update_on_click() {
|
|
|
|
var pkey_name = ipa_objs[obj_name].primary_key;
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_update(container, ipa_details_cache[obj_name][pkey_name][0]);
|
2010-09-16 09:28:07 -05:00
|
|
|
return (false);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
function new_on_click() {
|
|
|
|
add_dialog_create(obj_name, ipa_entity_add_list[obj_name]);
|
|
|
|
return (false);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-09-28 09:19:05 -05:00
|
|
|
function switch_view() {
|
|
|
|
var enroll_obj_name = $(this).attr('title');
|
|
|
|
var state = {};
|
|
|
|
if (enroll_obj_name != 'search' && enroll_obj_name != 'details') {
|
|
|
|
state[obj_name + '-facet'] = 'associate';
|
|
|
|
state[obj_name + '-enroll'] = enroll_obj_name;
|
|
|
|
} else {
|
|
|
|
state[obj_name + '-facet'] = enroll_obj_name;
|
|
|
|
state[obj_name + '-enroll'] = '';
|
|
|
|
}
|
|
|
|
$.bbq.pushState(state);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-28 09:19:05 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
function setup_search_facet() {
|
2010-09-29 19:55:58 -05:00
|
|
|
var filter = $.bbq.getState(obj_name + '-filter', true) || '';
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
search_create(obj_name, ipa_entity_search_list[obj_name], container);
|
2010-09-28 07:20:16 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
ipa_make_button( 'ui-icon-plus',ipa_messages.button.add).
|
|
|
|
click(new_on_click).
|
|
|
|
appendTo($( "div#" + obj_name + " > div.search-controls"))
|
2010-09-28 07:20:16 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
search_load(container, filter, null, null);
|
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-10-06 16:24:58 -05:00
|
|
|
function setup_details_facet(unspecified) {
|
2010-09-16 09:28:07 -05:00
|
|
|
var pkey = $.bbq.getState(obj_name + '-pkey', true);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_entity_generate_views(obj_name, container, switch_view);
|
|
|
|
var sections = ipa_entity_get_details_sections(obj_name);
|
|
|
|
ipa_details_create(container, sections);
|
|
|
|
container.find('.details-reset').click(reset_on_click);
|
|
|
|
container.find('.details-update').click(update_on_click);
|
2010-09-29 00:52:56 -05:00
|
|
|
|
2010-10-06 16:24:58 -05:00
|
|
|
if (pkey||unspecified){
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_load(container, pkey, null, null);
|
2010-10-06 16:24:58 -05:00
|
|
|
}
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
function setup_associate_facet() {
|
2010-09-23 15:57:11 -05:00
|
|
|
var pkey = $.bbq.getState(obj_name + '-pkey', true) || '';
|
2010-09-16 09:28:07 -05:00
|
|
|
var enroll_obj_name = $.bbq.getState(obj_name + '-enroll', true) || '';
|
|
|
|
var attr = ipa_get_member_attribute(obj_name, enroll_obj_name);
|
|
|
|
var columns = [
|
|
|
|
{
|
|
|
|
title: ipa_objs[enroll_obj_name].label,
|
|
|
|
column: attr + '_' + enroll_obj_name
|
|
|
|
}
|
|
|
|
];
|
2010-10-01 16:33:57 -05:00
|
|
|
|
|
|
|
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(
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
obj_name, pkey, enroll_obj_name, columns, container,
|
2010-10-01 16:33:57 -05:00
|
|
|
associator, method
|
|
|
|
);
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_entity_generate_views(obj_name, container, switch_view);
|
2010-09-16 09:28:07 -05:00
|
|
|
frm.setup();
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
container.empty();
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-10-06 16:24:58 -05:00
|
|
|
var facet = $.bbq.getState(obj_name + '-facet', true) ||
|
|
|
|
unspecified || 'search';
|
2010-09-16 09:28:07 -05:00
|
|
|
if (facet == 'search') {
|
|
|
|
setup_search_facet();
|
|
|
|
} else if (facet == 'details') {
|
2010-10-06 16:24:58 -05:00
|
|
|
setup_details_facet(unspecified);
|
2010-09-16 09:28:07 -05:00
|
|
|
} else if (facet == 'associate') {
|
|
|
|
setup_associate_facet();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-28 09:19:05 -05:00
|
|
|
function ipa_entity_generate_views(obj_name, container, switch_view)
|
2010-09-16 09:28:07 -05:00
|
|
|
{
|
|
|
|
var ul = $('<ul></ul>', {'class': 'entity-views'});
|
|
|
|
|
2010-09-16 14:13:48 -05:00
|
|
|
//TODO replace the plus image with the correct image for each facet
|
2010-09-16 09:28:07 -05:00
|
|
|
ul.append($('<li></li>', {
|
|
|
|
title: 'search',
|
2010-09-16 16:31:21 -05:00
|
|
|
text: 'Search',
|
2010-09-16 09:28:07 -05:00
|
|
|
click: switch_view
|
2010-10-15 15:12:34 -05:00
|
|
|
}));
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
ul.append($('<li></li>', {
|
|
|
|
text: 'Details',
|
|
|
|
title: 'details',
|
|
|
|
click: switch_view
|
2010-10-15 15:12:34 -05:00
|
|
|
}).prepend('| '));
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
var attribute_members = ipa_objs[obj_name].attribute_members;
|
|
|
|
for (attr in attribute_members) {
|
|
|
|
var objs = attribute_members[attr];
|
|
|
|
for (var i = 0; i < objs.length; ++i) {
|
|
|
|
var m = objs[i];
|
|
|
|
var label = ipa_objs[m].label;
|
|
|
|
|
|
|
|
ul.append($('<li></li>', {
|
|
|
|
title: m,
|
2010-09-16 16:31:21 -05:00
|
|
|
text:label,
|
2010-09-16 09:28:07 -05:00
|
|
|
click: switch_view
|
2010-10-15 15:12:34 -05:00
|
|
|
}).prepend('| '));
|
2010-09-16 09:28:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
container.append(ul);
|
|
|
|
}
|
2010-10-01 12:53:13 -05:00
|
|
|
|
|
|
|
function ipa_entity_quick_links(tr, attr, value, entry_attrs) {
|
|
|
|
|
|
|
|
var obj_name = tr.closest('.search-container').attr('title');
|
|
|
|
var pkey = ipa_objs[obj_name].primary_key;
|
|
|
|
var pkey_value = entry_attrs[pkey][0];
|
|
|
|
|
|
|
|
var td = $("<td/>");
|
|
|
|
tr.append(td);
|
|
|
|
|
|
|
|
$("<a/>", {
|
|
|
|
href: "#details",
|
2010-10-04 12:51:51 -05:00
|
|
|
title: "Details",
|
2010-10-01 12:53:13 -05:00
|
|
|
click: function() {
|
|
|
|
var state = {};
|
|
|
|
state[obj_name+'-facet'] = 'details';
|
|
|
|
state[obj_name+'-pkey'] = pkey_value;
|
|
|
|
nav_push_state(state);
|
|
|
|
return false;
|
|
|
|
}
|
2010-10-15 15:12:34 -05:00
|
|
|
}).appendTo(td);
|
2010-10-01 12:53:13 -05:00
|
|
|
|
|
|
|
var attribute_members = ipa_objs[obj_name].attribute_members;
|
|
|
|
for (attr_name in attribute_members) {
|
|
|
|
var objs = attribute_members[attr_name];
|
|
|
|
for (var i = 0; i < objs.length; ++i) {
|
|
|
|
var m = objs[i];
|
2010-10-04 12:51:51 -05:00
|
|
|
var label = ipa_objs[m].label;
|
2010-10-01 12:53:13 -05:00
|
|
|
|
|
|
|
$("<a/>", {
|
|
|
|
href: '#'+m,
|
2010-10-04 12:51:51 -05:00
|
|
|
title: label,
|
2010-10-15 15:12:34 -05:00
|
|
|
text: label,
|
2010-10-01 12:53:13 -05:00
|
|
|
click: function(m) {
|
|
|
|
return function() {
|
|
|
|
var state = {};
|
|
|
|
state[obj_name+'-facet'] = 'associate';
|
|
|
|
state[obj_name+'-enroll'] = m;
|
|
|
|
state[obj_name+'-pkey'] = pkey_value;
|
|
|
|
nav_push_state(state);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}(m)
|
2010-10-15 15:12:34 -05:00
|
|
|
}).append(' | ' ).appendTo(td);
|
2010-10-01 12:53:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|