Post

2 followers Follow
0
Avatar

Plugin: generic.NestedContainer inheritance

Hi,

I am working on a plugin for TIBCO Silver Fabric. I have only known about XL Deploy for about a week, but I've got most of it working so far. One thing I am struggling with is inheritance in generic.NestedContainer from the parent container.

In Silver Fabric, the basic infrastructure is: the manager hosts components and the components contain all the code/configuration to run an application. There might only be 3 or 4 managers total within an organization, but there can be very many components.

I started my plugin with a single container that is the manager (the manager needs to know the manager url, credentials, etc) and that works. However, I would need to create a new manager with the same properties (url, creds) for each component. So I want to use a generic.NestedContainer to represent the components, but I also need to inherit the creds from the parent manager container.

So I have an sf.Manager container that just extends the generic.Container with the extra properties I need (host, port, user, password). Then I created a generic.NestedContainer like so (in synthetic.xml):

<type type="sf.ComponentContainer" extends="generic.NestedContainer">
<property name="server" kind="ci" as-containment="true" referenced-type="sf.Manager"/>
<property name="componentName" required="true" description="component name" />
<property name="fabricManagerHost" hidden="false" default="${container.fabricManagerHost}" description="Host or IP of the Fabric manager to deploy to." />
<property name="fabricManagerPort" hidden="false" default="${container.fabricManagerPort}" description="Port number of the Fabric manager to deploy to." />
<property name="fabricManagerUser" hidden="false" default="${container.fabricManagerUser}" description="Fabric manager admin user." />
<property name="fabricManagerPassword" hidden="false" default="${container.fabricManagerPassword}" description="Fabric manager admin user's password." password="true" />
</type>

I know I don't understand all of that since I'm new to XLD. But my problem is that the properties that are supposed to be coming from the parent container (the manager) are actually getting filled in a literal strings. For instance, when I create a new ComponentContainer, the text in the fabricManagerUser field is literally ${container.fabricManagerUser}. I was expecting that that would actually be the value from the Manager container that the NestedContainer is is.

Anyway, any help is appreciated. I would just like to be able to pull values from the Manager container into the ComponentContainer container so that my scripts will be able to resolve them.

Thanks.

-Brad

Brad Niles Answered

Please sign in to leave a comment.

2 comments

1
Avatar

Hi Brad,

my 2 cents:
- The replacement of your variables ${} takes place during deployment, so you cannot show the new values during edits. However, you can hide those fields and access them during deployment.
- Actually, when hiding those fields, you don't need them, as you can access the values of the owning container directly. What I once did when I wanted to alter a part of an "inherited" value: I added a new hidden field, combining the different parts via variables, and added fields for the different parts that were adjustable
- I think the variables used must be changed to ${container.server.fabric...}
- I think you can remove the componentName property, as each CI as a name property, which you can use for the componentName during deployment - except of course if you want to allow the componentName differ from the name of the CI in XLD

Best regards
Christian

Christian Langmann 1 vote
0
Avatar

Thanks Christian!

That ${container.server.fabric...} was exactly what I needed. I was only pulling in the variables to try and diagnose the problem, now I can just use ${deployed.container.server.fabric...} in my scripts directly.

Brad Niles 0 votes