RM-880 Cannot upload file into RM site over FTP/NFS file protocols

- Modified onRemoveAspect methods to only switch file name back to the format of "name (identifierId)" if content size is non-zero, else leave it as the original name to avoid CIFS shuffling issues. This fixes the issue seen on Windows Explorer and also allows files on Mac to be dragged across to RM via Finder (hence no more Error Code -43). However, there is still one outstanding issue with Mac and that is the copied files won't get renamed.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56015 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Craig Tan
2013-09-26 08:39:56 +00:00
parent 5b709487c9
commit ade9cb4887

View File

@@ -65,6 +65,7 @@ import org.alfresco.service.cmr.model.FileExistsException;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
@@ -371,9 +372,16 @@ public class RecordServiceImpl implements RecordService,
@Override
public void onRemoveAspect(NodeRef nodeRef, QName aspect)
{
if (nodeService.hasAspect(nodeRef, ASPECT_RECORD) == true)
{
switchNames(nodeRef);
ContentData contentData = (ContentData) nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
// Only switch name back to the format of "name (identifierId)" if content size is non-zero, else leave it as the original name to avoid CIFS shuffling issues.
if (contentData != null && contentData.getSize() > 0)
{
switchNames(nodeRef);
}
}
else
{
@@ -458,7 +466,7 @@ public class RecordServiceImpl implements RecordService,
NodeRef nodeRef = childAssocRef.getChildRef();
if (nodeService.exists(nodeRef) == true &&
nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY) == false &&
nodeService.getType(nodeRef).equals(TYPE_RECORD_FOLDER) == false &&
nodeService.getType(nodeRef).equals(TYPE_RECORD_FOLDER) == false &&
nodeService.getType(nodeRef).equals(TYPE_RECORD_CATEGORY) == false)
{
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_NO_CONTENT) == true)
@@ -880,6 +888,7 @@ public class RecordServiceImpl implements RecordService,
@Override
public void file(NodeRef record)
{
ParameterCheck.mandatory("item", record);
// we only support filling of content items