Re: [Freeipa-devel] [PATCH] admiyo-freeipa-0052-policy-and-config.patch

2010-10-07 Thread Adam Young

On 10/07/2010 11:54 AM, Endi Sukma Dewata wrote:

- Adam Youngayo...@redhat.com  wrote:

   

Population of the policy and entities tabs.
DNS and ACI are broken due to Plugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to serverconfig.js

Missed the Makefile.am additions necessary to pick up the .js files

Fixes an issued with missing pkey for the config page.
 

I have some comments/questions:

1. The labels of the first level tabs in admin_tab_set are removed.
Are they being replaced by translated texts from metadata?
   

Yes, that is correct.  The others will need values in internal.py as well.


2. In _ipa_entity_setup() the 'unspecified' facet will be displayed
only if it equals 'details'.

function _ipa_entity_setup(jobj,unspecified) {
  if (facet == 'details') {
setup_details_facet(unspecified);
  }
}

Also, maybe a more appropriate name is 'default_facet'?
   
I came up with unspecified when I discovered that 'default' was a key 
word in Javascript.  I thought unspecified did a good job of explaining 
that this was the facet to use if it is not specified in the URL params.



3. In policy.js the 'dialog-add-dns' and 'Add New Location'
are used by automount and pwpolicy:
   


Cut and paste error.  I'll fix that.

ipa_entity_set_add_definition('automountlocation', [
  'dialog-add-dns', 'Add New Location', [

ipa_entity_set_add_definition('pwpolicy', [
  'dialog-add-dns', 'Add New Location', [

The krbtpolicy doesn't need an add page:

ipa_entity_set_add_definition('krbtpolicy', [
  'dialog-add-dns', 'Add New Location', [

4. Password policy details is not working, it returns
this message:

GLOBAL: password policy not found
   


Hmmm.. Not for me.  GLOBAL is the default one, and also should be in the 
sample data.  I'll investigate.

5. Kerberos Ticket Policy  Configuration each has a link to the
search page (which is not searchable) and the details page
(which is unnecessary because it's the only page), we need to
figure out a way not to show them.
   

Agreed.


6. The HBAC associations don't work, we need to define the
association using ipa_entity_set_association_definition().
   
Not surprised.  I wasn't attempting to complete all of the tabs, just to 
get the main level entries in for the policy and config tab  sets.  
THere is more work to do on several of the entities.



7. DNS  ACI don't work as you already mentioned. The automount
currently is limited to location.
   


Yes.  I have a fix in for DNS, and we'll need somthing comparable for 
ACI.  automount and dns have subordinat entities, something we haven't 
dealt with elsewhere on the site yet.

Should any of these issues be fixed before ACK-ing this patch?
Thanks!
   

3 and 4 will be fixed before ACK.


--
Endi S. Dewata
   


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


Re: [Freeipa-devel] [PATCH] admiyo-freeipa-0052-policy-and-config.patch

2010-10-07 Thread Adam Young

On 10/07/2010 12:45 PM, Adam Young wrote:

On 10/07/2010 11:54 AM, Endi Sukma Dewata wrote:

- Adam Youngayo...@redhat.com  wrote:


Population of the policy and entities tabs.
DNS and ACI are broken due to Plugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to serverconfig.js

Missed the Makefile.am additions necessary to pick up the .js files

Fixes an issued with missing pkey for the config page.

I have some comments/questions:

1. The labels of the first level tabs in admin_tab_set are removed.
Are they being replaced by translated texts from metadata?
Yes, that is correct.  The others will need values in internal.py as 
well.



2. In _ipa_entity_setup() the 'unspecified' facet will be displayed
only if it equals 'details'.

function _ipa_entity_setup(jobj,unspecified) {
  if (facet == 'details') {
setup_details_facet(unspecified);
  }
}

Also, maybe a more appropriate name is 'default_facet'?
I came up with unspecified when I discovered that 'default' was a key 
word in Javascript.  I thought unspecified did a good job of 
explaining that this was the facet to use if it is not specified in 
the URL params.



3. In policy.js the 'dialog-add-dns' and 'Add New Location'
are used by automount and pwpolicy:


Cut and paste error.  I'll fix that.

ipa_entity_set_add_definition('automountlocation', [
  'dialog-add-dns', 'Add New Location', [

ipa_entity_set_add_definition('pwpolicy', [
  'dialog-add-dns', 'Add New Location', [

The krbtpolicy doesn't need an add page:

ipa_entity_set_add_definition('krbtpolicy', [
  'dialog-add-dns', 'Add New Location', [

4. Password policy details is not working, it returns
this message:

GLOBAL: password policy not found


Hmmm.. Not for me.  GLOBAL is the default one, and also should be in 
the sample data.  I'll investigate.

5. Kerberos Ticket Policy  Configuration each has a link to the
search page (which is not searchable) and the details page
(which is unnecessary because it's the only page), we need to
figure out a way not to show them.

Agreed.


6. The HBAC associations don't work, we need to define the
association using ipa_entity_set_association_definition().
Not surprised.  I wasn't attempting to complete all of the tabs, just 
to get the main level entries in for the policy and config tab  sets.  
THere is more work to do on several of the entities.



7. DNS  ACI don't work as you already mentioned. The automount
currently is limited to location.


Yes.  I have a fix in for DNS, and we'll need somthing comparable for 
ACI.  automount and dns have subordinat entities, something we haven't 
dealt with elsewhere on the site yet.

Should any of these issues be fixed before ACK-ing this patch?
Thanks!

3 and 4 will be fixed before ACK.


--
Endi S. Dewata


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

Fixed and pushed to master

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


Re: [Freeipa-devel] [PATCH] admiyo-freeipa-0052-policy-and-config.patch

2010-10-06 Thread Adam Young

On 10/06/2010 05:30 PM, Adam Young wrote:

Population of the policy and entities tabs.
DNS and ACI are broken due to Plugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to 
serverconfig.js



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

Missed the Makefile.am additions necessary to pick up the .js files

From 5a13f4b974d07b5a5c58066a9342e5ccb104b212 Mon Sep 17 00:00:00 2001
From: Adam Young ayo...@redhat.com
Date: Wed, 6 Oct 2010 17:24:58 -0400
Subject: [PATCH] policy and config

Population of the policy and entites tabs.
DNS and ACI are broken due to PLugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to serverconfig.js
---
 install/static/Makefile.am |3 +-
 install/static/entity.js   |   23 --
 install/static/index.xhtml |6 +-
 install/static/policy.js   |  156 
 install/static/rolegroup.js|   45 
 install/static/serverconfig.js |  118 ++
 install/static/webui.js|   17 -
 ipalib/plugins/automount.py|2 +
 ipalib/plugins/krbtpolicy.py   |2 +
 ipalib/plugins/pwpolicy.py |2 +
 10 files changed, 314 insertions(+), 60 deletions(-)
 create mode 100644 install/static/policy.js
 delete mode 100644 install/static/rolegroup.js
 create mode 100644 install/static/serverconfig.js

diff --git a/install/static/Makefile.am b/install/static/Makefile.am
index 7d7c27d..8071d25 100644
--- a/install/static/Makefile.am
+++ b/install/static/Makefile.am
@@ -28,7 +28,8 @@ app_DATA =  \
 	navigation.js			\
 	netgroup.js 			\
 	service.js 			\
-	rolegroup.js 			\
+	serverconfig.js			\
+	policy.js			\
 	search.js 			\
 	details.js 			\
 	entity.js 			\
diff --git a/install/static/entity.js b/install/static/entity.js
index c628edd..804f8e2 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -49,16 +49,21 @@ function ipa_entity_set_association_definition(obj_name, data)
 ipa_entity_association_list[obj_name] = data;
 }
 
-function ipa_entity_setup(container)
+
+function ipa_details_only_setup(container){
+ipa_entity_setup(container, 'details');
+}
+
+function ipa_entity_setup(container, unspecified)
 {
 var id = container.attr('id');
 
 var state = id + '-facet';
-var facet = $.bbq.getState(state, true) || 'search';
+var facet = $.bbq.getState(state, true) || unspecified || 'search';
 var last_facet = window_hash_cache[state];
 
 if (facet != last_facet) {
-_ipa_entity_setup(container);
+_ipa_entity_setup(container,unspecified);
 window_hash_cache[state] = facet;
 
 } else if (facet == 'search') {
@@ -90,7 +95,7 @@ function ipa_entity_setup(container)
 }
 }
 
-function _ipa_entity_setup(jobj) {
+function _ipa_entity_setup(jobj,unspecified) {
 
 var obj_name = jobj.attr('id');
 
@@ -137,15 +142,16 @@ function _ipa_entity_setup(jobj) {
 search_load(jobj, filter, null, null);
 };
 
-function setup_details_facet() {
+function setup_details_facet(unspecified) {
 var pkey = $.bbq.getState(obj_name + '-pkey', true);
 ipa_entity_generate_views(obj_name, jobj, switch_view);
 ipa_details_create(obj_name, ipa_entity_details_list[obj_name], jobj);
 jobj.find('.details-reset').click(reset_on_click);
 jobj.find('.details-update').click(update_on_click);
 
-if (pkey)
+if (pkey||unspecified){
 ipa_details_load(jobj, pkey, null, null);
+}
 };
 
 function setup_associate_facet() {
@@ -175,11 +181,12 @@ function _ipa_entity_setup(jobj) {
 
 jobj.empty();
 
-var facet = $.bbq.getState(obj_name + '-facet', true) || 'search';
+var facet = $.bbq.getState(obj_name + '-facet', true) || 
+unspecified || 'search';
 if (facet == 'search') {
 setup_search_facet();
 } else if (facet == 'details') {
-setup_details_facet();
+setup_details_facet(unspecified);
 } else if (facet == 'associate') {
 setup_associate_facet();
 }
diff --git a/install/static/index.xhtml b/install/static/index.xhtml
index 2e2ac4e..338ddbb 100644
--- a/install/static/index.xhtml
+++ b/install/static/index.xhtml
@@ -25,7 +25,9 @@
 script type=text/javascript src=hostgroup.js/script
 script type=text/javascript src=netgroup.js/script
 script type=text/javascript src=service.js/script
-script type=text/javascript src=rolegroup.js/script
+script type=text/javascript src=serverconfig.js/script
+script type=text/javascript src=policy.js/script
+
 
 script type=text/javascript src=develop.js/script
 script 

Re: [Freeipa-devel] [PATCH] admiyo-freeipa-0052-policy-and-config.patch

2010-10-06 Thread Adam Young

On 10/06/2010 07:30 PM, Adam Young wrote:

On 10/06/2010 05:30 PM, Adam Young wrote:

Population of the policy and entities tabs.
DNS and ACI are broken due to Plugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to 
serverconfig.js



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

Missed the Makefile.am additions necessary to pick up the .js files


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

Fixes an issued with missing pkey for the config page.
From a08e87015f06ab3e17bef4a43acee9aece4bf865 Mon Sep 17 00:00:00 2001
From: Adam Young ayo...@redhat.com
Date: Wed, 6 Oct 2010 17:24:58 -0400
Subject: [PATCH] policy and config

Population of the policy and entites tabs.
DNS and ACI are broken due to PLugin issues
Fix for entities without search
Added new files to Makefile.am
used rolegroup.js file as the start point, renamed to serverconfig.js
---
 install/static/Makefile.am |3 +-
 install/static/details.js  |   10 ++--
 install/static/entity.js   |   23 --
 install/static/index.xhtml |6 +-
 install/static/policy.js   |  156 
 install/static/rolegroup.js|   45 
 install/static/serverconfig.js |  118 ++
 install/static/webui.js|   17 -
 ipalib/plugins/automount.py|2 +
 ipalib/plugins/krbtpolicy.py   |2 +
 ipalib/plugins/pwpolicy.py |2 +
 11 files changed, 319 insertions(+), 65 deletions(-)
 create mode 100644 install/static/policy.js
 delete mode 100644 install/static/rolegroup.js
 create mode 100644 install/static/serverconfig.js

diff --git a/install/static/Makefile.am b/install/static/Makefile.am
index 7d7c27d..8071d25 100644
--- a/install/static/Makefile.am
+++ b/install/static/Makefile.am
@@ -28,7 +28,8 @@ app_DATA =  \
 	navigation.js			\
 	netgroup.js 			\
 	service.js 			\
-	rolegroup.js 			\
+	serverconfig.js			\
+	policy.js			\
 	search.js 			\
 	details.js 			\
 	entity.js 			\
diff --git a/install/static/details.js b/install/static/details.js
index 62c5c5e..41f3a51 100644
--- a/install/static/details.js
+++ b/install/static/details.js
@@ -125,14 +125,14 @@ function ipa_details_load(jobj, pkey, on_win, on_fail)
 details.append('p'+error_thrown.message+'/p');
 };
 
-if (!pkey)
-return;
-
+var params = [pkey];
+if (!pkey){
+params = [];
+}
 ipa_cmd(
-'show', [pkey], {all: true}, load_on_win, load_on_fail, obj_name
+'show', params, {all: true}, load_on_win, load_on_fail, obj_name
 );
 }
-
 function ipa_details_update(obj_name, pkey, on_win, on_fail)
 {
 function update_on_win(data, text_status, xhr) {
diff --git a/install/static/entity.js b/install/static/entity.js
index c628edd..804f8e2 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -49,16 +49,21 @@ function ipa_entity_set_association_definition(obj_name, data)
 ipa_entity_association_list[obj_name] = data;
 }
 
-function ipa_entity_setup(container)
+
+function ipa_details_only_setup(container){
+ipa_entity_setup(container, 'details');
+}
+
+function ipa_entity_setup(container, unspecified)
 {
 var id = container.attr('id');
 
 var state = id + '-facet';
-var facet = $.bbq.getState(state, true) || 'search';
+var facet = $.bbq.getState(state, true) || unspecified || 'search';
 var last_facet = window_hash_cache[state];
 
 if (facet != last_facet) {
-_ipa_entity_setup(container);
+_ipa_entity_setup(container,unspecified);
 window_hash_cache[state] = facet;
 
 } else if (facet == 'search') {
@@ -90,7 +95,7 @@ function ipa_entity_setup(container)
 }
 }
 
-function _ipa_entity_setup(jobj) {
+function _ipa_entity_setup(jobj,unspecified) {
 
 var obj_name = jobj.attr('id');
 
@@ -137,15 +142,16 @@ function _ipa_entity_setup(jobj) {
 search_load(jobj, filter, null, null);
 };
 
-function setup_details_facet() {
+function setup_details_facet(unspecified) {
 var pkey = $.bbq.getState(obj_name + '-pkey', true);
 ipa_entity_generate_views(obj_name, jobj, switch_view);
 ipa_details_create(obj_name, ipa_entity_details_list[obj_name], jobj);
 jobj.find('.details-reset').click(reset_on_click);
 jobj.find('.details-update').click(update_on_click);
 
-if (pkey)
+if (pkey||unspecified){
 ipa_details_load(jobj, pkey, null, null);
+}
 };
 
 function setup_associate_facet() {
@@ -175,11 +181,12 @@ function _ipa_entity_setup(jobj) {
 
 jobj.empty();
 
-var facet =