/** * Parses a hierarchy of CMIS objects to return an array format of a subset of information * required for a webservice response * * Essentially a reversal of createChildObjectHierarchy and createParentObjectHierarchy, * though the output may well be different to what went into that function * * @param array $input // input hierarchy to decode * @param string $linkText // 'child' or 'parent' - indicates direction of hierarchy => descending or ascending * @return array $hierarchy */ public static function decodeObjectHierarchy($input, $linkText) { $hierarchy = array(); // first, run through the base array to get the initial children foreach ($input as $key => $entry) { $object = $entry['object']; $properties = $object->getProperties(); $hierarchy[$key] = CMISUtil::createObjectPropertiesEntry($properties); } return $hierarchy; }
/** * Gets the properties for the selected object * * @param string $repositoryId * @param string $objectId * @param boolean $includeAllowableActions * @param boolean $includeRelationships * @param string $returnVersion * @param string $filter * @return properties[] */ public function getProperties($repositoryId, $objectId, $includeAllowableActions, $includeRelationships, $returnVersion = false, $filter = '') { try { $propertyCollection = $this->ObjectService->getProperties($repositoryId, $objectId, $includeAllowableActions, $includeRelationships); } catch (Exception $e) { return array("status_code" => 1, "message" => $e->getMessage()); } $properties = CMISUtil::createObjectPropertiesEntry($propertyCollection); return array("status_code" => 0, "results" => $properties); }
/** * Returns a list of checked out documents from the selected repository * * @param string $repositoryId * @param string $folderId The folder for which checked out docs are requested * @param string $filter * @param boolean $includeAllowableActions * @param boolean $includeRelationships * @param int $maxItems * @param int $skipCount * @return array $checkedout The collection of checked out documents */ function getCheckedOutDocs($repositoryId, $includeAllowableActions, $includeRelationships, $folderId = null, $filter = '', $maxItems = 0, $skipCount = 0) { $checkedout = $this->NavigationService->getCheckedOutDocs($repositoryId, $includeAllowableActions, $includeRelationships, $folderId, $filter, $maxItems, $skipCount); if (PEAR::isError($checkedout)) { return array("status_code" => 1, "message" => "Failed getting list of checked out documents"); } // convert to array format for external code $co = array(); foreach ($checkedout as $documentProperties) { $co[] = CMISUtil::createObjectPropertiesEntry($documentProperties); } return array("status_code" => 0, "results" => $co); }