Search in sources :

Example 11 with ContextBase

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

the class PdcaReportContentQueryAction method getExcel.

@SuppressWarnings("unchecked")
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    List<String> bscExcelFileUploadOids = new ArrayList<String>();
    List<ChainResultObj> bscReportResults = null;
    if ("true".equals(this.getFields().get("showBscReport"))) {
        bscReportResults = this.getBscReportContent("kpiReportExcelContentChain");
    }
    for (int i = 0; bscReportResults != null && i < bscReportResults.size(); i++) {
        ChainResultObj resultObj = bscReportResults.get(i);
        if (resultObj.getValue() instanceof String) {
            bscExcelFileUploadOids.add((String) resultObj.getValue());
        }
    }
    Context pdcaContext = new ContextBase();
    pdcaContext.put("pdcaOid", this.getFields().get("pdcaOid"));
    pdcaContext.put("bscExcelFileUploadOids", bscExcelFileUploadOids);
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("pdcaReportExcelContentChain", pdcaContext);
    this.message = resultObj.getMessage();
    if (resultObj.getValue() instanceof String) {
        this.uploadOid = (String) resultObj.getValue();
        this.success = IS_YES;
    }
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) ArrayList(java.util.ArrayList) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 12 with ContextBase

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

the class WeightContentQueryAction method renderBody.

@SuppressWarnings("unchecked")
private void renderBody() throws ControllerException, ServiceException, Exception {
    this.getCheckFieldHandler().single("visionOid", (super.isNoSelectId(this.getFields().get("visionOid"))), this.getText("MESSAGE.BSC_PROG002D0006Q_visionOid")).throwMessage();
    SimpleChain simpleChanin = new SimpleChain();
    Context context = new ContextBase();
    context.put("visionOid", this.getFields().get("visionOid"));
    if (YesNo.YES.equals(this.getFields().get("autoAllocation"))) {
        context.put("autoAllocation", this.getFields().get("autoAllocation"));
    }
    context.put("weightName", this.getText("TPL.BSC_PROG002D0006Q_weightName"));
    ChainResultObj resultObj = simpleChanin.getResultFromResource("weightItemsChain", context);
    this.body = String.valueOf(resultObj.getValue());
    this.message = resultObj.getMessage();
    this.success = IS_YES;
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 13 with ContextBase

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

the class StrategyMapManagementAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
    Context context = new ContextBase();
    context.put("visionOid", this.visionOid);
    return context;
}
Also used : Context(org.apache.commons.chain.Context) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 14 with ContextBase

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

the class SwotContentQueryAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
    Context context = new ContextBase();
    context.put("visionOid", this.getFields().get("visionOid"));
    context.put("organizationOid", this.getFields().get("organizationOid"));
    context.put("strengthsName", this.getText("TPL.BSC_PROG002D0008Q_s"));
    context.put("weaknessesName", this.getText("TPL.BSC_PROG002D0008Q_w"));
    context.put("opportunitiesName", this.getText("TPL.BSC_PROG002D0008Q_o"));
    context.put("threatsName", this.getText("TPL.BSC_PROG002D0008Q_t"));
    return context;
}
Also used : Context(org.apache.commons.chain.Context) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 15 with ContextBase

use of org.apache.commons.chain.impl.ContextBase in project sonarqube by SonarSource.

the class TestWrappingLookupCommand method testSame.

public void testSame() throws Exception {
    WrappingLookupCommand command = new WrappingLookupCommand();
    Context testContext = new ContextBase();
    Context wrapped = command.getContext(testContext);
    assertNotNull(wrapped);
    assertSame(testContext, wrapped);
}
Also used : ServletWebContext(org.apache.commons.chain.web.servlet.ServletWebContext) ServletActionContext(org.apache.struts.chain.contexts.ServletActionContext) 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