throws Exception {
AccessController.checkAccess(
context.getServiceContext(), ACL_ADD_APPLICATIONS);
ConnectorForm connForm = (ConnectorForm)actionForm;
ApplicationType appType =
ApplicationTypes.getApplicationType(connForm.getType());
assert appType.getId().equals("connector"): "Invalid app type: " + connForm.getType();
ModuleConfig moduleConfig = appType.getModule();
MetaApplicationConfig metaAppConfig = moduleConfig.getMetaApplicationConfig();
request.setAttribute(RequestAttributes.META_APP_CONFIG, metaAppConfig);
if (connForm.getConnectorId() == null
|| connForm.getConnectorId().length() == 0
|| connForm.getConnectorId().equals("none")) {
connForm.setConfigNames(new String[0]);
}
else {
ConnectorConfigData cfgData =
ConnectorConfigRegistry.getConnectorConfigData(
connForm.getConnectorId());
connForm.setConfigNames(cfgData.getFieldNames());
connForm.setConfigValues(cfgData.getFieldDefaultValues());
}
connForm.setConnectorNames(ConnectorConfigRegistry.getConnectorNames());
connForm.setConnectorIds(ConnectorConfigRegistry.getConnectorIdList());
/*set current page for navigation*/
request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Add Connector");
return mapping.findForward(Forwards.SUCCESS);
}