Show TOC Anfang des Inhaltsbereichs

Prozessdokumentation Creating a Support Platform Plug-In  Dokument im Navigationsbaum lokalisieren

This section describes how to create a plug-in project and plug-in, and to create a plug-in JAR file for deployment.

Prerequisite

      You have opened NetWeaver Developer Studio.

      You have installed the NetWeaver Developer Studio plug-in for the Support Platform.

      Your project has a reference to supportplatformengine.jar, which. is located in \j2ee\cluster\server0\bin\ext\tc~supportplatform~engine.

The file is also available from the SAP note described in Installing the NetWeaver Developer Studio Plug-in.

Procedure

...

       1.      Create a plug-in project by selecting File New Other Support Platform New Support Platform Plug-In Project.

Select a name for the project and click Finish. The project folder structure is created, as well as a plugins.xml file.

       2.      Create the plug-in class file by selecting File New Other Support Platform, and then selecting either Add a Simple Plug-In (creates an ISupportPluginclass) or Add a Configurable Plug-In (creates an IConfigurableSupportPluginclass).

A dialog is displayed that requires you to specify the following:

       The class package

       The name of the plug-in and where to display the plug-in within the Support Platform user interface

       You can specify a simple name. The plug-in is displayed at the top-level of the tree.

       You can specify a name that includes a folder (or path) in which to display the plug-in.

For example, if you specify myFolder/myPlugIn, the plug-in is displayed as myPlugIn in the myFolder folder, which is displayed at the top-level of the tree.

The following is a sample plugins.xml file,

<plugins>

    <plugin name="myFolder/myPlugIn">

        <class name="myPlugIn">

        </class>

    </plugin>

</plugins>

and how the plug-in is displayed in the Support Platform user interface.

Diese Grafik wird im zugehörigen Text erklärt

The entire value for name – including the entire path – is considered the name of the plug-in and must be unique.

       The name of the plug-in class

       3.      In the plug-in class, implement the following methods:

       getDescription(): Returns a description for the plug-in, which is displayed in the Task pane and as a tooltip when hovering over the plug-in name in the Plug-In pane.

       getColumnNames(): Returns a list of column names for the results table for this plug‑in. A Description column is created automatically.

The first custom column is displayed in the results table. The other columns are displayed in the results detail area below when you click a result row.

       analyze(): Performs some analysis and creates results to be displayed in the Results pane. This method is called when the administrator clicks Run.

The method is passed an IPluginActionobject, which you use to create results by calling the following methods on this object:

       addResult(): Adds a row in the result table.

The method enables you to mark the type of result (successful, info or error, by specifying an IResult constant), to indicate if the result is fixable, and provide a Vector of data to be displayed in the results table.

       addSuccessfulResultSimple(): Adds a row in the results table. The result is marked as successful and no additional data is displayed.

       addSuccessfulResult(): Adds a row in the results table. The result is marked as successful.

The method enables you to provide additional data to be displayed in the results table and results detail area.

       addMessage(): Adds a message to the message tab of the Results pane.

       fix(): Attempts to correct the problem that caused an error result and, if successful, changes the status of the result.

       ccessful, changes the status of the result.

When the administrator clicks Fix, the method is called once for each fixable error result. The result is fixable if you set the fixable parameter to true when creating the result.

       4.      For a configurable plug-in class, also implement the methods defined in the IConfigurableSupportPlugininterface.

For more information, see

       5.      If you want to make the plug-in dependent on another plug-in, create a dependency in the plugins.xml file. The Support Platform will not run the plug-in unless all results from the second plug-in are successful.

Add a <dependency>element inside the <plugin> element for the plug-in, and write in the tag’s body the name of the plug-in on which the current plug-in is dependent.

The following example makes myFolder/myPlugIndependent on myFolder/myPlugInChild:

<plugins>

    <plugin name="myFolder/myPlugIn">

        <class name="myPlugIn"/>

        <dependency>myFolder/myPlugInChild</dependency>

    </plugin>

    <plugin name="myFolder/myPlugInChild">

 

Ende des Inhaltsbereichs