<?php
/**
* class.pmTrAlfresco.pmFunctions.php
*
*/
/**
* Alfresco Triggers that allow ProcessMaker to perform common DM actions
* @class pmTrAlfresco
* @name Alfresco DM Triggers v. 0.1
* @icon /images/triggers/alfrescoIcon.png
* @className class.pmTrAlfresco.pmFunctions.php
*/
/**
* @method
*
* Upload file/document in Alfresco Repository
*
* @name uploadDoc
* @label Upload file/document in Alfresco Repository
*
* @param string | $alfrescoServerUrl | Server name and port where Alfresco exists | http://localhost:8080/alfresco
* @param string | $fileSource | File Source
* @param string | $title | File Title
* @param string | $description | Description about File
* @param string | $docType | Type of document to be Uploaded
* @param string | $user | Valid Admin username to connect to Alfresco server
* @param string | $pwd | Valid Admin password to connect to Alfresco server
*
* @return string | $result | Response
*
*/
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd) {
$filep = fopen($fileSource,"r");
$fileLength = filesize($fileSource);
$fileContent = fread($filep,$fileLength);
$fileContent = base64_encode($fileContent);
$alfresco_url = "$alfrescoServerUrl/s/cmis/p/Sites/children";
$xmlData = array();
$xmlData = '<?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"><title>'.$title.'</title><summary>'.$description.'</summary><content type="application/'.$docType.'">'.$fileContent.'</content><cmisra:object><cmis:properties><cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId></cmis:properties></cmisra:object></entry>';
$alfresco_exec = RestClient::post($alfresco_url,$xmlData,$user,$pwd,"application/atom+xml");
$sXmlArray = $alfresco_exec->getResponse();
$sXmlArray = trim($sXmlArray);
$xXmlArray = simplexml_load_string($sXmlArray);
$aXmlArray = @json_decode(@json_encode($xXmlArray),1);
var_dump($aXmlArray);
return $aXmlArray;
}
Me gustaría que me ayudaran a resolver este tema dado que quisiera plantear este DMS para un cliente interesado en gestionar sus documentos de Processmaker en Alfresco y estoy evaluando la facilidad de uso.Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.