Details

    • Fix Priority:
      5
    • Caused by:
      Other (provide details)
    • Where was the bug?:
      Java, Javascript

      Description

      PrivateMessagingUtil has the following method:

      public static JSONArray getJSONRecipients(long userId)

      which gets all the users in Liferay, then returns them in a JSON formatted list

      The issue is that this is included in a JSP like this:

      <script>
      AUI().use('aui-autocomplete', function(A) {
      var sendList = A.one('#<portlet:namespace/>sendList');

      var autocomplete = new A.AutoComplete(
      {
      dataSource: <%= PrivateMessagingUtil.getJSONRecipients(user.getUserId()) %>,
      schema:

      { resultFields: ['name', 'classPk', 'classNameId'] }

      ,
      schemaType: 'json',
      matchKey: 'name',
      delimChar: ',',
      typeAhead: true,
      on: {
      itemSelect: function(sType, aArgs)

      { var name = aArgs.name; var classPk = aArgs.classPk; // the <li> element selected in the suggestion var classNameId = aArgs.classNameId; // object literal of data for the result sendList.val(sendList.val() + name + "|" + classPk + "|" + classNameId + ","); }

      },
      contentBox: '#<portlet:namespace/>autoCompleteContainer',
      input: '#<portlet:namespace/>to'
      }
      ).render();

      autocomplete.overlay.set('zIndex', 1002);
      });
      </script>

      Which, my client has 99000 users in their test env, and over 2 million in production. This should be something far more performant.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 22 weeks, 5 days ago