The layout view used to create visualizations in Novell Operations Center (NOC) supports the use of drawing templates. These templates allow us to “create once” and “use everywhere” when creating our visualizations.
For example, we may have a specific class of element in our system. Whenever we view a drawing for an element of this class in the system, we want to see a particular drawing format. This scenario can be accomplished with drawing templates. The goal of this post is to briefly describe how to create and apply drawing templates in NOC.
Consider the hypothetical example element hierarchy below that consists of several “ServerGroup” root elements which each contain several “Server” element children.
Currently, if we view any of these “ServerGroup” elements in the Layout View, we see the default drawing for the element:
While this drawing is useful for basic hierarchy traversal, we are really interested in creating a better looking visualization for our “ServerGroup” element. Let’s set a goal for ourselves at this point which is the following:
Whenever we view a visualization for a “ServerGroup” element, we want to see an organized container of the element’s children sorted by severity.
Let’s start by creating this new type of drawing. We’ll begin by using one of our existing “ServerGroup” elements as a sandbox in order to create and test the new drawing. Once we have the drawing in the form that we like, we’ll save the drawing as a template to be used for all instances of “ServerGroup”. While viewing the drawing for element “ServerGroupOne”, right-click the background of the drawing and select “New Drawing”. This will clear the drawing and put the editor into edit-mode. Now, let’s add a child container by using the “Customize” menu option available on the background right-click context menu. Select “Customize -> Add -> Container -> Children Container”. This will insert a default children container group into the drawing.
Let’s also set a new global nodestyle for this drawing by dragging the “Server1_ALL” nodestyle from the “Graphics -> Nodes” branch onto the background of the drawing and selecting “yes” when prompted to change the ambient nodestyle. We will now have a drawing that looks like the following:
Let’s make one more change to our container before we turn the drawing into a template. We mentioned sorting earlier so now we will add sorting by element severity. Right-click on the rectangle of the container and select “Customize -> Child Container -> Sorting -> Adjust Sorting…”. This brings up the following dialog:
Select a “Sort Direction” of “Ascending” and a “Sort By” of “Condition” and then click “OK”. This will change the sort order to look like the following:
Now save the drawing by clicking on the save button on the drawing toolbar. What we now have is a visualization that is saved on the current element. Whenever we view this element in the Layout View, we will see this drawing. However, if we switch to another “ServerGroup” element such as “ServerGroupTwo”, we still see the following drawing:
Let’s now go ahead and create our template based on our newly created drawing. Switch back to the element “ServerGroupOne” and right-click on the background and select “Save As Custom…” to bring up the following dialog:
Select “Save drawing as template for all elements of class: ServerGroup” and click “Save”. This will create a new drawing template under the “Graphics -> Templates -> _class” folder and then assign this template drawing to the “ServerGroup” metamodel class definition. Now when we view other “ServerGroup” elements in the Layout View we will see this new template drawing applied in the view. Let’s go back to “ServerGroupTwo” to confirm that everything worked:
That’s all there is to it. Novell Operations Center makes it easy to create drawing templates which can be applied to certain classes of elements.