Package org.joget.apps.datalist.model

Examples of org.joget.apps.datalist.model.DataListCollection


        String url = getHref();
        String hrefParam = getHrefParam();
        String hrefColumn = getHrefColumn();
       
        if (hrefParam != null && hrefColumn != null && !hrefColumn.isEmpty() && rowKeys != null && rowKeys.length > 0) {
            DataListCollection rows = dataList.getRows();
            String primaryKeyColumnName = dataList.getBinder().getPrimaryKeyColumnName();
       
            String[] params = hrefParam.split(";");
            String[] columns = hrefColumn.split(";");
View Full Code Here


        return "id";
    }

    @Override
    public DataListCollection getData(DataList dataList, Map properties, DataListFilterQueryObject[] filterQueryObjects, String sort, Boolean desc, Integer start, Integer rows) {
        DataListCollection resultList = new DataListCollection();

        Form form = getSelectedForm();
        if (form != null) {
            FormDataDao formDataDao = (FormDataDao) AppUtil.getApplicationContext().getBean("formDataDao");

            DataListFilterQueryObject criteria = getCriteria(properties, filterQueryObjects);

            FormRowSet rowSet = formDataDao.find(form, criteria.getQuery(), criteria.getValues(), sort, desc, start, rows);
            resultList.addAll(rowSet);
        }

        return resultList;
    }
View Full Code Here

        return dataList;
    }

    protected DataListCollection getRows(DataList dataList) {
        try {
            DataListCollection resultList = new DataListCollection();

            // determine filter
            String packageId = null;
            String processDefId = null;
            String appFilter = getPropertyString(PROPERTY_FILTER);
            if (PROPERTY_FILTER_ALL.equals(appFilter)) {
                AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                if (appDef != null) {
                    PackageDefinition packageDef = appDef.getPackageDefinition();
                    if (packageDef != null) {
                        packageId = packageDef.getId();
                    }
                }
            } else if (PROPERTY_FILTER_PROCESS.equals(appFilter)) {
                String processId = getPropertyString("processId");
                AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                if (appDef != null && processId != null && !processId.isEmpty()) {
                    ApplicationContext ac = AppUtil.getApplicationContext();
                    AppService appService = (AppService) ac.getBean("appService");
                    WorkflowProcess process = appService.getWorkflowProcessForApp(appDef.getId(), appDef.getVersion().toString(), processId);
                    processDefId = process.getId();
                }
            }

            if (packageId != null || processDefId != null) {
                DataListQueryParam param = dataList.getQueryParam(null, null);

                // get assignments
                WorkflowManager workflowManager = (WorkflowManager) WorkflowUtil.getApplicationContext().getBean("workflowManager");
                PagedList<WorkflowAssignment> assignmentList = workflowManager.getAssignmentPendingAndAcceptedList(packageId, processDefId, null, param.getSort(), param.getDesc(), param.getStart(), param.getSize());

                DirectoryManager directoryManager = (DirectoryManager) AppUtil.getApplicationContext().getBean("directoryManager");
                WorkflowUserManager workflowUserManager = (WorkflowUserManager) AppUtil.getApplicationContext().getBean("workflowUserManager");
                User user = directoryManager.getUserByUsername(workflowUserManager.getCurrentUsername());
                String gmt = "";
                if (user != null) {
                    gmt = user.getTimeZone();
                }
                String format = AppUtil.getAppDateFormat();
                for (WorkflowAssignment assignment : assignmentList) {
                    Map data = new HashMap();
                    data.put("processId", assignment.getProcessId());
                    data.put("processRequesterId", assignment.getProcessRequesterId());
                    data.put("activityId", assignment.getActivityId());
                    data.put("processName", assignment.getProcessName());
                    data.put("activityName", assignment.getActivityName());
                    data.put("processVersion", assignment.getProcessVersion());
                    data.put("dateCreated", TimeZoneUtil.convertToTimeZone(assignment.getDateCreated(), gmt, format));
                    data.put("acceptedStatus", assignment.isAccepted());
                    data.put("dueDate", assignment.getDueDate() != null ? TimeZoneUtil.convertToTimeZone(assignment.getDueDate(), gmt, format) : "-");

                    double serviceLevelMonitor = workflowManager.getServiceLevelMonitorForRunningActivity(assignment.getActivityId());

                    data.put("serviceLevelMonitor", WorkflowUtil.getServiceLevelIndicator(serviceLevelMonitor));

                    // set results
                    resultList.add(data);
                }
            }
           
            return resultList;
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.joget.apps.datalist.model.DataListCollection

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.