Adobe AEM WorkFlow activate a page including child pages [duplicate] - adobe

This question already has answers here:
How to replicate a page and all its children using replicator API?
(2 answers)
Closed 7 years ago.
I want to activate a page also include it's child pages using workflow
like below
Parent Node
・Child Node 1
・Child Node 2
・Child Node 3
Requirement is:
Is it possible ??? Please give solution also in comment......
thank you very much!!!

You can use the Replicator api to activate the pages.
In your workflow process step. You can do the following
currentPage = getCurrentPagePath(); // this is something which you have to figure out, this depends on your workflow code i.e how exactly your workflow got triggered.
Now,
Iterator<Page> childPages = currentPage.listChildren();
Now iterate over the child pages and for each child page, do the following
replicator.replicate(session,repplicationActionType, childPagePath);
You can get the instance of replicator using OSGi dependency injection.
#Reference
public Replicator replicator

Related

nextjs dynamically set response header [duplicate]

This question already has answers here:
how to cleanly handle errors in nextjs getStaticProps
(2 answers)
Closed 12 months ago.
I'm trying to create a blog for my website. Because I want to be able to dynamically add blogs without rebuilding I had to choose between incremental static generation and server-side rendering. Because a blog page won't change often, I decided to go for ISG. Of course, not every blog ID is a valid page. Therefor I want to set a status code, but I can't find out how without using server-side rendering
I found the answer. Turns out I can return notFound: true from the getStaticProps to get a 404

Revalidate key in Next.js [duplicate]

This question already has answers here:
How does the revalidate process in Incremental Static Regeneration work?
(2 answers)
Closed 7 months ago.
As you know, we can update SSG page via revalidate key in getStaticProps() and user at firstly see latest content and after refresh page twice can see updated content.
But is it proper that user should refresh page twice? In my opinion, user do not know should refresh twice. However, new users can see the new content at first.
I would be appreciate if share your comments about revalidate.
You'll usually have more than 1 user. The Re-generation can be triggered by any of your users so not everyone on the site needs to refresh twice. Only 1 user would do that.

Cannot create a new child form in C# windows form

In my windows form application, I have already added a child form that appears on the center location of the parent form when I click on add a new product button. Now, I want to add a new child form with a different name where I can capture the existing details of the product for editing them.
My problem is that when I create a new child form for editing products, I keep its name different i.e childEditProduct but when I save it, both the child forms (childAddProduct and childEditProduct) appears with the same name.
How can I prevent the IDE from renaming the existing child form?
Your question is unclear. Is it ASP.net Web Forms or Windows Forms Application Aka Desktop Application ?(talking for Windows Forms) if i understand you right you are trying to add and edit from 1 form. so at that form when you pick data.you can simply change form's name in to editProduct and for Add make form Caption Add new. just place that simple row of code in your methods so program will rename it. Also prove some code.
Due to some restrictions, I think Asp.Net do not allow multiple child forms within the same folder. I have created another folder within Forms folder and then I added the 2nd child form for editing a product and it works.
I am still looking for a perfect answer that can clear the ambiguity that was the reason behind this problem.

Multiple servlets from same HTML page [duplicate]

This question already has answers here:
Multiple submit buttons in the same form calling different Servlets
(6 answers)
Closed 6 years ago.
I am working on a web project. The login HTML page has 5 buttons like search, edit, create, delete, get. There is a text box where I give the string to search/edit/delete from the database. The create button when clicked will be redirected to a new page and a servlet handles the logic for that page. I have a servlet for login page which does the redirection based on button clicks. I have created servlets for the delete, search, edit functionality. However, I don't have separate html pages for the delete, search, get buttons. I used a request dispatcher servlet and am successfully able to enter to those corresponding servlets based on the clicks. But how should my web.xml be for the url mappings? I am using just HTML and Servlets. Also the final output should be displayed based on freemarker template engine. I am getting an error at this point. The freemarker is showing a Class File Error.
Any suggestions on how this should be called?
Disclaimer: I am not an expert at this, but I do know how PHP and Smarty works.
I would think in each respective servlet, you would specify what template you want to use.
request.getRequestDispatcher(TEMPLATE).forward(request, response);
where I earlier determined which .ftl template to use.
There is probably more to what I have done (I don't understand it all, yet) that I have failed to mention.

Internal Link Resolution Issue

I am getting a freak behavior as stated below (The environment is SDL Tridion 2011 SP1 with HotFix Rollup applied):
I have a page - Page 1 - with say following components on it associated thru' different static Templates:
1) Component 1
2) Component 2
3) Component 3
I have another page - Page 2 - with Component 4 on it. Component 4 is having an internal link to Component 1.
Both the pages are published multiple times.
Now my expectation is that the internal link on Page 2 should get resolved at run time to link to Page 1. but this is not happening - This might be simple to crack if this is the only issue - but now the real trouble - If Component 4 on Page 2 is edited to have internal link to Component 2 then everything works fine and internal link on Page 2 correctly points to the Page 1.
Any suggestion or data point that could check?
One thing that I have done is that I have re-positioned the Page from one structure group to another structure group after un-publishing it followed by the publishing of it.
Please note:
1) All the pages and structure group hierarchy is published multiple times
2) All other internal links are working fine
3) If I see the preview mode of these pages, they generate the expected code including the one for internal linking
Any help will be appreciated.
You might need to check your Compoennt Template priorities. Are Components 1 & 2 using the same Component Template on Page 1. Make sure they are not set to "Never Link"
phew...Finally I was able to resolve the issue after checking that everything was correct.
Logically everything seems correct...so I went the illogical way....removed all the reference from pages, re-create the specific component and re-link them in the pages...publish them...and woo hoo...it starts working....remembered the Microsoft way..If your Windows is giving problem...just re-start it :( ... I would love to explore the reason though :(

Resources