我有一個組件,其屬性如下。爲什麼sling:AEG中的/ etc /文件夾中的OsgiConfig節點不工作?
@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代碼中聲明的屬性,該屬性工作正常。
但如果我只是有相同sling:OsgiConfig
內/etc/myapp/myconfig
,這是行不通的。
添加'/ etc:300'後,它開始在'/ etc/system/config /'中工作。但是文件夾'/ etc/myapp/myconfig'仍然無法工作。 – Dileepa
將文件夾myconfig重命名爲config。 – awd
工作。謝謝。 :) – Dileepa