OK, the hard part is of course that the framework package i'm talking about is 
a third-party framework (in my case it is the accesscontroltool which provides 
a hook to trigger installation of acl rules), so I'd have to see if we can get 
it added in the third party framework.

Will already start with a fork of the repo and see if I can get it working with 
the situation you specify.

Thanks,
Roy

> On 29 Jan 2023, at 20:27, Konrad Windszus <k...@apache.org> wrote:
> 
> This can be expressed with the combination of
> a) package dependencies (package-with-install-hook needs to depend on the 
> package containing the bundle with the hook class)
> b) the package containing the bundle with the hook class needs to leverage 
> https://sling.apache.org/documentation/bundles/installer-provider-installhook.html
>  
> <https://sling.apache.org/documentation/bundles/installer-provider-installhook.html>
>  in order to deploy the bundle synchronously with the package installation.
> 
> That way the correct order is enforced.
> You need to specify the bundle path because that is actually used to figure 
> out the input stream to provide to the OSGi installer.
> 
> Konrad
> 
>> On 29. Jan 2023, at 10:36, Roy Teeuwen <r...@teeuwen.be> wrote:
>> 
>> And to make things even more complicated, the package actually looks like:
>> 
>> 
>> - all
>>      - framework
>>              - framework-with-bundle
>>      - package-with-install-hook (dependant on framework-with-bundle)
>> 
>> So I tried to add the installPathRegex on the root 'all' package with as 
>> regex the path that is defined where the bundle from the framework would be 
>> installed, but this doesn't seem to fix anything
>> 
>> 
>>> On 29 Jan 2023, at 09:42, Roy Teeuwen <r...@teeuwen.be> wrote:
>>> 
>>> I also doubted between Sling and Jackrabbit, but seeing as it is 
>>> specifically an issue when using OSGi where all classes are not available 
>>> yet, I decided to register it here.
>>> 
>>> I also found the following after posting the question, 
>>> https://sling.apache.org/documentation/bundles/installer-provider-installhook.html,
>>>  which sort of seemed to cover my use-case. Just wondering on how to 
>>> properly set the configuration. Having an install path regex seems a bit 
>>> brittle, instead of being able to specify things like bundle symbolic name 
>>> or something instead. I also have the feeling that I'd rather set the 
>>> dependency explicitly on the "package-with-install-hook" instead of setting 
>>> something on the "all" package
>>> 
>>> Roy
>>> 
>>>> On 27 Jan 2023, at 19:18, Konrad Windszus <konra...@gmx.de> wrote:
>>>> 
>>>> This is more a topic for Jackrabbit than for Sling. It is already tracked 
>>>> in https://issues.apache.org/jira/plugins/servlet/mobile#issue/JCRVLT-195 
>>>> but not yet implemented. Maybe you want to come up with a PR for that?
>>>> 
>>>> Konrad 
>>>> 
>>>>> Am 27.01.2023 um 09:56 schrieb Roy Teeuwen <r...@teeuwen.be>:
>>>>> 
>>>>> Hey,
>>>>> 
>>>>> We are using an install hook to trigger a migration of some sort after 
>>>>> the content package is installed. We have one specific issue with this, 
>>>>> namely that if have a fresh environment, the installhook main class might 
>>>>> not be available yet. Is there a way we can easily fix this?
>>>>> 
>>>>> The content package:
>>>>> 
>>>>> - all
>>>>> - package-with-bundle
>>>>> - package-with-install-hook
>>>>> 
>>>>> We can set the dependency of package-with-install-hook on the 
>>>>> package-with-bundle, but it's not because the package-with-bundle is 
>>>>> installed first, that the bundle contained in the package is already 
>>>>> started up. So instead of setting a dependency on a package being 
>>>>> installed, I'd like to set a dependency on a bundle being active. Is 
>>>>> there any way to achieve this?
>>>>> 
>>>>> Greets,
>>>>> Roy
>>>>> 
>>>>> 
>>> 
>> 
> 

Reply via email to