So I have an Excel spreadsheet processor/importer where all existing pages are deleted and then it recreates the pages based on the spreadsheet info.
I'm creating new pages via
Page page = pageManager.create(getCorrectPath(main, fish), getValidName(fish), templatePath, fish.getName(), true);
and this creates new pages under /content/data/fishes.
There is a new need where I cannot delete the pages anymore. I need to update it in possibility it's an existing one.
example:
/content/data/fishes/greatwhale
jcr:contents
species:arachnid
on the spreadsheet, the species has been updated to fish.
I've looked at com.day.cq.wcm.api.PageManager and com.day.cq.wcm.api.Page
Reading these 2 pages, it seems to me there is no update/edit facility available. So I'm thinking the next option is to delete the page and then recreate it?
Or perhaps you have a better suggestion?
Thank you so much!
Solved! Go to Solution.
You should use ModifiableValueMap
https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ModifiableValueMap.html
Sample code
ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class);
properties.put("key", "value");
resourceResolver.commit();
You should use ModifiableValueMap
https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ModifiableValueMap.html
Sample code
ModifiableValueMap properties = resource.adaptTo(ModifiableValueMap.class);
properties.put("key", "value");
resourceResolver.commit();
With PageManager API - you can create new pages - we have a new article that shows this -- Scott's Digital Community: Creating an Experience Manager 6.3 Page using the Page Manager API (be released week of Jan 8)
Views
Likes
Replies
Views
Likes
Replies