webui: replace IPA.command usage with rpc.command

Replace all IPA.command, IPA.batch_command and IPA.concurrent_command usages
by equivalents from rpc module.

Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
This commit is contained in:
Petr Vobornik
2014-03-10 17:05:51 +01:00
parent d5cf0b273a
commit 06a7a1b3cb
25 changed files with 189 additions and 168 deletions

View File

@@ -7,9 +7,9 @@
"classes": [ "classes": [
"IPA.object", "IPA.object",
"IPA.observer", "IPA.observer",
"IPA.command", "rpc.command",
"IPA.batch_command", "rpc.batch_command",
"IPA.concurrent_command", "rpc.concurrent_command",
"entity.entity" "entity.entity"
] ]
}, },

View File

@@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
define(['./ipa', './jquery', './navigation', './text', './field', './widget', './dialog'], define(['./ipa', './jquery', './navigation', './rpc', './text', './field', './widget', './dialog'],
function(IPA, $, navigation, text) { function(IPA, $, navigation, rpc, text) {
/** /**
* Entity adder dialog * Entity adder dialog
@@ -42,11 +42,11 @@ IPA.entity_adder_dialog = function(spec) {
that.method = spec.method || 'add'; that.method = spec.method || 'add';
/** @property {Function} on_error Custom add error handler */ /** @property {Function} on_error Custom add error handler */
that.on_error = spec.on_error ; that.on_error = spec.on_error ;
/** @property {boolean} retry=true Allow retry on error (same as in IPA.command)*/ /** @property {boolean} retry=true Allow retry on error (same as in rpc.command)*/
that.retry = typeof spec.retry !== 'undefined' ? spec.retry : true; that.retry = typeof spec.retry !== 'undefined' ? spec.retry : true;
/** /**
* Add command * Add command
* @property {IPA.command} * @property {rpc.command}
* @protected * @protected
*/ */
that.command = null; that.command = null;
@@ -184,7 +184,7 @@ IPA.entity_adder_dialog = function(spec) {
var pkey_name = that.entity.metadata.primary_key; var pkey_name = that.entity.metadata.primary_key;
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.method, method: that.method,
retry: that.retry retry: that.retry

View File

@@ -31,13 +31,14 @@ define([
'./navigation', './navigation',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./spec_util', './spec_util',
'./text', './text',
'./facet', './facet',
'./search', './search',
'./dialog'], './dialog'],
function(lang, Deferred, metadata_provider, IPA, $, navigation, function(lang, Deferred, metadata_provider, IPA, $, navigation,
phases, reg, su, text) { phases, reg, rpc, su, text) {
/** /**
* Association module * Association module
@@ -93,7 +94,7 @@ IPA.serial_associator = function(spec) {
return; return;
} }
var batch = IPA.batch_command({ var batch = rpc.batch_command({
on_success: that.on_success, on_success: that.on_success,
on_error: that.on_error on_error: that.on_error
}); });
@@ -105,7 +106,7 @@ IPA.serial_associator = function(spec) {
options = {}; options = {};
options[that.entity.name] = that.pkey; options[that.entity.name] = that.pkey;
command = IPA.command({ command = rpc.command({
entity: that.other_entity.name, entity: that.other_entity.name,
method: that.method, method: that.method,
args: args, args: args,
@@ -140,7 +141,7 @@ IPA.bulk_associator = function(spec) {
return; return;
} }
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.method, method: that.method,
args: [that.pkey], args: [that.pkey],
@@ -313,7 +314,7 @@ IPA.association_adder_dialog = function(spec) {
} }
} }
IPA.command({ rpc.command({
entity: that.other_entity.name, entity: that.other_entity.name,
method: 'find', method: 'find',
args: [that.get_filter()], args: [that.get_filter()],
@@ -668,7 +669,7 @@ IPA.association_table_widget = function (spec) {
var pkey = that.facet.get_pkey(); var pkey = that.facet.get_pkey();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.add_method, method: that.add_method,
args: [pkey], args: [pkey],
@@ -732,7 +733,7 @@ IPA.association_table_widget = function (spec) {
var pkey = that.facet.get_pkey(); var pkey = that.facet.get_pkey();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.remove_method, method: that.remove_method,
args: [pkey], args: [pkey],
@@ -795,7 +796,7 @@ IPA.association_table_field = function (spec) {
} }
var pkey = that.facet.get_pkey(); var pkey = that.facet.get_pkey();
IPA.command({ rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'show', method: 'show',
args: [pkey], args: [pkey],
@@ -1246,7 +1247,7 @@ exp.association_facet = IPA.association_facet = function (spec, no_init) {
var pkeys = that.get_pkeys(); var pkeys = that.get_pkeys();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'show', method: 'show',
args: pkeys args: pkeys
@@ -1407,7 +1408,7 @@ exp.attribute_facet = IPA.attribute_facet = function(spec, no_init) {
var pkey = that.get_pkeys(); var pkey = that.get_pkeys();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'show', method: 'show',
args: pkey args: pkey
@@ -1492,7 +1493,7 @@ exp.attribute_facet = IPA.attribute_facet = function(spec, no_init) {
var pkey = that.get_pkeys(); var pkey = that.get_pkeys();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.remove_method, method: that.remove_method,
args: pkey, args: pkey,

View File

@@ -25,12 +25,13 @@ define([
'./navigation', './navigation',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity'], './entity'],
function(metadata_provider, IPA, $, navigation, phases, reg, text) { function(metadata_provider, IPA, $, navigation, phases, reg, rpc, text) {
var exp = IPA.automember = {}; var exp = IPA.automember = {};
@@ -524,7 +525,7 @@ IPA.automember.condition_widget = function(spec) {
that.create_remove_command = function(values, on_success, on_error) { that.create_remove_command = function(values, on_success, on_error) {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: 'automember_remove_condition', name: 'automember_remove_condition',
on_success: on_success, on_success: on_success,
on_error: on_error on_error: on_error
@@ -628,7 +629,7 @@ IPA.automember.default_group_widget = function(spec) {
method = 'default_group_' + method; method = 'default_group_' + method;
var command_name = that.entity.name + that.group_type + '_' + method; var command_name = that.entity.name + that.group_type + '_' + method;
var command = IPA.command({ var command = rpc.command({
name: command_name, name: command_name,
entity: that.entity.name, entity: that.entity.name,
method: method, method: method,
@@ -726,7 +727,7 @@ IPA.automember.rebuild_action = function(spec) {
options['type'] = 'hostgroup'; options['type'] = 'hostgroup';
} }
var command = IPA.command({ var command = rpc.command({
entity: 'automember', entity: 'automember',
method: 'rebuild', method: 'rebuild',
options: options, options: options,

View File

@@ -27,9 +27,10 @@ define([
'./menu', './menu',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./dialog'], './dialog'],
function(lang, metadata_provider, IPA, $, menu, phases, reg, text) { function(lang, metadata_provider, IPA, $, menu, phases, reg, rpc, text) {
var exp = IPA.cert = {}; var exp = IPA.cert = {};
@@ -517,7 +518,7 @@ IPA.cert.load_policy = function(spec) {
}; };
that.load_revocation_reason = function(serial_number) { that.load_revocation_reason = function(serial_number) {
IPA.command({ rpc.command({
entity: 'cert', entity: 'cert',
method: 'show', method: 'show',
args: [serial_number], args: [serial_number],
@@ -643,7 +644,7 @@ IPA.cert.request_action = function(spec) {
message: request_message, message: request_message,
request: function(values) { request: function(values) {
IPA.command({ rpc.command({
entity: 'cert', entity: 'cert',
method: 'request', method: 'request',
args: [values.request], args: [values.request],
@@ -702,7 +703,7 @@ IPA.cert.revoke_action = function(spec) {
var certificate = facet.certificate; var certificate = facet.certificate;
IPA.command({ rpc.command({
entity: 'cert', entity: 'cert',
method: 'revoke', method: 'revoke',
args: [certificate.serial_number], args: [certificate.serial_number],
@@ -759,7 +760,7 @@ IPA.cert.restore_action = function(spec) {
var certificate = facet.certificate; var certificate = facet.certificate;
IPA.command({ rpc.command({
entity: 'cert', entity: 'cert',
method: 'remove_hold', method: 'remove_hold',
args: [certificate.serial_number], args: [certificate.serial_number],

View File

@@ -28,11 +28,12 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./spec_util', './spec_util',
'./text', './text',
'./facet', './facet',
'./add'], './add'],
function(lang, builder, IPA, $, phases, reg, su, text) { function(lang, builder, IPA, $, phases, reg, rpc, su, text) {
/** /**
* Details module * Details module
@@ -825,7 +826,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
* Adds update info as command options * Adds update info as command options
* @protected * @protected
* @param {details.update_info} update_info * @param {details.update_info} update_info
* @param {IPA.command} command * @param {rpc.command} command
*/ */
that.add_fields_to_command = function(update_info, command) { that.add_fields_to_command = function(update_info, command) {
@@ -833,7 +834,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
var field_info = update_info.fields[i]; var field_info = update_info.fields[i];
if (field_info.field.flags.indexOf('no_command') > -1) continue; if (field_info.field.flags.indexOf('no_command') > -1) continue;
var values = field_info.field.save(); var values = field_info.field.save();
IPA.command_builder.add_field_option( exp.command_builder.add_field_option(
command, command,
field_info.field, field_info.field,
values); values);
@@ -844,7 +845,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
* Create update command based on field part of update info * Create update command based on field part of update info
* @protected * @protected
* @param {details.update_info} update_info * @param {details.update_info} update_info
* @return {IPA.command} * @return {rpc.command}
*/ */
that.create_fields_update_command = function(update_info) { that.create_fields_update_command = function(update_info) {
@@ -853,7 +854,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
var options = { all: true }; var options = { all: true };
if (that.check_rights) options.rights = true; if (that.check_rights) options.rights = true;
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.update_command_name, method: that.update_command_name,
args: args, args: args,
@@ -873,11 +874,11 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
* to reflect field part of update info (if present). * to reflect field part of update info (if present).
* @protected * @protected
* @param {details.update_info} update_info * @param {details.update_info} update_info
* @return {IPA.batch_command} * @return {rpc.batch_command}
*/ */
that.create_batch_update_command = function(update_info) { that.create_batch_update_command = function(update_info) {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: that.entity.name + '_details_update' name: that.entity.name + '_details_update'
}); });
@@ -915,7 +916,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
/** /**
* Create update command * Create update command
* @protected * @protected
* @return {IPA.command/IPA.batch_command} * @return {rpc.command|rpc.batch_command}
*/ */
that.create_update_command = function() { that.create_update_command = function() {
@@ -975,14 +976,14 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
/** /**
* Create refresh command * Create refresh command
* @protected * @protected
* @return {IPA.command} * @return {rpc.command}
*/ */
that.create_refresh_command = function() { that.create_refresh_command = function() {
var options = { all: true }; var options = { all: true };
if (that.check_rights) options.rights = true; if (that.check_rights) options.rights = true;
var command = IPA.command({ var command = rpc.command({
name: that.get_refresh_command_name(), name: that.get_refresh_command_name(),
entity: that.entity.name, entity: that.entity.name,
method: 'show', method: 'show',
@@ -1169,7 +1170,7 @@ exp.update_info = IPA.update_info = function(spec) {
/** /**
* Create new command info and add it to collection * Create new command info and add it to collection
* @param {IPA.command} command * @param {rpc.command} command
* @param {number} priority * @param {number} priority
*/ */
that.append_command = function (command, priority) { that.append_command = function (command, priority) {
@@ -1191,7 +1192,7 @@ exp.command_info = IPA.command_info = function(spec) {
/** /**
* Command * Command
* @property {IPA.command} * @property {rpc.command}
*/ */
that.command = spec.command; that.command = spec.command;
@@ -1268,7 +1269,7 @@ exp.update_info_builder = IPA.update_info_builder = function() {
/** /**
* Create new command info * Create new command info
* @param {IPA.command} command * @param {rpc.command} command
* @param {number} priority * @param {number} priority
* @return {details.command_info} * @return {details.command_info}
*/ */
@@ -1309,16 +1310,15 @@ exp.update_info_builder = IPA.update_info_builder = function() {
* Field add/mod command builder * Field add/mod command builder
* *
* @class details.command_builder * @class details.command_builder
* @alternateClassName IPA.command_builder
* @singleton * @singleton
*/ */
exp.command_builder = IPA.command_builder = function() { exp.command_builder = function() {
var that = IPA.object(); var that = IPA.object();
/** /**
* Add option to command with field values * Add option to command with field values
* @param {IPA.command} command * @param {rpc.command} command
* @param {IPA.field} field * @param {IPA.field} field
* @param {Array} values * @param {Array} values
*/ */
@@ -1790,7 +1790,7 @@ exp.object_action = IPA.object_action = function(spec) {
var entity_name = facet.entity.name; var entity_name = facet.entity.name;
var pkeys = facet.get_pkeys(); var pkeys = facet.get_pkeys();
IPA.command({ rpc.command({
entity: entity_name, entity: entity_name,
method: that.method, method: that.method,
args: pkeys, args: pkeys,

View File

@@ -24,9 +24,10 @@ define([
'../ipa', '../ipa',
'../phases', '../phases',
'../reg', '../reg',
'../rpc',
'../text', '../text',
'../dialog'], '../dialog'],
function(lang, builder, IPA, phases, reg, text) { function(lang, builder, IPA, phases, reg, rpc, text) {
var dialogs = {}; // dummy object var dialogs = {}; // dummy object
/** /**
@@ -211,7 +212,7 @@ dialogs.password.dialog = function(spec) {
that.create_command = function() { that.create_command = function() {
var options = that.make_otions(); var options = that.make_otions();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.method, method: that.method,
args: that.pkeys, args: that.pkeys,

View File

@@ -28,12 +28,13 @@ define([
'./menu', './menu',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity'], './entity'],
function(IPA, $, NET, navigation, menu, phases, reg, text) { function(IPA, $, NET, navigation, menu, phases, reg, rpc, text) {
var exp = IPA.dns = { var exp = IPA.dns = {
zone_permission_name: 'Manage DNS zone ${dnszone}' zone_permission_name: 'Manage DNS zone ${dnszone}'
@@ -340,7 +341,7 @@ IPA.dnszone_details_facet = function(spec, no_init) {
var pkey = that.get_pkey(); var pkey = that.get_pkey();
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: 'dnszone_details_refresh' name: 'dnszone_details_refresh'
}); });
@@ -357,7 +358,7 @@ IPA.dnszone_details_facet = function(spec, no_init) {
var permission_name = IPA.dns.zone_permission_name.replace('${dnszone}', pkey); var permission_name = IPA.dns.zone_permission_name.replace('${dnszone}', pkey);
var permission_command = IPA.command({ var permission_command = rpc.command({
entity: 'permission', entity: 'permission',
method: 'show', method: 'show',
args: [permission_name], args: [permission_name],
@@ -595,7 +596,7 @@ IPA.dns.add_permission_action = function(spec) {
var pkey = facet.get_pkey(); var pkey = facet.get_pkey();
var command = IPA.command({ var command = rpc.command({
entity: 'dnszone', entity: 'dnszone',
method: 'add_permission', method: 'add_permission',
args: [pkey], args: [pkey],
@@ -625,7 +626,7 @@ IPA.dns.remove_permission_action = function(spec) {
var pkey = facet.get_pkey(); var pkey = facet.get_pkey();
var command = IPA.command({ var command = rpc.command({
entity: 'dnszone', entity: 'dnszone',
method: 'remove_permission', method: 'remove_permission',
args: [pkey], args: [pkey],
@@ -668,7 +669,7 @@ IPA.dns.record_search_facet = function(spec) {
that.get_records = function(pkeys, on_success, on_error) { that.get_records = function(pkeys, on_success, on_error) {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: that.get_records_command_name(), name: that.get_records_command_name(),
on_success: on_success, on_success: on_success,
on_error: on_error on_error: on_error
@@ -679,7 +680,7 @@ IPA.dns.record_search_facet = function(spec) {
for (var i=0; i<pkeys.length; i++) { for (var i=0; i<pkeys.length; i++) {
var pkey = pkeys[i]; var pkey = pkeys[i];
var command = IPA.command({ var command = rpc.command({
entity: that.table.entity.name, entity: that.table.entity.name,
method: 'show', method: 'show',
args: [zone, pkey], args: [zone, pkey],
@@ -1205,7 +1206,7 @@ IPA.dns.record_adder_dialog = function(spec) {
var that = IPA.entity_adder_dialog(spec); var that = IPA.entity_adder_dialog(spec);
that.on_error = IPA.create_4304_error_handler(that); that.on_error = rpc.create_4304_error_handler(that);
return that; return that;
}; };
@@ -1799,7 +1800,7 @@ IPA.dns.record_type_table_widget = function(spec) {
that.remove = function(values, pkey, on_success, on_error) { that.remove = function(values, pkey, on_success, on_error) {
var pkeys = that.facet.get_pkeys(); var pkeys = that.facet.get_pkeys();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'del', method: 'del',
args: pkeys, args: pkeys,
@@ -1838,7 +1839,7 @@ IPA.dns.record_type_table_widget = function(spec) {
var cancel_button = dialog.buttons.get('cancel'); var cancel_button = dialog.buttons.get('cancel');
dialog.buttons.empty(); dialog.buttons.empty();
dialog.on_error = IPA.create_4304_error_handler(dialog); dialog.on_error = rpc.create_4304_error_handler(dialog);
dialog.get_add_message = function() { dialog.get_add_message = function() {
var label = that.entity.metadata.label_singular; var label = that.entity.metadata.label_singular;
@@ -2229,7 +2230,7 @@ IPA.dns.ptr_redirection_dialog = function(spec) {
that.append_status(text.get('@i18n:objects.dnsrecord.ptr_redir_zones')); that.append_status(text.get('@i18n:objects.dnsrecord.ptr_redir_zones'));
var command = IPA.command({ var command = rpc.command({
entity: 'dnszone', entity: 'dnszone',
method: 'find', method: 'find',
options: { options: {
@@ -2284,7 +2285,7 @@ IPA.dns.ptr_redirection_dialog = function(spec) {
var record_name = that.reverse_address.substring(0,i1 - 1); var record_name = that.reverse_address.substring(0,i1 - 1);
that.record_keys = [that.zone, record_name]; that.record_keys = [that.zone, record_name];
var command = IPA.command({ var command = rpc.command({
entity: 'dnsrecord', entity: 'dnsrecord',
method: 'show', method: 'show',
args: that.record_keys, args: that.record_keys,
@@ -2321,7 +2322,7 @@ IPA.dns.ptr_redirection_dialog = function(spec) {
var ptr = that.dns_record.name +'.' + that.dns_record.zone; var ptr = that.dns_record.name +'.' + that.dns_record.zone;
var command = IPA.command({ var command = rpc.command({
entity: 'dnsrecord', entity: 'dnsrecord',
method: 'add', method: 'add',
args: that.record_keys, args: that.record_keys,

View File

@@ -35,13 +35,15 @@ define([
'./navigation', './navigation',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./spec_util', './spec_util',
'./text', './text',
'./dialog', './dialog',
'./field', './field',
'./widget' './widget'
], function(declare, lang, construct, on, Stateful, Evented, ], function(declare, lang, construct, on, Stateful, Evented,
Singleton_registry, builder, IPA, $, navigation, phases, reg, su, text) { Singleton_registry, builder, IPA, $,
navigation, phases, reg, rpc, su, text) {
/** /**
* Facet module * Facet module
@@ -1883,7 +1885,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
*/ */
that.create_get_records_command = function(pkeys, on_success, on_error) { that.create_get_records_command = function(pkeys, on_success, on_error) {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: that.get_records_command_name(), name: that.get_records_command_name(),
on_success: on_success, on_success: on_success,
on_error: on_error on_error: on_error
@@ -1892,7 +1894,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
for (var i=0; i<pkeys.length; i++) { for (var i=0; i<pkeys.length; i++) {
var pkey = pkeys[i]; var pkey = pkeys[i];
var command = IPA.command({ var command = rpc.command({
entity: that.table.entity.name, entity: that.table.entity.name,
method: 'show', method: 'show',
args: [pkey] args: [pkey]

View File

@@ -33,9 +33,10 @@ define([
'./navigation', './navigation',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text'], './text'],
function(array, lang, metadata_provider, builder, datetime, IPA, $, function(array, lang, metadata_provider, builder, datetime, IPA, $,
navigation, phases, reg, text) { navigation, phases, reg, rpc, text) {
/** /**
* Field module * Field module
@@ -1294,7 +1295,7 @@ IPA.link_field = function(spec) {
return; return;
} }
IPA.command({ rpc.command({
entity: that.other_entity.name, entity: that.other_entity.name,
method: 'show', method: 'show',
args: that.other_pkeys(), args: that.other_pkeys(),
@@ -1370,7 +1371,7 @@ IPA.enable_field = function(spec) {
method = that.enable_method; method = that.enable_method;
} }
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: method, method: method,
args: that.facet.get_pkeys(), args: that.facet.get_pkeys(),

View File

@@ -24,13 +24,14 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./association', './association',
'./details', './details',
'./entity', './entity',
'./rule', './rule',
'./search' './search'
], ],
function(IPA, $, phases, reg) { function(IPA, $, phases, reg, rpc) {
var exp = IPA.hbac = { var exp = IPA.hbac = {
//priority of commands in details facet //priority of commands in details facet

View File

@@ -25,13 +25,14 @@ define([
'./navigation', './navigation',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity', './entity',
'./hbac'], './hbac'],
function(metadata_provider, IPA, $, navigation, phases, reg, text) { function(metadata_provider, IPA, $, navigation, phases, reg, rpc, text) {
var exp = {}; var exp = {};
@@ -235,7 +236,7 @@ IPA.hbac.test_facet = function(spec) {
var filter = that.state.filter; var filter = that.state.filter;
var command = IPA.command({ var command = rpc.command({
name: that.get_search_command_name(), name: that.get_search_command_name(),
entity: that.managed_entity.name, entity: that.managed_entity.name,
method: 'find', method: 'find',
@@ -675,7 +676,7 @@ IPA.hbac.test_run_facet = function(spec) {
that.run = function() { that.run = function() {
var command = IPA.command({ method: 'hbactest' }); var command = rpc.command({ method: 'hbactest' });
var options = {}; var options = {};
var validation_results = { var validation_results = {

View File

@@ -23,13 +23,14 @@ define(['./ipa',
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity', './entity',
'./certificate'], './certificate'],
function(IPA, $, phases, reg, text) { function(IPA, $, phases, reg, rpc, text) {
var exp = IPA.host = {}; var exp = IPA.host = {};
@@ -459,7 +460,7 @@ IPA.host_adder_dialog = function(spec) {
that.container.addClass('host-adder-dialog'); that.container.addClass('host-adder-dialog');
}; };
that.on_error = IPA.create_4304_error_handler(that); that.on_error = rpc.create_4304_error_handler(that);
return that; return that;
}; };
@@ -509,7 +510,7 @@ IPA.dnszone_select_widget = function(spec) {
var that = IPA.entity_select_widget(spec); var that = IPA.entity_select_widget(spec);
that.create_search_command = function(filter) { that.create_search_command = function(filter) {
return IPA.command({ return rpc.command({
entity: that.other_entity.name, entity: that.other_entity.name,
method: 'find', method: 'find',
args: [filter], args: [filter],
@@ -672,7 +673,7 @@ IPA.host_unprovision_dialog = function(spec) {
var pkey = that.facet.get_pkeys(); var pkey = that.facet.get_pkeys();
var command = IPA.command({ var command = rpc.command({
name: that.entity.name+'_disable_'+pkey, name: that.entity.name+'_disable_'+pkey,
entity: that.entity.name, entity: that.entity.name,
method: 'disable', method: 'disable',

View File

@@ -31,8 +31,10 @@ define([
'./metadata', './metadata',
'./builder', './builder',
'./reg', './reg',
'./text'], './rpc',
function(keys, $, JSON, i18n, datetime, metadata_provider, builder, reg, text) { './text',
'exports'
], function(keys, $, JSON, i18n, datetime, metadata_provider, builder, reg, rpc, text, exports) {
/** /**
* @class * @class
@@ -44,11 +46,11 @@ define([
* and move them to separate modules. * and move them to separate modules.
* *
*/ */
var IPA = function() { var IPA = function () {
var that = { var that = exports;
jsonrpc_id: 0
}; that.jsonrpc_id = 0;
// live server path // live server path
that.url = '/ipa/ui/'; that.url = '/ipa/ui/';
@@ -130,7 +132,7 @@ var IPA = function() {
$.ajaxSetup(that.ajax_options); $.ajaxSetup(that.ajax_options);
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: 'ipa_init', name: 'ipa_init',
retry: false, retry: false,
on_success: function() { on_success: function() {
@@ -168,7 +170,7 @@ var IPA = function() {
} }
}); });
batch.add_command(IPA.command({ batch.add_command(rpc.command({
method: 'i18n_messages', method: 'i18n_messages',
on_success: function(data, text_status, xhr) { on_success: function(data, text_status, xhr) {
that.messages = data.texts; that.messages = data.texts;
@@ -176,7 +178,7 @@ var IPA = function() {
} }
})); }));
batch.add_command(IPA.command({ batch.add_command(rpc.command({
entity: 'config', entity: 'config',
method: 'show', method: 'show',
on_success: function(data, text_status, xhr) { on_success: function(data, text_status, xhr) {
@@ -186,7 +188,7 @@ var IPA = function() {
batch.add_command(that.get_whoami_command(true)); batch.add_command(that.get_whoami_command(true));
batch.add_command(IPA.command({ batch.add_command(rpc.command({
method: 'env', method: 'env',
on_success: function(data, text_status, xhr) { on_success: function(data, text_status, xhr) {
that.env = data.result; that.env = data.result;
@@ -194,7 +196,7 @@ var IPA = function() {
} }
})); }));
batch.add_command(IPA.command({ batch.add_command(rpc.command({
entity: 'dns', entity: 'dns',
method: 'is_enabled', method: 'is_enabled',
on_success: function(data, text_status, xhr) { on_success: function(data, text_status, xhr) {
@@ -202,7 +204,7 @@ var IPA = function() {
} }
})); }));
batch.add_command(IPA.command({ batch.add_command(rpc.command({
entity: 'trustconfig', entity: 'trustconfig',
method: 'show', method: 'show',
retry: false, retry: false,
@@ -224,7 +226,7 @@ var IPA = function() {
* in a batch. * in a batch.
*/ */
that.get_whoami_command = function(batch) { that.get_whoami_command = function(batch) {
return IPA.command({ return rpc.command({
entity: 'user', entity: 'user',
method: 'find', method: 'find',
options: { options: {
@@ -247,7 +249,7 @@ var IPA = function() {
*/ */
that.init_metadata = function(params) { that.init_metadata = function(params) {
var objects = IPA.command({ var objects = rpc.command({
name: 'ipa_init_objects', name: 'ipa_init_objects',
method: 'json_metadata', method: 'json_metadata',
options: { options: {
@@ -258,7 +260,7 @@ var IPA = function() {
} }
}); });
var commands = IPA.command({ var commands = rpc.command({
name: 'ipa_init_commands', name: 'ipa_init_commands',
method: 'json_metadata', method: 'json_metadata',
options: { options: {
@@ -269,7 +271,7 @@ var IPA = function() {
} }
}); });
var metadata_command = IPA.concurrent_command({ var metadata_command = rpc.concurrent_command({
commands: [ commands: [
objects, objects,
commands commands
@@ -822,9 +824,9 @@ IPA.error_dialog = function(spec) {
that.text_status = spec.text_status || ''; that.text_status = spec.text_status || '';
/** @property {{name:string,message:string}} error_thrown Command's error */ /** @property {{name:string,message:string}} error_thrown Command's error */
that.error_thrown = spec.error_thrown || {}; that.error_thrown = spec.error_thrown || {};
/** @property {IPA.command} command Command */ /** @property {rpc.command} command Command */
that.command = spec.command; that.command = spec.command;
/** @property {IPA.error_list} errors Errors */ /** @property {rpc.error_list} errors Errors */
that.errors = spec.errors; that.errors = spec.errors;
/** @property {string[]} visible_buttons=['retry', 'cancel'] Visible button names */ /** @property {string[]} visible_buttons=['retry', 'cancel'] Visible button names */
that.visible_buttons = spec.visible_buttons || ['retry', 'cancel']; that.visible_buttons = spec.visible_buttons || ['retry', 'cancel'];

View File

@@ -28,9 +28,7 @@ define([
'./text', './text',
'exports' 'exports'
], ],
function(lang, IPA, text, exports) { function(lang, IPA, text, rpc /*exports*/) {
var rpc = {};
/** /**
* Call an IPA command over JSON-RPC. * Call an IPA command over JSON-RPC.
@@ -379,14 +377,14 @@ rpc.command = function(spec) {
/** /**
* Parse successful command result and get all errors. * Parse successful command result and get all errors.
* @protected * @protected
* @param {IPA.command} command * @param {rpc.command} command
* @param {Object} result * @param {Object} result
* @param {string} text_status * @param {string} text_status
* @param {XMLHttpRequest} xhr * @param {XMLHttpRequest} xhr
* @return {IPA.error_list} * @return {rpc.error_list}
*/ */
that.get_failed = function(command, result, text_status, xhr) { that.get_failed = function(command, result, text_status, xhr) {
var errors = IPA.error_list(); var errors = rpc.error_list();
if(result && result.failed) { if(result && result.failed) {
for(var association in result.failed) { for(var association in result.failed) {
for(var member_name in result.failed[association]) { for(var member_name in result.failed[association]) {
@@ -461,7 +459,7 @@ rpc.command = function(spec) {
* @extends rpc.command * @extends rpc.command
* *
* @param {Object} spec * @param {Object} spec
* @param {Array.<IPA.command>} spec.commands - IPA commands to be executed * @param {rpc.command[]} spec.commands - IPA commands to be executed
* @param {Function} spec.on_success - callback function if command succeeds * @param {Function} spec.on_success - callback function if command succeeds
* @param {Function} spec.on_error - callback function if command fails * @param {Function} spec.on_error - callback function if command fails
*/ */
@@ -471,12 +469,12 @@ rpc.batch_command = function(spec) {
spec.method = 'batch'; spec.method = 'batch';
var that = IPA.command(spec); var that = rpc.command(spec);
/** @property {IPA.command[]} commands Commands */ /** @property {rpc.command[]} commands Commands */
that.commands = []; that.commands = [];
/** @property {IPA.error_list} errors Errors */ /** @property {rpc.error_list} errors Errors */
that.errors = IPA.error_list(); that.errors = rpc.error_list();
/** /**
* Show error if some command fail * Show error if some command fail
@@ -487,7 +485,7 @@ rpc.batch_command = function(spec) {
/** /**
* Add command * Add command
* @param {IPA.command} command * @param {rpc.command} command
*/ */
that.add_command = function(command) { that.add_command = function(command) {
that.commands.push(command); that.commands.push(command);
@@ -496,7 +494,7 @@ rpc.batch_command = function(spec) {
/** /**
* Add commands * Add commands
* @param {IPA.command[]} commands * @param {rpc.command[]} commands
*/ */
that.add_commands = function(commands) { that.add_commands = function(commands) {
for (var i=0; i<commands.length; i++) { for (var i=0; i<commands.length; i++) {
@@ -510,7 +508,7 @@ rpc.batch_command = function(spec) {
that.execute = function() { that.execute = function() {
that.errors.clear(); that.errors.clear();
var command = IPA.command({ var command = rpc.command({
name: that.name, name: that.name,
entity: that.entity, entity: that.entity,
method: that.method, method: that.method,
@@ -830,7 +828,7 @@ rpc.concurrent_command = function(spec) {
* *
* Collection for RPC command errors. * Collection for RPC command errors.
* *
* @class IPA.error_list * @class rpc.error_list
* @private * @private
*/ */
rpc.error_list = function() { rpc.error_list = function() {
@@ -869,7 +867,7 @@ rpc.error_list = function() {
}; };
/** /**
* Error handler for IPA.command which handles error #4304 as success. * Error handler for rpc.command which handles error #4304 as success.
* *
* 4304 is raised when part of an operation succeeds and the part that failed * 4304 is raised when part of an operation succeeds and the part that failed
* isn't critical. * isn't critical.
@@ -917,14 +915,5 @@ rpc.create_4304_error_handler = function(adder_dialog) {
}; };
}; };
// backwards compatibility:
IPA.error_list = rpc.error_list;
IPA.create_4304_error_handler = rpc.create_4304_error_handler;
IPA.command = rpc.command;
IPA.batch_command = rpc.batch_command;
IPA.concurrent_command = rpc.concurrent_command;
lang.mixin(exports, rpc);
return rpc; return rpc;
}); });

View File

@@ -23,11 +23,12 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity'], './entity'],
function(IPA, $, phases, reg) { function(IPA, $, phases, reg, rpc) {
IPA.rule_details_widget = function(spec) { IPA.rule_details_widget = function(spec) {
@@ -221,7 +222,7 @@ IPA.rule_association_table_field = function(spec) {
if (values.length > 0) { //no need to delete if has no values if (values.length > 0) { //no need to delete if has no values
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.widget.remove_method, method: that.widget.remove_method,
args: that.facet.get_pkeys() args: that.facet.get_pkeys()

View File

@@ -26,10 +26,11 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./spec_util', './spec_util',
'./text', './text',
'./facet'], './facet'],
function(IPA, $, phases, reg, su, text, mod_facet) { function(IPA, $, phases, reg, rpc, su, text, mod_facet) {
var exp = {}; var exp = {};
@@ -235,7 +236,7 @@ IPA.search_facet = function(spec, no_init) {
var args = that.get_refresh_command_args(); var args = that.get_refresh_command_args();
var command = IPA.command({ var command = rpc.command({
name: that.get_search_command_name(), name: that.get_search_command_name(),
entity: that.managed_entity.name, entity: that.managed_entity.name,
method: 'find', method: 'find',
@@ -312,12 +313,12 @@ IPA.search_deleter_dialog = function(spec) {
that.pkey_prefix = spec.pkey_prefix || []; that.pkey_prefix = spec.pkey_prefix || [];
that.create_command = function() { that.create_command = function() {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
error_message: '@i18n:search.partial_delete' error_message: '@i18n:search.partial_delete'
}); });
for (var i=0; i<that.values.length; i++) { for (var i=0; i<that.values.length; i++) {
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'del' method: 'del'
}); });
@@ -475,7 +476,7 @@ IPA.batch_items_action = function(spec) {
var pkeys = facet.get_pkeys(); var pkeys = facet.get_pkeys();
if (!pkeys[0]) pkeys = []; // correction for search facet if (!pkeys[0]) pkeys = []; // correction for search facet
that.batch = IPA.batch_command({ that.batch = rpc.batch_command({
name: entity.name + '_batch_'+ that.method, name: entity.name + '_batch_'+ that.method,
on_success: that.get_on_success(facet, on_success) on_success: that.get_on_success(facet, on_success)
}); });
@@ -492,7 +493,7 @@ IPA.batch_items_action = function(spec) {
}; };
that.create_action_command = function(facet, keys) { that.create_action_command = function(facet, keys) {
var command = IPA.command({ var command = rpc.command({
entity: facet.managed_entity.name, entity: facet.managed_entity.name,
method: that.method, method: that.method,
args: keys, args: keys,

View File

@@ -23,12 +23,13 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity'], './entity'],
function(IPA, $, phases, reg, text) { function(IPA, $, phases, reg, rpc, text) {
var exp =IPA.service = {}; var exp =IPA.service = {};
@@ -410,7 +411,7 @@ IPA.service.unprovision_dialog = function(spec) {
var principal_f = that.facet.fields.get_field('krbprincipalname'); var principal_f = that.facet.fields.get_field('krbprincipalname');
var pkey = principal_f.values[0]; var pkey = principal_f.values[0];
IPA.command({ rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: 'disable', method: 'disable',
args: [pkey], args: [pkey],

View File

@@ -23,6 +23,7 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./association', './association',
'./entity', './entity',
@@ -30,7 +31,7 @@ define([
'./rule', './rule',
'./search' './search'
], ],
function(IPA, $, phases, reg, text) { function(IPA, $, phases, reg, rpc, text) {
var exp = IPA.sudo = { var exp = IPA.sudo = {
//priority of commands in details facet //priority of commands in details facet
@@ -822,7 +823,7 @@ IPA.sudo.options_section = function(spec) {
var pkey = that.facet.get_pkey(); var pkey = that.facet.get_pkey();
var command = IPA.command({ var command = rpc.command({
entity: 'sudorule', entity: 'sudorule',
method: 'add_option', method: 'add_option',
args: [pkey], args: [pkey],
@@ -878,7 +879,7 @@ IPA.sudo.options_section = function(spec) {
dialog.execute = function() { dialog.execute = function() {
var batch = IPA.batch_command({ var batch = rpc.batch_command({
on_success: function(data) { on_success: function(data) {
//last successful result of batch results contains valid data //last successful result of batch results contains valid data
var result; var result;
@@ -905,7 +906,7 @@ IPA.sudo.options_section = function(spec) {
}); });
for (var i=0; i<values.length; i++) { for (var i=0; i<values.length; i++) {
var command = IPA.command({ var command = rpc.command({
entity: 'sudorule', entity: 'sudorule',
method: 'remove_option', method: 'remove_option',
args: [pkey] args: [pkey]
@@ -923,7 +924,7 @@ IPA.sudo.options_section = function(spec) {
}; };
that.reload = function() { that.reload = function() {
var command = IPA.command({ var command = rpc.command({
entity: that.facet.entity.name, entity: that.facet.entity.name,
method: 'show', method: 'show',
args: that.facet.get_pkeys(), args: that.facet.get_pkeys(),

View File

@@ -26,13 +26,14 @@ define([
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text', './text',
'./details', './details',
'./search', './search',
'./association', './association',
'./entity', './entity',
'./certificate'], './certificate'],
function(IPA, $, phases, reg, text) { function(IPA, $, phases, reg, rpc, text) {
/** /**
* User module * User module
@@ -366,7 +367,7 @@ IPA.user.details_facet = function(spec) {
var pkey = that.get_pkey(); var pkey = that.get_pkey();
var batch = IPA.batch_command({ var batch = rpc.batch_command({
name: 'user_details_refresh' name: 'user_details_refresh'
}); });
@@ -381,7 +382,7 @@ IPA.user.details_facet = function(spec) {
batch.add_command(user_command); batch.add_command(user_command);
var pwpolicy_command = IPA.command({ var pwpolicy_command = rpc.command({
entity: 'pwpolicy', entity: 'pwpolicy',
method: 'show', method: 'show',
options: { options: {
@@ -406,7 +407,7 @@ IPA.user.details_facet = function(spec) {
batch.add_command(pwpolicy_command); batch.add_command(pwpolicy_command);
var krbtpolicy_command = IPA.command({ var krbtpolicy_command = rpc.command({
entity: 'krbtpolicy', entity: 'krbtpolicy',
method: 'show', method: 'show',
args: [ pkey ], args: [ pkey ],
@@ -623,7 +624,7 @@ IPA.user_password_dialog = function(spec) {
that.set_password = function(pkey, current_password, password, on_success, on_error) { that.set_password = function(pkey, current_password, password, on_success, on_error) {
var command = IPA.command({ var command = rpc.command({
method: 'passwd', method: 'passwd',
args: [ pkey ], args: [ pkey ],
options: { options: {

View File

@@ -34,10 +34,11 @@ define(['dojo/_base/array',
'./jquery', './jquery',
'./phases', './phases',
'./reg', './reg',
'./rpc',
'./text' './text'
], ],
function(array, lang, Evented, has, keys, on, builder, datetime, IPA, $, function(array, lang, Evented, has, keys, on, builder, datetime, IPA, $,
phases, reg, text) { phases, reg, rpc, text) {
/** /**
* Widget module * Widget module
@@ -2933,7 +2934,7 @@ IPA.attribute_table_widget = function(spec) {
var pkeys = that.get_pkeys(); var pkeys = that.get_pkeys();
var command = IPA.command({ var command = rpc.command({
entity: that.entity.name, entity: that.entity.name,
method: that.remove_command || 'del', method: that.remove_command || 'del',
args: pkeys, args: pkeys,
@@ -3543,7 +3544,7 @@ IPA.entity_select_widget = function(spec) {
that.filter_options = spec.filter_options || {}; that.filter_options = spec.filter_options || {};
that.create_search_command = function(filter) { that.create_search_command = function(filter) {
return IPA.command({ return rpc.command({
entity: that.other_entity.name, entity: that.other_entity.name,
method: 'find', method: 'find',
args: [filter], args: [filter],

View File

@@ -19,8 +19,14 @@
*/ */
define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/association', 'freeipa/entity'], function(IPA, $) { define([
return function() { 'freeipa/ipa',
'freeipa/jquery',
'freeipa/rpc',
'freeipa/association',
'freeipa/entity'
], function(IPA, $, rpc)
{ return function() {
module('association'); module('association');
@@ -29,7 +35,7 @@ test("Testing serial_associator().", function() {
expect(11); expect(11);
var orig_ipa_batch_command = IPA.batch_command; var orig_ipa_batch_command = rpc.batch_command;
var user = IPA.entity({ name: 'user' }); var user = IPA.entity({ name: 'user' });
var group = IPA.entity({ name: 'group' }); var group = IPA.entity({ name: 'group' });
@@ -43,13 +49,13 @@ test("Testing serial_associator().", function() {
params.values = ['user1', 'user2', 'user3']; params.values = ['user1', 'user2', 'user3'];
IPA.batch_command = function(spec) { rpc.batch_command = function(spec) {
var that = orig_ipa_batch_command(spec); var that = orig_ipa_batch_command(spec);
that.execute = function() { that.execute = function() {
equals(that.commands.length, params.values.length, equals(that.commands.length, params.values.length,
'Checking IPA.batch_command command count'); 'Checking rpc.batch_command command count');
var i, command; var i, command;
@@ -58,15 +64,15 @@ test("Testing serial_associator().", function() {
equals( equals(
command.entity, params.other_entity.name, command.entity, params.other_entity.name,
'Checking IPA.command() parameter: entity'); 'Checking rpc.command() parameter: entity');
equals( equals(
command.method, params.method, command.method, params.method,
'Checking IPA.command() parameter: method'); 'Checking rpc.command() parameter: method');
equals( equals(
command.args[0], 'user'+(i+1), command.args[0], 'user'+(i+1),
'Checking IPA.command() parameter: primary key'); 'Checking rpc.command() parameter: primary key');
} }
that.on_success({}); that.on_success({});
@@ -82,14 +88,14 @@ test("Testing serial_associator().", function() {
var associator = IPA.serial_associator(params); var associator = IPA.serial_associator(params);
associator.execute(); associator.execute();
IPA.batch_command = orig_ipa_batch_command; rpc.batch_command = orig_ipa_batch_command;
}); });
test("Testing bulk_associator().", function() { test("Testing bulk_associator().", function() {
expect(4); expect(4);
var orig_ipa_command = IPA.command; var orig_ipa_command = rpc.command;
var counter = 0; var counter = 0;
@@ -105,7 +111,7 @@ test("Testing bulk_associator().", function() {
params.values = ['user1', 'user2', 'user3']; params.values = ['user1', 'user2', 'user3'];
IPA.command = function(spec) { rpc.command = function(spec) {
var that = orig_ipa_command(spec); var that = orig_ipa_command(spec);
@@ -114,15 +120,15 @@ test("Testing bulk_associator().", function() {
equals( equals(
that.method, params.method, that.method, params.method,
'Checking IPA.command() parameter: method'); 'Checking rpc.command() parameter: method');
equals( equals(
that.args[0], params.pkey, that.args[0], params.pkey,
'Checking IPA.command() parameter: primary key'); 'Checking rpc.command() parameter: primary key');
equals( equals(
that.options[params.other_entity.name], 'user1,user2,user3', that.options[params.other_entity.name], 'user1,user2,user3',
'Checking IPA.command() parameter: options[\""+params.other_entity+"\"]'); 'Checking rpc.command() parameter: options[\""+params.other_entity+"\"]');
that.on_success({}); that.on_success({});
}; };
@@ -137,7 +143,7 @@ test("Testing bulk_associator().", function() {
var associator = IPA.bulk_associator(params); var associator = IPA.bulk_associator(params);
associator.execute(); associator.execute();
IPA.command = orig_ipa_command; rpc.command = orig_ipa_command;
}); });
};}); };});

View File

@@ -25,10 +25,11 @@ define([
'freeipa/details', 'freeipa/details',
'freeipa/facet', 'freeipa/facet',
'freeipa/reg', 'freeipa/reg',
'freeipa/rpc',
'freeipa/entity', 'freeipa/entity',
'freeipa/field', 'freeipa/field',
'freeipa/widget'], 'freeipa/widget'],
function(md, IPA, $, mod_details, mod_facet, reg) { function(md, IPA, $, mod_details, mod_facet, reg, rpc) {
return function() { return function() {
var details_container; var details_container;
@@ -127,15 +128,15 @@ test("Testing details lifecycle: create, load.", function(){
data.result = {}; data.result = {};
data.result.result = {}; data.result.result = {};
IPA.command({ rpc.command({
entity: 'user', entity: 'user',
method: 'show', method: 'show',
args: ['kfrog'], args: ['kfrog'],
on_success: function(data, text_status, xhr) { on_success: function(data, text_status, xhr) {
ok(true, "IPA.command() succeeded."); ok(true, "rpc.command() succeeded.");
}, },
on_error: function(xhr, text_status, error_thrown) { on_error: function(xhr, text_status, error_thrown) {
ok(false, "IPA.command() failed: "+error_thrown); ok(false, "rpc.command() failed: "+error_thrown);
} }
}).execute(); }).execute();

View File

@@ -18,8 +18,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/dialog', 'freeipa/widget', define([
'freeipa/details'], function(IPA, $) { 'freeipa/ipa',
'freeipa/jquery',
'freeipa/rpc',
'freeipa/dialog',
'freeipa/widget',
'freeipa/details'],
function(IPA, $, rpc) {
return function() { return function() {
module('ipa'); module('ipa');
@@ -88,7 +94,7 @@ test("Testing IPA.get_member_attribute().", function() {
"IPA.get_member_attribute(null, \"group\")"); "IPA.get_member_attribute(null, \"group\")");
}); });
test("Testing successful IPA.command().", function() { test("Testing successful rpc.command().", function() {
var method = 'method'; var method = 'method';
var args = ['arg1', 'arg2', 'arg3']; var args = ['arg1', 'arg2', 'arg3'];
@@ -138,7 +144,7 @@ test("Testing successful IPA.command().", function() {
request.success(xhr, text_status, error_thrown); request.success(xhr, text_status, error_thrown);
}; };
IPA.command({ rpc.command({
entity: object, entity: object,
method: method, method: method,
args: args, args: args,
@@ -164,7 +170,7 @@ test("Testing successful IPA.command().", function() {
$.ajax = orig; $.ajax = orig;
}); });
test("Testing unsuccessful IPA.command().", function() { test("Testing unsuccessful rpc.command().", function() {
var method = 'method'; var method = 'method';
var args = ['arg1', 'arg2', 'arg3']; var args = ['arg1', 'arg2', 'arg3'];
@@ -209,7 +215,7 @@ test("Testing unsuccessful IPA.command().", function() {
request.error(xhr, text_status, error_thrown); request.error(xhr, text_status, error_thrown);
}; };
IPA.command({ rpc.command({
entity: object, entity: object,
method: method, method: method,
args: args, args: args,

View File

@@ -521,9 +521,9 @@ class UI_driver(object):
var args = arguments[1]; var args = arguments[1];
var options = arguments[2]; var options = arguments[2];
var callback = arguments[arguments.length - 1]; var callback = arguments[arguments.length - 1];
var IPA = require('freeipa/ipa'); var rpc = require('freeipa/rpc');
var cmd = IPA.command({ var cmd = rpc.command({
method: method, method: method,
args: args, args: args,
options: options, options: options,