Package com.liferay.portal.kernel.search

Examples of com.liferay.portal.kernel.search.Sort


    try {
      LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
      params.put("expandoAttributes", null);

      Sort sort = SortFactoryUtil.getSort(User.class, DEFAULT_SORT_CRITERIA, "asc");

      boolean andSearch = true;
      int status = WorkflowConstants.STATUS_ANY;

      String firstName = null;
View Full Code Here


  public List<User> load(int first, int pageSize, String sortField, SortOrder sortOrder,
    Map<String, String> filters) {

    List<User> users = null;

    Sort sort;

    // sort
    if (sortField != null) {

      if (sortOrder.equals(SortOrder.DESCENDING)) {
        sort = SortFactoryUtil.getSort(User.class, sortField, "desc");
      }
      else {
        sort = SortFactoryUtil.getSort(User.class, sortField, "asc");
      }
    }
    else {
      sort = SortFactoryUtil.getSort(User.class, DEFAULT_SORT_CRITERIA, "asc");
    }

    try {
      LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
      int liferayOneRelativeFinishRow = first + pageSize + 1;

      boolean andSearch = true;
      int status = WorkflowConstants.STATUS_ANY;

      String firstName = trimExpresssion(filters.get("firstName"));
      String middleName = trimExpresssion(filters.get("middleName"));
      String lastName = trimExpresssion(filters.get("lastName"));
      String screenName = trimExpresssion(filters.get("screenName"));
      String emailAddress = trimExpresssion(filters.get("emailAddress"));

      // For the sake of speed, search for users in the index rather than
      // querying the database directly.
      Hits hits = UserLocalServiceUtil.search(companyId, firstName, middleName, lastName, screenName,
          emailAddress, status, params, andSearch, first, liferayOneRelativeFinishRow, sort);

      List<Document> documentHits = hits.toList();

      logger.debug(
        ("filters firstName=[{0}] middleName=[{1}] lastName=[{2}] screenName=[{3}] emailAddress=[{4}] active=[{5}] andSearch=[{6}] startRow=[{7}] liferayOneRelativeFinishRow=[{8}] sortColumn=[{9}] reverseOrder=[{10}] hitCount=[{11}]"),
        firstName, middleName, lastName, screenName, emailAddress, status, andSearch, first,
        liferayOneRelativeFinishRow, sortField, sort.isReverse(), documentHits.size());

      // Convert the results from the search index into a list of user
      // objects.
      users = new ArrayList<User>(documentHits.size());
View Full Code Here

    try {
      LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
      params.put("expandoAttributes", null);

      Sort sort = SortFactoryUtil.getSort(User.class, DEFAULT_SORT_CRITERIA, "asc");

      boolean andSearch = true;
      int status = WorkflowConstants.STATUS_ANY;

      String firstName = null;
View Full Code Here

  public List<User> load(int first, int pageSize, String sortField, SortOrder sortOrder,
    Map<String, Object> filters) {

    List<User> users = null;

    Sort sort;

    // sort
    if (sortField != null) {

      if (sortOrder.equals(SortOrder.DESCENDING)) {
        sort = SortFactoryUtil.getSort(User.class, sortField, "desc");
      }
      else {
        sort = SortFactoryUtil.getSort(User.class, sortField, "asc");
      }
    }
    else {
      sort = SortFactoryUtil.getSort(User.class, DEFAULT_SORT_CRITERIA, "asc");
    }

    try {
      LinkedHashMap<String, Object> params = new LinkedHashMap<String, Object>();
      int liferayOneRelativeFinishRow = first + pageSize + 1;

      boolean andSearch = true;
      int status = WorkflowConstants.STATUS_ANY;

      String firstName = trimExpresssion((String) filters.get("firstName"));
      String middleName = trimExpresssion((String) filters.get("middleName"));
      String lastName = trimExpresssion((String) filters.get("lastName"));
      String screenName = trimExpresssion((String) filters.get("screenName"));
      String emailAddress = trimExpresssion((String) filters.get("emailAddress"));

      // For the sake of speed, search for users in the index rather than
      // querying the database directly.
      Hits hits = UserLocalServiceUtil.search(companyId, firstName, middleName, lastName, screenName,
          emailAddress, status, params, andSearch, first, liferayOneRelativeFinishRow, sort);

      List<Document> documentHits = hits.toList();

      logger.debug(
        ("filters firstName=[{0}] middleName=[{1}] lastName=[{2}] screenName=[{3}] emailAddress=[{4}] active=[{5}] andSearch=[{6}] startRow=[{7}] liferayOneRelativeFinishRow=[{8}] sortColumn=[{9}] reverseOrder=[{10}] hitCount=[{11}]"),
        firstName, middleName, lastName, screenName, emailAddress, status, andSearch, first,
        liferayOneRelativeFinishRow, sortField, sort.isReverse(), documentHits.size());

      // Convert the results from the search index into a list of user
      // objects.
      users = new ArrayList<User>(documentHits.size());
View Full Code Here

TOP

Related Classes of com.liferay.portal.kernel.search.Sort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.