-
Task
-
Resolution: Done
-
Blocker
-
3.3.0.Final
-
None
At the moment the JCR clone operation does not take into account external nodes, which can cause problems. The clone operation, as defined by the spec, tries to keep the identifiers unchanged for the nodes and can work either between 2 different workspaces or within the same workspace.
Therefore, the following scenarios have to be handled:
- clone into the same workspace - this produces shareable nodes, but given that there would a very limited use for those in an external source (e.g. Ext FS with symbolic links), this operation should not be allowed (i.e. an exception should be raised) if either the source or the target of the clone are external nodes.
- clone into a different workspace - given that for external nodes to work its critical that the corresponding projections are already set-up on a per-workspace basis, we should implement(allow) this operation in the case of external nodes only if an entire workspace is cloned into another workspace. In this case, the projections from the source workspace should be copied into the target workspace (if they do not exist). In case the target workspace is not empty, the semantic of the removeExisting flag should be used, including for projections. So for example, if the target workspace contains a projection with the same name as an incoming projection from the source workspace and removeExisting is false an exception should be raised. Also, if the clone operation is invoked between the workspace in any other way than clone("ws", "/", "/", removeExisting an exception should be raised.