Description

  • org.joget.apps.userview.service.UserviewService
  • Under wflow-core module
  • Service methods used to parse userview json definition to create Userview

Code Sample

import javax.servlet.http.HttpServletRequest;
import org.joget.apps.app.dao.UserviewDefinitionDao;
import org.joget.apps.app.model.UserviewDefinition;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.userview.service.UserviewService;
import org.joget.workflow.util.WorkflowUtil;


UserviewService userviewService = (UserviewService) AppUtil.getApplicationContext().getBean("userviewService");
UserviewDefinitionDao userviewDefinitionDao = (UserviewDefinitionDao) AppUtil.getApplicationContext().getBean("userviewDefinitionDao");
 
HttpServletRequest request = WorkflowUtil.getHttpServletRequest();
AppDefinition appDef = AppUtil.getCurrentAppDefinition();
UserviewDefinition userviewDef = userviewDefinitionDao.loadById("crm", appDef);
 
if (userviewDef != null) {
    //create userview
    Userview userview = userviewService.createUserview(userview.getJson(), null, false, request.getContextPath(), request.getParameterMap(), null, false);
}

Methods

createUserview
public org.joget.apps.userview.model.Userview createUserview(java.lang.String json, java.lang.String menuId, boolean preview, java.lang.String contextPath, java.util.Map requestParameters, java.lang.String key, java.lang.Boolean embed)

Create userview fron json

createUserview
public org.joget.apps.userview.model.Userview createUserview(org.joget.apps.app.model.AppDefinition appDef, java.lang.String json, java.lang.String menuId, boolean preview, java.lang.String contextPath, java.util.Map requestParameters, java.lang.String key, java.lang.Boolean embed)

Create userview fron json

getMenuId
public java.lang.String getMenuId(org.joget.apps.userview.model.UserviewMenu menu)

Gets the id of an userview menu

getUserviewDescription
public java.lang.String getUserviewDescription(java.lang.String json)

Gets userview description from json definition

getUserviewName
public java.lang.String getUserviewName(java.lang.String json)

Gets the name of a userview from json definition

getUserviewSetting
public org.joget.apps.userview.model.UserviewSetting getUserviewSetting(org.joget.apps.app.model.AppDefinition appDef, java.lang.String json)

Get userview setting object

getUserviewTheme
public org.joget.apps.userview.model.UserviewTheme getUserviewTheme(java.lang.String appId, java.lang.String userviewId)

Gets the userview theme used by an userview



  • No labels