Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Root.commit()


                    // some external template implementation, copy before proceeding
                    template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd);
                }
                template.writeTo(tree, allowUpdate);
            }
            root.commit();

            refresh();

            List<NodeType> types = new ArrayList<NodeType>(ntds.length);
            for (NodeTypeDefinition ntd : ntds) {
View Full Code Here


            throw new NoSuchNodeTypeException("Node type " + name + " can not be unregistered.");
        }

        try {
            type.remove();
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message = "Failed to unregister node type " + name;
            throw e.asRepositoryException(message);
        }
View Full Code Here

                if (!type.exists()) {
                    throw new NoSuchNodeTypeException("Node type " + name + " can not be unregistered.");
                }
                type.remove();
            }
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message = "Failed to unregister node types.";
            throw e.asRepositoryException(message);
        }
View Full Code Here

                syncMode = SyncMode.fromObject(smValue);
            }
            ExternalUser eu = getExternalUser();
            if (eu != null && handler.initialize(userManager, root, syncMode, options)) {
                handler.sync(eu);
                root.commit();
                return true;
            } else {
                log.warn("Failed to initialize sync handler.");
                return false;
            }
View Full Code Here

            String ns = Namespaces.getNamespacePrefix(namespaces, uri);
            if (ns != null) {
                namespaces.removeProperty(ns);
            }
            namespaces.setProperty(prefix, uri);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message =
                    "Failed to register namespace mapping from "
                            + prefix + " to " + uri;
View Full Code Here

                            + getURI(prefix) + " can not be unregistered");
        }

        try {
            namespaces.removeProperty(prefix);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message = "Failed to unregister namespace mapping for prefix " + prefix;
            throw e.asRepositoryException(message);
        }
View Full Code Here

            String anonymousId = Strings.emptyToNull(params.getConfigValue(PARAM_ANONYMOUS_ID, DEFAULT_ANONYMOUS_ID, String.class));
            if (anonymousId != null && userManager.getAuthorizable(anonymousId) == null) {
                userManager.createUser(anonymousId, null);
            }
            if (root.hasPendingChanges()) {
                root.commit();
            }
        } catch (RepositoryException e) {
            log.error(errorMsg, e);
            throw new RuntimeException(e);
        } catch (CommitFailedException e) {
View Full Code Here

                if (!p.isArray() && p.getValue(STRING).equals(uri)) {
                    namespaces.removeProperty(p.getName());
                }
            }
            namespaces.setProperty(prefix, uri);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message =
                    "Failed to register namespace mapping from "
                            + prefix + " to " + uri;
View Full Code Here

                            + getURI(prefix) + " can not be unregistered");
        }

        try {
            namespaces.removeProperty(prefix);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message = "Failed to unregister namespace mapping for prefix " + prefix;
            throw e.asRepositoryException(message);
        }
View Full Code Here

        accessManager.checkPermissions(destPath, Permissions.getString(Permissions.NODE_TYPE_MANAGEMENT));

        try {
            new WorkspaceCopy(root, srcPath, destPath).perform();
            root.commit();
            sessionDelegate.refresh(true);
        } catch (CommitFailedException e) {
            throw e.asRepositoryException();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.