Package org.jmanage.webui.forms

Examples of org.jmanage.webui.forms.ConnectorForm


            throws Exception {

        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);

        ConnectorForm connForm = (ConnectorForm) actionForm;

        ApplicationConfig config =
                ApplicationConfigManager.getApplicationConfig(
                        connForm.getApplicationId());

        assert config != null;

        config.setName(connForm.getName());

        Map<String, String> paramValueMap = config.getParamValues();

        String[] paramNames = connForm.getConfigNames();
        String[] paramValues = connForm.getConfigValues();

        for (int i = 0; i < paramNames.length; i++) {
            if(paramValues[i] != null) {
                paramValueMap.put(paramNames[i], paramValues[i]);
            }
View Full Code Here


        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);

        ApplicationConfig config = context.getApplicationConfig();

        ConnectorForm connForm = (ConnectorForm)actionForm;

        connForm.setApplicationId(config.getApplicationId());
        connForm.setName(config.getName());
        connForm.setType(config.getType());

        Map paramValues = config.getParamValues();
        String connId = (String) paramValues.get(ConnectorForm.CONNECTOR_ID);
        ConnectorConfigData cfgData =
                ConnectorConfigRegistry.getConnectorConfigData(connId);

        String[] attrNames = cfgData.getFieldNames();
        for(int i = 0; i < attrNames.length; i++) {
            String value = (String) paramValues.get(attrNames[i]);
            if (value != null) {
                connForm.setConfigName(i, attrNames[i]);
                connForm.setConfigValue(i, value);
            }
        }

        connForm.setConnectorId(connId);
        connForm.setConnectorName(cfgData.getConnectorName());

        /*set current page for navigation*/
        request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Edit Application");
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {

        ConnectorForm connForm = (ConnectorForm) actionForm;
        String[] paramNames = connForm.getConfigNames();
        String[] paramValues = connForm.getConfigValues();

        /* create ApplicationConfigData from this form */
        ApplicationConfigData appConfigData = new ApplicationConfigData();
        Map<String, String> paramValueMap = new HashMap<String, String>();

        paramValueMap.put(ConnectorForm.CONNECTOR_ID, connForm.getConnectorId());

        for (int i = 0; i < paramNames.length; i++) {
            paramValueMap.put(paramNames[i], paramValues[i]);
        }

        appConfigData.setName(connForm.getName());
        appConfigData.setType(connForm.getType());
        appConfigData.setParamValues(paramValueMap);

        ConfigurationService service = ServiceFactory.getConfigurationService();
        appConfigData = service.addApplication(Utils.getServiceContext(context), appConfigData);
       
View Full Code Here

            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);
    }
View Full Code Here

TOP

Related Classes of org.jmanage.webui.forms.ConnectorForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.