11-04-2010 05:19 AM
….
<namespace uri="http://www.alfresco.org/model/myNameSpace/1.0" prefix="myNs"/>
….
<aspects>
<aspect name="myNs:myAspect">
<title>MyAspect</title>
<properties>
<property name="myNs:content">
<title>MyContent</title>
<type>d:content</type>
</property>
<property name="myNs:user">
<title>User</title>
<type>d:text</type>
<multiple>true</multiple>
</property>
</properties>
</aspect>
</aspects>
The purpose of myNs:content is to store binary data(application/octet-stream).
Write:
String propertyName = "{http://www.alfresco.org/model/myNameSpace/1.0}content";
Content propertyContent = WebServiceFactory.getContentService().write(nodeReference, propertyName,
ContentUtils.convertToByteArray(new FileInputStream(propertyFilePath)), new ContentFormat("application/octet-stream", "UTF-8"));
Read:
Content[] contents = WebServiceFactory.getContentService().read(new Predicate(new Reference[]{nodeReference}, store, null), propertyName);
for (Content content : contents) {
System.out.println("Content.length:" + content.getLength());
ContentUtils.copyContentToFile(content, new File("./propertyContent"));
}
In the result I`m getting valid content size(content.getLength()) but the result of calling ContentUtils.copyContentToFile is invalid - it is11-04-2010 10:44 AM
11-05-2010 04:13 AM
11-08-2010 06:19 AM
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.