As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<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>
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>