Examples of EditorHook


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

        final Oak oak = new Oak(nodeStore)
        .with(new InitialContent())
        .with(new ExtraSlingContent())

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

        .with(securityProvider)

        .with(new NameValidatorProvider())
        .with(new NamespaceEditorProvider())
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 NamespaceEditorProvider());
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, true);
View Full Code Here

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

                                  @Nonnull RepositoryInitializer initializer,
                                  @Nonnull IndexEditorProvider indexEditor) {
        try {
            NodeBuilder builder = store.getRoot().builder();
            initializer.initialize(builder);
            CommitHook hook = new EditorHook(new IndexUpdateProvider(indexEditor));
            store.merge(builder, hook, null);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

        NodeBuilder builder = store.getRoot().builder();
        for (WorkspaceInitializer wspInit : initializer) {
            wspInit.initialize(builder, workspaceName, indexProvider, commitHook);
        }
        try {
            CommitHook hook = new EditorHook(new IndexUpdateProvider(indexEditor));
            store.merge(builder, hook, null);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
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) {
            String name = "async";
            AsyncIndexUpdate task = new AsyncIndexUpdate(name, store,
View Full Code Here

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

     */
    private CommitHook getCommitHook(@Nullable final String path) {
        List<CommitHook> hooks = newArrayList();

        if (path != null) {
            hooks.add(new EditorHook(new EditorProvider() {
                @Override
                public Editor getRootEditor(NodeState before, NodeState after, NodeBuilder builder) {
                    return new ItemSaveValidator(path);
                }
            }));
        }

        hooks.add(hook);

        List<CommitHook> postValidationHooks = new ArrayList<CommitHook>();
        for (SecurityConfiguration sc : securityProvider.getConfigurations()) {
            for (CommitHook ch : sc.getCommitHooks(workspaceName)) {
                if (ch instanceof PostValidationHook) {
                    postValidationHooks.add(ch);
                } else if (ch != EmptyHook.INSTANCE) {
                    hooks.add(ch);
                }
            }

            List<? extends ValidatorProvider> validators = sc.getValidators(workspaceName, subject.getPrincipals(), moveTracker);
            if (!validators.isEmpty()) {
                hooks.add(new EditorHook(CompositeEditorProvider.compose(validators)));
            }
        }
        hooks.addAll(postValidationHooks);

        return CompositeHook.compose(hooks);
View Full Code Here

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

       
        addFolder(root, "folder-1");
        addFolder(root, "folder-2");
        addFile(root, "file-1");

        store.merge(root, new EditorHook(new IndexUpdateProvider(
                new PropertyIndexEditorProvider())), PostCommitHook.EMPTY);

        NodeState rootState = store.getRoot();
        NodeTypeIndex index = new NodeTypeIndex();
        FilterImpl filter;
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.