ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srimanth Gunturi <sgunt...@hortonworks.com>
Subject Re: Redefine Themes and Themes inheritance
Date Tue, 09 Feb 2016 19:38:48 GMT
Hello,
The way merging with parent themes happens is by the 'name' property for layouts, and 'config'
property for placements and widgets.
Which means that you can override in a child the entire layout, tab, section, sub-section
defined in the parent. 
You can also change and delete the placements of configs.
You can also change the type of widgets for a config.

So getting back to your questions:
> 1. Is there any way to add a new section and configurations to display on an existing
themes file?

Yes - can you please try in your child theme to define a layout and tab with the same 'name'
as parent, and then add a section with a new 'name'.
If you want to remove a section, subsection, etc. from the parent, just define it in the child
with same name, but with empty values.

> Does the new one defined in common services overwrite the stack inherited one?
Themes are only defined in the stacks/ folder - not in common-services... so you would not
hit this situation.

If you are still unable to get it to work, maybe you can share the exception, and maybe the
parent and child themes.
Hope this helps.
Regards,
Srimanth




________________________________________
From: Juanjo Marron <juanjo.marron@yahoo.com.INVALID>
Sent: Monday, February 08, 2016 6:06 PM
To: Ambari
Subject: Redefine Themes and Themes inheritance

Hi all,

Couple of questions related with themes inheritance and redefinition:

1. Is there any way to add a new section and configurations to display on an existing themes
file?

For HBASE in HDP stack I saw initial themes is defined in 2.2 stack and in 2.3 some configuration/widgets
are removed (pointed to null).

For RANGER, two theme files are defined with different name for HDP 2.2 (theme_version_1.json)
and HDP 2.3 (theme_version_2,.json). New section, properties and widget are added in version_2
compared with version_1.

My doubt is, is it possible to overwrite theme.json file to add new subsection similar to
the merge process .xml files are doing or it needs to be complete redefined?



2. How is the design for merging theme.json file?

In case a service has some theme.json file inherited from the previous stack (stack inheritance)
and the new stack version also extends a common-service definition with themes on it (service
inheritance). Are they merged? Does the new one defined in common services overwrite the stack
inherited one?

A good example could be if HBASE in HDP 2.3 extends a new common-service definition (lets
say 1.2.0.2.3) with a new theme definition, and HDP 2.3 receives also a theme file from previous
HDP 2.2 stack inheritance.

I'm facing java errors when trying to merge theme.json files with a scenario similar to the
one  detailed below. Im not sure if the java code (org.apache.ambari.server.state.theme.Section.mergeWithParent)
is supporting this double inheritance stack& service for theme .json files.

Does anyone have some insight on it?

Thanks for your help

Mime
View raw message