private boolean nonMandatorySeedNotAddedToReport(ReportSeedParsedVo seed, QueryBuilderClient client) { if(seed == null) return false; if(client == null) return false; if(client.getSeeds() == null) return true; for(int i=0; i<client.getSeeds().size(); i++) { if(client.getSeeds().get(i) == null) continue; SeedValue sValue = (SeedValue)client.getSeeds().get(i); if(seed.getName() != null && seed.getName().equals(sValue.getName())) return false; } return true; }
private String getSeedName(ReportSeedParsedVoCollection seeds, String boClassName) { if(boClassName == null || boClassName.length() == 0) throw new CodingRuntimeException("BoClassName cannot be null."); if(seeds == null || seeds.size() == 0) throw new CodingRuntimeException("Cannot return a seed name from a null list of seeds."); for(int i=0; i<seeds.size(); i++) { ReportSeedParsedVo seed = seeds.get(i); if(seed == null) continue; if(boClassName.equals(seed.getBOName())) return seed.getName(); } return null; }
private ReportSeedParsedVoCollection parseSeedsFromXML(String reportXML) throws DocumentException { Document document = DocumentHelper.parseText(reportXML); ReportSeedParsedVoCollection seeds = new ReportSeedParsedVoCollection(); List list = document.selectNodes("//Project/Seeds/Seed"); for (Iterator iter = list.iterator(); iter.hasNext();) { DefaultElement attribute = (DefaultElement) iter.next(); ReportSeedParsedVo seed = new ReportSeedParsedVo(); seed.setName(attribute.valueOf("Name")); seed.setType(attribute.valueOf("Type")); seed.setBOName(attribute.valueOf("BOName")); seed.setBOField(attribute.valueOf("BOField")); seed.setCanBeNull(new Boolean(attribute.valueOf("CanBeNull").equalsIgnoreCase("true"))); seeds.add(seed); } return seeds; }
@Override protected void onBtnOkClick() throws ims.framework.exceptions.PresentationLogicException { ReportSeedParsedVoCollection seeds = new ReportSeedParsedVoCollection(); for (int i = 0; i < form.dyngrdParameters().getRows().size(); i++) { DynamicGridRow row = form.dyngrdParameters().getRows().get(i); if (row.getValue() instanceof ReportSeedParsedVo) { ReportSeedParsedVo seed = (ReportSeedParsedVo) row.getValue(); DynamicGridCell valueCell = row.getCells().get(getColumn(VALUE_COLUMN)); seed = setSeedValue(valueCell, seed); seeds.add(seed); } } form.getGlobalContext().Admin.setReportSeedParsed(seeds); engine.close(DialogResult.OK); }
private void parseSeedsFromXML(String reportXML) throws DocumentException { Document document = DocumentHelper.parseText(reportXML); ReportSeedParsedVoCollection seeds = new ReportSeedParsedVoCollection(); List list = document.selectNodes("//Project/Seeds/Seed"); for (Iterator iter = list.iterator(); iter.hasNext();) { DefaultElement attribute = (DefaultElement) iter.next(); ReportSeedParsedVo seed = new ReportSeedParsedVo(); seed.setName(attribute.valueOf("Name")); seed.setType(attribute.valueOf("Type")); seed.setBOName(attribute.valueOf("BOName")); seed.setBOField(attribute.valueOf("BOField")); seed.setCanBeNull(new Boolean(attribute.valueOf("CanBeNull").equalsIgnoreCase("true"))); seeds.add(seed); } form.getGlobalContext().Admin.setReportSeedParsed(seeds); }
private boolean addValueForNonMandatorySeeds(QueryBuilderClient client, ReportSeedParsedVoCollection seeds) { if(seeds == null || seeds.size() == 0) return true; for(int i=0; i<seeds.size(); i++) { ReportSeedParsedVo seed = seeds.get(i); if(seed == null) continue; if(Boolean.TRUE.equals(seed.getCanBeNull())) { if(nonMandatorySeedNotAddedToReport(seed, client)) { try { client.addSeed(new SeedValue(seed.getName(), null, Class.forName(seed.getType()))); } catch (ClassNotFoundException e) { e.printStackTrace(); engine.showMessage("Error building the report: " + e.getMessage()); return false; } } } } return true; }
private DynamicCellType getSeedSearchCellType(ReportSeedParsedVo seed) { // If the seed is marked as 'search'-able seed if (seed.getSearchTypeIsNotNull()) { // If the seed is 'search'-able partial date - search type will be the string "PD" if (seed.getSearchType().equalsIgnoreCase("PD")) return DynamicCellType.PARTIALDATE; // If the seed is 'search'-able by a collection of strings - the search type will be the string "S" if (seed.getSearchType().equalsIgnoreCase("S")) { // WDEV-14289' // For 'Lookup instance' we use a combo-box if (seed.getBOName().equalsIgnoreCase("ims.domain.lookups.LookupInstance")) { return DynamicCellType.ENUMERATION; } return DynamicCellType.QUERYCOMBOBOX; } } // Keep this for old reports legacy if(seed.getType().equalsIgnoreCase(INTEGER) && (seed.getName().equalsIgnoreCase("DOB") || seed.getName().equalsIgnoreCase("DOB_START") || seed.getName().equalsIgnoreCase("DOB_END") || seed.getName().equalsIgnoreCase("DATE_OF_BIRTH_FROM") || seed.getName().equalsIgnoreCase("DATE_OF_BIRTH_TO") || "PD".equalsIgnoreCase(seed.getSearchType()))) { return DynamicCellType.PARTIALDATE; } return getReportSeed().getCellType(seed); }