2016-06-13 102 views
1

我想使用文本文件来配置Apache Sling服务用户映射程序服务。我在jcr_root/apps/sling/config下创建了一个文件,这个文件被称为org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.json。如何在Sling中使用描述符文件配置OSGi服务?

这是文件的内容:

{ 
    "jcr:primaryType":"sling:OsgiConfig", 
    "user.mapping" : "artifact.name=systemUserName" 
} 

该文件在JCR创建和属性是否正确解决,但没有被配置的服务。如何解决这个问题?

回答

0

原来,要在Sling中配置服务,描述符文件必须存储在jcr_root/apps/sling/install目录下。

有关Sling安装程序的更多信息,请参阅here

+1

这是部分正确的。 Apache Sling JCR安装程序是可配置的,请参阅:http:// localhost:8080/system/console/configMgr/org.apache.sling.installer.provider.jcr.impl.JcrInstaller。开箱即用,您可以将OSGi配置存储在“install”或“c​​onfig”中,该配置可以达到4层深度。标准做法是使用'config'文件夹而不是'install',比如'/ apps//config'。从那里,你可以进入运行模式规范,例如'config.prod.chicago'或'config.qa'。 – nateyolles