【问题标题】:how to replace osgi configuration properties through aem dialog如何通过 aem 对话框替换 osgi 配置属性
【发布时间】:2017-02-02 06:52:09
【问题描述】:

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

【问题讨论】:

  • 您期待组件对话框还是 Felix 控制台配置对话框?
  • 是的,我期待组件对话框

标签: java annotations osgi aem


【解决方案1】:

OSGI 属性可以通过 OSGI 服务配置对话框进行配置。 例如

您可以在一个特殊的 OSGI Configuration 选项卡上找到所有配置

【讨论】:

  • 感谢回复,我想从组件对话框中替换 osgi 配置属性
【解决方案2】:

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

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

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

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

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多