Plugin Manifest Converter

  1. Overview
  2. Local plugin extension to Remote plugin json mappings
  3. Tool Options
  4. Tool Output
  5. Sample Commands

1. Overview

The plugin manifest converter tool helps in converting your local plugin's manifest file (plugin.xml) to the remote plugin's manifest format (plugin.json). The converter tool migrates the configuration of all the supported extensions from XML format to JSON format.
This tool supports the latest SDK version of the plugin.xml manifest file for conversion.

In addition to converting the plugin manifest file, the converter tool does the following conversions:

The tool does not support:

2. Local plugin extension to Remote plugin json mappings


The following table represents the local plugin extensions to remote plugin json mappings,

Plugin XML extensions Plugin JSON mappings
Global extensions:
  • vise.global.views
  • vise.navigator.nodespecs
  • vise.home.shortcuts
{
  "global": {
    "view": {
      "navigationId": "com.vmware.samples.htmlsample.welcomeView",
      "uri": "resources/datacenterSummary.html?title=DatacenterSummaryV1",
      "navigationVisible": true
    }
  }
}
               
Object Summary view extensions:
  • ${namespace}.summarySectionViews
{
  "objects": {
    "VirtualMachine": {
      "summary": {
        "view": {
          "uri": "resources/view1"
        }
      }
    }
  }
}
               
Configure extensions:
  • ${namespace}.manageViews
  • ${namespace}.settingsViews
{
  "objects": {
    "VirtualMachine": {
      "configure": {
        "views": [
          {
            "labelKey": "vmConfigureViewTitle1",
            "uri": "resources/view1"
          },
          {
            "labelKey": "vmConfigureViewTitle2",
            "uri": "resources/view2"
          }
        ]
      }
    }
  }
}
               
Monitor extensions:
  • ${namespace}.monitorViews
{
  "objects": {
    "VirtualMachine": {
      "monitor": {
        "views": [
          {
            "labelKey": "vmMonitorViewTitle1",
            "uri": "resources/view1"
          },
          {
            "labelKey": "vmMonitorViewTitle2",
            "uri": "resources/view2"
          }
        ]
      }
    }
  }
}
               
Actions
  • vise.actions.specs
{
  "objects": {
    "VirtualMachine": {
      "menu": {
        "actions": [
          {
            "labelKey": "vm.action.label",
            "icon": {
              "name": "action-1"
            },
            "trigger": {
              "type": "modal",
              "uri": "index.html?view=vm-action-modal",
              "titleKey": "vm.action.modal.title",
              "size": {
                "width": 600,
                "height": 250
              }
            }
          }
        ]
      }
    }
  }
}
               
I18n resources: Resource file links were part of plugin.xml for e.g.,
<resources baseUrl="locales/">
  <resource>
    com_vmware_samples_templateextensions
  </resource>
</resources>
               
 {
  "definitions": {
    "i18n": {
      "locales": [
        "en-US",
        "de-DE",
        "fr-FR"
      ],
      "definitions": {
        "RemoteSample:plugin.name": {
          "en-US": "vSphere HTML SDK Plugin",
          "de-DE": "vSphere HTML SDK Plugin",
          "fr-FR": "vSphere HTML SDK Plugin"
        }
      }
    }
  }
}
               
Icons were added as part of css or style configurations. Icon sprite sheet
 {
  "definitions": {
    "iconSpriteSheet": {
      "uri": "assets/images/sprites.png",
      "definitions": {
        "action-1": {
          "x": 0,
          "y": 0
        },
        "action-2": {
          "x": 0,
          "y": 32
        }
      }
    }
  }
}
               

The following templates/ extensions are not supported in the remote plugin.json,

3. Tool Options


Option Alias Description
--projectDir -p Required path to the project directory which contains the plugin.xml, MANIFEST.MF, locale properties files and plugin's css and images.
--outputDir -o Optional path to the output directory where the converted plugin.json, sprite image file and report.txt file are placed.
If this option is not specified then the converted files will be placed in the project directory specified with --projectDir or -p option.
--sdkVersion -v Optional property to specify the target SDK version for the manifest conversion. The default value is the initial SDK version "1.0.0".
--help -h Provides help on the input options.

4. Tool Output

The following files will be generated and placed in the output directory provided in the --outputDir or -o option by running the plugin manifest converter tool,

  1. plugin.json - The migrated plugin.json manifest file.
  2. sprite-image.png - The single sprite image consisting of all the plugin specific icons used in the extensions.
  3. After you run the converter tool, copy the sprite file from the output directory to its recommended location in the "assets/images" directory, and modify plugin.json to specify its location relative to the plugin.json file.
  4. report.txt - Information or warning for the unsupported extensions used in local plugin.xml manifest file which have not been converted by the plugin manifest converter tool.

5. Sample commands

Linux

./plugin-manifest-converter.sh --projectDir [path to the project directory]  --outputDir [path to the output directory]

Windows

plugin-manifest-converter.bat  --projectDir [path to the project directory]  --outputDir [path to the output directory]