|
|
|
@ -10,7 +10,6 @@ import javax.inject.Inject;
|
|
|
|
|
import javax.jcr.ItemNotFoundException;
|
|
|
|
|
import javax.jcr.Node;
|
|
|
|
|
import javax.jcr.NodeIterator;
|
|
|
|
|
import javax.jcr.PathNotFoundException;
|
|
|
|
|
import javax.jcr.RepositoryException;
|
|
|
|
|
import javax.jcr.Session;
|
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
@ -392,12 +391,13 @@ public class MessageManager extends Impersonable{
|
|
|
|
|
String newPath= String.format("%s/%s", destination.getPath(), uniqueName);
|
|
|
|
|
session.getWorkspace().copy(nodeToCopy.getPath(), newPath);
|
|
|
|
|
Node newNode = session.getNode(newPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (itemToCopy instanceof AbstractFileItem) {
|
|
|
|
|
((AbstractFileItem) itemToCopy).getContent().setRemotePath(newPath);
|
|
|
|
|
String newStorageID = folderPluginHandler.getDefault().getStorageBackend().onCopy((AbstractFileItem) itemToCopy);
|
|
|
|
|
((AbstractFileItem) itemToCopy).getContent().setStorageId(newStorageID);
|
|
|
|
|
item2Node.replaceContent(newNode, (AbstractFileItem) itemToCopy, ItemAction.CLONED);
|
|
|
|
|
AbstractFileItem newNodeItem = node2Item.getItem(newNode, Excludes.EXCLUDE_ACCOUNTING);
|
|
|
|
|
newNodeItem.getContent().setRemotePath(newPath);
|
|
|
|
|
String newStorageID = folderPluginHandler.getDefault().getStorageBackend().onCopy(newNodeItem);
|
|
|
|
|
newNodeItem.getContent().setStorageId(newStorageID);
|
|
|
|
|
item2Node.replaceContent(newNode, newNodeItem, ItemAction.CLONED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Utils.setPropertyOnChangeNode(newNode, currentUser, ItemAction.CLONED);
|
|
|
|
|