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.
File testFile = somefile; // Put the content onto the server String contentData = ContentUtils.putContent(testFile); // Create the parent reference ParentReference parentRef = new ParentReference(); parentRef.setStore(BaseWebServiceSystemTest.store); parentRef.setUuid(BaseWebServiceSystemTest.rootReference.getUuid()); parentRef.setAssociationType(Constants.ASSOC_CHILDREN); parentRef.setChildName(Constants.ASSOC_CHILDREN); String myFile = "test.jpg"; // Create the content NamedValue[] properties = new NamedValue[] { Utils.createNamedValue(Constants.PROP_NAME, myFile), Utils.createNamedValue(Constants.PROP_CONTENT, contentData) }; CMLCreate create = new CMLCreate("1", parentRef, null, null, null, Constants.TYPE_CONTENT, properties); CML cml = new CML(); cml.setCreate(new CMLCreate[]{create}); UpdateResult[] result = this.repositoryService.update(cml);
…. // Put the content onto the server String contentData = ContentUtils.putContent(testFile); // Create the parent reference ParentReference parentRef = new ParentReference(); parentRef.setStore(STORE); parentRef.setUuid(id); parentRef.setAssociationType(Constants.ASSOC_CHILDREN); parentRef.setChildName(Constants.ASSOC_CHILDREN); String myFile = fichero.getName(); // Create the content NamedValue[] properties = new NamedValue[] { Utils.createNamedValue(Constants.PROP_NAME, myFile), Utils.createNamedValue(Constants.PROP_CONTENT, contentData) }; CMLCreate create = new CMLCreate("1", parentRef, null, null, null, Constants.TYPE_CONTENT, properties); CML cml = new CML(); cml.setCreate(new CMLCreate[]{create}); UpdateResult[] result = this.repositoryService.update(cml); ….
UpdateResult[] result = this.repositoryService.update(cml);