java - 为什么吊索 :OsgiConfig node not working in/etc/folder in AEM?

标签 java osgi aem jcr sling

我有一个具有如下属性的组件。

@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 代码中声明,工作正常。

screen shot

但是如果我在 /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/

相关文章:

c# - 如何配置 WebService 返回 ArrayList 而不是 Array?

java - 如何捕获 System.exit 事件?

java - OpenNLP 中术语 "Feature"是什么意思?或者在一般的 NLP 中。外行术语会很好

OSGi中的Spring组件扫描什么也没找到

osgi - 如何添加cq :listener to a component

java - JList setListData 线程问题

configuration - 用于配置服务的 OSGi 声明式服务与 ManagedService?

java - Websphere 8 + 工作管理器 ClassCastException

java - 使用 AssetManager 以编程方式在 DAM 中上传文件?我应该使用什么 MimeType?

javascript - 缩小 Angular 不更新模板?