You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Hasini Witharana <ha...@gmail.com> on 2018/07/03 14:34:59 UTC

[Dev][GSoC] How to read configurations from a xml file

Hi all,

I am working on OpenID Connect Handler project. Currently the OpenID
Provider's meta data is hard coded in a separate class. I want to make
these meta data configurable in a higher level not in the code level.
Therefor I was thinking about using a xml configuration file to store the
meta data.

Are there any examples I can refer for this particular task?

Thank You.
-- 
*Hasini Witharana*
Undergraduate | Department of Computer Science and Engineering
University of Moratuwa
Linkedin <https://www.linkedin.com/in/hasini-witharana-185785109/>

Re: [Dev][GSoC] How to read configurations from a xml file

Posted by Daniel Klco <da...@gmail.com>.
Hasini,

Are you thinking of storing these as OSGi configurations? This would allow
you to provide the configurations as a file or view / modify them in the
OSGi console.

Nate has a pretty good write up of using OSGi R6 Annotations to configure
an OSGi service:

http://www.nateyolles.com/blog/2017/05/osgi-declarative-services-annotations-in-aem

You could also check out the File Optimizer project in the Sling Whiteboard
which uses OSGi configurations to provide default values which can then be
overridden by providing a configuration file:
https://github.com/apache/sling-whiteboard/blob/master/file-optim/src/main/java/org/apache/sling/fileoptim/optimizers/JpegFileOptimizer.java

Hope that helps! Feel free to reach out if you have any questions, the OSGi
configurations are awesome, but are a bit complex to configure the first
time.

Regards,
Dan

On Tue, Jul 3, 2018 at 10:35 AM Hasini Witharana <ha...@gmail.com>
wrote:

> Hi all,
>
> I am working on OpenID Connect Handler project. Currently the OpenID
> Provider's meta data is hard coded in a separate class. I want to make
> these meta data configurable in a higher level not in the code level.
> Therefor I was thinking about using a xml configuration file to store the
> meta data.
>
> Are there any examples I can refer for this particular task?
>
> Thank You.
> --
> *Hasini Witharana*
> Undergraduate | Department of Computer Science and Engineering
> University of Moratuwa
> Linkedin <https://www.linkedin.com/in/hasini-witharana-185785109/>
>