LCCS and PHP with ZendAMF

Adobe LiveCycle Collaboration Service has in its SDK examples for integration with the main languages used in web programming like PHP, Java, Python, etc.
In the Adobe documentation, it is recommended to use AMFPHP or pure PHP, but this integration can be used seamlessly together with ZendFramework (using ZendAMF)
Ryan Stewart wrote two articles that show how this implementation with PHP and REST.

A note on the article by Ryan, in Flex 4, Adobe introduced the use of swfobject, then the mode of getting the URL and pass parameters to the SWF looks like this:
[JAVASCRIPT]
var xiSwfUrlStr = “playerProductInstall.swf”;
var flashvars = {};
{
flashvars.roomURL = swfobject.getQueryParamValue(“roomURL”);
flashvars.authToken = swfobject.getQueryParamValue(“authToken”);
}
var params = {};
[/JAVASCRIPT]
In LCCS sdk, there is a file called lccs.php, just copy it to the same directory of your class zend. Then add the include in your gateway.php
[PHP]
< ?php require_once 'Zend/Amf/Server.php'; require_once 'lccs.php'; require_once 'Test.php'; /** Bootstrap */ // Instantiate server $server = new Zend_Amf_Server(); $server->setProduction(false);
$server->setClass(‘Test’);
// Handle request
echo($server->handle());
?>
[/PHP]
And this is a simple test class to call the method that returns the token for authentication
[PHP]
< ?php class Test { private $account; private $room; private $devUsername; private $devPassword; private $secret; //$accountURL = "https://collaboration.adobelivecycle.com/$account"; private $accountURL; private $roomURL; function __construct() { //for LCCS $this->account = “Your SDK account username from LCCS developer portal”;
$this->room = “The room you want to connect to”;
$this->devUsername = “Your LCCS developer account username”;
$this->devPassword = “Your LCCS developer account password”;
$this->secret = “The shared secret from the LCCS developer portal”;

//$accountURL = “https://collaboration.adobelivecycle.com/$account”;
$this->accountURL = “http://connectnow.acrobat.com/$this->account”;
$this->roomURL = “$this->accountURL/$this->room”;
}

public function getToken($data=array())
{
try
{
$this->account = new RTCAccount($this->accountURL);
$this->account->login($this->devUsername,$this->devPassword);
$session = $this->account->getSession($data[‘room’]);
$displayName = $data[‘displayName’];
$username = $data[‘username’];
$role = $data[‘role’];
$token = $session->getAuthenticationToken($this->secret, $displayName, $username, $role);
return $token;
}
catch (Exception $e)
{
throw new Exception($e->getMessage());
}
}
}
?>
[/PHP]

Was this article helpful? feel free to make a donation and help keep the blog in the air
Adobe, LCCS, PHP, ZendAMF , ,

3 comments


  1. Antonio

    I am trying to do the Ryan example but dont understand the javascript suggestion for replacing “application” in context. Can you show a completed .mxml?

    thanks

  2. Antonio

    I have tried ryans samples and this addition but still don’t get it, should I be getting a visible token back from LCCS on the second page of the html?
    thanks. All I want is to set up a simple verification of users for external verification and then launch a flash based chat session with another flash based user. thanks

  3. I used the following way: the swf requests the token by using the RemoteObject (calling ZendAMF) and step to the next step is authentication in LCCS giving permissions. All on the same screen

Leave a Reply