Hi All,
I have a component embedded directly into the page something like below:
<div data-sly-resource="${@path = 'somecomponent',resourceType='someproject/component/somecomponent'}"></div>
Now when I add this resourceType to SSI include config, this throws a not found error on dispatcher. This is because dispatcher is trying to access as below:
<!--#include virtual="/content/somesite/en/_jcr_content/somecomponent.nocache.html" --> (This doesn't exist in publish)
Please let me know some solution where in I don't need to manually author all pages or reload all pages.
Solved! Go to Solution.
Atlast fixed it from dispatcher end and came to know few new things about AEM.
/content/somesite/en/_jcr_content/somecomponent.nocache.html
if the somecomponent node is not present in crxde and if we pass the resourcetype to the url. It will call the somecomponent internally.
something like below
/content/somesite/en/_jcr_content/somecompoent.nocache.html/project/components/somecomponent
SSI is already doing the job when the node is not present. It is including the url with resource type appended as told above.
<!--#include virtual="/content/somesite/en/_jcr_content/somecomponent.nocache.html/project/components/somecomponent" -->
Actual issue was dispatcher calling with appending .html at end like
/content/somesite/en/_jcr_content/somecomponent.nocache.html/project/components/somecomponent.html which was giving a not found in publish environment.
wrote dispatcher rewrite rule to stop appending .html specific to url containing .nocache.html/
Now it works fine. Thanks all
Do you have this component on the publish instance? Does it work if you do not use SSI?
Views
Replies
Total Likes
Hi Susheel,
I have couple of more Question along with Smac Question.
1. Without loading the Page you want to create the node i.e pages are already there in production so you don't want to reload all pages.
is it right?
2.What ever pages are all there in prod. do you need one time node creation?
3.For new pages after creating the Page. Does author will open the pages?
3 Question Expected answer- If author open the pages after creating for new pages: for that case you create one java class that will instantiate on component load that will check the node on the current page if the node does't exist create node else not.
2 Question Expected- If all pages are on prod. to create a node one time to all pages on the prod without pages reload :
Option 1: create a dummy component that will call the java class on activate method write the java code to iterate through your pages using page manager api and check your template or use Query builder to find the pages created by your template and then iterate through those pages to check the node is exist or not if not create the node.
Option 2:Create a service having configuration of your path, template name, options like disable and start service option to start and disable this service(if you have multiple path and different template) that will call the java class on activate method write the java code to iterate through your pages using page manager api and check your template or use Query builder to find the pages created by your template and then iterate through those pages to check the node is exist or not if not create the node.
there are other option too to achieve the same results.
Thanks
Views
Replies
Total Likes
Yes it works if I load the page but not the direct component.
/content/somesite/en.html
When I load the above url components load correctly on page
But when I tried to access the component directly it wont as the node is not present
/content/somesite/en/_jcr_content/somecomponent.html
Views
Replies
Total Likes
Q1 - Yes
Q2 - I don't want to write any code to loop through all pages and stuff. Just want to make sure if any other way, without writing any extra code.
Q3 - Yes - I already mentioned in question that I wrote code to generate the node if not present. This is fine for new pages. I am talking about existing pages.
Views
Replies
Total Likes
yes you can do one thing.
1.First take the package of single component.And then extract it.Go to .content.xml of your component then took only component XMl. like secondary_nav_text in below example.
1Then take the whole package of your content and Extract the package and find you template name in Notepad++ this will give you all the path of matched template name.
Those will be in .content.xml then find common things based on the page structure that will be common in content and replace with that suppose my page having parsys before that component is rel_par then i will find </rel_par> and replace with our component xml including search term. It depend on your common thing.
</rel_par>
<secondary_nav_text_l
jcr:created="{Date}2017-02-01T19:44:30.089+05:30"
jcr:createdBy="admin"
tertiarytitle="All "
tertiaryurl="test.html"/>
and then create the package again and then deploy it on testing server to test everything is fine.
This might be helpful that required no code.
Atlast fixed it from dispatcher end and came to know few new things about AEM.
/content/somesite/en/_jcr_content/somecomponent.nocache.html
if the somecomponent node is not present in crxde and if we pass the resourcetype to the url. It will call the somecomponent internally.
something like below
/content/somesite/en/_jcr_content/somecompoent.nocache.html/project/components/somecomponent
SSI is already doing the job when the node is not present. It is including the url with resource type appended as told above.
<!--#include virtual="/content/somesite/en/_jcr_content/somecomponent.nocache.html/project/components/somecomponent" -->
Actual issue was dispatcher calling with appending .html at end like
/content/somesite/en/_jcr_content/somecomponent.nocache.html/project/components/somecomponent.html which was giving a not found in publish environment.
wrote dispatcher rewrite rule to stop appending .html specific to url containing .nocache.html/
Now it works fine. Thanks all
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies