My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Authors:
# Richard McKnight
#

require_once ('cmis_repository_wrapper.php');
$repo_url = $_SERVER["argv"][1];
$repo_username = $_SERVER["argv"][2];
$repo_password = $_SERVER["argv"][3];
$repo_folder = $_SERVER["argv"][4];
$repo_debug = $_SERVER["argv"][5];

$client = new CMISService($repo_url, $repo_username, $repo_password);

if ($repo_debug)
{
print "Repository Information:\n===========================================\n";
print_r($client->workspace);
print "\n===========================================\n\n";
}

$myfolder = $client->getObjectByPath($repo_folder);
if ($repo_debug)
{
print "Folder Object:\n===========================================\n";
print_r($myfolder);
print "\n===========================================\n\n";
}

$objs = $client->getChildren($myfolder->id);
if ($repo_debug)
{
print "Folder Children Objects\n:\n===========================================\n";
print_r($objs);
print "\n===========================================\n\n";
}

foreach ($objs->objectList as $obj)
{
if ($obj->properties['cmis:baseTypeId'] == "cmis:document")
{
print "Document: " . $obj->properties['cmis:name'] . "\n";
}
elseif ($obj->properties['cmis:baseTypeId'] == "cmis:folder")
{
print "Folder: " . $obj->properties['cmis:name'] . "\n";
} else
{
print "Unknown Object Type: " . $obj->properties['cmis:name'] . "\n";
}
}

if ($repo_debug > 2)
{
print "Final State of CLient:\n===========================================\n";
print_r($client);
}

Change log

6332141f4c55 by rich...@localhost.localdomain on May 31, 2010   Diff
Reformat and add Apache Licensing to all
Go to: 
Project members, sign in to write a code review

Older revisions

2c600b35f37b by rich...@localhost.localdomain on Dec 3, 2009   Diff
Additional Debug to check the links
9aa7ca830e95 by rich...@localhost.localdomain on Dec 3, 2009   Diff
Added getChildren
178f0e61403f by rich...@localhost.localdomain on Dec 3, 2009   Diff
Added some Methods that Match the
Domain model -specifically getObject
and getObjectByPath
Left CMISRepositoryWrapper as is
Created CMISService to extend
...
All revisions of this file

File info

Size: 2135 bytes, 71 lines
Powered by Google Project Hosting