Reputation: 11
I want to write a Java code which update a document's content from a MS-word file to a pdf file in IBM Filenet Content Engine 4.5.No conversion as of now required, just updation of the content only. Metadata Properties etc remain unchanged from the word file.
Many Thanks
Upvotes: 1
Views: 2523
Reputation: 5782
Do you have any problem using code samples from the documentation?
Based on Setting a Document's Content:
// references to the document and file you are working with
Document document;
File file;
document.checkout(ReservationType.EXCLUSIVE, null, null, null);
document.save(RefreshMode.REFRESH);
Document reservation = (Document) document.get_Reservation();
ContentTransfer contentTransfer = Factory.ContentTransfer.createInstance();
InputStream inputStream = new FileInputStream(file);
ContentElementList contentList = Factory.ContentTransfer.createList();
contentTransfer.setCaptureSource(inputStream);
contentList.add(contentTransfer);
reservation.set_ContentElements(contentList);
reservation.save(RefreshMode.REFRESH);
reservation.checkin(AutoClassify.DO_NOT_AUTO_CLASSIFY, CheckinType.MAJOR_VERSION);
reservation.save(RefreshMode.REFRESH);
Upvotes: 1