08-14-2006 05:03 PM
String dateCreated = document.getDateCreated().toString();
String dateUpdated = document.getDateUpdated().toString();
NamedValue[] properties =
new NamedValue[]{
Utils.createNamedValue(Constants.PROP_DESCRIPTION, document.getDescription()),
Utils.createNamedValue(Constants.PROP_TITLE, document.getTitle()),
Utils.createNamedValue("{http://www.alfresco.org/model/content/1.0}author", document.getAuthors()),
Utils.createNamedValue(Constants.PROP_NAME, document.getFileName()),
//Utils.createNamedValue("{http://www.alfresco.org/model/content/1.0}created", dateCreated),
Utils.createNamedValue("{http://www.alfresco.org/model/content/1.0}modified", dateUpdated)
};
logger.warn("Creating: " + document.getFileName());
CMLCreate create = new CMLCreate("1", parentReference, Constants.TYPE_CONTENT, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);
ContentFormat format = new ContentFormat(document.getMimeType(), document.getEncoding());
WebServiceFactory.getContentService().write(results[0].getDestination(), Constants.PROP_CONTENT, document.getContentAsByteArr(), format);
08-15-2006 12:52 PM
08-15-2006 04:38 PM
10-25-2006 06:24 AM
12-13-2006 09:34 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.