JSONObject userviewObj = new JSONObject(json);
userview.setProperties(PropertyUtil.getPropertiesValueFromJson(userviewObj.getJSONObject("properties").toString()));
//set Setting
JSONObject settingObj = userviewObj.getJSONObject("setting");
UserviewSetting setting = new UserviewSetting();
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 {
JSONObject permissionObj = settingObj.getJSONObject("properties").getJSONObject("permission");
UserviewPermission permission = null;
String permissionClassName = permissionObj.getString("className");
if (permissionClassName != null && !permissionClassName.isEmpty()) {
permission = (UserviewPermission) pluginManager.getPlugin(permissionClassName);
}
if (permission != null) {
permission.setProperties(PropertyUtil.getPropertiesValueFromJson(permissionObj.getJSONObject("properties").toString()));
permission.setRequestParameters(requestParameters);
permission.setCurrentUser(currentUser);
setting.setPermission(permission);
}
} catch (Exception e) {
LogUtil.debug(getClass().getName(), "set permission error.");
}
userview.setSetting(setting);