Novell is now a part of Micro Focus

Using the Novell iManager Plug-in Studio

Novell Cool Solutions: Feature
By Matthew Sorensen

Digg This - Slashdot This

Posted: 28 Oct 2003
 

Update: Matthew Sorensen is a software engineer at Novell. If you have any questions about this article you may contact him at msorensen@novell.com

Introduction

In an effort to cut the time and resources associated with network management, many companies today are looking for ways to enhance the quality of the information stored in their directories; but that endeavor is made difficult by the lack of flexibility in most management consoles. Now, for the first time, Novell is changing that. With Novell iManager, Novell is delivering a management console that empowers the administrators, allowing them to design management interfaces tailored to their corporate directory policies.

Using the new Novell iManager Plug-in Studio, you can create a complete plug-in (management operation) without writing a single line of code. The Novell iManager Plug-in Studio is available as part of Novell iManager 2.0.1 and later. Novell iManager can be downloaded free of charge from here. This article will introduce you to the basic features and functions of the Plug-in Studio, and walk you through the process of creating a customized interface.

Topics:

  1. Types of Plug-ins
  2. What It Can Build
  3. Tour of Plug-in Studio
  4. Control Parameters
  5. What the Studio Creates
  6. Custom Java Code
  7. New Features

1. Types of Plug-ins

The Plug-in Studio can build four types of plug-ins:

  1. Property book pages
  2. Task for Create
  3. Task for Modify
  4. Task for Delete

All four of these plug-in types are for managing eDirectory objects.

One of the first steps of creating a plug-in will be to select which type of plug-in will be built.

2. What It Can Build

Three examples of when this is useful:

  1. Do you ever wish you could give your helpdesk administrators only a subset of the user management? Instead of the entire Modify User property book, you want them to see just a few attributes on the user (e.g. phone numbers, group membership, etc.).
  2. Have you extended the schema with your own attributes and/or class and now need a way to create these objects and manage them?
  3. Do you use auxiliary classes and find it annoying that you must first create the user with one task and then use another task to extend the object with your custom auxiliary class? Wouldn't it be nice to do it all in one step?

Custom user management:

Many companies, especially large companies, have helpdesk personnel that focus specifically on user management. Often super administrators may not want helpdesk administrators viewing or modifying some of the information contained in the Modify User property book.

To solve this problem, administrators can build tasks that contain only the fields they want their helpdesk managing. Not only does this have security benefits, it also allows for a simpler user interface that is easier for helpdesk administrators to use.

Steps to create the above task (figure 2):

  1. Click on the Configure tab at the top of iManager.
  2. Expand the Task Configuration role.
  3. Click on the Plug-in Studio task.
  4. You should now see a list of custom tasks. Click the New button.
  5. Click the Next button.
  6. You are now in the Plug-in Studio development environment (see figure 3).
  7. Double click on all fields you want in your task.
  8. Use drag and drop to order the fields how you would like.
  9. Fill in the plug-in properties at the bottom.
  10. Click Install (found at the top of the page).

Now to run the task, simply log in as a user who is a member of the role you have assigned the task to. Run the task. If you decide you want to add or remove fields, this can also be done from the Plug-in Studio.

Building a management interface for custom schema:
Novell eDirectory has a base schema that contains classes such as Users, Groups, Lists, Dynamic Groups, and Organizational Units. However, it also allows customers to extend this schema with custom attributes and classes that make sense for that customer's data needs.

With the iManager Plug-in Studio, customers can now build custom user interfaces for managing this data.

Combining auxiliary classes and an effective class in the same task:
More and more customers are using auxiliary classes to hold custom data. Using ConsoleOne or iManager to create and manage objects with auxiliary classes can be more work than managing with traditional objects. For example, to create a user with an auxiliary class, three separate tasks must be run. However, you can build a task with the Plug-in Studio that will do the same work in one step.

The Plug-in Studio allows you to build a task to create objects and automatically extend them with one or more auxiliary classes. To do this, select an effective object class like User. Then click the check box to add auxiliary classes and choose the classes you want to add. Also, change the plug-in type to Create task.

After picking the field you want in the studio development environment, you now have a one-page task that shows exactly the fields you will be using. It will create the object, extend the object with auxiliary classes, and value the attributes you want, all in one page.

3. Tour of Plug-in Studio

Figure 3: Plug-in Studio

Menu Bar: From the menu bar you can preview the plug-in. While running the preview, any changes made to the eDirectory object will be saved. From the menu you can also install the task. This will generate the files necessary and install the current plug-in into eDirectory. It will then be available for immediate use. Exit closes the studio without saving the current plug-in.

Plug-in Fields: These are the fields you have added you your plug-in. If you are building a Create task, then the mandatory attributes will already be added for you. To the right of each field you will see three buttons. The first one will allow you to change the parameters of the field (discussed later). The second button allows you to change the type of control the field will be displayed with. The final button allows you to remove the field. Mandatory attributes cannot be removed from Create tasks.

Plug-in Properties: This section allows you to provide general information about the plug-in (like its name).

Attributes: The attributes section shows all of the available fields that the user can add to the selected fields section. Users can double click on an item, which will add the field using the default control, or can click once and choose a control from the controls section.

Controls: For the attribute selected in the attributes section, the Plug-in Studio will discover all of the controls that can be used to manage this attribute based on its syntax and attribute type. In many cases, the user will have multiple options. For example, the attribute "Allow Unlimited Credit" is a Boolean syntax. The Plug-in Studio provides three controls for managing attributes of Boolean syntax (checkbox, radio button, and select box).

4. Control Parameters

Most controls allow the user to specify parameters to customize the control. Currently most controls support the read-only parameter. This is very useful when you want to build a task for displaying the information, but not modifying the information. Choosing to make a field read-only will both disable the user interface and also only give the users read access to that attribute (if you are using Role-Based Services).

Another interesting parameter that some controls offer is the values parameter. This is fantastic for creating a plug-in for a particular company. If your company has three departments (research, marketing, and IST) you can build a plug-in for creating users that will only allow user creation in those containers.

Above we are using the radio button control for the container field (where the object will be created). This is beneficial for two reasons: First, it is much easier to use. The user does not need to type in the container or browse the tree for it. The user simply picks one of the three containers. A second advantage is that it can be used to limit helpdesk administrators as to where they create objects in the tree.

5. What the Plug-in Studio Creates

The Plug-in Studio creates:

  1. JSP file used to build the GUI
  2. An XML descriptor of the plug-in (to plug-in to the iManager framework)
  3. Adds information to Custom.npm

JSP file:
The JSP file is a file that contains both HTML and Java tag libraries calls that are run on the server. This file will be created at webapps/nps/portal/modules/custom/skins/default/devices/default/???.jsp. A copy of the file is also added to the Custom.npm file.

For those of you who are ambitious or know Java, this file can be modified to make custom enhancements not possible through the Plug-in Studio. For example, you could add an image that displays your company's logo. Note, however, that if you use the Plug-in Studio's Modify Plug-in feature, you will lose any manual modification you have made to the JSP file.

XML descriptor: For property pages, an XML file is created and written to the webapps/nps/portal/modules/custom/plug-ins/plug-ins.xml file. This contains information such as the page's name and what object class it is used to manage. For tasks, the XML descriptor is installed into eDirectory and the information is stored on an RBSTask object. For the pages and tasks, a copy of the XML descriptor is added to the Custom.npm.

Custom.npm The Custom.npm is essentially a zip file that contains all of the custom plug-ins created by the Plug-in Studio. This file is used for two proposes: First, it is used to automatically synchronize plug-ins with other iManager servers in this same tree. Another use is that of moving the custom plug-ins to another tree. For example, you can take this one file from a test environment to a production environment and simply deploy the NPM and then run the Configure iManager task. The two tasks Deploy and Configure are found on the Configure tab of iManager.

6. Custom Java Code

For many developers and consultants, the Plug-in Studio helps to quickly build most of the user interface needed, but sometimes there is a need for custom business logic to interact with other systems besides eDirectory. For example, one company wanted to automatically create a UNIX account for the user when a task was run. This and most anything else you can dream up can be accomplished by writing your own Java code. The Plug-in Studio makes this very easy by doing the work it knows how to do and letting you do the work you know how to do.

If you have built a custom task using the Plug-in Studio and want to write your own custom Java code, you can do that by overriding one or more of four methods. Below is an example:
public class MyCustomTask extends eDirAccessService
{
   protected boolean preRead(TaskContext context, Properties resultStrings)
   {
      // do work here
      return true;
   }

   protected boolean postRead(TaskContext context, Properties resultStrings)
   {
      // do work here
      return true;
   }

   protected boolean preWrite(TaskContext context, Properties resultStrings)
   {
      // do work here
      return true;
   }

   protected boolean postWrite(TaskContext context, Properties resultStrings)
   {
      // do work here
      return true;
   }
}

If you want to add custom Java code to a page, follow this example:

public MyCustomPage extends DirPropertyBookPage
{
   public void cache(PropertyPageContext context) throws PageException
   {
      // work here
      save(context, context.getResultStrings());
      // or work here
   }

   public void show(PropertyPageContext context) throws PageException
   {
      show(context, context.getResultStrings());
   }
}

After your Java code is compiled and placed in the classpath (classes or lib directory), you will need to update the plug-in to point to your Java class instead of the default one the Plug-in Studio uses. For a task, this is done by modifying the RBSTask object in eDirectory. Change the entry point attribute to be your full class name. For a property page, the change is made by editing the plug-ins XML file in the custom/plug-ins directory. Change the entry-point element to the full class name.

Note: If you are planning to add custom Java code, please download the iManager SDK from developer.novell.com for documentation.

7. New Features

The following features are new in iManager 2.0.1:

Copy Plug-in: You can now copy existing custom plug-ins. This is great when you want to create a plug-in similar to an existing custom plug-in.

Modify Plug-in: You can now modify existing custom plug-ins. Note: Any manual modifications to the JSP file created by the Plug-in Studio will be lost.

Drag and Drop: Ordering of fields is much faster. Simply drag the fields into the order you like.

Non-functional Preview: As you select fields to add to your plug-in, you will immediately see a non-functional preview to show you approximately what your plug-in will look like. Of course, you still have access to the full preview that lets you interact with each control and try the plug-in on real eDirectory objects.

Better Auxiliary Class support: Plug-ins can now combine both auxiliary class attributes and effective class attributes in the same plug-in.

Plug-in Overview: This task shows all currently created custom plug-ins (property pages, tasks for Modify, and tasks for Create). This task allows administrators to run the New, Copy, and Modify Plug-in tasks. It also allows administrators to delete custom plug-ins.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© Copyright Micro Focus or one of its affiliates