4.0

Table Of Contents
10 Add error handling to the implementation of the configuration action.
The SolarSystemConfigureAction class returns an array of errors if the configuration is invalid.
public ConfigurationError[] getConfigErrors() {
return configErrors;
}
public void setConfigErrors(ConfigurationError[] configErrors) {
this.configErrors = configErrors;
}
public int getConfigErrorsSize() {
return configErrors.length;
}
11 Add the configuration adapter to the Struts Web application in the configuration interface by
implementing the ModelDriven.getModel() class from the OpenSymphony XWork2 framework.
The SolarSystemConfigureAction class passes an instance of the SolarSystemConfigurationAdaptor to the
Struts framework.
public SolarSystemConfigurationAdaptor getModel() {
return solarSystemConfigurationAdaptor;
}
You created the configuration action that instantiates the configuration adapter and implements the
Orchestrator BaseAction and OpenSymphony ModelDriven classes. The BaseAction and ModelDriven classes
pass configuration information from the Orchestrator configuration interface to the Orchestrator server
through the Struts framework.
What to do next
Create a Struts-based Web application to add a tab to the Orchestrator configuration interface.
Create a Struts-Based Web Application to Add to the Configuration Interface
The tab that you add to the Orchestrator configuration interface is an Apache Struts-based Web application.
You define the layout of the page by using HTML or JavaServer Pages (JSP) and add actions to the page by
implementing the Struts framework.
To add a configuration tab to the Orchestrator configuration interface, you must include a Web application
archive (WAR) file in the DAR file of the plug-in.
The DAR file of the solar system plug-in contains a built WAR file for the solar system configuration tab. You
can also examine the files of the solar system configuration Web application in the bundle of source files of the
solar system plug-in.
n
VSOSDK-SolarSystem\webapp\index.jsp
n
VSOSDK-SolarSystem\webapp\WEB-INF\web.xml
n
VSOSDK-SolarSystem\webapp\WEB-INF\pages\configure.jsp
n
VSOSDK-SolarSystem\src\struts.xml
You must be familiar with Web application development technologies, including the Struts framework and
JSP. See the Apache Struts documentation for information about Struts. For details of all the directories and
files that the WAR file contains, see “Contents of the Solar System Configuration WAR File,” on page 200.
Prerequisites
n
Implement the plug-in adapter and factory interfaces.
n
Create the configuration adapter and configuration action implementations.
vCenter Orchestrator Developer's Guide
198 VMware, Inc.