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

项目:AvoinApotti    文件:Logic.java   
private AppUserShortWithNameVoCollection searchUsersBySurname(String surname) throws CodingRuntimeException
{
    if (surname == null)
    {
        // Leave throw so that the users are not cleared when an empty search is made
        throw new CodingRuntimeException("Search citeria can not be null");
    }

    // Set the filter VO needed for the search
    AppUserShortVo filterVo = new AppUserShortVo();
    filterVo.setUserRealName(surname);

    // Retrieve the users (list from domain)
    try
    {
        return domain.searchUsers(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        engine.showMessage(exception.getMessage());
        return null;
    }
}
项目:openMAXIMS    文件:Logic.java   
private AppUserShortWithNameVoCollection searchUsersBySurname(String surname) throws CodingRuntimeException
{
    if (surname == null)
    {
        // Leave throw so that the users are not cleared when an empty search is made
        throw new CodingRuntimeException("Search citeria can not be null");
    }

    // Set the filter VO needed for the search
    AppUserShortVo filterVo = new AppUserShortVo();
    filterVo.setUserRealName(surname);

    // Retrieve the users (list from domain)
    try
    {
        return domain.searchUsers(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        engine.showMessage(exception.getMessage());
        return null;
    }
}
项目:openMAXIMS    文件:Logic.java   
private AppUserShortWithNameVoCollection searchUsersBySurname(String surname) throws CodingRuntimeException
{
    if (surname == null)
    {
        // Leave throw so that the users are not cleared when an empty search is made
        throw new CodingRuntimeException("Search citeria can not be null");
    }

    // Set the filter VO needed for the search
    AppUserShortVo filterVo = new AppUserShortVo();
    filterVo.setUserRealName(surname);

    // Retrieve the users (list from domain)
    try
    {
        return domain.searchUsers(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        engine.showMessage(exception.getMessage());
        return null;
    }
}
项目:openmaxims-linux    文件:Logic.java   
private AppUserShortWithNameVoCollection searchUsersBySurname(String surname) throws CodingRuntimeException
{
    if (surname == null)
    {
        // Leave throw so that the users are not cleared when an empty search is made
        throw new CodingRuntimeException("Search citeria can not be null");
    }

    // Set the filter VO needed for the search
    AppUserShortVo filterVo = new AppUserShortVo();
    filterVo.setUserRealName(surname);

    // Retrieve the users (list from domain)
    try
    {
        return domain.searchUsers(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        engine.showMessage(exception.getMessage());
        return null;
    }
}
项目:AvoinApotti    文件:Logic.java   
private void setUserGrid(AppUserShortWithNameVoCollection searchResults)
{
    clearUsers();

    if (searchResults == null)
        return;

    for (int i = 0; i < searchResults.size(); i++)
    {
        if (searchResults.get(i) != null)
        {
            setUserGridRow(form.grdUserList().getRows().newRow(), searchResults.get(i));
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void setUserGrid(AppUserShortWithNameVoCollection searchResults)
{
    clearUsers();

    if (searchResults == null)
        return;

    for (int i = 0; i < searchResults.size(); i++)
    {
        if (searchResults.get(i) != null)
        {
            setUserGridRow(form.grdUserList().getRows().newRow(), searchResults.get(i));
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void setUserGrid(AppUserShortWithNameVoCollection searchResults)
{
    clearUsers();

    if (searchResults == null)
        return;

    for (int i = 0; i < searchResults.size(); i++)
    {
        if (searchResults.get(i) != null)
        {
            setUserGridRow(form.grdUserList().getRows().newRow(), searchResults.get(i));
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void setUserGrid(AppUserShortWithNameVoCollection searchResults)
{
    clearUsers();

    if (searchResults == null)
        return;

    for (int i = 0; i < searchResults.size(); i++)
    {
        if (searchResults.get(i) != null)
        {
            setUserGridRow(form.grdUserList().getRows().newRow(), searchResults.get(i));
        }
    }
}
项目:AvoinApotti    文件:UserProfileConfigurationImpl.java   
/**
* Domain function to search users based on criteria that are assembled into a filter VO.
*/
public AppUserShortWithNameVoCollection searchUsers(AppUserShortVo filterVo) throws DomainInterfaceException
{
    if (filterVo == null)
        throw new DomainInterfaceException("Can not search on null user surname");

    if (filterVo.getUserRealName() == null || filterVo.getUserRealName().length() == 0)
        throw new DomainInterfaceException("Can not search on null or zero lenght surname");

    String[] names = filterVo.getUserRealName().split(" ");

    DomainFactory factory = getDomainFactory();

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


    // Build search criteria Forename OR Surname
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append(" (");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("au.mos.name.upperSurname like :SURNAME" + i);
            markers.add("SURNAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            hql.append(" OR ");

            hql.append("au.mos.name.upperForename like :FORENAME" + i);
            markers.add("FORENAME" + 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);

        // We need to create a AppUserVoCollection because we need the name (if we create AppUserShortVoCollection we do not get the name)
        return AppUserShortWithNameVoAssembler.createAppUserShortWithNameVoCollectionFromAppUser(results);
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openMAXIMS    文件:UserProfileConfigurationImpl.java   
/**
* Domain function to search users based on criteria that are assembled into a filter VO.
*/
public AppUserShortWithNameVoCollection searchUsers(AppUserShortVo filterVo) throws DomainInterfaceException
{
    if (filterVo == null)
        throw new DomainInterfaceException("Can not search on null user surname");

    if (filterVo.getUserRealName() == null || filterVo.getUserRealName().length() == 0)
        throw new DomainInterfaceException("Can not search on null or zero lenght surname");

    String[] names = filterVo.getUserRealName().split(" ");

    DomainFactory factory = getDomainFactory();

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


    // Build search criteria Forename OR Surname
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append(" (");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("au.mos.name.upperSurname like :SURNAME" + i);
            markers.add("SURNAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            hql.append(" OR ");

            hql.append("au.mos.name.upperForename like :FORENAME" + i);
            markers.add("FORENAME" + 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);

        // We need to create a AppUserVoCollection because we need the name (if we create AppUserShortVoCollection we do not get the name)
        return AppUserShortWithNameVoAssembler.createAppUserShortWithNameVoCollectionFromAppUser(results);
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openMAXIMS    文件:UserProfileConfigurationImpl.java   
/**
* Domain function to search users based on criteria that are assembled into a filter VO.
*/
public AppUserShortWithNameVoCollection searchUsers(AppUserShortVo filterVo) throws DomainInterfaceException
{
    if (filterVo == null)
        throw new DomainInterfaceException("Can not search on null user surname");

    if (filterVo.getUserRealName() == null || filterVo.getUserRealName().length() == 0)
        throw new DomainInterfaceException("Can not search on null or zero lenght surname");

    String[] names = filterVo.getUserRealName().split(" ");

    DomainFactory factory = getDomainFactory();

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


    // Build search criteria Forename OR Surname
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append(" (");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("au.mos.name.upperSurname like :SURNAME" + i);
            markers.add("SURNAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            hql.append(" OR ");

            hql.append("au.mos.name.upperForename like :FORENAME" + i);
            markers.add("FORENAME" + 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);

        // We need to create a AppUserVoCollection because we need the name (if we create AppUserShortVoCollection we do not get the name)
        return AppUserShortWithNameVoAssembler.createAppUserShortWithNameVoCollectionFromAppUser(results);
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}
项目:openmaxims-linux    文件:UserProfileConfigurationImpl.java   
/**
* Domain function to search users based on criteria that are assembled into a filter VO.
*/
public AppUserShortWithNameVoCollection searchUsers(AppUserShortVo filterVo) throws DomainInterfaceException
{
    if (filterVo == null)
        throw new DomainInterfaceException("Can not search on null user surname");

    if (filterVo.getUserRealName() == null || filterVo.getUserRealName().length() == 0)
        throw new DomainInterfaceException("Can not search on null or zero lenght surname");

    String[] names = filterVo.getUserRealName().split(" ");

    DomainFactory factory = getDomainFactory();

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


    // Build search criteria Forename OR Surname
    {
        if (markers.size() > 0)
            hql.append(" AND (");
        else
            hql.append(" (");

        for (int i = 0; i < names.length; i++)
        {
            hql.append("au.mos.name.upperSurname like :SURNAME" + i);
            markers.add("SURNAME" + i);
            values.add("%" + names[i].toUpperCase() + "%");

            hql.append(" OR ");

            hql.append("au.mos.name.upperForename like :FORENAME" + i);
            markers.add("FORENAME" + 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);

        // We need to create a AppUserVoCollection because we need the name (if we create AppUserShortVoCollection we do not get the name)
        return AppUserShortWithNameVoAssembler.createAppUserShortWithNameVoCollectionFromAppUser(results);
    }
    catch (RuntimeException e)
    {
        e.printStackTrace();
        return null;
    }
}