Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-25031

Updating new Service API to support the coming composition interface

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed

      Description

      Currently, the new Liferay.Service API supports the following format:
      Liferay.Service(methodName, data, callback)

      However, we will also be adding a composition-based interface in which users can call multiple services in one batch.

      To allow both API's to be used now, I'm adding support for this type of call:

      Liferay.Service({
      methodName: data
      }, callback);

      As an example:

      //Simple way:

      Liferay.Service('user/get-user-by-id',

      {id: 10202}

      , function(obj){
      //console.log(obj);
      })

      // Composition-compatibile way:

      Liferay.Service({
      'user/get-user-by-id':

      {id: 10202}

      },
      function(obj){
      //console.log(obj);
      })

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              nathan.cavanaugh Nate Cavanaugh
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 21 weeks, 2 days ago

                  Packages

                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2