Java 类ims.core.vo.lookups.UserDefinedAssessmentTypeCollection 实例源码

项目:AvoinApotti    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getAssessmentTypes(UserDefinedAssessmentType value)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if(value != null)
    {
        lkpColl.add(value);
        if(value.equals(UserDefinedAssessmentType.USERDEFINEDDATASHEET))
        {
            lkpColl.add(UserDefinedAssessmentType.DISCHARGECHECKLIST);
        }
        if(value.equals(UserDefinedAssessmentType.ASSESSMENTTOOL))
        {
            lkpColl.add(UserDefinedAssessmentType.DPP);
        }
    }

    return lkpColl;
}
项目:AvoinApotti    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);
            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    assTypeColl.add((UserDefinedAssessmentType)lkpType.getChildInstances().get(j));
                }
            }
        }
    }

    return assTypeColl;
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getAssessmentTypes(UserDefinedAssessmentType value)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if(value != null)
    {
        lkpColl.add(value);
        if(value.equals(UserDefinedAssessmentType.USERDEFINEDDATASHEET))
        {
            lkpColl.add(UserDefinedAssessmentType.DISCHARGECHECKLIST);
        }
        if(value.equals(UserDefinedAssessmentType.ASSESSMENTTOOL))
        {
            lkpColl.add(UserDefinedAssessmentType.DPP);
        }
    }

    return lkpColl;
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);
            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    assTypeColl.add((UserDefinedAssessmentType)lkpType.getChildInstances().get(j));
                }
            }
        }
    }

    return assTypeColl;
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getAssessmentTypes(UserDefinedAssessmentType value)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if(value != null)
    {
        lkpColl.add(value);
        if(value.equals(UserDefinedAssessmentType.USERDEFINEDDATASHEET))
        {
            lkpColl.add(UserDefinedAssessmentType.DISCHARGECHECKLIST);
        }
        if(value.equals(UserDefinedAssessmentType.ASSESSMENTTOOL))
        {
            lkpColl.add(UserDefinedAssessmentType.DPP);
        }
    }

    return lkpColl;
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);
            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    assTypeColl.add((UserDefinedAssessmentType)lkpType.getChildInstances().get(j));
                }
            }
        }
    }

    return assTypeColl;
}
项目:openmaxims-linux    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getAssessmentTypes(UserDefinedAssessmentType value)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if(value != null)
    {
        lkpColl.add(value);
        if(value.equals(UserDefinedAssessmentType.USERDEFINEDDATASHEET))
        {
            lkpColl.add(UserDefinedAssessmentType.DISCHARGECHECKLIST);
        }
        if(value.equals(UserDefinedAssessmentType.ASSESSMENTTOOL))
        {
            lkpColl.add(UserDefinedAssessmentType.DPP);
        }
    }

    return lkpColl;
}
项目:openmaxims-linux    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);
            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    assTypeColl.add((UserDefinedAssessmentType)lkpType.getChildInstances().get(j));
                }
            }
        }
    }

    return assTypeColl;
}
项目:AvoinApotti    文件:Logic.java   
private UserAssessmentLiteVoCollection listUserAssessments()
{
    UserDefinedAssessmentTypeCollection coll = new UserDefinedAssessmentTypeCollection();
    coll.add(UserDefinedAssessmentType.DPP);
    //coll.add(UserDefinedAssessmentType.ADDITIONALDPP);
    return domain.listUserAssessments(coll);    
}
项目:AvoinApotti    文件:Logic.java   
private void populateLookups()
{
    form.cmbComponent().clear();
    //WDEV-1692 - Display first level one lookups
    UserDefinedAssessmentTypeCollection lookupColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());
    LookupInstVo[] lookupParents = lookupColl.getRoots();
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        UserDefinedAssessmentType assessmentType = lookupColl.get(i);
        if (lookupHasARootParent(lookupParents, assessmentType))
        {
            form.cmbComponent().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type, UserDefinedAssessmentType excludedType)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);

            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    UserDefinedAssessmentType userDefinedAssessmentType = (UserDefinedAssessmentType)lkpType.getChildInstances().get(j);
                    if(excludedType != null && excludedType.equals(userDefinedAssessmentType))
                        continue;
                    assTypeColl.add(userDefinedAssessmentType);
                }
            }
        }
    }

    return assTypeColl;
}
项目:AvoinApotti    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, UserAssessmentCategory category, UserDefinedAssessmentType assessmentType)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if (assessmentType != null)
        lkpColl.add(assessmentType);
    return listAssessments(name, category, lkpColl, null);
}
项目:AvoinApotti    文件:DPPGroupingsConfigImpl.java   
public ims.assessment.vo.UserAssessmentLiteVoCollection listUserAssessments(UserDefinedAssessmentTypeCollection assessmentTypes)
{
    if (assessmentTypes == null || assessmentTypes.size() == 0)
        throw new CodingRuntimeException("Cannot list UserAssessment for null assessmentTypes");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from UserAssessment u ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String orStr = " where ";

    // AssessmentType
    for (int i = 0; i < assessmentTypes.size(); i++)
    {
        UserDefinedAssessmentType type = assessmentTypes.get(i);
        if (type != null)
        {
            String marker = "assType" + i;
            hql.append(orStr + " u.assessmentType =:" + marker);
            markers.add(marker);
            values.add(getDomLookup(type));
            orStr = " or ";
        }
    }

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

    return UserAssessmentLiteVoAssembler.createUserAssessmentLiteVoCollectionFromUserAssessment(list).sort(SortOrder.DESCENDING);
}
项目:openMAXIMS    文件:Logic.java   
private UserAssessmentLiteVoCollection listUserAssessments()
{
    UserDefinedAssessmentTypeCollection coll = new UserDefinedAssessmentTypeCollection();
    coll.add(UserDefinedAssessmentType.DPP);
    //coll.add(UserDefinedAssessmentType.ADDITIONALDPP);
    return domain.listUserAssessments(coll);    
}
项目:openMAXIMS    文件:Logic.java   
private void populateLookups()
{
    form.cmbComponent().clear();
    //WDEV-1692 - Display first level one lookups
    UserDefinedAssessmentTypeCollection lookupColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());
    LookupInstVo[] lookupParents = lookupColl.getRoots();
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        UserDefinedAssessmentType assessmentType = lookupColl.get(i);
        if (lookupHasARootParent(lookupParents, assessmentType))
        {
            form.cmbComponent().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type, UserDefinedAssessmentType excludedType)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);

            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    UserDefinedAssessmentType userDefinedAssessmentType = (UserDefinedAssessmentType)lkpType.getChildInstances().get(j);
                    if(excludedType != null && excludedType.equals(userDefinedAssessmentType))
                        continue;
                    assTypeColl.add(userDefinedAssessmentType);
                }
            }
        }
    }

    return assTypeColl;
}
项目:openMAXIMS    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, UserAssessmentCategory category, UserDefinedAssessmentType assessmentType)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if (assessmentType != null)
        lkpColl.add(assessmentType);
    return listAssessments(name, category, lkpColl, null);
}
项目:openMAXIMS    文件:DPPGroupingsConfigImpl.java   
public ims.assessment.vo.UserAssessmentLiteVoCollection listUserAssessments(UserDefinedAssessmentTypeCollection assessmentTypes)
{
    if (assessmentTypes == null || assessmentTypes.size() == 0)
        throw new CodingRuntimeException("Cannot list UserAssessment for null assessmentTypes");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from UserAssessment u ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String orStr = " where ";

    // AssessmentType
    for (int i = 0; i < assessmentTypes.size(); i++)
    {
        UserDefinedAssessmentType type = assessmentTypes.get(i);
        if (type != null)
        {
            String marker = "assType" + i;
            hql.append(orStr + " u.assessmentType =:" + marker);
            markers.add(marker);
            values.add(getDomLookup(type));
            orStr = " or ";
        }
    }

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

    return UserAssessmentLiteVoAssembler.createUserAssessmentLiteVoCollectionFromUserAssessment(list).sort(SortOrder.DESCENDING);
}
项目:openMAXIMS    文件:Logic.java   
private UserAssessmentLiteVoCollection listUserAssessments()
{
    UserDefinedAssessmentTypeCollection coll = new UserDefinedAssessmentTypeCollection();
    coll.add(UserDefinedAssessmentType.DPP);
    //coll.add(UserDefinedAssessmentType.ADDITIONALDPP);
    return domain.listUserAssessments(coll);    
}
项目:openMAXIMS    文件:Logic.java   
private void populateLookups()
{
    form.cmbComponent().clear();
    //WDEV-1692 - Display first level one lookups
    UserDefinedAssessmentTypeCollection lookupColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());
    LookupInstVo[] lookupParents = lookupColl.getRoots();
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        UserDefinedAssessmentType assessmentType = lookupColl.get(i);
        if (lookupHasARootParent(lookupParents, assessmentType))
        {
            form.cmbComponent().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type, UserDefinedAssessmentType excludedType)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);

            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    UserDefinedAssessmentType userDefinedAssessmentType = (UserDefinedAssessmentType)lkpType.getChildInstances().get(j);
                    if(excludedType != null && excludedType.equals(userDefinedAssessmentType))
                        continue;
                    assTypeColl.add(userDefinedAssessmentType);
                }
            }
        }
    }

    return assTypeColl;
}
项目:openMAXIMS    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, UserAssessmentCategory category, UserDefinedAssessmentType assessmentType)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if (assessmentType != null)
        lkpColl.add(assessmentType);
    return listAssessments(name, category, lkpColl, null);
}
项目:openMAXIMS    文件:DPPGroupingsConfigImpl.java   
public ims.assessment.vo.UserAssessmentLiteVoCollection listUserAssessments(UserDefinedAssessmentTypeCollection assessmentTypes)
{
    if (assessmentTypes == null || assessmentTypes.size() == 0)
        throw new CodingRuntimeException("Cannot list UserAssessment for null assessmentTypes");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from UserAssessment u ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String orStr = " where ";

    // AssessmentType
    for (int i = 0; i < assessmentTypes.size(); i++)
    {
        UserDefinedAssessmentType type = assessmentTypes.get(i);
        if (type != null)
        {
            String marker = "assType" + i;
            hql.append(orStr + " u.assessmentType =:" + marker);
            markers.add(marker);
            values.add(getDomLookup(type));
            orStr = " or ";
        }
    }

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

    return UserAssessmentLiteVoAssembler.createUserAssessmentLiteVoCollectionFromUserAssessment(list).sort(SortOrder.DESCENDING);
}
项目:openmaxims-linux    文件:Logic.java   
private UserAssessmentLiteVoCollection listUserAssessments()
{
    UserDefinedAssessmentTypeCollection coll = new UserDefinedAssessmentTypeCollection();
    coll.add(UserDefinedAssessmentType.DPP);
    //coll.add(UserDefinedAssessmentType.ADDITIONALDPP);
    return domain.listUserAssessments(coll);    
}
项目:openmaxims-linux    文件:Logic.java   
private void populateLookups()
{
    form.cmbComponent().clear();
    //WDEV-1692 - Display first level one lookups
    UserDefinedAssessmentTypeCollection lookupColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());
    LookupInstVo[] lookupParents = lookupColl.getRoots();
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        UserDefinedAssessmentType assessmentType = lookupColl.get(i);
        if (lookupHasARootParent(lookupParents, assessmentType))
        {
            form.cmbComponent().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type, UserDefinedAssessmentType excludedType)
{
    UserDefinedAssessmentTypeCollection assTypeColl = new UserDefinedAssessmentTypeCollection();
    if(type != null)
    {
        assTypeColl.add(type);

        UserDefinedAssessmentTypeCollection udfColl = LookupHelper.getUserDefinedAssessmentType(domain.getLookupService());

        for (int i = 0; i < udfColl.size(); i++)
        {
            UserDefinedAssessmentType lkpType = udfColl.get(i);

            if(type.equals(lkpType))
            {
                //Add the children (if any) to the collection
                for (int j = 0; lkpType.getChildInstances() != null && j < lkpType.getChildInstances().size(); j++)
                {
                    UserDefinedAssessmentType userDefinedAssessmentType = (UserDefinedAssessmentType)lkpType.getChildInstances().get(j);
                    if(excludedType != null && excludedType.equals(userDefinedAssessmentType))
                        continue;
                    assTypeColl.add(userDefinedAssessmentType);
                }
            }
        }
    }

    return assTypeColl;
}
项目:openmaxims-linux    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, UserAssessmentCategory category, UserDefinedAssessmentType assessmentType)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    if (assessmentType != null)
        lkpColl.add(assessmentType);
    return listAssessments(name, category, lkpColl, null);
}
项目:openmaxims-linux    文件:DPPGroupingsConfigImpl.java   
public ims.assessment.vo.UserAssessmentLiteVoCollection listUserAssessments(UserDefinedAssessmentTypeCollection assessmentTypes)
{
    if (assessmentTypes == null || assessmentTypes.size() == 0)
        throw new CodingRuntimeException("Cannot list UserAssessment for null assessmentTypes");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from UserAssessment u ");
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String orStr = " where ";

    // AssessmentType
    for (int i = 0; i < assessmentTypes.size(); i++)
    {
        UserDefinedAssessmentType type = assessmentTypes.get(i);
        if (type != null)
        {
            String marker = "assType" + i;
            hql.append(orStr + " u.assessmentType =:" + marker);
            markers.add(marker);
            values.add(getDomLookup(type));
            orStr = " or ";
        }
    }

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

    return UserAssessmentLiteVoAssembler.createUserAssessmentLiteVoCollectionFromUserAssessment(list).sort(SortOrder.DESCENDING);
}
项目:AvoinApotti    文件:Logic.java   
private void search(boolean checkMandatory)
{
    UserAssessmentShortVoCollection assessments;
    String name = form.txtName().getValue();

    if(name != null && name.length() > 0)
    {
        if(form.GroupCriteria().getValue().equals(GenForm.GroupCriteriaEnumeration.rdoBegins))
        {
            name += '%';
        }
        else if(form.GroupCriteria().getValue().equals(GenForm.GroupCriteriaEnumeration.rdoContains))
        {
            name = '%' + name + '%';
        }
    }
    else
    {
        if(checkMandatory)
        {
            engine.showMessage("Please enter a name");
            form.txtName().setFocus();
            form.grdDetails().getRows().clear();
            refreshContextMenu();
            return;
        }
    }

    UserDefinedAssessmentTypeCollection assessmentTypes = getAssessmentTypes(form.cmbAssType().getValue());
    assessments = domain.listAssessments(name, form.cmbCategory().getValue(), assessmentTypes, form.cmbStatus().getValue());

    populateScreenFromData(assessments);

    if(assessments == null || assessments.size() == 0)
    {
        engine.showMessage("No Assessments found for the Search Criteria Provided");
    }

    if(form.getGlobalContext().Core.getSelectedUserAssessmentIsNotNull() && form.getGlobalContext().Core.getSelectedUserAssessment().getID_UserAssessmentIsNotNull())
        form.grdDetails().setValue(form.getGlobalContext().Core.getSelectedUserAssessment());

    refreshContextMenu();
}
项目:AvoinApotti    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    return getUserDefinedTypes(type, null);
}
项目:AvoinApotti    文件:GraphicAssessmentsImpl.java   
private GraphicAssessmentShortVoCollection listGraphicAssesssments(String name, ims.core.vo.lookups.PreActiveActiveInactiveStatus status, UserDefinedAssessmentTypeCollection types)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from GraphicAssessment ga ");
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();
    String clause = " where ";

    if (name != null)
    {
        hql.append(clause);
        hql.append(" upper(ga.name) like :name");
        names.add("name");
        values.add(name.toUpperCase());
        clause = " and ";
    }
    if (status != null)
    {
        hql.append(clause);
        hql.append(" ga.activeStatus = :status");
        names.add("status");
        values.add(getDomLookup(status));
        clause = " and ";
    }

    if (types != null)
    {
        int size = types.size();
        for (int i = 0; i < size; i++)
        {
            UserDefinedAssessmentType assType = types.get(i);
            // Check if " where " clause was added previously
            hql.append(clause);
            if (i == 0)
                hql.append(" (");

            hql.append("ga.assessmentType.id =:assessmentType" + Integer.toString(i));
            names.add("assessmentType" + i);
            values.add(new Integer(assType.getId()));

            if (i == (size - 1))
                hql.append(")");

            clause = " or ";
        }

        clause = " and ";
    }

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

    return GraphicAssessmentShortVoAssembler.createGraphicAssessmentShortVoCollectionFromGraphicAssessment(list);
}
项目:AvoinApotti    文件:GraphicAssessmentsImpl.java   
public GraphicAssessmentShortVoCollection listAssessments(String name, PreActiveActiveInactiveStatus status, UserDefinedAssessmentTypeCollection types)
{
    return listGraphicAssesssments(name, status, types);
}
项目:AvoinApotti    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, PreActiveActiveInactiveStatus status, UserDefinedAssessmentType assessmentType)
{
    UserDefinedAssessmentTypeCollection lkpColl = new UserDefinedAssessmentTypeCollection();
    lkpColl.add(assessmentType);
    return listAssessments(name, null, lkpColl, status);
}
项目:AvoinApotti    文件:UserAssessmentsImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, ims.core.vo.lookups.UserAssessmentCategory category, UserDefinedAssessmentTypeCollection assessmentTypeColl, ims.core.vo.lookups.PreActiveActiveInactiveStatus status)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from UserAssessment u ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (name != null && name.length() > 0)
    {
        hql.append(andStr + " upper(u.name) like :name");
        markers.add("name");
        values.add(name.toUpperCase());
        andStr = " and ";

    }
    if (category != null)
    {
        hql.append(andStr + " u.category.id =:category");
        markers.add("category");
        values.add(new Integer(category.getId()));
        andStr = " and ";
    }

    if (status != null)
    {
        hql.append(andStr + " u.activeStatus =:status");
        markers.add("status");
        values.add(getDomLookup(status));
        andStr = " and ";
    }

    if (assessmentTypeColl != null)
    {
        int size = assessmentTypeColl.size();
        for (int i = 0; i < size; i++)
        {
            UserDefinedAssessmentType assType = assessmentTypeColl.get(i);
            hql.append(andStr);
            if (i == 0)
                hql.append(" (");
            hql.append(" u.assessmentType.id =:assessmentType" + Integer.toString(i));
            markers.add("assessmentType" + i);
            values.add(new Integer(assType.getId()));
            andStr = " or ";

            if (i == (size - 1))
                hql.append(")");    
        }
    }

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

    query += hql.toString();

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

    return UserAssessmentShortVoAssembler.createUserAssessmentShortVoCollectionFromUserAssessment(list).sort();
}
项目:AvoinApotti    文件:UserDefinedFormSearchImpl.java   
/**
* listAssessments
*/
public UserAssessmentShortVoCollection listAssessments(String name, ims.core.vo.lookups.PreActiveActiveInactiveStatus status, UserDefinedAssessmentTypeCollection types)
{
    UserAssessments domainImpl = (UserAssessments) getDomainImpl(UserAssessmentsImpl.class);
    return domainImpl.listAssessments(name, null, types, status);
}
项目:AvoinApotti    文件:UserDefinedFormSearchImpl.java   
public GraphicAssessmentShortVoCollection listGraphicAssessments(String name, PreActiveActiveInactiveStatus status, UserDefinedAssessmentTypeCollection types)
{
    GraphicAssessments domainImpl = (GraphicAssessments) getDomainImpl(GraphicAssessmentsImpl.class);
    return domainImpl.listAssessments(name, status, types);
}
项目:AvoinApotti    文件:ClinicalNoteDrawingImpl.java   
public UserAssessmentShortVoCollection listAssessments(String name, UserAssessmentCategory category, UserDefinedAssessmentTypeCollection assessmentType, PreActiveActiveInactiveStatus status) 
{
    UserAssessments impl = (UserAssessments)getDomainImpl(UserAssessmentsImpl.class);
    return impl.listAssessments(name,category,assessmentType,status);
}
项目:openMAXIMS    文件:Logic.java   
private void search(boolean checkMandatory)
{
    UserAssessmentShortVoCollection assessments;
    String name = form.txtName().getValue();

    if(name != null && name.length() > 0)
    {
        if(form.GroupCriteria().getValue().equals(GenForm.GroupCriteriaEnumeration.rdoBegins))
        {
            name += '%';
        }
        else if(form.GroupCriteria().getValue().equals(GenForm.GroupCriteriaEnumeration.rdoContains))
        {
            name = '%' + name + '%';
        }
    }
    else
    {
        if(checkMandatory)
        {
            engine.showMessage("Please enter a name");
            form.txtName().setFocus();
            form.grdDetails().getRows().clear();
            refreshContextMenu();
            return;
        }
    }

    UserDefinedAssessmentTypeCollection assessmentTypes = getAssessmentTypes(form.cmbAssType().getValue());
    assessments = domain.listAssessments(name, form.cmbCategory().getValue(), assessmentTypes, form.cmbStatus().getValue());

    populateScreenFromData(assessments);

    if(assessments == null || assessments.size() == 0)
    {
        engine.showMessage("No Assessments found for the Search Criteria Provided");
    }

    if(form.getGlobalContext().Core.getSelectedUserAssessmentIsNotNull() && form.getGlobalContext().Core.getSelectedUserAssessment().getID_UserAssessmentIsNotNull())
        form.grdDetails().setValue(form.getGlobalContext().Core.getSelectedUserAssessment());

    refreshContextMenu();
}
项目:openMAXIMS    文件:Logic.java   
private UserDefinedAssessmentTypeCollection getUserDefinedTypes(UserDefinedAssessmentType type)
{
    return getUserDefinedTypes(type, null);
}
项目:openMAXIMS    文件:GraphicAssessmentsImpl.java   
private GraphicAssessmentShortVoCollection listGraphicAssesssments(String name, ims.core.vo.lookups.PreActiveActiveInactiveStatus status, UserDefinedAssessmentTypeCollection types)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from GraphicAssessment ga ");
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();
    String clause = " where ";

    if (name != null)
    {
        hql.append(clause);
        hql.append(" upper(ga.name) like :name");
        names.add("name");
        values.add(name.toUpperCase());
        clause = " and ";
    }
    if (status != null)
    {
        hql.append(clause);
        hql.append(" ga.activeStatus = :status");
        names.add("status");
        values.add(getDomLookup(status));
        clause = " and ";
    }

    if (types != null)
    {
        int size = types.size();
        for (int i = 0; i < size; i++)
        {
            UserDefinedAssessmentType assType = types.get(i);
            // Check if " where " clause was added previously
            hql.append(clause);
            if (i == 0)
                hql.append(" (");

            hql.append("ga.assessmentType.id =:assessmentType" + Integer.toString(i));
            names.add("assessmentType" + i);
            values.add(new Integer(assType.getId()));

            if (i == (size - 1))
                hql.append(")");

            clause = " or ";
        }

        clause = " and ";
    }

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

    return GraphicAssessmentShortVoAssembler.createGraphicAssessmentShortVoCollectionFromGraphicAssessment(list);
}