Merged V1.3 to HEAD (3117:3125)

svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3117 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3125 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3402 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-07-26 09:43:07 +00:00
parent 0b3a447a0d
commit 8330b9b924
3 changed files with 15 additions and 8 deletions

View File

@@ -744,7 +744,8 @@ public class CheckinCheckoutBean
{
try
{
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
if (logger.isDebugEnabled())
@@ -763,8 +764,10 @@ public class CheckinCheckoutBean
{
// add the content to an anonymous but permanent writer location
// we can then retrieve the URL to the content to to be set on the node during checkin
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, false);
// TODO: Adjust the mimetype
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
// also update the mime type in case a different type of file is uploaded
String mimeType = Repository.getMimeTypeForFileName(context, this.fileName);
writer.setMimetype(mimeType);
writer.putContent(this.file);
contentUrl = writer.getContentUrl();
}