Basic customization of layout views in NOC
The Novell Operations Center provides a useful tool for visualizing items in your element hierarchy. I’m sure just about every user of the NOC Client has run across a view that resembles something like the following:
This is the default layout view for an element that has no customized drawing saved on that element. This view shows a hierarchy of one parent and its children rendered in a compact tree using a common graphic. This common graphic is the one used for all default layout views. This type of view is a good starting point for diagrams simply aiming to show names and conditions of elements, but that is about as far as it goes.
The goal of this post is to show how easily a user can customize the graphic used for a given element in a layout view.
When an element graphic is picked for display in the layout view, a simple algorithm is used to determine the specific graphic to show for a given element (in this priority order):
1) Does the current layout view have a custom graphic specified for this specific element in THIS layout view?
2) Does the element’s class definition have a custom graphic specified on itself?
3) Does the view containing the element have a custom graphic specified in the view?
If none of these criteria are met, then a default graphic is used, which is what you see in the default layout view. Let’s now go and demonstrate how to set each of three customized settings listed in the above algorithm.
Before we begin, let’s clarify what a customized graphic is for a given element. We refer to these custom graphics as “nodestyles” and we will use that terminology from this point forward. These nodestyles are simply layout view drawings themselves that can be used as mini-templates for rendering the graphic for a single element in a view. Nodestyles are defined at the following location in the NOC Client:
Version 4.7 of the NOC Client shipped with a sample nodestyle library. Here is a sample of that library showing server-related nodestyles:
Any of these nodestyles can be used to customize the graphic used in a layout view for one or all elements in the view. Let’s go ahead and start customizing our layout views. We’ll start with a default layout view for the following sample hierarchy:
NOTE: We’re going to work in reverse to demonstrate how the graphic algorithm is implemented.
How do I specify the graphic to be used for ALL elements in a given drawing?
First determine the desired nodestyle to be used for the drawing. Remember that these are defined in the “Administration” hierarchy under “Graphics/Nodes”. Since our drawing appears to contain all “server-like” elements, let’s go ahead and set the view to use the “Server1_ALL” nodestyle. To accomplish this, select the target view in the element tree so that the view is rendered for that element. Then, drag and drop the “Server1_ALL” nodestyle onto the background on the target layout view. It is import to ensure that you do not drop onto part of the drawing, but instead on the background whitespace. If done correctly, the following prompt will be displayed:
Select “yes” and the view should re-render to something like the following:
This demonstrates algorithm item “3” from above. The layout view itself specifies the custom graphic to use when rendering elements for this view.
In this hierarchy, there are two types of servers. Generic servers and "desktop" servers.
Let’s now say that we want to keep the current nodestyle rendering for the view, but I want to render all “desktop-server” servers with a different nodestyle.
This can be accomplished by setting the nodestyle to be used for all desktop servers in the system. While still in the Layout View tab, go to the metamodel class definition for a “desktop-server” and select the “Element Nodestyle” channel from the upper toolbar:
This will switch to the nodestyle setting panel for the current class definition element. Now, drag and drop the “Desktop” nodestyle onto the right-hand panel and you should see the following:
If you switch back to the DEMO element, you should now see that the desktop servers are now rendered using the new nodestyle.
This demonstrates algorithm item “2” from above. All instances of class “desktop-server” will be rendered using the “Desktop” nodestyle.
Now, let’s say that we’re happy with this view with the exception of one element in the view.
Let’s pretend that we really want to render element "ServerTwo" as a laptop-like graphic.
This element is already a “desktop-server” element. We’ve already specified that the view should use the “Server1_ALL” nodestyle and that all “desktop-server” element instances in the system should be rendered using the “Desktop” nodestyle. NOC still provides the user with localized view override ability that allows the user to override the nodestyle for an element in the drawing. To accomplish this, just drag the “Laptop” nodestyle from the “Graphics” hierarchy directly on to the "ServerTwo" element in the current layout view to present the following question:
Select “Change Node Style For This Node only” from the menu and the view should render something like the following:
This demonstates algorithm item “1” from above. We now have a localized layout view override of an element’ custom graphic. This override can be removed by right-clicking the element "ServerTwo" in the drawing:
By selecting “Remove Nodestyle Override” we can remove this override and the drawing will revert back to the last revision.
This demo is just the tip of the iceberg on NOC layout view customization, but I hope that this gives a good primer on basic customizations.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.