. JavaScript API inter-store copy support

- Transparent support for inter-store copy added to JavaScript Node and AVMNode implementations
   The existing API mechanisms for copy() now support passing of Node or AVMNode and visa-versa as the destination target
   No changes to existing copy() semantics and no new services/APIs to learn
. Improvements to handling of missing input parameters in JavaScript Node APIs
. Added Workspace->Workspace support to CrossRepositoryCopyService

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5047 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-02-06 10:36:46 +00:00
parent 92c73dd54a
commit d781cc74c1
5 changed files with 2097 additions and 1931 deletions

View File

@@ -20,6 +20,7 @@ import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.CopyService;
import org.alfresco.service.cmr.repository.CrossRepositoryCopyService;
@@ -117,24 +118,24 @@ public class CrossRepositoryCopyServiceImpl implements
{
StoreRef srcStoreRef = src.getStoreRef();
StoreRef dstStoreRef = dst.getStoreRef();
if (srcStoreRef.getProtocol().equals("avm"))
if (srcStoreRef.getProtocol().equals(StoreRef.PROTOCOL_AVM))
{
if (dstStoreRef.getProtocol().equals("avm"))
if (dstStoreRef.getProtocol().equals(StoreRef.PROTOCOL_AVM))
{
copyAVMToAVM(src, dst, name);
}
else
else if (dstStoreRef.getProtocol().equals(StoreRef.PROTOCOL_WORKSPACE))
{
copyAVMToRepo(src, dst, name);
}
}
else
else if (srcStoreRef.getProtocol().equals(StoreRef.PROTOCOL_WORKSPACE))
{
if (dstStoreRef.getProtocol().equals("avm"))
if (dstStoreRef.getProtocol().equals(StoreRef.PROTOCOL_AVM))
{
copyRepoToAVM(src, dst, name);
}
else
else if (dstStoreRef.getProtocol().equals(StoreRef.PROTOCOL_WORKSPACE))
{
copyRepoToRepo(src, dst, name);
}
@@ -277,6 +278,8 @@ public class CrossRepositoryCopyServiceImpl implements
*/
private void copyRepoToRepo(NodeRef src, NodeRef dst, String name)
{
ChildAssociationRef assocRef = fNodeService.getPrimaryParent(src);
fCopyService.copyAndRename(src, dst, ContentModel.ASSOC_CONTAINS, assocRef.getQName(), true);
}
private void copyData(InputStream in, OutputStream out)