When you create a
solution, you can add tabs to your solution to allow users to configure the
solution and to access the functions of the solution in the
vSphere
Client.
You define the content of tabs
as dynamic Web pages. For example, you can define tabs that allow you to
perform the following kinds of actions.
■
|
Configure the solution.
|
■
|
Show events triggered by
the solution events or
vCenter Server.
|
■
|
Deploy predefined virtual
machines or vApps of different types.
|
■
|
Monitor the solution
application or the virtual machines that it deploys.
|
■
|
Uninstall the solution.
|
You create tabs by
implementing the
ExtSolutionManagerInfoTabInfo
data object in the program that manages the solution. You set properties in
ExtSolutionManagerInfoTabInfo
to provide a label for the tabs and a URL to the dynamic Web pages that provide
the content of the tabs. You create one
ExtSolutionManagerInfoTabInfo
instance for each tab that you add to your solution. You pass that instance to
ExtSolutionManagerInfo
in an array.
How you define the content of
the tabs depends on the function of the application that the solution adds to
vCenter Server.
The EAM Sample Solution adds a
Configuration portlet to the Summary page of the solution. With the EAM Sample
Solution Configuration page, you can deploy ESX agents on the hosts that
vCenter Server
manages and to uninstall the solution. You find the implementation of the EAM
Sample Solution Configuration page in
eam_sample_solution_working_folder\src\com\vmware\eam\sample\solution\ui.
Elements of the EAM
Sample Solution Configuration Page
|
|
ConfigModel.java
|
Defines the actions of the EAM Sample
Solution Configuration page by calling methods that
Manager.java and
AgentHandler.java
define.
|
ConfigController.java
|
Constructs the Web page that appears for the
EAM Sample Solution from the
eam_sample_solution_working_folder\war\WEB-INF\jsp\config.jsp
file.
|
The EAM Sample Solution
implements
ExtSolutionManagerInfoTabInfo
in the
Manager.java class.
Prerequisites
■
|
Download the vSphere ESX Agent Manager SDK.
|
■
|
Verify that you have set up
and started the EAM Sample Solution in an application server.
|
■
|
Verify that you have opened
eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java
in an editor.
|
■
|
Examine the code of the
ConfigController.java
and
ConfigModel.java
classes and the
config.jsp file to
see how they expose the functions of the EAM Sample Solution Configuration
page.
|
Procedure
1 | Create an instance of
ExtSolutionManagerInfo
in the program that manages the solution.
The following
lines in the
Manager.java class
show how the EAM Sample Solution creates an instance of
ExtSolutionManagerInfo.
private Extension createExtensionObject() {
Extension extension = new Extension();
[...]
ExtSolutionManagerInfo extSolutionManagerInfo =
new ExtSolutionManagerInfo();
[...]
}
|
2 | Create an instance of
ExtSolutionManagerInfoTabInfo
to contain the name of the page and a link to the Web page that defines its
contents.
ExtSolutionManagerInfoTabInfo extSolutionManagerInfoTabInfo =
new ExtSolutionManagerInfoTabInfo();
|
3 | Call the
ExtSolutionManagerInfoTabInfo.setLabel()
method to provide a name for the page.
Manager.java names
the EAM Sample Solution Configuration page.
extSolutionManagerInfoTabInfo.setLabel("Configuration");
|
4 | Call the
ExtSolutionManagerInfoTabInfo.setUrl()
method to provide a URL to the Web page that defines the contents of the EAM
Sample Solution Configuration page.
Manager.java uses the
config.html Web page
to define the contents of the configuration page.
extSolutionManagerInfoTabInfo.setUrl("/config.html");
|
5 | Add the tab to the array
of
ExtSolutionManagerInfoTabInfo
instances that define the tabs for the solution in the
ExtSolutionManagerInfo
object.
extSolutionManagerInfo.getTab().add(extSolutionManagerInfoTabInfo);
|
You added solution-specific
tabs that appear on the Summary page of the EAM Sample Solution.
What to do next
Set up health monitoring for
the solution and the objects that it manages.