Adding the SQL Map
Assuming the file name is CurrewiseTransactionSqlMap.xml
<?xml version="1.0" encoding="UTF-8" ?> <sqlMap> <resultMap id="CURRENCYWISE_TXN_RESULT_MAP" class="java.util.HashMap"> <result property="TRANS_COUNT" nullValue="" column="TRANS_COUNT" javaType="java.lang.String" jdbcType="NUMBER"/> <result property="OD_TXN_CY" nullValue="" column="OD_TXN_CY" javaType="java.lang.String" jdbcType="VARCHAR"/> </resultMap> <select id="VIEW_MGR_FRMWK_MNT_SELECT_GET_CURRENCYWISE_TXN" parameterClass="java.util.HashMap" resultMap="CURRENCYWISE_TXN_RESULT_MAP"> SELECT COUNT(OD_REF_NO) AS TRANS_COUNT,OD_TXN_CY FROM OD_TXN_MASTER WHERE OD_GCIF=#INPUT_GCIF# AND OD_TXN_CY IS NOT NULL AND OD_FUNCTION_ID NOT IN ('CRSTAM','BULKUP','CRUTIL','RECUR','CNCLSI') AND Od_SUBPROD_CODE In ('BKSRNT','BKSIBT','BKSIFT','TELTRF') AND OD_HOST_STATUS='AH' GROUP BY OD_TXN_CY </select> <sqlMap>
Adding the Instruction Class
Assuming the file name is CurrencywiseTxnBarChartInstruction.java
package com.intellectdesign.payments.instruction; import java.util.HashMap; import java.util.List; import com.intellectdesign.canvas.entitlement.DataEntitlements; import com.intellectdesign.canvas.viewdefinition.ViewDefinition; import com.intellectdesign.canvas.viewdefinition.ViewDefinitionException; import com.intellectdesign.canvas.viewdefinition.instruction.GraphViewInstruction; public class CurrencywiseTxnBarChartInstruction extends GraphViewInstruction { /** * Return the unique sort field name for this view * * */ @Override protected String getUniqueSortFieldName() { return "OD_TXN_CY"; } /** * This method gets the sort order for the unique sort field * */ @Override protected String getUniqueSortFieldOrder() { return "ASC"; } @Override protected HashMap<String, String> getSortColumnMap() { logger.log(ENTRYLevel.ENTRY, "Inside Hashmap"); HashMap<String, String> SingSeriesBarChartColMap = new HashMap<String, String>(); listViewColumnMap.put("OD_TXN_CY", "OD_TXN_CY"); listViewColumnMap.put("TRANS_COUNT", "TRANS_COUNT"); return SingSeriesBarChartColMap; } /** * This method forms the view specific filters from the input params * */ public HashMap getViewSpecificFilters(HashMap hmInputParams, DataEntitlements dataEntitlements) throws ViewDefinitionException { HashMap mapViewSpecificFilter = null; return mapViewSpecificFilter; } @Override protected HashMap processResponse(List listViewData, ViewDefinition viewDefinition, HashMap mapInputParams) throws ViewDefinitionException { return super.processResponse(listViewData, viewDefinition, mapInputParams); } }