/** * Return the draft field containers of the node in the latest branch. * * @return */ default TraversalResult<? extends NodeGraphFieldContainer> getDraftGraphFieldContainers() { // FIX ME: We should not rely on specific branches. return getGraphFieldContainersIt(getProject().getLatestBranch(), DRAFT); }
@Override public Branch getBranch(Project project) { if (project == null) { project = getProject(); } return branchCache.computeIfAbsent(project, p -> { if (p == null) { // TODO i18n throw error(INTERNAL_SERVER_ERROR, "Cannot get branch without a project"); } Branch branch = null; String branchNameOrUuid = getVersioningParameters().getBranch(); if (!isEmpty(branchNameOrUuid)) { branch = p.getBranchRoot().findByUuid(branchNameOrUuid); if (branch == null) { branch = p.getBranchRoot().findByName(branchNameOrUuid); } if (branch == null) { throw error(BAD_REQUEST, "branch_error_not_found", branchNameOrUuid); } } else { branch = p.getLatestBranch(); } return branch; }); }
addTags(document, node.getTags(node.getProject().getLatestBranch())); addTagFamilies(document, node.getTags(node.getProject().getLatestBranch())); addPermissionInfo(document, node, type);
branchUuid = theirProject.getLatestBranch().getUuid();