활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi All ,
I have a requirement where i want to programatically activate the pages. I need a program which will parse through the pages and check for "replicated" property. If the property is available the pages should get activated after 30 mins automatically. Can you please please tell me how this can be achieved ??
Awaiting your positive response
Regards
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
This would need a custom implementation. I would look at using workflows as part of this solution.
Write code that iterates through pages using JCR API or QueryBuilder API. The when you find a page that meets you criteria, invoke a workflow (that activates the page) using an API. You can invoke workflows programmatically. See:
http://scottsdigitalcommunity.blogspot.ca/2013/09/creating-workflows-for-adobe-experience.html
You may need to write a custom workflow step as well to perform time operations (if you want to wait 30 mins for example)\. However AEM is very flexable in letting you write custom workflow steps. TO learn how to write a custom workflow step that implements , WorkflowProcess see:
https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html
This would need a custom implementation. I would look at using workflows as part of this solution.
Write code that iterates through pages using JCR API or QueryBuilder API. The when you find a page that meets you criteria, invoke a workflow (that activates the page) using an API. You can invoke workflows programmatically. See:
http://scottsdigitalcommunity.blogspot.ca/2013/09/creating-workflows-for-adobe-experience.html
You may need to write a custom workflow step as well to perform time operations (if you want to wait 30 mins for example)\. However AEM is very flexable in letting you write custom workflow steps. TO learn how to write a custom workflow step that implements , WorkflowProcess see:
https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html
Thanks,
Can't this be achieved through schedulers? , can you please elaborate on the procedure ..
조회 수
답글
좋아요 수
The Scheduler is a service that uses a cron expression to schedule other services/jobs. Here is an example [2].
You could run code that runs on a schedule to check for the replicated property, but depending on how many pages you have and how often the job is run, this could place a load on the system.
Regards,
Opkar
[0]https://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html
[1] https://helpx.adobe.com/experience-manager/using/aem-first-components1.html
조회 수
답글
좋아요 수
R.K,
What would be the frequency to look for page property?. And If property
--
조회 수
답글
좋아요 수
Hi
Apart form above mentioned, please find few reference link to help you achieve the needful.
Link:- https://helpx.adobe.com/experience-manager/kb/CQ5ReplicateToSpecificAgents.html
//How to activate to a specific replication agent.
Link:- http://www.sotheanim.com/21-how-to-programmatically-activate-cq-page
//How to programmatically activate CQ Page
Link:- http://stackoverflow.com/questions/18955982/how-to-activate-programmatically-a-page-in-cq5-workflow
//
Use Replicator OSGi service:
@Component
public class MyComponent {
@Reference
private Replicator replicator;
private void activatePage(Session session) {
//...
replicator.replicate(session, ReplicationActionType.ACTIVATE, pathToPage);
//...
}
}
The above stated option is based on Scott's reply another way to do is as mentioned by Opkar Gill,
I hope this would help you.
Thanks and Regards
Kautuk Sahni
조회 수
답글
좋아요 수
Thanks all for your valuable responses.
Basically if replicatedBy property is set , page should get activated after a specific time.
조회 수
답글
좋아요 수
I have one more query , for "import com.day.cq.replication.Replicator;" which dependency should be added to pom.xml ?? As i am getting package not found error. I have included many dependencies it is not at all taking..
조회 수
답글
좋아요 수
Use AEM dependency finder to locate POM dependencies you need to reference.
http://blog.behrang.org/blog/2014/03/11/aem-dependency-finder/
조회 수
답글
좋아요 수
Add this, it will work
<dependency>
<groupId>com.day.cq</groupId>
<artifactId>cq-replication</artifactId>
<version>5.4.2</version>
<scope>provided</scope>
</dependency>
조회 수
답글
좋아요 수
Hi
Please refer to this link:- https://maven-repository.com/artifact/com.day.cq/cq-replication
Click to the specific version that you would want, you would get the dependency code there.
Link:- https://maven-repository.com/artifact/com.day.cq/cq-replication/5.4.2
<dependency><groupId>com.day.cq</groupId><artifactId>cq-replication</artifactId><version>5.4.2</version></dependency>
I hope this would help you.
Thanks and Regards
Kautuk Sahni
조회 수
답글
좋아요 수
Hi can you tell how I can replicate an asset from one path to different path with using
getReplicator().replicate(workflowSession.getSession(), ReplicationActionType.ACTIVATE,
payload, opts);
조회 수
답글
좋아요 수