Search in sources :

Example 36 with Context

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

the class RegionMapViewAction method renderInfowindowContent.

private void renderInfowindowContent() throws ServiceException, Exception {
    StringBuilder outStr = new StringBuilder();
    String year = this.getFields().get("year");
    String orgId = this.getFields().get("orgId");
    List<String> visionOids = this.visionService.findForOidByKpiOrga(orgId);
    if (visionOids == null || visionOids.size() < 1) {
        this.setPageMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA) + " , for KPIs.");
        return;
    }
    for (String visionOid : visionOids) {
        Context context = this.getChainContext(visionOid, year);
        SimpleChain chain = new SimpleChain();
        ChainResultObj resultObj = chain.getResultFromResource("kpiReportHtmlContentChain", context);
        outStr.append(String.valueOf(resultObj.getValue()));
    }
    this.content = outStr.toString();
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain)

Example 37 with Context

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

the class StrategyMapManagementAction method loadRecord.

private void loadRecord() throws ControllerException, ServiceException, Exception {
    if (StringUtils.isBlank(this.visionOid) || super.isNoSelectId(this.visionOid)) {
        throw new ControllerException(this.getText("MESSAGE.BSC_PROG002D0007Q_vision"));
    }
    Context context = this.getChainContext();
    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) ControllerException(com.netsteadfast.greenstep.base.exception.ControllerException) StrategyMapItemsVO(com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain)

Example 38 with Context

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

the class StrategyMapManagementAction method loadNew.

private void loadNew() throws ControllerException, ServiceException, Exception {
    if (StringUtils.isBlank(this.visionOid) || super.isNoSelectId(this.visionOid)) {
        throw new ControllerException(this.getText("MESSAGE.BSC_PROG002D0007Q_vision"));
    }
    Context context = this.getChainContext();
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForNewChain", context);
    this.setPageMessage(resultObj.getMessage());
    if (resultObj.getValue() instanceof StrategyMapItemsVO) {
        this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
        this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
    }
}
Also used : Context(org.apache.commons.chain.Context) ControllerException(com.netsteadfast.greenstep.base.exception.ControllerException) StrategyMapItemsVO(com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain)

Example 39 with Context

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

the class SwotContentQueryAction method getContent.

private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    Context context = this.getChainContext();
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("swotHtmlContentChain", context);
    this.body = String.valueOf(resultObj.getValue());
    this.message = resultObj.getMessage();
    if (!StringUtils.isBlank(this.body) && this.body.startsWith("<!-- BSC_PROG002D0008Q -->")) {
        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)

Example 40 with Context

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

the class SwotContentQueryAction method getPdfDataContent.

private void getPdfDataContent() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    Context context = this.getChainContext();
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("swotPdfDataContentChain", context);
    this.reportId = String.valueOf(resultObj.getValue());
    this.message = resultObj.getMessage();
    if (!StringUtils.isBlank(this.reportId)) {
        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)

Aggregations

Context (org.apache.commons.chain.Context)49 SimpleChain (com.netsteadfast.greenstep.base.chain.SimpleChain)28 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)27 ContextBase (org.apache.commons.chain.impl.ContextBase)24 Map (java.util.Map)9 LinkedHashMap (java.util.LinkedHashMap)7 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)6 ArrayList (java.util.ArrayList)6 LinkedList (java.util.LinkedList)6 List (java.util.List)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 AppContext (com.netsteadfast.greenstep.base.AppContext)4 HashMap (java.util.HashMap)4 ServletWebContext (org.apache.commons.chain.web.servlet.ServletWebContext)4 ServletActionContext (org.apache.struts.chain.contexts.ServletActionContext)4 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)3 StrategyMapItemsVO (com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO)3 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)3 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)3 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)2