05-30-2011 07:39 AM
// Create a parent reference, this contains information about the association we are createing to the new content and the
// parent of the new content (the space retrived from the search)
ParentReference parentReference = new ParentReference(STORE, null, parent, ASSOC_CONTAINS,
"{" + Constants.NAMESPACE_CONTENT_MODEL + "}" + name);
// Define the content format for the content we are adding
ContentFormat contentFormat = new ContentFormat("text/html", "UTF-8");
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, name)};
CMLCreate create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_CONTENT, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
Reference newContentNode = result[0].getDestination();
Content content = contentService.write(newContentNode, Constants.PROP_CONTENT, contentString.getBytes(), contentFormat);
05-30-2011 08:47 AM
05-30-2011 08:52 AM
05-30-2011 09:32 AM
un 'article' est un sous type de Constants.TYPE_CONTENTOui, un article (ws:article, pour être précis), est un sous type de cm:content.
05-30-2011 09:55 AM
05-30-2011 10:07 AM
il me suffit de remplacer Constants.TYPE_CONTENT par la String correspondant au type articleC'est exactement ça !
05-30-2011 10:14 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.