Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.EngineSettingViewBean


        final String engineSettingCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_ENGINE_SETTING_CODE);
        if(StringUtils.isNotEmpty(engineSettingCode)){
            // EDIT MODE
            final EngineSetting engineSetting = engineSettingService.getEngineSettingByCode(engineSettingCode);

            EngineSettingViewBean engineSettingViewBean = backofficeViewBeanFactory.buildViewBeanEngineSetting(requestData, engineSetting);
            request.setAttribute(ModelConstants.ENGINE_SETTING_VIEW_BEAN, engineSettingViewBean);

            Object[] params = {engineSetting.getName() + " (" + engineSetting.getCode() + ")"};
            overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.ENGINE_SETTING_EDIT.getKey(), params);
View Full Code Here


    /**
     *
     */
    public EngineSettingViewBean buildViewBeanEngineSetting(final RequestData requestData, final EngineSetting engineSetting) throws Exception {
        final EngineSettingViewBean engineSettingViewBean = new EngineSettingViewBean();
        engineSettingViewBean.setName(engineSetting.getName());
        engineSettingViewBean.setCode(engineSetting.getCode());
        engineSettingViewBean.setDescription(engineSetting.getDescription());
        if(StringUtils.isNotEmpty(engineSetting.getDefaultValue())){
            engineSettingViewBean.setDefaultValue(engineSetting.getDefaultValue());
        } else {
            engineSettingViewBean.setDefaultValue(Constants.NOT_AVAILABLE);
        }
       
        Set<EngineSettingValue> engineSettingValues = engineSetting.getEngineSettingValues();
        if (engineSettingValues != null) {
            for (Iterator<EngineSettingValue> iterator = engineSettingValues.iterator(); iterator.hasNext();) {
                EngineSettingValue engineSettingValue = (EngineSettingValue) iterator.next();
                engineSettingViewBean.getEngineSettingValues().add(buildViewBeanEngineSettingValue(requestData, engineSettingValue));
            }
        }
       
        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        Date dateCreate = engineSetting.getDateCreate();
        if (dateCreate != null) {
            engineSettingViewBean.setDateCreate(dateFormat.format(dateCreate));
        } else {
            engineSettingViewBean.setDateCreate(Constants.NOT_AVAILABLE);
        }

        Date dateUpdate = engineSetting.getDateUpdate();
        if (dateUpdate != null) {
            engineSettingViewBean.setDateUpdate(dateFormat.format(dateUpdate));
        } else {
            engineSettingViewBean.setDateUpdate(Constants.NOT_AVAILABLE);
        }

        engineSettingViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.ENGINE_SETTING_DETAILS, requestData, engineSetting));
        engineSettingViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.ENGINE_SETTING_EDIT, requestData, engineSetting));

        return engineSettingViewBean;
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.EngineSettingViewBean

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.