10-28-2007 06:04 PM
10-29-2007 09:14 AM
10-29-2007 09:39 AM
function doCheckOut($node) {
debug($node->id);
$authoringService = WebServiceFactory::getAuthoringService($this->conf['server'],$this->ticket);
$result = $authoringService->checkout(array(
'items'=>array(
'node'=>array(
'uuid'=>'824948d4-8579-11dc-a1c1-0984a6647dd0',
),
),
'destination'=>array(
'associationType'=>'{http://www.alfresco.org/model/content/1.0}contains',
'reference'=> array(
'uuid'=>$node->id,
),
'childName'=>'copie de travail',
),
));
}
10-29-2007 05:50 PM
03-06-2013 01:26 AM
04-16-2009 04:57 PM
04-15-2010 06:44 AM
05-20-2010 05:34 AM
Hi,
I'm trying to implement by myself some missinf features i need in the PHP API. But i'm not really familiar with this kind of datatypes.
For example when i wanna use the authoring service … let's say checkout… it requires 2 params … one predicate and the other parentReference… i've read the document «web service data types» but i still can't figure out what kind of data i have to pass.
Any idea please ???
Ps : by the way … i dunno who develops the php api … first thanks a lot, second if you need help just ask.
P.
06-14-2010 05:58 AM
<?php/* * Created by: Dominik Danninger <ddanninger@may.co.at> */class NamedValues { private $_properties; private $_session; public function __construct($session) { $this->_session = $session; } public function __get($name) { $fullName = $this->_session->namespaceMap->getFullName($name); if (array_key_exists($fullName, $this->_properties) == true) { return $this->_properties[$fullName]; } else { return null; } } public function __set($name, $value) { $fullName = $this->_session->namespaceMap->getFullName($name); $this->_properties[$fullName] = $value; } public function __toArray() { $tempArray = array(); if (count($this->_properties) > 0) { foreach ($this->_properties as $key => $value) { $isMultiValue = false; if (is_array($value)) $isMultiValue = true; $tempArray[] = array("name"=>$key,"value"=>$value,"isMultiValue"=>$isMultiValue); } } return $tempArray; }}
<?php/* * Created by: Dominik Danninger <ddanninger@may.co.at> */ require_once 'WebService/WebServiceFactory.php';class Administration extends BaseObject { public $administrationService; private $_repository; private $_session; private $_store; private $_ticket; public function __construct($repository, $store, $session) { $this->_repository = $repository; $this->_store = $store; $this->_session = $session; $this->_ticket = $this->_session->getTicket(); $this->administrationService = WebServiceFactory::getAdministrationService($this->_repository->connectionUrl, $this->_ticket); } public function queryUsers($user_name=null) { $filter = null; if ($user_name != null) { $filter = array("userName" => $user_name); } $result = $this->administrationService->queryUsers(array( "filter" => $filter)); $resultSet = $result->result; return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet); } public function getUser($user_name) { $result = $this->administrationService->getUser(array( "userName" => $user_name)); $resultSet = $result->result; return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet); } public function createUsers($userDetails) { $result = $this->administrationService->createUsers(array( "newUsers" => $userDetails)); $resultSet = $result->result; return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet); } }?>
<?php require_once "Alfresco/Service/Repository.php"; require_once "Alfresco/Service/Session.php"; require_once "Alfresco/Service/SpacesStore.php"; require_once "Alfresco/Service/NamedValues.php"; require_once "Alfresco/Service/Administration.php"; // Specify the connection details $repositoryUrl = "http://localhost:8080/alfresco/api"; $userName = "admin"; $password = "admin"; // Authenticate the user and create a session $repository = new Repository($repositoryUrl); $ticket = $repository->authenticate($userName, $password); $session = $repository->createSession($ticket); // Create a reference to the 'SpacesStore' $spacesStore = new SpacesStore($session); $administration = new Administration($repository,$spacesStore,$session); $NamedValues = new NamedValues($session); $NamedValues->cm_firstName = "FIRSTNAME"; $NamedValues->cm_lastName = "LASTNAME"; $NamedValues->cm_email = "EMAIL@EMAIL.COM"; $userDetails = array("userName"=>"USERNAME", "password"=>"PASSWORD", "properties"=>$NamedValues->__toArray()); print_r($administration->createUsers($userDetails));?>
03-02-2013 01:58 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.