如何通过aem对话框替换osgi配置属性

时间:2017-02-02 06:52:10

标签: java annotations osgi cq5 aem

我搜索了下面的博客,但我找不到确切的解决方案,最初我通过java类配置了OSGI配置属性,我想从对话框输入中替换这些值。

2 个答案:

答案 0 :(得分:2)

OSGI属性可以通过OSGI服务配置对话框进行配置。 E.g。

您可以在特殊的 OSGI Configuration标签上找到所有配置

答案 1 :(得分:1)

您的服务必须包含org.apache.felix.scr.annotations.Service和可选的org.apache.felix.scr.annotations.Component注释。

使用org.apache.felix.scr.annotations.Propertiesorg.apache.felix.scr.annotations.Property,如下例所示:

@Properties({
        @Property(
                label = "Some Property",
                description = "Some custom property",
                name = "myComponent.property",
                value = "default value"
        )
})

部署服务后,您可以转到AEM实例的/ system / console / configMgr,并使用动态生成的属性对话框修改属性。这是系统的默认行为。

希望这有帮助。