system users administrative session

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

system users administrative session

Andres Bott
Hello all,  

I'm currently using this code in my bundle
http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/repository/SystemUsersInitializer.java?view=markup&pathrev=1727946
to execute a repoinit file to create service users.

I wanted to know if there is a better/intended way to execute repoinit
on bundle installation

and since loginAdministrative is deprecated, how should we run this code
in the future?

Regards
Andres
Reply | Threaded
Open this post in threaded view
|

Re: system users administrative session

Robert Munteanu-2
Hi Andres,

On Sun, 2018-02-04 at 12:57 +0100, Andres Bott wrote:
> and since loginAdministrative is deprecated, how should we run this
> code
> in the future?

Sometimes it's ok to use login administrative, and I guess provisioning
system users and overall repository initialization is one of those
scenarios.

BTW, we moved to Git, so a current link would be

  https://github.com/apache/sling-org-apache-sling-launchpad-test-servi
ces/blob/master/src/main/java/org/apache/sling/launchpad/testservices/r
epository/SystemUsersInitializer.java

Thanks,

Robert
Reply | Threaded
Open this post in threaded view
|

Re: system users administrative session

Oliver Lietz
In reply to this post by Andres Bott
On Sunday 04 February 2018 12:57:10 Andres Bott wrote:
> Hello all,

Hi  Andres,

> I'm currently using this code in my bundle
> http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/ja
> va/org/apache/sling/launchpad/testservices/repository/SystemUsersInitializer
> .java?view=markup&pathrev=1727946 to execute a repoinit file to create
> service users.
>
> I wanted to know if there is a better/intended way to execute repoinit
> on bundle installation
>
> and since loginAdministrative is deprecated, how should we run this code
> in the future?

you can provide OSGi configurations with Repoinit statements in your bundle.
To get an idea have a look at SLING-7177[1], Karaf Configs[2] and how to
install OSGi configurations from bundles[3].

Regards,
O.

[1] https://issues.apache.org/jira/browse/SLING-7177
[2] https://github.com/apache/sling-org-apache-sling-karaf-configs/tree/master/src/main/resources
[3] http://sling.apache.org/documentation/bundles/configuration-installer-factory.html

> Regards
> Andres