09-16-2011 03:17 AM
<type name="my:my_type">
<title>My Content Type</title>
<parent>[b]cm:content[/b]</parent>
<properties>
<property name="my:empNumber">
<type>d:text</type>
</property>
<property name="my:empName">
<type>d:text</type>
</property>
</properties>
</type>
09-16-2011 12:28 PM
03-06-2012 06:53 AM
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
properties.put(PropertyIds.NAME, filename);
ObjectId id = ((Folder) targetFolder).createDocument(properties, contentStream, VersioningState.MAJOR);
// Start creating extendedSOP document
// First get the parent folder object
CmisObject extendedSOPFolder = session.getObjectByPath("/ExtendedSOP");
System.out.println("crete a new document in folder " +extendedSOPFolder.getName());
final String extendedSOPFileName = "extendedSOPtest.txt";
System.out.println("creating a simple text file, " + extendedSOPFileName);
String extendedSOPmimetype = "text/plain; charset=UTF-8";
String extendedSOPcontent = "This is an extendedSOP test.";
String extendedSOPfilename = extendedSOPFileName;
String extendedSOPvisibility = "Public"
int extendedSOPreviewPeriod = 365;
byte[] extendedSOPbuf = null;
try {
extendedSOPbuf = extendedSOPcontent.getBytes("UTF-8");
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
ByteArrayInputStream extendedSOPStream = new ByteArrayInputStream(extendedSOPbuf);
ContentStream extendedSOPcontentStream = session.getObjectFactory().createContentStream(extendedSOPfilename, extendedSOPbuf.length, extendedSOPmimetype, extendedSOPStream);
Map<String, Object> extendedSOPproperties = new HashMap<String, Object>();
extendedSOPproperties.put(PropertyIds.OBJECT_TYPE_ID, "extendedSOP:extendedSOP");
extendedSOPproperties.put(PropertyIds.NAME, extendedSOPfilename);
extendedSOPproperties.put(PropertyIds.visibility, extendedSOPvisibility);
ObjectId extendedSOPid = ((Folder) extendedSOPFolder).createDocument(extendedSOPproperties, extendedSOPcontentStream, VersioningState.MAJOR);
System.out.println("Created a new extendedSOP document " +extendedSOPFileName + " and its ID is " +extendedSOPid.getId());
<!– Definition of new Content Type: Extended Standard Operating Procedure –>
<type name="extendedSOP:extendedSOP">
<title>Standard Operating Procedure</title>
<!– This inherits from cm:content and thus has all the standard content attributes –>
<parent>cm:content</parent>
…..
</type>
08-29-2012 09:44 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.