what the content of the parameter "obc" for /dlfolder/get-folders restful api in liferay?

The parameter obc for restful api /dlfolder/get-folders in liferay requires the type com.liferay.portal.kernel.util.OrderByComparator.

I tried many possible values but always got the error message

Unable to cast value to type: com.liferay.portal.kernel.util.OrderByComparator

Now I got stuck in this problem. Is anyone who know what the value should be put in this parameter, please teach me, thx.

Upvotes: 0

Views: 715

Answers (1)

Romeo Sheshi
Romeo Sheshi

Reputation: 931

When there are object as parameters have to put + before the parameter and : as saparator of full name class like this

http://localhost:8080/api/jsonws/dlfolder/get-folders/group-id/0/parent-folder-id/0/start/0/end/10/+obc:com.liferay.portlet.documentlibrary.util.comparator.FolderNameComparator

or javascript

Liferay.Service(
  '/dlfolder/get-folders',
  {
    groupId: 0,
    parentFolderId: 0,
    start: 0,
    end: 10,
    "+obc":"com.liferay.portlet.documentlibrary.util.comparator.FolderNameComparator"
  },
  function(obj) {
    console.log(obj);
  }
);

link to documentation for more info https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/invoking-json-web-services#object-parameters

Upvotes: 1

Related Questions