03-28-2012 06:05 PM
400
03-29-2012 01:44 AM
03-30-2012 03:02 PM
04-04-2012 11:35 AM
04-04-2012 12:18 PM
04-04-2012 01:29 PM
04-09-2012 06:03 PM
Session session = getSession();
// Grab a reference to the folder where we want to create content
Folder folder = (Folder) session.getObjectByPath("/" + getFolderName());
String timeStamp = new Long(System.currentTimeMillis()).toString();
String filename = docName + " (" + timeStamp + ")";
// Create a Map of objects with the props we want to set
Map <String, Object> properties = new HashMap<String, Object>();
// Following sets the content type and adds the titled aspect
// This works because we are using the OpenCMIS extension for Alfresco
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled");
properties.put("cm:title", "some title");
properties.put("cm:description", "some description");
String docText = "This is a sample " + contentType + " document called " + docName;
byte[] content = docText.getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(filename, BigInteger.valueOf(content.length), "text/plain", stream);
Document doc = folder.createDocument(
properties,
contentStream,
VersioningState.MAJOR);
System.out.println("Created: " + doc.getId());
System.out.println("Content Length: " + doc.getContentStreamLength());
04-10-2012 03:53 PM
04-10-2012 05:58 PM
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
In the "use the workbench" option, you have to tell the workbench to use the OpenCMIS extension. To do that, first make sure the alfresco-opencmis-extension JAR is on the classpath. Once that is set, launch the workbench. When specifying the connection details, fill out everything you need on the "Basic" tab. Then, switch to the "Expert" tab and add:org.apache.chemistry.opencmis.objectfactory.classname=org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl
Now, WITHOUT switching back to "Basic", click "Load Repositories" then "Login". Now you should be able to see aspect-based properties as you navigate the repository.04-10-2012 07:01 PM
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.