The entity definitions have been converted into classes. The entity
init() method will use the builder to construct the facets and dialogs.
The UI can be customized by creating a subclass of the original entity
in extension.js and then overriding the init() method.
Ticket #2043
--
Endi S. Dewata
From 509cf7f568d763058f6133a6f71feb5ccb5c4b97 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata edew...@redhat.com
Date: Wed, 2 Nov 2011 14:07:07 -0500
Subject: [PATCH] Added extensible UI framework.
The entity definitions have been converted into classes. The entity
init() method will use the builder to construct the facets and dialogs.
The UI can be customized by creating a subclass of the original entity
in extension.js and then overriding the init() method.
Ticket #2043
---
install/ui/aci.js | 87 +---
install/ui/automount.js| 56 +++--
install/ui/dns.js | 38 +---
install/ui/entitle.js | 31 ++--
install/ui/entity.js | 10 +++---
install/ui/group.js| 22
install/ui/hbac.js | 56 +++-
install/ui/host.js | 20 +++---
install/ui/hostgroup.js| 20 ++
install/ui/index.html |2 +-
install/ui/ipa.js | 29 +++
install/ui/netgroup.js | 20 +++---
install/ui/policy.js | 46 +++-
install/ui/serverconfig.js | 21 +++
install/ui/service.js | 21 +++
install/ui/sudo.js | 55 ++--
install/ui/user.js | 19 ++
17 files changed, 355 insertions(+), 198 deletions(-)
diff --git a/install/ui/aci.js b/install/ui/aci.js
index 5ffb2108b51b2e30113221d9ab1af107635eb8b4..92c5dcf02db36dfe48be4b80f0d6d0656c72de61 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -23,11 +23,15 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
-IPA.entity_factories.permission = function() {
+IPA.aci = {};
-return IPA.entity_builder().
-entity('permission').
-facet_groups([ 'privilege' , 'settings' ]).
+IPA.aci.permission_entity = function(spec) {
+
+var that = IPA.entity(spec);
+
+that.init = function(params) {
+
+params.builder.facet_groups([ 'privilege' , 'settings' ]).
search_facet({
columns:['cn']
}).
@@ -78,15 +82,19 @@ IPA.entity_factories.permission = function() {
label: IPA.messages.objects.permission.target
}
]
-}).
-build();
+});
+};
+
+return that;
};
+IPA.aci.privilege_entity = function(spec) {
-IPA.entity_factories.privilege = function() {
-return IPA.entity_builder().
-entity('privilege').
-facet_groups([ 'role', 'settings', 'permission' ]).
+var that = IPA.entity(spec);
+
+that.init = function(params) {
+
+params.builder.facet_groups([ 'role', 'settings', 'permission' ]).
search_facet({
columns: [
'cn',
@@ -130,16 +138,19 @@ IPA.entity_factories.privilege = function() {
name: 'description'
}
]
-}).
-build();
+});
+};
+return that;
};
+IPA.aci.role_entity = function(spec) {
-IPA.entity_factories.role = function() {
-return IPA.entity_builder().
-entity('role').
-facet_groups([ 'member', 'settings', 'privilege' ]).
+var that = IPA.entity(spec);
+
+that.init = function(params) {
+
+params.builder.facet_groups([ 'member', 'settings', 'privilege' ]).
search_facet({
columns: [
'cn',
@@ -176,15 +187,19 @@ IPA.entity_factories.role = function() {
name: 'description'
}
]
-}).
-build();
+});
+};
+
+return that;
};
+IPA.aci.selfservice_entity = function(spec) {
-IPA.entity_factories.selfservice = function() {
-return IPA.entity_builder().
-entity('selfservice').
-search_facet({
+var that = IPA.entity(spec);
+
+that.init = function(params) {
+
+params.builder.search_facet({
columns:['aciname']}).
details_facet({
sections:[{
@@ -204,15 +219,19 @@ IPA.entity_factories.selfservice = function() {
object_type:'user',
name:'attrs'
}]
-}).
-build();
+});
+};
+
+return that;
};
+IPA.aci.delegation_entity = function(spec) {
-IPA.entity_factories.delegation = function() {
-return IPA.entity_builder().
-entity('delegation').
-search_facet({
+var that = IPA.entity(spec);
+
+that.init = function(params) {
+
+params.builder.search_facet({
columns:['aciname']}).