-
Notifications
You must be signed in to change notification settings - Fork 13
/
read-workflow-settings.php
46 lines (40 loc) · 1.92 KB
/
read-workflow-settings.php
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
<?php
$soapURL = "http://localhost:8080/ws/services/AssetOperationService?wsdl";
$client = new SoapClient
(
$soapURL,
array ('trace' => 1, 'location' => str_replace('?wsdl', '', $soapURL))
);
$auth = array ('username' => 'admin', 'password' => 'admin' );
$identifier = array
(
'id' => 'folder-id-here',
'type' => 'folder'
);
$readParams = array ('authentication' => $auth, 'identifier' => $identifier);
$reply = $client->readWorkflowSettings($readParams);
if ($reply->readWorkflowSettingsReturn->success=='true')
{
echo "Inherit workflows: ".($reply->readWorkflowSettingsReturn->workflowSettings->inheritWorkflows?"true":"false");
echo "\r\nRequired workflow: ".($reply->readWorkflowSettingsReturn->workflowSettings->requireWorkflow?"true":"false");
$workflowDefinitions = $reply->readWorkflowSettingsReturn->workflowSettings->workflowDefinitions->assetIdentifier;
if (sizeof($workflowDefinitions)==0)
$workflowDefinitions = array();
else if (!is_array($workflowDefinitions)) // For less than 2 elements, the returned object isn't an array
$workflowDefinitions=array($workflowDefinitions);
echo "\r\nWorkflow definitions: ";
foreach($workflowDefinitions as $identifier)
echo "site://" .$identifier->path->siteName."/".$identifier->path->path . " ";
$inheritedWorkflowDefinitions = $reply->readWorkflowSettingsReturn->workflowSettings->inheritedWorkflowDefinitions->assetIdentifier;
if (sizeof($inheritedWorkflowDefinitions)==0)
$inheritedWorkflowDefinitions = array();
else if (!is_array($inheritedWorkflowDefinitions)) // For less than 2 elements, the returned object isn't an array
$inheritedWorkflowDefinitions=array($inheritedWorkflowDefinitions);
echo "\r\nInherited workflow definitions: ";
foreach($inheritedWorkflowDefinitions as $identifier)
echo "site://" .$identifier->path->siteName."/".$identifier->path->path . " ";
echo "\r\n";
}
else
echo "Error occurred: " . $reply->readWorkflowSettingsReturn->message;
?>