Creating Admin Pages for Components (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

See The Debug Console for an introduction to the debug console.

Locating the XSL Transform

XSL transforms for the debug console are bundled with the JAR file that contains the component code. This increases the portability of components, since the Administration user interface (i.e., the XSL transform) is included and installed automatically with the component software itself.

However, the Aspire Application will first attempt to load the transform from the following directory:

{Aspire Home}/resources/{component-implementation-class}

This is done for user interface development, since it is much easier to edit files in the Aspire Home directory than it is to edit files inside a component JAR file.

For example, if the component's Java implementation class is "com.searchtechnologies.aspire.components.RDBConnectionStage", then the aspire application will first attempt to load the transform from the following directory:

{Aspire Home}/resources/com.searchtechnologies.aspire.components.RDBConnectionStage

If the XSLT is not in Aspire Home, then it will then attempt to locate it in the component's JAR file, under the "resources/{component-implementation-class} directory. In this way, most of the components are bundled with the XSL transform used for their administration user interface.

Steps for Creating an XSL Interface for the Debug Console

  1. If you created your component using the Aspire stage archetype:
    1. Open up the src/main/resources/resources/{Java-Class-Name} folder in your project.
      • There will be a default XSL transforms for status.xsl and result.xsl.
    2. Modify these transform as necessary to provide status for your component.
      • There will also be a default image for your component in image.jpeg.
    3. Load an appropriate image for your component.
  2. Install your component into Aspire.
  3. Go to your component in the Aspire debug console: http://localhost:50505/aspire
  4. Check that your component's presentation looks correct.
  5. If you need to do more complex XSLT editing:
    1. Copy your "src/main/resources/resources/{Java-Class-Name}" to $ASPIRE_HOME/resources of your Aspire installation.
    2. Modify your XSLT transform.
    3. Click "Refresh" on your Aspire debug console.
      • You XSLT modifications should be immediately available.
    4. When done, copy the directory $ASPIRE_HOME/resources/{Java-Class-Name} back to the "src/main/resources/resources" directory of your project.
    5. And then re-build your project.

XSL Transform File Name

The XSL transform names are the same as the Aspire URL command names, i.e., the command names passed to the "cmd" parameter on the URL.

For example, "status.xsl" is the XSL transform used for all status reports.

If the XSL file for the specific command can not be located, the XSL transform called "result.xsl" will be located. This is the fallback transform used to present the result for most components.

Finally, if no "result.xsl" transform can be located, the XML will be sent directly to the admin user without a transform.