@Override public void fill(FormMap formMap) { // TODO Auto-generated method stub if (log.isInfoEnabled()) { log.info("Into the fill method"); } if (formMap == null) return; if (formMap.getField("name") != null) { String name = formMap.getField("name").getValue(); setName(name); } if (formMap.getField("email") != null) { String email = formMap.getField("email").getValue(); setEmail(email); } if (formMap.getField("comment") != null) { String comment = formMap.getField("comment").getValue(); setComment(comment); } if (formMap.getField("rating") != null) { String rating = formMap.getField("rating").getValue(); Long longrating = Long.parseLong(rating); setRating(longrating); } }
@Override public void fill(FormMap formMap) { // TODO Auto-generated method stub if (log.isInfoEnabled()) { log.info("Into the fill method"); } if (formMap == null) return; if (formMap.getField("tan_employertds") != null) { setTan_Employer(formMap.getField("tan_employertds").getValue()); } if (formMap.getField("name_employertds") != null) { setName_Employer(formMap.getField("name_employertds").getValue()); } if (formMap.getField("income_chargeabletds") != null) { String strIncome = formMap.getField("income_chargeabletds").getValue(); double DecIncome = Double.parseDouble(strIncome); setIncome_Chargeable(DecIncome); } if (formMap.getField("total_taxdeductedtds") != null) { String StrTax = formMap.getField("total_taxdeductedtds").getValue(); double taxdeducted = Double.parseDouble(StrTax); setTotal_TaxDeducted(taxdeducted); } }
@Override public boolean bind(Object content, Node node) throws ContentNodeBindingException { // TODO Auto-generated method stub log.info("Let's update the document by binder"); BeanInfo bi; try { bi = Introspector.getBeanInfo(content.getClass()); PropertyDescriptor[] properties = bi.getPropertyDescriptors(); DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(content); for (PropertyDescriptor property : properties) { if (formMap.getField(property.getName()) != null) { log.info("have a founding"); if (node != null) { Class<?> theTypeClass = directFieldAccessor.getPropertyType(property.getName()); if (!theTypeClass.isPrimitive()) { try { Class<?> thePrimitiveClass = (Class<?>) theTypeClass.getDeclaredField("TYPE").get(node); if (thePrimitiveClass != null) { theTypeClass = thePrimitiveClass; } } catch (NoSuchFieldException e) { // TODO Auto-generated catch block // e.printStackTrace(); } } Object theValue = formMap.getField(property.getName()).getValue(); // theReadMethod.invoke(anObject); Method theMethod = MethodUtils.getAccessibleMethod( node.getClass(), "setProperty", new Class[] {String.class, theTypeClass}); if (theMethod != null) { theMethod.invoke(node, "mootlywcm:" + property.getName(), theValue); } else { if (node.hasNode("mootlywcm:" + property.getName())) { Node htmlNode = node.getNode("mootlywcm:" + property.getName()); if (theValue != null) { htmlNode.setProperty("hippostd:content", theValue.toString()); } } } } } // } } } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (RepositoryException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; }
public void fill(FormMap formMap) { // TODO Auto-generated method stub if (formMap == null) return; double amtGovtInc = 0.0d; if (formMap.getField("Gov_income").getValue().isEmpty()) { setGov_income(amtGovtInc); } else { String strGov_income = formMap.getField("Gov_income").getValue(); amtGovtInc = Double.parseDouble(strGov_income); setGov_income(amtGovtInc); } double bankdetailfdr = 0.0d; if (formMap.getField("Bank_detail_fdr").getValue().isEmpty()) { setBank_detail_fdr(bankdetailfdr); } else { String strBankdetail = formMap.getField("Bank_detail_fdr").getValue(); bankdetailfdr = Double.parseDouble(strBankdetail); setBank_detail_fdr(bankdetailfdr); } double bankdetailsaving = 0.0d; if (formMap.getField("Bank_detail_saving").getValue().isEmpty()) { setBank_detail_saving(bankdetailsaving); } else { String strBankdetail = formMap.getField("Bank_detail_saving").getValue(); bankdetailsaving = Double.parseDouble(strBankdetail); setBank_detail_saving(bankdetailsaving); } double kissan = 0.0d; if (formMap.getField("Kissan").getValue().isEmpty()) { setKissan(kissan); } else { String strKissanpatra = formMap.getField("Kissan").getValue(); kissan = Double.parseDouble(strKissanpatra); setKissan(kissan); } double indira = 0.0d; if (formMap.getField("Indira").getValue().isEmpty()) { setIndira(indira); } else { String strIndirapatra = formMap.getField("Indira").getValue(); indira = Double.parseDouble(strIndirapatra); setIndira(indira); } double intnsc = 0.0d; if (formMap.getField("intnsc").getValue().isEmpty()) { setIntnsc(intnsc); } else { String strInt_nsc = formMap.getField("intnsc").getValue(); intnsc = Double.parseDouble(strInt_nsc); setIntnsc(intnsc); } double otherint = 0.0d; if (formMap.getField("Otherint").getValue().isEmpty()) { setOtherint(otherint); } else { String strOther_interest = formMap.getField("Otherint").getValue(); otherint = Double.parseDouble(strOther_interest); setOtherint(otherint); } double totalInt = 0.0d; if (formMap.getField("Totalint").getValue().isEmpty()) { setTotalint(totalInt); } else { String strTotal_interest = formMap.getField("Totalint").getValue(); totalInt = Double.parseDouble(strTotal_interest); setTotalint(totalInt); } double familyPension = 0.0d; if (formMap.getField("Family_pension").getValue().isEmpty()) { setFamily_pension(familyPension); } else { String strFamily_pension = formMap.getField("Family_pension").getValue(); familyPension = Double.parseDouble(strFamily_pension); setFamily_pension(familyPension); } double dividends = 0.0d; if (formMap.getField("Dividends").getValue().isEmpty()) { setDividends(dividends); } else { String strDividends = formMap.getField("Dividends").getValue(); dividends = Double.parseDouble(strDividends); setDividends(dividends); } double ded57 = 0.0d; if (formMap.getField("Deduction_57").getValue().isEmpty()) { setDeduction_57(ded57); } else { String strDeduction_57 = formMap.getField("Deduction_57").getValue(); ded57 = Double.parseDouble(strDeduction_57); setDeduction_57(ded57); } double totalexpense = 0.0d; if (formMap.getField("totalexpense").getValue().isEmpty()) { setTotalexpense(totalexpense); } else { String strTotal_expenses = formMap.getField("totalexpense").getValue(); totalexpense = Double.parseDouble(strTotal_expenses); setTotalexpense(totalexpense); } double familyPensionDed = 0.0d; if (formMap.getField("Familypension_deduction").getValue().isEmpty()) { setFamilypension_deduction(familyPensionDed); } else { String strstrTotalOther_income = formMap.getField("Familypension_deduction").getValue(); familyPensionDed = Double.parseDouble(strstrTotalOther_income); setFamilypension_deduction(familyPensionDed); } double totalOtherIncome = 0.0d; if (formMap.getField("TotalOther_income").getValue().isEmpty()) { setTotalOther_income(totalOtherIncome); } else { String strTotalOther_income = formMap.getField("TotalOther_income").getValue(); totalOtherIncome = Double.parseDouble(strTotalOther_income); setTotalOther_income(totalOtherIncome); } /*if (formMap.getField("Lottery_horse_income").getValue().isEmpty()){} else{ String strLottery_horse_income=formMap.getField("Lottery_horse_income").getValue(); double amt= Double.parseDouble(strLottery_horse_income); log.info("expense is"+amt); setLottery_horse_income(amt); }*/ double depreciation = 0.0d; if (formMap.getField("depreciation").getValue().isEmpty()) { setDepreciation(depreciation); } else { String strDepreciation = formMap.getField("depreciation").getValue(); depreciation = Double.parseDouble(strDepreciation); setDepreciation(depreciation); } double incomeRentMachine = 0.0d; if (formMap.getField("Income_rent_machine").getValue().isEmpty()) { setIncome_rent_machine(incomeRentMachine); } else { String strIncome_rent_machine = formMap.getField("Income_rent_machine").getValue(); incomeRentMachine = Double.parseDouble(strIncome_rent_machine); setIncome_rent_machine(incomeRentMachine); } /* if (formMap.getField("Income_maintain").getValue().isEmpty()){} else{ String strIncome_maintain=formMap.getField("Income_maintain").getValue(); double amt= Double.parseDouble(strIncome_maintain); setIncome_maintain(amt); }*/ double dividend_uti = 0.0d; if (formMap.getField("Dividends_uti").getValue().isEmpty()) { setDividends_uti(dividend_uti); } else { String strDividends_uti = formMap.getField("Dividends_uti").getValue(); dividend_uti = Double.parseDouble(strDividends_uti); setDividends_uti(dividend_uti); } double mutualFund = 0.0d; if (formMap.getField("Dividends_mutualfund").getValue().isEmpty()) { setDividends_mutualfund(mutualFund); } else { String strDividends_mutualfund = formMap.getField("Dividends_mutualfund").getValue(); mutualFund = Double.parseDouble(strDividends_mutualfund); setDividends_mutualfund(mutualFund); } double indiandividend = 0.0d; if (formMap.getField("Dividends_indian_companies").getValue().isEmpty()) { setDividends_indian_companies(indiandividend); } else { String strDividends_indian_companies = formMap.getField("Dividends_indian_companies").getValue(); indiandividend = Double.parseDouble(strDividends_indian_companies); setDividends_indian_companies(indiandividend); } double agricultureIncome = 0.0d; if (formMap.getField("Agriculture_income").getValue().isEmpty()) { setAgriculture_income(agricultureIncome); } else { String strAgriculture_income = formMap.getField("Agriculture_income").getValue(); agricultureIncome = Double.parseDouble(strAgriculture_income); setAgriculture_income(agricultureIncome); } double OtherIncome = 0.0d; if (formMap.getField("Otherincome").getValue().isEmpty()) { setOtherincome(OtherIncome); } else { String strOther_income = formMap.getField("Otherincome").getValue(); OtherIncome = Double.parseDouble(strOther_income); setOtherincome(OtherIncome); } double otherIncome = 0.0d; if (formMap.getField("Income_other").getValue().isEmpty()) { setIncome_other(otherIncome); } else { String strIncome_other = formMap.getField("Income_other").getValue(); otherIncome = Double.parseDouble(strIncome_other); setIncome_other(otherIncome); } double taxfreeincome = 0.0d; if (formMap.getField("Total_taxfree_income").getValue().isEmpty()) { setTotal_taxfree_income(taxfreeincome); } else { String strTotal_taxfree_income = formMap.getField("Total_taxfree_income").getValue(); taxfreeincome = Double.parseDouble(strTotal_taxfree_income); setTotal_taxfree_income(taxfreeincome); } double Interest_income = 0.0d; if (formMap.getField("Interest_income").getValue().isEmpty()) { setInterest_income(Interest_income); } else { String strInterest_income = formMap.getField("Interest_income").getValue(); Interest_income = Double.parseDouble(strInterest_income); setInterest_income(Interest_income); } double taxable_income = 0.0d; if (formMap.getField("Taxable_income").getValue().isEmpty()) { setTaxable_income(taxable_income); } else { String strTaxable_income = formMap.getField("Taxable_income").getValue(); taxable_income = Double.parseDouble(strTaxable_income); setTaxable_income(taxable_income); } double otherDed = 0.0d; if (formMap.getField("Otherdeduction").getValue().isEmpty()) { setOtherdeduction(otherDed); } else { String strTaxable_income = formMap.getField("Otherdeduction").getValue(); otherDed = Double.parseDouble(strTaxable_income); setOtherdeduction(otherDed); } double value_Receipts = 0.0d; if (formMap.getField("Receipts").getValue().isEmpty()) { setReceipts(value_Receipts); } else { String strReceipts = formMap.getField("Receipts").getValue(); value_Receipts = Double.parseDouble(strReceipts); setReceipts(value_Receipts); } double value_dedus57 = 0.0d; if (formMap.getField("dedus57").getValue().isEmpty()) { setDedus57(value_dedus57); } else { String strdedus57 = formMap.getField("dedus57").getValue(); value_dedus57 = Double.parseDouble(strdedus57); setDedus57(value_dedus57); } double value_balance = 0.0d; if (formMap.getField("balance").getValue().isEmpty()) { setBalance(value_balance); } else { String strbalance = formMap.getField("balance").getValue(); value_balance = Double.parseDouble(strbalance); setBalance(value_balance); } double value_LotteryOrhorse_income = 0.0d; if (formMap.getField("LotteryOrhorse_income").getValue().isEmpty()) { setLotteryOrhorse_income(value_LotteryOrhorse_income); } else { String strLotteryOrhorse_income = formMap.getField("LotteryOrhorse_income").getValue(); value_LotteryOrhorse_income = Double.parseDouble(strLotteryOrhorse_income); setLotteryOrhorse_income(value_LotteryOrhorse_income); } double value_profit_FirmAOP_BOI = 0.0d; if (formMap.getField("profit_FirmAOP_BOI").getValue().isEmpty()) { setProfit_FirmAOP_BOI(value_profit_FirmAOP_BOI); } else { String strProfit_FirmAOP_BOI = formMap.getField("profit_FirmAOP_BOI").getValue(); value_profit_FirmAOP_BOI = Double.parseDouble(strProfit_FirmAOP_BOI); setProfit_FirmAOP_BOI(value_profit_FirmAOP_BOI); } }
public void saveSOAPRequestToRepository( String soapOperation, String absoluteBasePathToReturnDocuments, WorkflowPersistenceManager wpm, Map<String, Object> outputMapSOAPResponse) { if (getItReturnComponentHelper() == null) { logger.warn("ITReturnComponentHelper is null. Please check Spring Dependency Injection"); return; } Session persistableSession = null; try { if (absoluteBasePathToReturnDocuments == null) { logger.warn("absoluteBasePathToReturnDocuments is null"); return; } if (outputMapSOAPResponse == null || outputMapSOAPResponse.size() == 0) { return; } FormMap theMapForSOAPResponse = new FormMap(); for (String key : outputMapSOAPResponse.keySet()) { Object theObj = outputMapSOAPResponse.get(key); if (theObj instanceof String) { FormField formField = new FormField(key); formField.addValue((String) theObj); theMapForSOAPResponse.addFormField(formField); } } FormField theSOAPOperation = new FormField("soapOperation"); theSOAPOperation.addValue(soapOperation); theMapForSOAPResponse.addFormField(theSOAPOperation); persistableSession = wpm.getSession(); BeanLifecycle<HippoBean> childBeanLifeCycleHandler = null; BeanLifecycle<HippoBean> parentBeanLifeCycleHandler = null; String parentBeanAbsolutePath = absoluteBasePathToReturnDocuments + "/" + DITResponseDocument.class.getSimpleName().toLowerCase(); String parentBeanNameSpace = "mootlywcm:ditResponseDocument"; String parentBeanNodeName = DITResponseDocument.class.getSimpleName().toLowerCase(); getItReturnComponentHelper() .saveAddNewChild( theMapForSOAPResponse, null, null, null, absoluteBasePathToReturnDocuments, parentBeanAbsolutePath, parentBeanNameSpace, parentBeanNodeName, DITResponseDocumentDetail.class, wpm.getSession(), wpm); } catch (Exception e) { logger.error("Error saving SOAP Requests to Repository", e); } finally { if (persistableSession != null) try { persistableSession.logout(); } catch (Exception e) { } } }