Package org.jmanage.webui.forms

Examples of org.jmanage.webui.forms.ApplicationForm


                                 HttpServletResponse response)
            throws Exception{
        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);
        ApplicationConfig config = context.getApplicationConfig();
        ApplicationForm appForm = (ApplicationForm)actionForm;
        ApplicationType appType = config.getApplicationType();
        MetaApplicationConfig metaAppConfig =
                appType.getModule().getMetaApplicationConfig();

        /* populate the form */
        appForm.setApplicationId(config.getApplicationId());
        appForm.setName(config.getName());
        appForm.setType(config.getType());
        if(metaAppConfig.isDisplayHost())
            appForm.setHost(config.getHost());
        if(metaAppConfig.isDisplayPort())
            appForm.setPort(String.valueOf(config.getPort()));
        if(metaAppConfig.isDisplayURL())
            appForm.setURL(config.getURL());
        if(metaAppConfig.isDisplayUsername())
            appForm.setUsername(config.getUsername());
        if(metaAppConfig.isDisplayPassword() && config.getPassword() != null
                && config.getPassword().length()>0)
            appForm.setPassword(ApplicationForm.FORM_PASSWORD);

        // for jsr160
        Map paramValues = config.getParamValues();
        appForm.setJndiFactory((String)paramValues.get(ApplicationConfig.JNDI_FACTORY));
        appForm.setJndiURL((String)paramValues.get(ApplicationConfig.JNDI_URL));

        request.setAttribute(RequestAttributes.META_APP_CONFIG, metaAppConfig);

        /*set current page for navigation*/
        request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Edit Application");
View Full Code Here


                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(),
                ACL_ADD_APPLICATIONS);

        ApplicationForm appForm = (ApplicationForm)actionForm;
        ApplicationType appType =
                ApplicationTypes.getApplicationType(appForm.getType());
        assert appType != null: "Invalid app type: " + appForm.getType();

        if(appForm.getType().equals("connector"))  {
            return mapping.findForward("connector");
        }

        ModuleConfig moduleConfig = appType.getModule();
        MetaApplicationConfig metaAppConfig = moduleConfig.getMetaApplicationConfig();
        request.setAttribute(RequestAttributes.META_APP_CONFIG, metaAppConfig);

        appForm.setHost(appType.getDefaultHost());
        appForm.setPort(appType.getDefaultPort());
        appForm.setURL(appType.getDefaultURL());

        /*set current page for navigation*/
        request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE, "Add Application");
        return mapping.findForward(Forwards.SUCCESS);

View Full Code Here

                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);
        ApplicationForm appForm = (ApplicationForm)actionForm;
        ApplicationConfig config=ApplicationConfigManager.deleteApplication
                (appForm.getApplicationId());

        String appType = config.getType();
        if ("connector".equals(appType)) {
            ConnectorRegistry.remove(config);
        }
View Full Code Here

                                 ActionMapping mapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception{
        ApplicationForm appForm = (ApplicationForm)actionForm;

        /* create ApplicationConfigData from this form */
        ApplicationConfigData appConfigData = new ApplicationConfigData();
        CoreUtils.copyProperties(appConfigData, appForm);
        Map<String, String> paramValues = new HashMap<String, String>();
        if(appForm.getJndiFactory() != null)
            paramValues.put(ApplicationConfig.JNDI_FACTORY, appForm.getJndiFactory());
        if(appForm.getJndiURL() != null)
            paramValues.put(ApplicationConfig.JNDI_URL, appForm.getJndiURL());
        appConfigData.setParamValues(paramValues);

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

                                 HttpServletResponse response)
            throws Exception {

        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);
        ApplicationForm appForm = (ApplicationForm)actionForm;
        ApplicationConfig config =
                ApplicationConfigManager.getApplicationConfig(
                        appForm.getApplicationId());
        assert config != null;

        config.setName(appForm.getName());
        config.setHost(appForm.getHost());
        if(appForm.getPort() != null)
            config.setPort(new Integer(appForm.getPort()));
            config.setURL(appForm.getURL());
            config.setUsername(appForm.getUsername());

        final String password = appForm.getPassword();
        if(!ApplicationForm.FORM_PASSWORD.equals(password)){
            config.setPassword(password);
        }

        Map<String, String> paramValues = config.getParamValues();
        if(appForm.getJndiFactory() != null){
            paramValues.put(ApplicationConfig.JNDI_FACTORY, appForm.getJndiFactory());
        }else{
            paramValues.remove(ApplicationConfig.JNDI_FACTORY);
        }

        if(appForm.getJndiURL() != null){
            paramValues.put(ApplicationConfig.JNDI_URL, appForm.getJndiURL());
        }else{
            paramValues.remove(ApplicationConfig.JNDI_URL);
        }

        ApplicationConfigManager.updateApplication(config);
View Full Code Here

TOP

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

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.