I have a setup with blueprints and live copies but I am experiencing some weird behavior.
Example 1:
Example 2:
Code:
Session session = resourceResolver.adaptTo(Session.class);
Resource brandPageResource = resourceResolver.getResource("/content/platform-blueprints/company/nl/brands/439");
Page brandPage = brandPageResource.adaptTo(Page.class);
Resource brandPageContentResource = brandPage.getContentResource();
Node brandPageContentNode = brandPageContentResource.adaptTo(Node.class);
try {
brandPageContentNode.setProperty(JCR_TITLE, "NEW-TITLE-FROM-ENDPOINT");
} catch (RepositoryException e) {
LOG.error("Error initializing components", e.getMessage(), e);
}
session.save();
Does somebody know why this is happening and how I can fix this?
When you change a node's property the surrounding page will not get an update on its cq:lastModified property and the page will not be marked as changed in the UI as well.
You could use PageManager.touch() to update the cq:lastModified and cq:lastModifiedBy properties of the page.
Using Resources instead of Nodes might also do the trick - but I am not sure about that one.