I need to publish templates and template types along with other nodes. I achieve this with a sling job, however, unlock doesn't work on the template root and also on any custom templates created on top of the published template-types.
I notice that, if I pass replicationOptions.setSuppressStatusUpdate(true) it works. But this would not update properties like 'isActivated', 'cq:lastReplicated' and 'cq:lastReplicatedBy' which is a limitation for me.
Version: AEM 6.5.15
Please help me resolve this issue.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @samaraneni
We need not publish template-types, only templates are required.
All pages are rendered via templates.
Template-types are only a template to create new templates. You can skip publishing the same.
Please try and validate on publish that all features work fine without template-types
Thanks for the response.
I agree excluding 'template-types' from publishing would let me unlock, however I have this concern with not publishing 'template-types'
1) They won't exist in publish instance anymore but there is a reference to template-types as shown in this image
Are there any potential issues that could arise if these elements are not included? In the package approach, these elements are present in the published instance. I want to ensure that transitioning to the API approach won’t inadvertently cause any issues.
As per my understanding, it should be ok to skip template-types on publish.
Hi Aancha,
I have excluded 'template-types' from the publish logic, now the templates and rest of the nodes are published. Although the custom templates built using template-types are unlocking, the 'template-root' unlock is still not working. Please share your thoughts
I see POST with 200 for root call. (Note: when the unlock is successful I see POST with 201 response code)
I suspect that when the replication properties are set during replication this is happening. Please share your thoughts
I have tried on WKND site.
I am able to unlock root with replication params as well
I would suggest, not to unlock root. That is the basic structure of your template. You would not want anyone other than template editors playing with it.
In my opinion, it should stay locked.
Thanks for validating. I want to make sure the api approach is behaving similar to package where the admin can edit the 'template-root'.
On further debugging the issue I noticed that an extra flag `"structureLocked":true` is being passed with the 'editable' parameter to the unlockStructureComponent method in case of nodes with published templates whereas for nodes without published templates this property is not there.
I'm not setting this during publish. Do you know why and how this property is being set? Can I override it programmatically or what's the better way to handle this?
I am not getting "structureLocked" param in following request http://localhost:4502/bin/wcm/template/sync.html/conf/wknd/settings/wcm/templates/landing-page-templ...
May be install WKND and compare templates. Basic structure until root might be same.You might be able to find some difference
Hi Aanchal,
I am able to reproduce the issue with WKND. Here are the steps
1. Replicate the root node using 'replicate' option in crxde as show in this screenshot
2. Now navigate to template editor page and try to unlock, you get 200 response code for POST instead of 201 created and unlock won't happen
Please let me know your thoughts.
Please do not replicate nodes individually. Publish only the template.
I have published the template and root. Still able to unlock
One difference is I am using AEM Cloud SDK.
Now I have tried with the parent nodes published at these levels
/conf/wknd/settings/wcm
/conf/wknd/settings/wcm/templates
/conf/wknd/settings/wcm/templates/adventure-page-template/structure
/conf/wknd/settings/wcm/templates/adventure-page-template/structure/jcr:content
/conf/wknd/settings/wcm/templates/adventure-page-template/structure/jcr:content/root
Still I see the same issue with unlocking http://localhost:4502/bin/wcm/template/sync.html/conf/wknd/settings/wcm/templates/adventure-page-tem...
Could you please try reproducing the issue on AEM 6.5.15. Thanks
@samaraneni Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies