11-23-2011 04:52 PM
11-24-2011 03:34 AM
11-24-2011 09:26 AM
11-25-2011 02:38 AM
11-25-2011 09:25 AM
11-25-2011 12:56 PM
03-10-2012 07:19 PM
<?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.Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.