private ReportTemplateVo getTemplateByName(String templateName) { StringBuffer hql = new StringBuffer(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<String> values = new ArrayList<String>(); hql.append("from TemplateBo as template where UPPER(template.name) like UPPER(:templateName)"); markers.add("templateName"); values.add(templateName); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); ReportTemplateVoCollection result = ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(list); return result != null ? result.get(0) : null; }
public ims.admin.vo.ReportTemplateVoCollection listTemplates(Boolean activeOnly) { DomainFactory factory = getDomainFactory(); List templates = factory.find("from TemplateBo"); return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(templates).sort(); }
public ReportTemplateVo getTemplate(TemplateBoRefVo templateBoRefVo) { if (templateBoRefVo == null) throw new CodingRuntimeException("Cannot get ReportTemplateVo for null TemplateBoRefVo"); DomainFactory factory = getDomainFactory(); TemplateBo boTemplate = (TemplateBo) factory.getDomainObject(TemplateBo.class, templateBoRefVo.getID_TemplateBo()); return ReportTemplateVoAssembler.create(boTemplate); }
/** * List all templates matching the given search criteria */ public ims.admin.vo.ReportTemplateVoCollection listTemplates(String searchFilter) { DomainFactory factory = getDomainFactory(); String hql = " from TemplateBo tmp where upper(tmp.name) like upper(:name)"; List lst = factory.find(hql, new String[]{"name"}, new Object[]{searchFilter}); return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(lst); }
public ReportTemplateVo getReportTemplateVo(TemplateBoRefVo reportTemplateRef) { if (reportTemplateRef==null) throw new CodingRuntimeException("Cannot Get Report Template for null value"); TemplateBo domReportTemplate=(TemplateBo)getDomainFactory().getDomainObject(TemplateBo.class, reportTemplateRef.getID_TemplateBo()); return ReportTemplateVoAssembler.create(domReportTemplate); }
/** * list tempaltes */ public ims.admin.vo.ReportTemplateVoCollection listTemplates(Boolean activeOnly, Integer voMedicId, Integer voLocationId, Integer voServiceId) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer condStr = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer hql = new StringBuffer(); hql.append("select distinct t2_1.id from TemplateAssociations as t1_1 left join t1_1.template as t2_1"); if (voMedicId != null) { hql.append(" left join t1_1.consultants as m1_1"); condStr.append(andStr + " m1_1.id = :medicId"); markers.add("medicId"); values.add(voMedicId); andStr = " or "; } if (voServiceId != null) { hql.append(" left join t1_1.specialties as l1_1 left join l1_1.instance as l2_1"); condStr.append(andStr + " l2_1.id = :service"); markers.add("service"); values.add(voServiceId); andStr = " or "; } if (voLocationId != null) { hql.append(" left join t1_1.clinics as c1_1"); condStr.append(andStr + " c1_1.id = :location"); markers.add("location"); values.add(voLocationId); } List templates; if (values.size()>0) { hql.append(" where "); hql.append("(" + condStr + ")"); templates = factory.find("from TemplateBo where id in (" + hql.toString() + ")",markers,values); if(templates.size()>0) { return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(templates); } templates = factory.find("from TemplateBo"); return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(templates); } else { templates = factory.find("from TemplateBo"); return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(templates); } }
public ReportTemplateVoCollection listTemplates(Boolean activeOnly) { DomainFactory factory = getDomainFactory(); List templates = factory.find("from TemplateBo"); return ReportTemplateVoAssembler.createReportTemplateVoCollectionFromTemplateBo(templates); }
private ReportTemplateVo getTemplate(int templateBoRefVoId) { DomainFactory factory = getDomainFactory(); TemplateBo boTemplate = (TemplateBo) factory.getDomainObject(TemplateBo.class, templateBoRefVoId); return ReportTemplateVoAssembler.create(boTemplate); }
public ReportTemplateVo getLinkedTemplate(String className) { ReportTemplateBoRef domRep = ReportTemplateBoRef.getReportTemplateBoRefFromBusinessObj(getDomainFactory(), className); return ReportTemplateVoAssembler.create(domRep.getTemplate()); }