Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions atom/cmis/cmis_service.php
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,16 @@ function createDocument($folderId, $fileName, $properties = array (), $content =
return $this->postObject($folderId, $fileName, "cmis:document", $properties, $content, $content_type, $options);
}

function createDocumentFromSource() { //Yes?
throw new CmisNotSupportedException("createDocumentFromSource is not supported by the AtomPub binding!");
function createDocumentFromSource($folderId, $fileName, $fileNameFrom, $properties = array(), $options = array()) { //Yes?
//Get content_type
$finfo = finfo_open(FILEINFO_MIME);
$content_type = finfo_file($finfo, $fileNameFrom);
finfo_close($finfo);

//Get content
$content = file_get_contents($fileNameFrom);

return $this->createDocument($folderId, $fileName, $properties, $content, $content_type, $options);
}

function createFolder($folderId, $folderName, $properties = array (), $options = array ()) { // Yes
Expand Down Expand Up @@ -1280,4 +1288,4 @@ function getACL() {
function applyACL() {
throw new CmisNotImplementedException("applyACL");
}
}
}