I need to acces page properties of a given page in JAVA as i want to make servlet.
I can do it in JS. But i dont know how to do in JAVA.
In js - i did this way
ResourceUtils.getResource(pageResource.path + "/jcr:content")
.then(function (pageContentResource){
if (pageContentResource.properties["fileReference"]) {
log.error("@@@'pageContentResource.properties['fileReference']'"+pageContentResource.properties["fileReference"]);
imagePathPromise.resolve(pageContentResource.properties["fileReference"]);
} else {
ResourceUtils.getResource(pageContentResource.path + "/image")
.then(function (imageChildResource) {
if (imageChildResource.properties["fileReference"]) {
log.error("@@@'imageChildResource.properties['fileReference']'"+imageChildResource.properties["fileReference"]);
imagePathPromise.resolve(imageChildResource.properties["fileReference"]);
} else {
ResourceUtils.getResource(imageChildResource.path + "/file")
.then(function (imageFileResource) {
log.error("@@@'imageChildResource.path '/file'' " +imageChildResource.path + "/file");
imagePathPromise.resolve(imageChildResource.path + "/file");
}, function () {
imagePathPromise.resolve("");
});
}
}, function () {
imagePathPromise.resolve("");
});
}
}, function () {
imagePathPromise.resolve("");
});
Now for JAVA , which all functions i have to use.. Kindly assist me
Solved! Go to Solution.
Views
Replies
Total Likes
Use getResourceResolver() to resolve path.
You can use resource.getResourceResolver()
Views
Replies
Total Likes
Use getResourceResolver() to resolve path.
You can use resource.getResourceResolver()
Views
Replies
Total Likes