[
https://issues.apache.org/jira/browse/SLING-8309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17168130#comment-17168130
]
Eric Norman commented on SLING-8309:
------------------------------------
I'd like to revisit this again. I see there are concerns in the comments about
dynamic commit hooks, but would dynamic EditorProviders be ok with all of you?
My use case is a custom variation of the AtomicCounterEditorProvider to
increment some counting property values. I'd rather not have to clone and
change the OakSlingRepositoryManager to get that custom EditorProvider hooked
in.
>From what I can see, the oak
>[RepositoryManager|[https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java]]
> that I assume the OakSlingRepositoryManager was based on has support for
>dynamic EditorProvider, IndexEditorProvider, and QueryIndexProvider based on
>the available whiteboard services.
Changing the OakSlingRepositoryManager to do the same work as the oak
RepositoryManager in this regard would solve my use case as my custom
EditorProvider component would be discovered by the WhiteboardEditorProvider
and get used.
If the oak impl from the link below does this, it should be ok for the sling
impl to the same, right?
1.
[https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java]
> Allow adding CommitHooks and EditorProviders dynamically from bundles
> ---------------------------------------------------------------------
>
> Key: SLING-8309
> URL: https://issues.apache.org/jira/browse/SLING-8309
> Project: Sling
> Issue Type: Improvement
> Components: Oak
> Reporter: Sergiu Dumitriu
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Currently, {{OakSlingRepositoryManager}} uses a hard-coded list of
> {{CommitHook}} and {{EditorProvider}} to be used by the Oak repository. This
> means that other than building a patched version of
> {{OakSlingRepositoryManager}} there's no way to include a new commit
> observer. Ideally, a single pseudo-\{{CommitHook}} and
> pseudo-\{{EditorProvider}} should be handled to Oak, and these should just
> dynamically aggregate all the {{CommitHook}} and {{EditorProvider}} instances
> registered in the {{Whiteboard}}.
> All the currently hardcoded components are already available in the
> whiteboard, so no functionality will be lost, but this change will
> automatically enable support for {{mix:atomicCounter}} via the
> {{AtomicCounterEditorProvider}} that's not used at the moment.
> The old behavior should still be available via a new configuration,
> {{OakSlingRepositoryManagerConfiguration#dynamic_components}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)