private ReportSeedParsedVoCollection getSeedsFromReport(String reportXml) { if(reportXml == null || reportXml.length() == 0) return null; ReportSeedParsedVoCollection seeds = null; try { seeds = parseSeedsFromXML(reportXml); } catch (DocumentException e) { engine.showMessage("Error deserializing Seeds: " + e.toString()); return null; } if(seeds == null || seeds.size() == 0) return null; return seeds; }
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 String[] checkForSeeds(ReportSeedParsedVoCollection seeds, QueryBuilderClient client) { if(seeds == null || seeds.size() == 0) return null; if(client == null) return null; List<String> uiErrors = new ArrayList<String>(); for(int i=0; i<seeds.size(); i++) { if(seeds.get(i) == null || !seeds.get(i).getCanBeNullIsNotNull() || Boolean.TRUE.equals(seeds.get(i).getCanBeNull())) continue; if(!checkIfMandatorySeedIsAdded(seeds.get(i).getName(), client.getSeeds())) { uiErrors.add(seeds.get(i).getName() + " is mandatory for selected template."); } } String[] seedsValidate = new String[uiErrors.size()]; uiErrors.toArray(seedsValidate); return seedsValidate; }
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; }
private void populateDynamicGrid(String reportXml) { ReportSeedParsedVoCollection seeds = null; try { seeds = parseSeedsFromXML(reportXml); } catch (DocumentException e) { e.printStackTrace(); engine.showMessage(e.getMessage()); return; } if(seeds == null) return; createSeedRows(seeds); }
private String getSeedName(IReportField field, ReportSeedParsedVoCollection seeds) { String ret = ""; int pos = field.getName().lastIndexOf('.'); ret = field.getName().substring(pos + 1); if(seeds != null) { for (int i = 0; i < seeds.size(); i++) { if(field.getName().equalsIgnoreCase(seeds.get(i).getBOName() + "_" + seeds.get(i).getBOField())) { ret = seeds.get(i).getName(); break; } } } return ret; }
@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); }