【发布时间】:2017-02-02 06:52:09
【问题描述】:
我搜索了下面的博客,但我没有找到确切的解决方案,最初我通过java类配置了OSGI配置属性,我想从对话框输入中替换这些值。
【问题讨论】:
-
您期待组件对话框还是 Felix 控制台配置对话框?
-
是的,我期待组件对话框
标签: java annotations osgi aem
我搜索了下面的博客,但我没有找到确切的解决方案,最初我通过java类配置了OSGI配置属性,我想从对话框输入中替换这些值。
【问题讨论】:
标签: java annotations osgi aem
OSGI 属性可以通过 OSGI 服务配置对话框进行配置。 例如
AEMFormsManagerConfiguration 的链接将是
http://localhost:4502/system/console/configMgr/com.adobe.aem.formsndocuments.config.AEMFormsManagerConfiguration
com.my.package.MyClass
http://localhost:4502/system/console/configMgr/com.my.package.MyClass
您可以在一个特殊的 OSGI Configuration 选项卡上找到所有配置
【讨论】:
您的服务必须具有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 并使用动态生成的属性对话框修改属性。这是系统的默认行为。
希望这会有所帮助。
【讨论】: