01-21-2009 01:07 PM
TransactionService transactionService = serviceRegistry.getTransactionService();
RetryingTransactionCallback<Object> exampleWork = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Exception
{
ContentWriter content = contentService.getWriter(nodeIWantToChange, ContentModel.PROP_CONTENT, true);
content.setMimetype(MimetypeMap.MIMETYPE_HTML);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(exampleWork);
TransactionService transactionService = serviceRegistry.getTransactionService();
RetryingTransactionCallback<Object> exampleWork = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Exception
{
ContentReader content = contentService.getReader(nodeIWantToChange, ContentModel.PROP_CONTENT);
content.setMimetype(MimetypeMap.MIMETYPE_HTML);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(exampleWork);
01-27-2009 05:25 AM
01-27-2009 07:16 AM
ContentData cd = (ContentData) nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
ContentData newCD = ContentData.setMimetype(cd, "other/mimetype");
nodeService.setProperty(nodeRef, ContentModel.PROP_CONTENT, newCD);
01-27-2009 07:18 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.