checkedout.inc.php
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Retrieves the list of checked out documents and returns it as an AtomPub feed
*
* NOTE since we don't yet support getCheckedOutDocuments in the CMIS API, this code
* returns a static empty feed
*
* TODO when the CMIS API functionality exists, create the feed dynamically
*/
include 'services/cmis/RepositoryService.inc.php';
include 'services/cmis/NavigationService.inc.php';
$RepositoryService = new RepositoryService();
$NavigationService = new NavigationService();
$NavigationService->startSession($username, $password);
$repositories = $RepositoryService->getRepositories();
$repositoryId = $repositories[0]['repositoryId'];
$checkedout = $NavigationService->getCheckedoutDocs($repositoryId);
$feed = new KTCMISAPPFeed(KT_APP_BASE_URI, 'Checked out Documents', null, null, null, 'urn:uuid:checkedout');
foreach($checkedout as $document)
{
$entry = $feed->newEntry();
$objectElement = $feed->newElement('cmis:object');
$propertiesElement = $feed->newElement('cmis:properties');
foreach($cmisEntry['properties'] as $propertyName => $property)
{
$propElement = $feed->newElement('cmis:' . $property['type']);
$propElement->appendChild($feed->newAttr('cmis:name', $propertyName));
$feed->newField('value', CMISUtil::boolToString($property['value']), $propElement);
$propertiesElement->appendChild($propElement);
}
$objectElement->appendChild($propertiesElement);
$entry->appendChild($objectElement);
}
$entry = null;
$feed->newField('hasMoreItems', 'false', $entry, true);
$output = $feed->getAPPdoc();
?>