@Override public void process( CloneBranchRequest request ) { if (!updatesAllowed(request)) return; PathWorkspace workspace = getWorkspace(request, request.fromWorkspace()); PathWorkspace intoWorkspace = getWorkspace(request, request.intoWorkspace()); if (workspace == null || intoWorkspace == null) return; PathNode node = getTargetNode(workspace, request, request.from()); if (node == null) return; if (!(intoWorkspace instanceof WritablePathWorkspace)) { I18n msg = GraphI18n.workspaceIsReadOnly; request.setError(new InvalidRequestException(msg.text(repository.getSourceName(), intoWorkspace.getName()))); return; } WritablePathWorkspace newWorkspace = (WritablePathWorkspace)intoWorkspace; // Look up the new parent, which must exist ... Path newParentPath = request.into().getPath(); PathNode newParent = newWorkspace.getNode(newParentPath); Set<Location> removedExistingNodes = new HashSet<Location>(); Name desiredName = request.desiredName(); PathNode newNode = newWorkspace.copyNode(getExecutionContext(), node, workspace, newParent, desiredName, true); Location oldLocation = Location.create(node.getPath(), node.getUuid()); Location newLocation = Location.create(newNode.getPath(), newNode.getUuid()); request.setActualLocations(oldLocation, newLocation); request.setRemovedNodes(Collections.unmodifiableSet(removedExistingNodes)); recordChange(request); }
if (!updatesAllowed(request)) return; WorkspaceType workspace = getWorkspace(request, request.fromWorkspace()); WorkspaceType newWorkspace = getWorkspace(request, request.intoWorkspace()); if (workspace == null || newWorkspace == null) return;
if (!updatesAllowed(request)) return; MapWorkspace workspace = getWorkspace(request, request.fromWorkspace()); MapWorkspace newWorkspace = getWorkspace(request, request.intoWorkspace()); if (workspace == null || newWorkspace == null) return;
public void process( CloneBranchRequest request ) { ProjectedNode projectedFromNode = project(request.from(), request.fromWorkspace(), request, false); if (projectedFromNode == null) { submit(new FederatedRequest(request)); request.fromWorkspace(), readable(request.into()), request.intoWorkspace(),