【发布时间】:2016-03-01 06:41:12
【问题描述】:
我有一个组件,其属性如下。
@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,它就行不通了。
【问题讨论】: