[ 
https://issues.apache.org/jira/browse/SLING-8309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16793515#comment-16793515
 ] 

Michael Dürig commented on SLING-8309:
--------------------------------------

[~sdumitriu], I agree that using commit hooks is the simplest way for building 
these features. Keep in mind that it is also the most dangerous! 

If you really need to build it this way then you need to setup the repository 
with those extra hooks at initialisation time. Hooks must not be dynamic as 
[~frm] pointed out. I'd also suggest you cover the customised repository with 
enough additional tests to ensure you understand the interactions of the 
additional hooks with existing features. (E.g. access rights, hidden nodes, 
indexing, observation, import / export etc). 

> 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: 0.5h
>  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
(v7.6.3#76005)

Reply via email to