Search in sources :

Example 6 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project bamboobsc by billchen198318.

the class IndexAction method loadRecord.

@SuppressWarnings("unchecked")
private void loadRecord() throws ControllerException, ServiceException, Exception {
    String visionOid = this.getFields().get("visionOid");
    if (super.isNoSelectId(visionOid)) {
        return;
    }
    Context context = new ContextBase();
    context.put("visionOid", visionOid);
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForRecChain", context);
    this.setPageMessage(resultObj.getMessage());
    if (resultObj.getValue() instanceof StrategyMapItemsVO) {
        this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
        this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
        this.conItems = ((StrategyMapItemsVO) resultObj.getValue()).getCon();
    }
}
Also used : Context(org.apache.commons.chain.Context) StrategyMapItemsVO(com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 7 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project bamboobsc by billchen198318.

the class ObjectivesDashboardAction method getContext.

@SuppressWarnings("unchecked")
private Context getContext() throws Exception {
    List<Map<String, Object>> chartDatas = new LinkedList<Map<String, Object>>();
    Enumeration<String> paramNames = this.getHttpServletRequest().getParameterNames();
    while (paramNames.hasMoreElements()) {
        String paramName = paramNames.nextElement();
        String value = this.getHttpServletRequest().getParameter(paramName);
        if (paramName.startsWith("BSC_PROG003D0005Q_meterGaugeChartDatas:")) {
            Map<String, Object> dataMap = (Map<String, Object>) new ObjectMapper().readValue(value, LinkedHashMap.class);
            chartDatas.add(dataMap);
        }
    }
    Context context = new ContextBase();
    context.put("chartDatas", chartDatas);
    context.put("year", this.getHttpServletRequest().getParameter("BSC_PROG003D0005Q_year"));
    context.put("barChartsData", this.getHttpServletRequest().getParameter("BSC_PROG003D0005Q_objectivesBarChartsData"));
    return context;
}
Also used : Context(org.apache.commons.chain.Context) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) LinkedList(java.util.LinkedList) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) LinkedHashMap(java.util.LinkedHashMap) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 8 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project bamboobsc by billchen198318.

the class PerspectivesDashboardAction method getContext.

@SuppressWarnings("unchecked")
private Context getContext() throws Exception {
    List<Map<String, Object>> chartDatas = new LinkedList<Map<String, Object>>();
    String pieCanvasToData = "";
    String barCanvasToData = "";
    Enumeration<String> paramNames = this.getHttpServletRequest().getParameterNames();
    while (paramNames.hasMoreElements()) {
        String paramName = paramNames.nextElement();
        String value = this.getHttpServletRequest().getParameter(paramName);
        if (paramName.startsWith("BSC_PROG003D0004Q_meterGaugeChartDatas:")) {
            Map<String, Object> dataMap = (Map<String, Object>) new ObjectMapper().readValue(value, LinkedHashMap.class);
            chartDatas.add(dataMap);
        }
        if (paramName.equals("BSC_PROG003D0004Q_barChartDatas")) {
            barCanvasToData = SimpleUtils.deHex(this.defaultString(value));
        }
        if (paramName.equals("BSC_PROG003D0004Q_pieChartDatas")) {
            pieCanvasToData = SimpleUtils.deHex(this.defaultString(value));
        }
    }
    Context context = new ContextBase();
    context.put("barCanvasToData", barCanvasToData);
    context.put("pieCanvasToData", pieCanvasToData);
    context.put("chartDatas", chartDatas);
    context.put("year", this.getHttpServletRequest().getParameter("BSC_PROG003D0004Q_year"));
    return context;
}
Also used : Context(org.apache.commons.chain.Context) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) LinkedList(java.util.LinkedList) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) LinkedHashMap(java.util.LinkedHashMap) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 9 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project bamboobsc by billchen198318.

the class RegionMapRelationKpisAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext(String visionOid, String year) throws Exception {
    String dateStr1 = year + "0101";
    String dateStr2 = year + "1230";
    Context context = new ContextBase();
    context.put("visionOid", visionOid);
    context.put("startDate", dateStr1);
    context.put("endDate", dateStr2);
    context.put("startYearDate", year);
    context.put("endYearDate", year);
    context.put("frequency", BscMeasureDataFrequency.FREQUENCY_YEAR);
    context.put("dataFor", BscConstants.MEASURE_DATA_FOR_ORGANIZATION);
    context.put("orgId", this.getFields().get("orgId"));
    context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
    return context;
}
Also used : Context(org.apache.commons.chain.Context) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 10 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project bamboobsc by billchen198318.

the class RegionMapViewAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext(String visionOid, String year) throws Exception {
    String dateStr1 = year + "0101";
    String dateStr2 = year + "1230";
    Context context = new ContextBase();
    context.put("visionOid", visionOid);
    context.put("startDate", dateStr1);
    context.put("endDate", dateStr2);
    context.put("startYearDate", year);
    context.put("endYearDate", year);
    context.put("frequency", BscMeasureDataFrequency.FREQUENCY_YEAR);
    context.put("dataFor", BscConstants.MEASURE_DATA_FOR_ORGANIZATION);
    context.put("orgId", this.getFields().get("orgId"));
    context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
    return context;
}
Also used : Context(org.apache.commons.chain.Context) ContextBase(org.apache.commons.chain.impl.ContextBase)

Aggregations

Context (org.apache.commons.chain.Context)22 ContextBase (org.apache.commons.chain.impl.ContextBase)22 SimpleChain (com.netsteadfast.greenstep.base.chain.SimpleChain)8 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)8 Map (java.util.Map)5 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 ArrayList (java.util.ArrayList)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 AppContext (com.netsteadfast.greenstep.base.AppContext)3 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)3 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)3 LinkedHashMap (java.util.LinkedHashMap)3 LinkedList (java.util.LinkedList)3 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)2 HashMap (java.util.HashMap)2 List (java.util.List)2 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)1 TimeSeriesAnalysisResult (com.netsteadfast.greenstep.bsc.model.TimeSeriesAnalysisResult)1 StrategyMapItemsVO (com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO)1 BbPdcaKpis (com.netsteadfast.greenstep.po.hbm.BbPdcaKpis)1