[Freeipa-devel] [PATCH] HBAC Details Page

Endi Sukma Dewata edewata at redhat.com
Wed Nov 3 12:30:55 UTC 2010


On 11/1/2010 12:35 PM, Adam Young wrote:
> NACK, based on the templating issues we discussed on the phone.
>
> TO lay out the issues for other people reading: we previously had a
> framework like what Endi is proposing here. We found that importing HTML
> fragments didn't provide much benefit, and lead to duplicated code. When
> Pavel did a major rework of the code in August, we removed the
> templating mechanism.
>
> We are going to add it back in as part of this patch, but with a note
> that it is purely for Rapid prototyping purposes. For HBAC, Endi is
> going to make the Table code into a component that works without
> templating. Instead, weare going to generate the table code using
> Javascript, the same way that we do in the search code. This is the
> start of the work specified in
>
> https://fedorahosted.org/freeipa/ticket/419
>
> When we are done, we hope to havea reusable component that supports the
> search, associtions, record level attributes (like phone number) and the
> HBAC use cases. We'll produce a design document as we get better clarity.

Please take a look at the new patch. Thanks!

https://fedorahosted.org/reviewboard/r/99/

The UI framework has been extended to include a collection of widgets:
   - ipa_widget: base class
   - ipa_text_widget: text field
   - ipa_radio_widget: radio button
   - ipa_textarea_widget: textarea
   - ipa_button_widget: button
   - ipa_column_widget: column for table
   - ipa_table_widget: table

These widgets can be used to create input controls. They can also be
extended to create custom controls.

The framework has also been enhanced to support themes. Themes can be
used to change the look of the application without changing the code.
This would be useful to customize IPA deployments. Initially this is
only available in details section.

A theme is a collection of HTML templates. Each template is a complete
and valid HTML file which can be viewed using a browser. The template
will be loaded and initialized by the code, then filled with the data
from the server. The themes are located in install/static/themes folder.

By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
   - write a custom widget to generate the UI dynamically
   - create an HTML template and write the initialization code

For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
   - cleaner code and UI separation
   - more flexibility in customization
   - new pages can be developed quickly and require less coding
   - multiple templates can be used with the same initialization code
   - easier to maintain

The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use the
theme, add the following parameter to the URL, then reload the page:

    &theme=<theme name>

Currently the only available theme is 'default' which produces the
same layout as the custom widgets.

The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.

The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.

The Makefile has been updated to include the themes. The unit tests
also have been updated.

-- 
Endi S. Dewata

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-edewata-0025-2-HBAC-Details-Page.patch
Type: text/x-patch
Size: 139365 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20101103/cfdc22a2/attachment.bin>


More information about the Freeipa-devel mailing list