Merged V4.1-BUG-FIX to HEAD

40690: Removed 'repository-bm' project, which is no longer distributed, referenced or supported
    - Part of ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file
    - Also: ALF-15588
   40692: Removed 'repository-bm' project, which is no longer distributed, referenced or supported
    - Part of ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file
   40695: Fixed ALF-14420: Remove benchmarking tool (alfresco-bm.jar) from installer and Alfresco war installation file
    - Removed all related code as well
   40700: Remove XAM Connector.  Now built as a standalone project
   40707: ALF-14399 Share Calendar changes dates when "All Day" is selected. Event comparator now checks if date strings contain a time zone, previously was failing because we strip time zones from all day events.
   40708: Complete - task : ALF-14399 Share Calendar changes dates when "All Day" is selected. Added the time zone in which the recurrence rule was parsed to the recurrence rule string.
   40711: Merged V3.4-BUG-FIX to V4.1-BUG-FIX
      40700: (RECORD ONLY) Remove XAM Connector.  Now built as a standalone project
      40701: (RECORD ONLY) Remove Kofax.  Now built as a standalone integration.
      40703: (RECORD ONLY) Revert Kofax removal.
      40704: (RECORD ONLY) Revert XAM Connector removal for V3.4.
      40709: (RECORD ONLY) ALF-14752 - Collapse Links part at the WCM details page lead to error
      40710: ALF-15592: Merged PATCHES/V3.4.8 to V3.4-BUG-FIX
         40543: ALF-15507: Orphan content URLs when you overwrite a file with identical content in CIFS
         - Removed diffing behaviour that was leaking content URLs

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40712 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-08-22 09:27:02 +00:00
parent 4d5dbe31ed
commit b28d894e2a
18 changed files with 9 additions and 3662 deletions

View File

@@ -29,16 +29,12 @@ import org.alfresco.jlan.server.filesys.AccessDeniedException;
import org.alfresco.jlan.server.filesys.DiskFullException;
import org.alfresco.jlan.server.filesys.FileAttribute;
import org.alfresco.jlan.server.filesys.FileInfo;
import org.alfresco.jlan.server.filesys.FileOpenParams;
import org.alfresco.jlan.server.filesys.NetworkFile;
import org.alfresco.jlan.smb.SeekType;
import org.alfresco.jlan.smb.server.SMBSrvSession;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.AbstractContentReader;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.filestore.FileContentReader;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.TransactionListenerAdapter;
import org.alfresco.service.cmr.repository.ContentAccessor;
@@ -76,7 +72,6 @@ public class ContentNetworkFile extends NodeRefNetworkFile
private FileChannel channel; // File channel to file content
private ContentAccessor content; // content
private String preUpdateContentURL;
// Indicate if file has been written to or truncated/resized
private boolean modified;
@@ -336,7 +331,6 @@ public class ContentNetworkFile extends NodeRefNetworkFile
throw new AccessDeniedException("The network file was created for read-only: " + this);
}
preUpdateContentURL = null;
// Need to open content for write
if (write)
@@ -349,14 +343,6 @@ public class ContentNetworkFile extends NodeRefNetworkFile
content = contentService.getWriter( getNodeRef(), ContentModel.PROP_CONTENT, false);
// Keep the original content for later comparison
ContentData preUpdateContentData = (ContentData) nodeService.getProperty( getNodeRef(), ContentModel.PROP_CONTENT);
if (preUpdateContentData != null)
{
preUpdateContentURL = preUpdateContentData.getContentUrl();
}
// Indicate that we have a writable channel to the file
writableChannel = true;
@@ -484,40 +470,17 @@ public class ContentNetworkFile extends NodeRefNetworkFile
final ContentData contentData = content.getContentData();
// Update node properties, but only if the binary has changed (ETHREEOH-1861)
ContentReader postUpdateContentReader = writer.getReader();
RunAsWork<ContentReader> getReader = new RunAsWork<ContentReader>()
// Update node properties
nodeService.removeAspect(contentNodeRef, ContentModel.ASPECT_NO_CONTENT);
try
{
public ContentReader doWork() throws Exception
{
return preUpdateContentURL == null ? null : contentService.getRawReader(preUpdateContentURL);
}
};
ContentReader preUpdateContentReader = AuthenticationUtil.runAs(getReader, AuthenticationUtil.getSystemUserName());
boolean contentChanged = preUpdateContentURL == null
|| !AbstractContentReader.compareContentReaders(preUpdateContentReader,
postUpdateContentReader);
if (contentChanged)
nodeService.setProperty( contentNodeRef, ContentModel.PROP_CONTENT, contentData);
}
catch (ContentQuotaException qe)
{
if(logger.isDebugEnabled())
{
logger.debug("content has changed - remove ASPECT_NO_CONTENT");
}
nodeService.removeAspect(contentNodeRef, ContentModel.ASPECT_NO_CONTENT);
try
{
nodeService.setProperty( contentNodeRef, ContentModel.PROP_CONTENT, contentData);
}
catch (ContentQuotaException qe)
{
content = null;
setClosed( true);
throw new DiskFullException(qe.getMessage());
}
content = null;
setClosed( true);
throw new DiskFullException(qe.getMessage());
}
// Tidy up after ourselves after a successful commit. Otherwise leave things to allow a retry.
@@ -531,7 +494,6 @@ public class ContentNetworkFile extends NodeRefNetworkFile
if(channel == null)
{
content = null;
preUpdateContentURL = null;
setClosed( true);
}
}