08-29-2011 06:39 AM
$bizObj->draft=false;
$data = json_encode($bizObj);
$postUrl = $webServer. "/alfresco/service/api/blog/node/$bizObj->storeType/$bizObj->storeId/$bizObj->id";
try{
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$postUrl);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERPWD, "$user:$pwd");
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$json=json_decode(curl_exec($ch),true,512);
curl_close($ch);
if($json==null){
…..
…..
}else{
…..
…..
}
}catch(Exception $e){
….
}
03-20-2012 04:12 PM
Map <String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled,P:cm:syndication");
properties.put(PropertyIds.NAME, filename);
properties.put("cm:description", "");
properties.put("cm:title", "test blog cmis");
GregorianCalendar calendar = new GregorianCalendar();
properties.put("cm:published", calendar);
byte[] content = "<p>Hello World!</p>".getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(filename, BigInteger.valueOf(content.length), "text/html", stream);
return folder.createDocument(
properties,
contentStream,
VersioningState.MAJOR
); Jeff
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.