function CMISService::postObject in CMIS API 6.4
Same name and namespace in other branches
- 6.3 cmis_common/lib/cmis_repository_wrapper.php \CMISService::postObject()
- 7 cmis_common/lib/cmis_repository_wrapper.php \CMISService::postObject()
3 calls to CMISService::postObject()
- CMISService::createDocument in cmis_common/
lib/ cmis_repository_wrapper.php - CMISService::createFolder in cmis_common/
lib/ cmis_repository_wrapper.php - CMISService::moveObject in cmis_common/
lib/ cmis_repository_wrapper.php
File
- cmis_common/
lib/ cmis_repository_wrapper.php, line 699
Class
Code
function postObject($folderId, $objectName, $objectType, $properties = array(), $content = null, $content_type = "application/octet-stream", $options = array()) {
// Yes
$myURL = $this
->getLink($folderId, "down");
// TODO: Need Proper Query String Handling
// Assumes that the 'down' link does not have a querystring in it
$myURL = CMISRepositoryWrapper::getOpUrl($myURL, $options);
static $entry_template;
if (!isset($entry_template)) {
$entry_template = CMISService::getEntryTemplate();
}
if (is_array($properties)) {
$hash_values = $properties;
}
else {
$hash_values = array();
}
if (!isset($hash_values["cmis:objectTypeId"])) {
$hash_values["cmis:objectTypeId"] = $objectType;
}
$properties_xml = $this
->processPropertyTemplates($objectType, $hash_values);
if (is_array($options)) {
$hash_values = $options;
}
else {
$hash_values = array();
}
$hash_values["PROPERTIES"] = $properties_xml;
$hash_values["SUMMARY"] = CMISService::getSummaryTemplate();
if ($content) {
$hash_values["CONTENT"] = CMISService::getContentEntry($content, $content_type);
}
if (!isset($hash_values['title'])) {
$hash_values['title'] = $objectName;
}
if (!isset($hash_values['summary'])) {
$hash_values['summary'] = $objectName;
}
$post_value = CMISRepositoryWrapper::processTemplate($entry_template, $hash_values);
$ret = $this
->doPost($myURL, $post_value, MIME_ATOM_XML_ENTRY);
// print "DO_POST\n";
// print_r($ret);
$obj = $this
->extractObject($ret->body);
$this
->cacheEntryInfo($obj);
return $obj;
}