Re: [Freeipa-devel] [PATCH] 307 Added extensible UI framework.

2011-11-04 Thread Petr Vobornik

On 11/04/2011 04:37 AM, Endi Sukma Dewata wrote:

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


There is a warning/error in browser when there is no extension.js 
present. This doesn't affect functionality, but I think we should try to 
eliminate this kinds of error. Same problem is for develop.js on 
production machines. This can be fixed separately.


ACK and pushed to master

--
Petr Vobornik

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 307 Added extensible UI framework.

2011-11-04 Thread Adam Young

On 11/04/2011 12:10 PM, Petr Vobornik wrote:

On 11/04/2011 04:37 AM, Endi Sukma Dewata wrote:

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


There is a warning/error in browser when there is no extension.js 
present. This doesn't affect functionality, but I think we should try 
to eliminate this kinds of error. Same problem is for develop.js on 
production machines. This can be fixed separately.


ACK and pushed to master

One solution is to have stub  extension.js and develop.js  files with 
nothing in them.  In the case of the extension.js file,   it should be 
there, and served out of /etc/ipa/http.  develope.jss should be  done by 
converting of develop_blank.js  to develop.js  when packaging up the RPM


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 307 Added extensible UI framework.

2011-11-04 Thread Endi Sukma Dewata

On 11/4/2011 12:11 PM, Adam Young wrote:

There is a warning/error in browser when there is no extension.js
present. This doesn't affect functionality, but I think we should try
to eliminate this kinds of error. Same problem is for develop.js on
production machines. This can be fixed separately.


One solution is to have stub extension.js and develop.js files with
nothing in them. In the case of the extension.js file, it should be
there, and served out of /etc/ipa/http. develope.jss should be done by
converting of develop_blank.js to develop.js when packaging up the RPM


I don't actually see any warnings with Firefox, but I agree we shouldn't 
create a broken link. Ideally when viewing the static files during 
development we shouldn't have a broken link either, not just in the 
production machine.


How about this, we rename the develop.js into extension.js, but we don't 
include it in the RPM. Then during RPM install we will touch 
extension.js so we wouldn't override the existing file, and not remove 
it during uninstall either? Then we can remove any references to 
develop.js too.


Is it ok to create the extension.js in /usr/share/ipa/ui?

--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 307 Added extensible UI framework.

2011-11-03 Thread Endi Sukma Dewata

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']}).