Examples of EditorHook


Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

        MicroKernel microKernel = new MicroKernelImpl();
        store = new KernelNodeStore(microKernel);
        provider = new TestUtils();
        server = provider.getSolrServer();
        configuration = provider.getConfiguration();
        hook = new EditorHook(new IndexUpdateProvider(
                new SolrIndexEditorProvider(provider, provider)));
        Oak oak = new Oak().with(new InitialContent())
                .with(new OpenSecurityProvider())
                .with(new SolrIndexInitializer())
                .with(new SolrQueryIndexProvider(provider, provider))
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

        this.oak = oak;

        with(new InitialContent());

        with(JcrConflictHandler.JCR_CONFLICT_HANDLER);
        with(new EditorHook(new VersionEditorProvider()));

        with(new SecurityProviderImpl());

        with(new NameValidatorProvider());
        with(new NamespaceValidatorProvider());
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

     * order while still being able to leverage the performance gains of
     * multiple editors iterating over the changes simultaneously.
     */
    private void withEditorHook() {
        if (!editorProviders.isEmpty()) {
            commitHooks.add(new EditorHook(
                    CompositeEditorProvider.compose(editorProviders)));
            editorProviders = newArrayList();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

        OakInitializer.initialize(store, new CompositeInitializer(initializers), indexEditors);

        QueryIndexProvider indexProvider = CompositeQueryIndexProvider.compose(queryIndexProviders);

        List<CommitHook> initHooks = new ArrayList<CommitHook>(commitHooks);
        initHooks.add(new EditorHook(CompositeEditorProvider
                .compose(editorProviders)));

        if (asyncIndexing) {
            Runnable task = new AsyncIndexUpdate("async", store, indexEditors);
            WhiteboardUtils.scheduleWithFixedDelay(whiteboard, task, 5);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

                }
            }
            List<? extends ValidatorProvider> validators =
                    sc.getValidators(workspaceName, getCommitSubject());
            if (!validators.isEmpty()) {
                commitHooks.add(new EditorHook(CompositeEditorProvider.compose(validators)));
            }
        }
        commitHooks.addAll(postValidationHooks);
        return CompositeHook.compose(commitHooks);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

    public void save(final String path) throws RepositoryException {
        if (denotesRoot(path)) {
            save();
        } else {
            try {
                root.commit(new EditorHook(new EditorProvider() {
                    @Override
                    public Editor getRootEditor(NodeState before, NodeState after, NodeBuilder builder) {
                        return new ItemSaveValidator(path);
                    }
                }));
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

*/
public class TypeEditorTest {

    @Test
    public void ignoreHidden() throws CommitFailedException {
        EditorHook hook = new EditorHook(new TypeEditorProvider());

        NodeState root = INITIAL_CONTENT;
        NodeBuilder builder = root.builder();

        NodeState before = builder.getNodeState();
        builder.child(":hidden");
        NodeState after = builder.getNodeState();
        hook.processCommit(before, after);

        before = after;
        builder.child(":hidden").setProperty("prop", "value");
        after = builder.getNodeState();
        hook.processCommit(before, after);

        before = after;
        builder.getChildNode(":hidden").remove();
        after = builder.getNodeState();
        hook.processCommit(before, after);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

        try {
            NodeBuilder builder = store.getRoot().builder();
            initializer.initialize(builder);
            store.merge(
                    builder,
                    new EditorHook(new IndexUpdateProvider(indexEditor)),
                    PostCommitHook.EMPTY);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

            wspInit.initialize(builder, workspaceName, indexProvider, commitHook);
        }
        try {
            store.merge(
                    builder,
                    new EditorHook(new IndexUpdateProvider(indexEditor)),
                    PostCommitHook.EMPTY);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.EditorHook

            copyNamespaces(builder);
            copyNodeTypes(builder);
            copyVersionStore(builder);
            copyWorkspaces(builder);

            target.merge(builder, new EditorHook(new RegistrationEditorProvider()), PostCommitHook.EMPTY); // TODO: default hooks?
        } catch (Exception e) {
            throw new RepositoryException("Failed to copy content", e);
        }
    }
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.