我有一个具有如下属性的组件。
@Component(immediate = true, metatype = true, label = "Conf Details")
@Service(value = { LocationConfigurationUtil.class })
@Properties({
@Property(label = "location blueprint", name = "locationPath", value = "", description = "..."),
@Property(label = "location page template", name = "locationTemplate", value = "", description = "..."),
@Property(label = "basepath live copies", name = "liveCopyRoot", value = "/content/WebRoot", description = "...") })
public class LocationConfigurationUtil {
@Activate
protected void activate(Map<String, Object> mapCreated) {
// some code
}
}
为了使其在 jcr 节点中具有可编辑属性,我使用了一种非标准方法。我在路径 /apps/system/config
中创建了 sling:OsgiConfig
,其属性在 java 代码中声明,工作正常。
但是如果我在 /etc/myapp/myconfig
中只有相同的 sling:OsgiConfig
,它就不起作用。
最佳答案
使用默认设置,JCR Installer Provider 不会在 /libs
和 /apps< 以外的文件夹中寻找可安装的包和节点 (
。所以 sling:OsgiConfig
)//etc
中的任何配置都不会被加载。
如果您想更改此行为,请在 osgi 配置控制台的“Apache Sling JCR 安装程序”配置中创建一个搜索路径条目。但请注意,不建议这样做,您不应该首先将任何 sling:osgiconfig
节点放在 /etc
中。
关于java - 为什么吊索 :OsgiConfig node not working in/etc/folder in AEM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35716283/