}
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.");
}
}