Package org.joget.apps.userview.model

Examples of org.joget.apps.userview.model.UserviewTheme


                String appId = request.getParameterValues("__a_")[0];
                String uId = request.getParameterValues("__u_")[0];

                if (!appId.isEmpty() && !uId.isEmpty()) {
                    UserviewService userviewService = (UserviewService) appContext.getBean("userviewService");
                    UserviewTheme theme = userviewService.getUserviewTheme(appId, uId);

                    if (theme != null && theme.getCss() != null) {
                        return theme.getCss();
                    }
                }
            } catch (Exception e) {
                LogUtil.error(AppUtil.class.getName(), e, "getUserviewThemeCss Error!");
            }
View Full Code Here


            setting.setProperties(PropertyUtil.getPropertiesValueFromJson(settingObj.getJSONObject("properties").toString()));

            //set theme & permission
            try {
                JSONObject themeObj = settingObj.getJSONObject("properties").getJSONObject("theme");
                UserviewTheme theme = (UserviewTheme) pluginManager.getPlugin(themeObj.getString("className"));
                theme.setProperties(PropertyUtil.getPropertiesValueFromJson(themeObj.getJSONObject("properties").toString()));
                theme.setRequestParameters(requestParameters);
                theme.setUserview(userview);
                setting.setTheme(theme);
            } catch (Exception e) {
                LogUtil.debug(getClass().getName(), "set theme error.");
            }
            try {
View Full Code Here

        }
        return "";
    }
   
    public UserviewTheme getUserviewTheme(String appId, String userviewId) {
        UserviewTheme theme = null;
       
        Long appVersion = appService.getPublishedVersion(appId);
        HttpServletRequest request = WorkflowUtil.getHttpServletRequest();
        if (appVersion != null && request != null) {
            AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
            if (appDef != null) {
                UserviewDefinition userviewDef = userviewDefinitionDao.loadById(userviewId, appDef);
                if (userviewDef != null) {
                    String json = userviewDef.getJson();
                    //process json with hash variable
                    json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null);
                   
                    Map requestParameters = convertRequestParamMap(request.getParameterMap());
                    requestParameters.put("contextPath", request.getContextPath());
                    requestParameters.put("appId", appDef.getAppId());
                    requestParameters.put("appVersion", appDef.getVersion().toString());
                   
                    try {
                        Userview userview = new Userview();
                       
                        //set userview properties
                        JSONObject userviewObj = new JSONObject(json);
                        userview.setProperties(PropertyUtil.getPropertiesValueFromJson(userviewObj.getJSONObject("properties").toString()));
                       
                        JSONObject settingObj = userviewObj.getJSONObject("setting");
                        JSONObject themeObj = settingObj.getJSONObject("properties").getJSONObject("theme");
                       
                        theme = (UserviewTheme) pluginManager.getPlugin(themeObj.getString("className"));
                        theme.setProperties(PropertyUtil.getPropertiesValueFromJson(themeObj.getJSONObject("properties").toString()));
                        theme.setRequestParameters(requestParameters);
                        theme.setUserview(userview);
                       
                    } catch (Exception e) {
                        LogUtil.debug(getClass().getName(), "get userview theme error.");
                    }
                }
View Full Code Here

TOP

Related Classes of org.joget.apps.userview.model.UserviewTheme

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.