Add Tabs to the EAM
Sample Solution
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
.
- Verify that you have set up and started the EAM Sample Solution in an application server.
- Verify that you have openedin an editor.eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java
- Examine the code of theConfigController.javaandConfigModel.javaclasses and theconfig.jspfile to see how they expose the functions of the EAM Sample Solution Configuration page.
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 .
- 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
.
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
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\uiFile
| Description
|
---|---|
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 |
The EAM Sample Solution
implements
ExtSolutionManagerInfoTabInfo
in the
Manager.java
class.
- Create an instance ofExtSolutionManagerInfoin the program that manages the solution.The following lines in theManager.javaclass show how the EAM Sample Solution creates an instance ofExtSolutionManagerInfo.private Extension createExtensionObject() { Extension extension = new Extension(); [...] ExtSolutionManagerInfo extSolutionManagerInfo = new ExtSolutionManagerInfo(); [...] }
- Create an instance ofExtSolutionManagerInfoTabInfoto contain the name of the page and a link to the Web page that defines its contents.ExtSolutionManagerInfoTabInfo extSolutionManagerInfoTabInfo = new ExtSolutionManagerInfoTabInfo();
- Call theExtSolutionManagerInfoTabInfo.setLabel()method to provide a name for the page.Manager.javanames the EAM Sample Solution Configuration page.extSolutionManagerInfoTabInfo.setLabel("Configuration");
- Call theExtSolutionManagerInfoTabInfo.setUrl()method to provide a URL to the Web page that defines the contents of the EAM Sample Solution Configuration page.Manager.javauses theconfig.htmlWeb page to define the contents of the configuration page.extSolutionManagerInfoTabInfo.setUrl("/config.html");
- Add the tab to the array ofExtSolutionManagerInfoTabInfoinstances that define the tabs for the solution in theExtSolutionManagerInfoobject.extSolutionManagerInfo.getTab().add(extSolutionManagerInfoTabInfo);
You added solution-specific
tabs that appear on the Summary page of the EAM Sample Solution.
Set up health monitoring for
the solution and the objects that it manages.