Java 类ims.admin.vo.ReportTemplateLiteVoCollection 实例源码

项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbReportsTextSubmited(String value) throws PresentationLogicException
{
    form.qmbReports().clear();

    ReportTemplateLiteVoCollection coll = domain.listTemplates('%' + value + '%', form.chkDFT().getValue());

    for(ReportTemplateLiteVo item : coll)
    {
        form.qmbReports().newRow(item, item.getName());
    }

    if(coll.size() == 1)
    {
        form.qmbReports().setValue(coll.get(0));
    }
    else if(coll.size() > 1)
    {
        form.qmbReports().showOpened();
    }
}
项目:AvoinApotti    文件:Logic.java   
private void populateReportsGrid(ReportTemplateLiteVoCollection templates)
{
    if (templates == null ||
            (templates != null &&
                    templates.size() == 0))
        return;

    ReportListVoCollection coll = new ReportListVoCollection();
    for (int i = 0; i < templates.size(); i++)
    {
        ReportTemplateLiteVo rep = templates.get(i);
        if (rep != null &&
            rep.getReportIsNotNull())
        {
                coll.add(domain.getReport(rep.getReport()));
        }           
    }

    populateReports(coll);
}
项目:AvoinApotti    文件:Logic.java   
private void populateGridReportsControls(ReportTemplateLiteVoCollection reportTemplateLiteVoCollection)
{
    form.lyrAdds().tabReports().grdNavReports().getRows().clear();
    if (reportTemplateLiteVoCollection == null)
        return;

    for (int i = 0; i < reportTemplateLiteVoCollection.size(); i++)
    {
        grdNavReportsRow nReport = form.lyrAdds().tabReports().grdNavReports().getRows().newRow();
        nReport.setTypeIcon(form.getImages().Core.Report48);
        nReport.setName("<b>" + reportTemplateLiteVoCollection.get(i).getName() + "</b>" + "<br />" + reportTemplateLiteVoCollection.get(i).getDescription());
        nReport.setValue(reportTemplateLiteVoCollection.get(i));
        if (form.getLocalContext().getSelectedReportsIsNotNull() && form.getLocalContext().getSelectedReports().contains(reportTemplateLiteVoCollection.get(i)))
        {
            nReport.setBackColor(Color.Beige);
            nReport.setSelect(true);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onQmbReportsTextSubmited(String value) throws PresentationLogicException
{
    form.qmbReports().clear();

    ReportTemplateLiteVoCollection coll = domain.listTemplates('%' + value + '%', form.chkDFT().getValue());

    for(ReportTemplateLiteVo item : coll)
    {
        form.qmbReports().newRow(item, item.getName());
    }

    if(coll.size() == 1)
    {
        form.qmbReports().setValue(coll.get(0));
    }
    else if(coll.size() > 1)
    {
        form.qmbReports().showOpened();
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateReportsGrid(ReportTemplateLiteVoCollection templates)
{
    if (templates == null ||
            (templates != null &&
                    templates.size() == 0))
        return;

    ReportListVoCollection coll = new ReportListVoCollection();
    for (int i = 0; i < templates.size(); i++)
    {
        ReportTemplateLiteVo rep = templates.get(i);
        if (rep != null &&
            rep.getReportIsNotNull())
        {
                coll.add(domain.getReport(rep.getReport()));
        }           
    }

    populateReports(coll);
}
项目:openMAXIMS    文件:Logic.java   
private void populateGridReportsControls(ReportTemplateLiteVoCollection reportTemplateLiteVoCollection)
{
    form.lyrAdds().tabReports().grdNavReports().getRows().clear();
    if (reportTemplateLiteVoCollection == null)
        return;

    for (int i = 0; i < reportTemplateLiteVoCollection.size(); i++)
    {
        grdNavReportsRow nReport = form.lyrAdds().tabReports().grdNavReports().getRows().newRow();
        nReport.setTypeIcon(form.getImages().Core.Report48);
        nReport.setName("<b>" + reportTemplateLiteVoCollection.get(i).getName() + "</b>" + "<br />" + reportTemplateLiteVoCollection.get(i).getDescription());
        nReport.setValue(reportTemplateLiteVoCollection.get(i));
        if (form.getLocalContext().getSelectedReportsIsNotNull() && form.getLocalContext().getSelectedReports().contains(reportTemplateLiteVoCollection.get(i)))
        {
            nReport.setBackColor(Color.Beige);
            nReport.setSelect(true);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onQmbReportsTextSubmited(String value) throws PresentationLogicException
{
    form.qmbReports().clear();

    ReportTemplateLiteVoCollection coll = domain.listTemplates('%' + value + '%', form.chkDFT().getValue());

    for(ReportTemplateLiteVo item : coll)
    {
        form.qmbReports().newRow(item, item.getName());
    }

    if(coll.size() == 1)
    {
        form.qmbReports().setValue(coll.get(0));
    }
    else if(coll.size() > 1)
    {
        form.qmbReports().showOpened();
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateReportsGrid(ReportTemplateLiteVoCollection templates)
{
    if (templates == null ||
            (templates != null &&
                    templates.size() == 0))
        return;

    ReportListVoCollection coll = new ReportListVoCollection();
    for (int i = 0; i < templates.size(); i++)
    {
        ReportTemplateLiteVo rep = templates.get(i);
        if (rep != null &&
            rep.getReportIsNotNull())
        {
                coll.add(domain.getReport(rep.getReport()));
        }           
    }

    populateReports(coll);
}
项目:openMAXIMS    文件:Logic.java   
private void populateGridReportsControls(ReportTemplateLiteVoCollection reportTemplateLiteVoCollection)
{
    form.lyrAdds().tabReports().grdNavReports().getRows().clear();
    if (reportTemplateLiteVoCollection == null)
        return;

    for (int i = 0; i < reportTemplateLiteVoCollection.size(); i++)
    {
        grdNavReportsRow nReport = form.lyrAdds().tabReports().grdNavReports().getRows().newRow();
        nReport.setTypeIcon(form.getImages().Core.Report48);
        nReport.setName("<b>" + reportTemplateLiteVoCollection.get(i).getName() + "</b>" + "<br />" + reportTemplateLiteVoCollection.get(i).getDescription());
        nReport.setValue(reportTemplateLiteVoCollection.get(i));
        if (form.getLocalContext().getSelectedReportsIsNotNull() && form.getLocalContext().getSelectedReports().contains(reportTemplateLiteVoCollection.get(i)))
        {
            nReport.setBackColor(Color.Beige);
            nReport.setSelect(true);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onQmbReportsTextSubmited(String value) throws PresentationLogicException
{
    form.qmbReports().clear();

    ReportTemplateLiteVoCollection coll = domain.listTemplates('%' + value + '%', form.chkDFT().getValue());

    for(ReportTemplateLiteVo item : coll)
    {
        form.qmbReports().newRow(item, item.getName());
    }

    if(coll.size() == 1)
    {
        form.qmbReports().setValue(coll.get(0));
    }
    else if(coll.size() > 1)
    {
        form.qmbReports().showOpened();
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void populateReportsGrid(ReportTemplateLiteVoCollection templates)
{
    if (templates == null ||
            (templates != null &&
                    templates.size() == 0))
        return;

    ReportListVoCollection coll = new ReportListVoCollection();
    for (int i = 0; i < templates.size(); i++)
    {
        ReportTemplateLiteVo rep = templates.get(i);
        if (rep != null &&
            rep.getReportIsNotNull())
        {
                coll.add(domain.getReport(rep.getReport()));
        }           
    }

    populateReports(coll);
}
项目:openmaxims-linux    文件:Logic.java   
private void populateGridReportsControls(ReportTemplateLiteVoCollection reportTemplateLiteVoCollection)
{
    form.lyrAdds().tabReports().grdNavReports().getRows().clear();
    if (reportTemplateLiteVoCollection == null)
        return;

    for (int i = 0; i < reportTemplateLiteVoCollection.size(); i++)
    {
        grdNavReportsRow nReport = form.lyrAdds().tabReports().grdNavReports().getRows().newRow();
        nReport.setTypeIcon(form.getImages().Core.Report48);
        nReport.setName("<b>" + reportTemplateLiteVoCollection.get(i).getName() + "</b>" + "<br />" + reportTemplateLiteVoCollection.get(i).getDescription());
        nReport.setValue(reportTemplateLiteVoCollection.get(i));
        if (form.getLocalContext().getSelectedReportsIsNotNull() && form.getLocalContext().getSelectedReports().contains(reportTemplateLiteVoCollection.get(i)))
        {
            nReport.setBackColor(Color.Beige);
            nReport.setSelect(true);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void listTemplatesByName(String templateName)
{
    ReportTemplateLiteVoCollection templateList;

    // Clear the form 
    clearInstanceControls();

    try
    {
        // List the templates from domain
        templateList = domain.listTemplatesByName(templateName);

        if (templateList == null || templateList.size() == 0)
        {
            engine.showMessage("No templates found. Please define templates before accesing this form.");
            return;
        }

        for (int i = 0; i < templateList.size(); i++)
        {
            if (templateList.get(i) != null)
            {
                setTemplateGridRow(form.grdTemplates().getRows().newRow(), templateList.get(i));
            }
        }
    }
    catch (DomainInterfaceException exception)
    {   engine.showMessage(exception.getMessage()); }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{       
    ReportTemplateLiteVoCollection templates = domain.getTemplates(form.getGlobalContext().Scheduling.getAppointmentIds());     
    createDynamicGridColumns();
    populateReportsGrid(templates);
}
项目:AvoinApotti    文件:PrintAppointmentImpl.java   
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids)
{
    if (ids == null)
        throw new CodingRuntimeException("Mandatory argument - ids");

    DomainFactory factory = getDomainFactory(); 
    String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( ";

    for (int i = 0; i < ids.size(); i++)
    {
        if (i == 0 || i == ids.size())
            hql+=ids.get(0);
        else
            hql+=("," + ids.get(i));
    }
    hql += " )";        
    hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null";

    String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join pt.profile as prof where prof.id in ( ";
    finalHQL += hql;
    finalHQL += " )";       
    finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null";

    List lst = factory.find(finalHQL);

    return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst);
}
项目:AvoinApotti    文件:NavigationAdminProtImpl.java   
public ReportTemplateLiteVoCollection listReports(String nameFilter) {

    String hql = "select repTem from ReportBo as rep left join rep.templates as repTem where " +
            "(rep.isActive = 1 and repTem.isActive = 1 and upper(repTem.name) like :name) order by upper(repTem.name)";

    return  ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(
            getDomainFactory().find(hql,"name","%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%"));
}
项目:openMAXIMS    文件:Logic.java   
private void listTemplatesByName(String templateName)
{
    ReportTemplateLiteVoCollection templateList;

    // Clear the form 
    clearInstanceControls();

    try
    {
        // List the templates from domain
        templateList = domain.listTemplatesByName(templateName);

        if (templateList == null || templateList.size() == 0)
        {
            engine.showMessage("No templates found. Please define templates before accesing this form.");
            return;
        }

        for (int i = 0; i < templateList.size(); i++)
        {
            if (templateList.get(i) != null)
            {
                setTemplateGridRow(form.grdTemplates().getRows().newRow(), templateList.get(i));
            }
        }
    }
    catch (DomainInterfaceException exception)
    {   engine.showMessage(exception.getMessage()); }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{       
    ReportTemplateLiteVoCollection templates = domain.getTemplates(form.getGlobalContext().Scheduling.getAppointmentIds());     
    createDynamicGridColumns();
    populateReportsGrid(templates);

    form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false); //WDEV-19381
}
项目:openMAXIMS    文件:PrintAppointmentImpl.java   
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids)
{
    if (ids == null)
        throw new CodingRuntimeException("Mandatory argument - ids");

    DomainFactory factory = getDomainFactory(); 
    String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( ";

    for (int i = 0; i < ids.size(); i++)
    {
        if (i == 0 || i == ids.size())
            hql+=ids.get(0);
        else
            hql+=("," + ids.get(i));
    }
    hql += " )";        
    hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null";

    String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join temp.report as report join pt.profile as prof where report.isActive =1 and temp.isActive =1 and prof.id in ( "; //WDEV-23494 //WDEV-23731 
    finalHQL += hql;
    finalHQL += " )";       
    finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null";

    List lst = factory.find(finalHQL);

    return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst);
}
项目:openMAXIMS    文件:NavigationAdminProtImpl.java   
public ReportTemplateLiteVoCollection listReports(String nameFilter) {

    String hql = "select repTem from ReportBo as rep left join rep.templates as repTem where " +
            "(rep.isActive = 1 and repTem.isActive = 1 and upper(repTem.name) like :name) order by upper(repTem.name)";

    return  ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(
            getDomainFactory().find(hql,"name","%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%"));
}
项目:openMAXIMS    文件:Logic.java   
private void listTemplatesByName(String templateName)
{
    ReportTemplateLiteVoCollection templateList;

    // Clear the form 
    clearInstanceControls();

    try
    {
        // List the templates from domain
        templateList = domain.listTemplatesByName(templateName);

        if (templateList == null || templateList.size() == 0)
        {
            engine.showMessage("No templates found. Please define templates before accesing this form.");
            return;
        }

        for (int i = 0; i < templateList.size(); i++)
        {
            if (templateList.get(i) != null)
            {
                setTemplateGridRow(form.grdTemplates().getRows().newRow(), templateList.get(i));
            }
        }
    }
    catch (DomainInterfaceException exception)
    {   engine.showMessage(exception.getMessage()); }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{       
    ReportTemplateLiteVoCollection templates = domain.getTemplates(form.getGlobalContext().Scheduling.getAppointmentIds());     
    createDynamicGridColumns();
    populateReportsGrid(templates);
}
项目:openMAXIMS    文件:PrintAppointmentImpl.java   
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids)
{
    if (ids == null)
        throw new CodingRuntimeException("Mandatory argument - ids");

    DomainFactory factory = getDomainFactory(); 
    String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( ";

    for (int i = 0; i < ids.size(); i++)
    {
        if (i == 0 || i == ids.size())
            hql+=ids.get(0);
        else
            hql+=("," + ids.get(i));
    }
    hql += " )";        
    hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null";

    String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join pt.profile as prof where prof.id in ( ";
    finalHQL += hql;
    finalHQL += " )";       
    finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null";

    List lst = factory.find(finalHQL);

    return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst);
}
项目:openMAXIMS    文件:NavigationAdminProtImpl.java   
public ReportTemplateLiteVoCollection listReports(String nameFilter) {

    String hql = "select repTem from ReportBo as rep left join rep.templates as repTem where " +
            "(rep.isActive = 1 and repTem.isActive = 1 and upper(repTem.name) like :name) order by upper(repTem.name)";

    return  ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(
            getDomainFactory().find(hql,"name","%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%"));
}
项目:openmaxims-linux    文件:Logic.java   
private void listTemplatesByName(String templateName)
{
    ReportTemplateLiteVoCollection templateList;

    // Clear the form 
    clearInstanceControls();

    try
    {
        // List the templates from domain
        templateList = domain.listTemplatesByName(templateName);

        if (templateList == null || templateList.size() == 0)
        {
            engine.showMessage("No templates found. Please define templates before accesing this form.");
            return;
        }

        for (int i = 0; i < templateList.size(); i++)
        {
            if (templateList.get(i) != null)
            {
                setTemplateGridRow(form.grdTemplates().getRows().newRow(), templateList.get(i));
            }
        }
    }
    catch (DomainInterfaceException exception)
    {   engine.showMessage(exception.getMessage()); }
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{       
    ReportTemplateLiteVoCollection templates = domain.getTemplates(form.getGlobalContext().Scheduling.getAppointmentIds());     
    createDynamicGridColumns();
    populateReportsGrid(templates);
}
项目:openmaxims-linux    文件:PrintAppointmentImpl.java   
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids)
{
    if (ids == null)
        throw new CodingRuntimeException("Mandatory argument - ids");

    DomainFactory factory = getDomainFactory(); 
    String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( ";

    for (int i = 0; i < ids.size(); i++)
    {
        if (i == 0 || i == ids.size())
            hql+=ids.get(0);
        else
            hql+=("," + ids.get(i));
    }
    hql += " )";        
    hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null";

    String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join pt.profile as prof where prof.id in ( ";
    finalHQL += hql;
    finalHQL += " )";       
    finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null";

    List lst = factory.find(finalHQL);

    return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst);
}
项目:openmaxims-linux    文件:NavigationAdminProtImpl.java   
public ReportTemplateLiteVoCollection listReports(String nameFilter) {

    String hql = "select repTem from ReportBo as rep left join rep.templates as repTem where " +
            "(rep.isActive = 1 and repTem.isActive = 1 and upper(repTem.name) like :name) order by upper(repTem.name)";

    return  ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(
            getDomainFactory().find(hql,"name","%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%"));
}
项目:AvoinApotti    文件:TemplateAssociationsConfigurationImpl.java   
public ReportTemplateLiteVoCollection listTemplatesByName(String templateName) throws DomainInterfaceException
{
    if (templateName == null || templateName.length() == 0)
        throw new DomainInterfaceException("Cannot search on null or zero lenght template name"); //WDEV-17872

    String[] names = templateName.split(" ");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    String query = "from TemplateBo tb ";
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    // Build search criteria for template name
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append("(");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("upper(tb.name) like :NAME" + i);
            markers.add("NAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            if (i != names.length -1)
                hql.append(" OR ");
        }

        hql.append(")");
    }

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    try
    {
        List<DomainObject> results = factory.find(query, markers, values);
        ReportTemplateLiteVoCollection templateCollection = ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(results);
        return templateCollection;
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:AvoinApotti    文件:ReportsToModalityConfigFormImpl.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
//  @Override
    public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft)
    {
        DomainFactory factory = getDomainFactory();

        StringBuffer hql = new StringBuffer();
        StringBuffer cond = new StringBuffer();

        ArrayList markers = new ArrayList();
        ArrayList values = new ArrayList();
        String andStr = " ";

        hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd");

        cond.append(andStr + "t.isActive = :A");
        markers.add("A");
        values.add(Boolean.TRUE);
        andStr = " and ";

        cond.append(andStr + "t.report.isActive = :A");

        if(name.length() > 0)
        {
            cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)");
            markers.add("NAME");
            values.add(name);
            andStr = " and ";
        }

        if(isDft)
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")");
        else
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")");
        andStr = " and ";

        if (andStr.equals(" and "))
        {
            hql.append(" where ");
        }

        hql.append(cond.toString());
        hql.append(" order by UPPER(t.name)");

        List list = factory.find(hql.toString(), markers, values);

        return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list);
    }
项目:openMAXIMS    文件:TemplateAssociationsConfigurationImpl.java   
public ReportTemplateLiteVoCollection listTemplatesByName(String templateName) throws DomainInterfaceException
{
    if (templateName == null || templateName.length() == 0)
        throw new DomainInterfaceException("Cannot search on null or zero lenght template name"); //WDEV-17872

    String[] names = templateName.split(" ");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    String query = "from TemplateBo tb ";
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    // Build search criteria for template name
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append("(");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("upper(tb.name) like :NAME" + i);
            markers.add("NAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            if (i != names.length -1)
                hql.append(" OR ");
        }

        hql.append(")");
    }

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    try
    {
        List<DomainObject> results = factory.find(query, markers, values);
        ReportTemplateLiteVoCollection templateCollection = ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(results);
        return templateCollection;
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openMAXIMS    文件:ReportsToModalityConfigFormImpl.java   
@SuppressWarnings({ "rawtypes", "unchecked" })  
public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    StringBuffer cond = new StringBuffer();

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd");

    cond.append(andStr + "t.isActive = :A");
    markers.add("A");
    values.add(Boolean.TRUE);
    andStr = " and ";

    cond.append(andStr + "t.report.isActive = :A");

    if(name.length() > 0)
    {
        cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)");
        markers.add("NAME");
        values.add(name);
        andStr = " and ";
    }

    if(isDft)
        cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")");
    else
        cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")");
    andStr = " and ";

    if (andStr.equals(" and "))
    {
        hql.append(" where ");
    }

    hql.append(cond.toString());
    hql.append(" order by UPPER(t.name)");

    List list = factory.find(hql.toString(), markers, values);

    return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list);
}
项目:openMAXIMS    文件:TemplateAssociationsConfigurationImpl.java   
public ReportTemplateLiteVoCollection listTemplatesByName(String templateName) throws DomainInterfaceException
{
    if (templateName == null || templateName.length() == 0)
        throw new DomainInterfaceException("Cannot search on null or zero lenght template name"); //WDEV-17872

    String[] names = templateName.split(" ");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    String query = "from TemplateBo tb ";
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    // Build search criteria for template name
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append("(");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("upper(tb.name) like :NAME" + i);
            markers.add("NAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            if (i != names.length -1)
                hql.append(" OR ");
        }

        hql.append(")");
    }

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    try
    {
        List<DomainObject> results = factory.find(query, markers, values);
        ReportTemplateLiteVoCollection templateCollection = ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(results);
        return templateCollection;
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openMAXIMS    文件:ReportsToModalityConfigFormImpl.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
//  @Override
    public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft)
    {
        DomainFactory factory = getDomainFactory();

        StringBuffer hql = new StringBuffer();
        StringBuffer cond = new StringBuffer();

        ArrayList markers = new ArrayList();
        ArrayList values = new ArrayList();
        String andStr = " ";

        hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd");

        cond.append(andStr + "t.isActive = :A");
        markers.add("A");
        values.add(Boolean.TRUE);
        andStr = " and ";

        cond.append(andStr + "t.report.isActive = :A");

        if(name.length() > 0)
        {
            cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)");
            markers.add("NAME");
            values.add(name);
            andStr = " and ";
        }

        if(isDft)
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")");
        else
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")");
        andStr = " and ";

        if (andStr.equals(" and "))
        {
            hql.append(" where ");
        }

        hql.append(cond.toString());
        hql.append(" order by UPPER(t.name)");

        List list = factory.find(hql.toString(), markers, values);

        return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list);
    }
项目:openmaxims-linux    文件:TemplateAssociationsConfigurationImpl.java   
public ReportTemplateLiteVoCollection listTemplatesByName(String templateName) throws DomainInterfaceException
{
    if (templateName == null || templateName.length() == 0)
        throw new DomainInterfaceException("Cannot search on null or zero lenght template name"); //WDEV-17872

    String[] names = templateName.split(" ");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    String query = "from TemplateBo tb ";
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    // Build search criteria for template name
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append("(");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("upper(tb.name) like :NAME" + i);
            markers.add("NAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            if (i != names.length -1)
                hql.append(" OR ");
        }

        hql.append(")");
    }

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    try
    {
        List<DomainObject> results = factory.find(query, markers, values);
        ReportTemplateLiteVoCollection templateCollection = ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(results);
        return templateCollection;
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openmaxims-linux    文件:ReportsToModalityConfigFormImpl.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
//  @Override
    public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft)
    {
        DomainFactory factory = getDomainFactory();

        StringBuffer hql = new StringBuffer();
        StringBuffer cond = new StringBuffer();

        ArrayList markers = new ArrayList();
        ArrayList values = new ArrayList();
        String andStr = " ";

        hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd");

        cond.append(andStr + "t.isActive = :A");
        markers.add("A");
        values.add(Boolean.TRUE);
        andStr = " and ";

        cond.append(andStr + "t.report.isActive = :A");

        if(name.length() > 0)
        {
            cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)");
            markers.add("NAME");
            values.add(name);
            andStr = " and ";
        }

        if(isDft)
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")");
        else
            cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")");
        andStr = " and ";

        if (andStr.equals(" and "))
        {
            hql.append(" where ");
        }

        hql.append(cond.toString());
        hql.append(" order by UPPER(t.name)");

        List list = factory.find(hql.toString(), markers, values);

        return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list);
    }