掲示板

Access to Document Library via REST

13年前 に Mehmet Ceyran によって更新されました。

Access to Document Library via REST

New Member 投稿: 1 参加年月日: 10/05/06 最新の投稿
Hi everyone

I hope someone can give me some hidden pointers on this.

I am trying to access the document library via REST to /tunnel-web/secure/json using PHP. I have written a magic class (__call) that encapsulates PHP calls to the serviceClassName=...&serviceMethodName=... syntax, and this works very well for some basic functions. It looks something like this:

echo $companyService->getCompanyByVirtualHost('localhost') . "\n";
echo $organizationService->getUserOrganizations(USER_ID) . "\n";
echo $organizationService->getOrganization(ORGANIZATION_ID) . "\n";


And it prints very well the Web Service output as a JSON line.

Now I would like to create a folder in the document library of an organization with the corresponding group ID (10855, found out by clicking through to the organization's properties in the Control Center). Unfortunately, the following does not work:

echo $dlFolderService->addFolder(10855, 0, 'Test', 'Desc', true, true) . "\n";


But when I add a folder using the web interface and do the following (brute force on folder IDs from 0 to 20000), I can see the folder, but with a different group ID (10953):

for ($i = 0; $i < 20000; $i++) {
    $str = $dlFolderService->getFolder($i);
    $obj = json_decode($str);
    if (!isset($obj->exception)) {
        echo "$str\n";
    }
}


Still, addFolder() with the other group ID does not work at all. It won't even give me an exception or anything like that, which happens when a method does not exist at all. Well, according to http://docs.liferay.com/portal/5.2/javadocs/portal-service/, it does. My Liferay version is 5.2.2.

I suspect that maybe boolean arguments have a different syntax when putting them into the URL, but I tried 0/1 as well as true/false, yet neither works.

I would appreciate any comment on this.

Best Regards
Mehmet Ceyran