Merged V2.1 to HEAD

6636: Temporary hack to fix build.  
   6637: Better handling of binary string bufs, disable link validation when poll interval is <= 0
   6638: Forgotten files for TXT to PDF transformer.
   6639: Fix for AWC-1541
   6641: Fix for WCM-792.
   6642: A little extra PropertyValue support for createNode, too.
   6643: Fix for WCM-791
   6644: Closure of AR-1528: Check concurrency handling of DuplicateChildNodeNameException
   6647: Fix WCM-794
   6648: WCM-656
   6650: Applied user supplied patch to fix AWC-1546 - Cannot mount AVM using CIFS on new alfresco installation.
   6651: Index tidy ups
   6654: Various minor updates for passthru authentication debugging and error handling.
   6657: Fix for WCM-799 (Some items selected for submission were not present)
   6659: Updated installers.
   6660: Partial fix to AWC-1524
   6661: Fix WCM-803
   6664: Including  hibernate-3.2.1.jar in $VIRTUAL_TOMCAT_HOME/server/lib/ 
   6665: adding an automated unit test for output path patterns.
   6668: Fixed to add shale-test-1.0.4.jar to Eclipse classpath (PHH oked)
   6681: Fixes WCM-811 - Lookup.getIndirectionPath() had a bit of a howler in it.
   6684: UncategorizedSQLException with the word 'deadlock' in the message is now cause for retrying a transaction.
   6691: Fix for WCM-813 (lock not removed when expiration date set and no workflow on web project)
   6696: Imporved SSO filters for SiteMinder etc + test filter
   6697: Support for scheduled import
   6699: Fix for the compliation target:  compile-benchmarkframework 
   6701: Fix for 1.6 JVMs (1.5 gets by with lucky ordering)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 04:18:53 +00:00
parent f4f0f51a7d
commit a4b4ca69ec
27 changed files with 1110 additions and 205 deletions

View File

@@ -15,7 +15,6 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -180,10 +179,23 @@ public class CrossRepositoryCopyServiceImpl implements CrossRepositoryCopyServic
{
Pair<Integer, String> versionPath = AVMNodeConverter.ToAVMVersionPath(src);
AVMNodeDescriptor desc = fAVMService.lookup(versionPath.getFirst(), versionPath.getSecond());
NodeRef existing = fFileFolderService.searchSimple(dst, name);
if (desc.isFile())
{
FileInfo newChild = fFileFolderService.create(dst, name, ContentModel.TYPE_CONTENT);
NodeRef childRef = newChild.getNodeRef();
if (existing != null && !fNodeService.getType(existing).equals(ContentModel.TYPE_CONTENT))
{
fFileFolderService.delete(existing);
existing = null;
}
NodeRef childRef = null;
if (existing == null)
{
childRef = fFileFolderService.create(dst, name, ContentModel.TYPE_CONTENT).getNodeRef();
}
else
{
childRef = existing;
}
InputStream in = fAVMService.getFileInputStream(desc);
ContentData cd = fAVMService.getContentDataForRead(desc.getVersionID(), desc.getPath());
ContentWriter writer = fContentService.getWriter(childRef, ContentModel.PROP_CONTENT, true);
@@ -195,8 +207,20 @@ public class CrossRepositoryCopyServiceImpl implements CrossRepositoryCopyServic
}
else
{
FileInfo newChild = fFileFolderService.create(dst, name, ContentModel.TYPE_FOLDER);
NodeRef childRef = newChild.getNodeRef();
if (existing != null && !fNodeService.getType(existing).equals(ContentModel.TYPE_FOLDER))
{
fFileFolderService.delete(existing);
existing = null;
}
NodeRef childRef = null;
if (existing == null)
{
childRef = fFileFolderService.create(dst, name, ContentModel.TYPE_FOLDER).getNodeRef();
}
else
{
childRef = existing;
}
copyPropsAndAspectsAVMToRepo(src, childRef);
Map<String, AVMNodeDescriptor> listing = fAVMService.getDirectoryListing(desc);
for (Map.Entry<String, AVMNodeDescriptor> entry : listing.entrySet())
@@ -256,13 +280,22 @@ public class CrossRepositoryCopyServiceImpl implements CrossRepositoryCopyServic
{
ContentReader reader = fContentService.getReader(src, ContentModel.PROP_CONTENT);
InputStream in = reader.getContentInputStream();
try
AVMNodeDescriptor desc = fAVMService.lookup(-1, childPath);
if (desc != null && !desc.isFile())
{
fAVMService.createFile(versionPath.getSecond(), name).close();
fAVMService.removeNode(childPath);
desc = null;
}
catch (IOException e)
if (desc == null)
{
throw new AlfrescoRuntimeException("I/O Error.", e);
try
{
fAVMService.createFile(versionPath.getSecond(), name).close();
}
catch (IOException e)
{
throw new AlfrescoRuntimeException("I/O Error.", e);
}
}
ContentWriter writer = fAVMService.getContentWriter(childPath);
writer.setEncoding(reader.getEncoding());
@@ -274,7 +307,16 @@ public class CrossRepositoryCopyServiceImpl implements CrossRepositoryCopyServic
}
if (fDictionaryService.isSubClass(srcType, ContentModel.TYPE_FOLDER))
{
fAVMService.createDirectory(versionPath.getSecond(), name);
AVMNodeDescriptor desc = fAVMService.lookup(-1, childPath);
if (desc != null && !desc.isDirectory())
{
fAVMService.removeNode(childPath);
desc = null;
}
if (desc == null)
{
fAVMService.createDirectory(versionPath.getSecond(), name);
}
copyPropsAndAspectsRepoToAVM(src, childNodeRef, childPath);
List<FileInfo> listing = fFileFolderService.list(src);
for (FileInfo info : listing)