sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothee Maret (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-8591) Hook to support custom code when installing or deleting distribution packages
Date Tue, 23 Jul 2019 07:49:00 GMT

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

Timothee Maret commented on SLING-8591:
---------------------------------------

Thanks for picking that up [~cschneider]! The approach looks good, I left a few comments
in the [PR 20|https://github.com/apache/sling-org-apache-sling-distribution-core/pull/20]
(ignoring test and empty test).

> Hook to support custom code when installing or deleting distribution packages
> -----------------------------------------------------------------------------
>
>                 Key: SLING-8591
>                 URL: https://issues.apache.org/jira/browse/SLING-8591
>             Project: Sling
>          Issue Type: Improvement
>          Components: Content Distribution
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>            Priority: Major
>             Fix For: Content Distribution Core 0.4.2
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The concrete case for this is that some customers would like to automatically install
content packages that are deployed during a content distribution.
> I would like to avoid putting the content package installation code directly into the
content distribution core bundle. So the idea is to define a hook that can be implemented
to support custom code after installation of a distribution package and before deletion of
such a package.
> The hook could look like this:
> {code:java}
> public interface PackageInstallHook {
>     void onPostAdd(ResourceResolver resourceResolver, DistributionPackage distPackage);
>     void onPreRemove(ResourceResolver resourceResolver, DistributionPackage distPackage);
> }
> {code}
> The implementation of the hook can be offered as a service. A default noop service is
created by default. The referenced service can be overridden by specifiying a installHook.target
on the DistributionPackageBuilderFactory config.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message