Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Custom scheduleActivationWorkflow issue

Avatar

Level 2

Hi All,

We have created custom scheduleActivationWorkflow by copying the existing scheduleActivationWorkflow.

We customized the manage publication wizard to show our workflow when we schedue activation.

Vanitha_Duraisamy_0-1700015108262.png

This workflow works fine, we are able to schedule the activation time.

Issue - It is not showing the below message when a page is subjected to our custom scheduled activation workflow.

OOTB Workflow:

Vanitha_Duraisamy_1-1700015300515.png

Custom Workflow

Vanitha_Duraisamy_2-1700015530117.png

This is not showing the Publication Pending message, but the functionality works fine.

@Vijayalakshmi_S  @arunpatidar @Suraj_Kamdi 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Vanitha_Duraisamy 

 

Please refer to /libs/cq/gui/components/coral/admin/page/columnpreview/columnpreview.jsp

This file returns the html which renders the information about the page.

 

        List<Workflow> scheduledWorkflows = PublicationStatusUtils.getScheduledWorkflows(workflowStatus);
        if (scheduledWorkflows.size() > 0) {
            List<PublicationStatusUtils.ScheduledStatus> scheduledStatusPublish = PublicationStatusUtils.getScheduledStatus(scheduledWorkflows, resourceResolver, AGENT_ID_PUBLISH);
            if (scheduledStatusPublish.size() > 0) {
                %><coral-columnview-preview-label>&nbsp;</coral-columnview-preview-label><%
                %><coral-columnview-preview-value><br><%
                    for (PublicationStatusUtils.ScheduledStatus sInfo : scheduledStatusPublish) {
                        %><%= xssAPI.encodeForHTML(i18n.get(sInfo.isPublishPending() ? "Publication Pending":"Un-publication Pending")) %><br><%
                        %><%= i18n.get("Version") %>: <%= xssAPI.encodeForHTML(sInfo.getVersion()) %><br><%
                        OffsetDateTime odt = sInfo.getOffsetDateTime();
                        if (odt != null) {
                          %><%= i18n.get("Scheduled") %>: <foundation-time value="<%= xssAPI.encodeForHTMLAttr(odt.toString()) %>" format="short" type="datetime"></foundation-time><br><%
                        }
                        %>(<%= xssAPI.encodeForHTML(sInfo.getAuthorizableName()) %>)<br><%
                    }
                %></coral-columnview-preview-value><%
            }
        }

 You would need to explore "PublicationStatusUtils.getScheduledWorkflows" API or customize the JSP to get the desired results


Aanchal Sikka

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hello @Vanitha_Duraisamy 

 

Please refer to /libs/cq/gui/components/coral/admin/page/columnpreview/columnpreview.jsp

This file returns the html which renders the information about the page.

 

        List<Workflow> scheduledWorkflows = PublicationStatusUtils.getScheduledWorkflows(workflowStatus);
        if (scheduledWorkflows.size() > 0) {
            List<PublicationStatusUtils.ScheduledStatus> scheduledStatusPublish = PublicationStatusUtils.getScheduledStatus(scheduledWorkflows, resourceResolver, AGENT_ID_PUBLISH);
            if (scheduledStatusPublish.size() > 0) {
                %><coral-columnview-preview-label>&nbsp;</coral-columnview-preview-label><%
                %><coral-columnview-preview-value><br><%
                    for (PublicationStatusUtils.ScheduledStatus sInfo : scheduledStatusPublish) {
                        %><%= xssAPI.encodeForHTML(i18n.get(sInfo.isPublishPending() ? "Publication Pending":"Un-publication Pending")) %><br><%
                        %><%= i18n.get("Version") %>: <%= xssAPI.encodeForHTML(sInfo.getVersion()) %><br><%
                        OffsetDateTime odt = sInfo.getOffsetDateTime();
                        if (odt != null) {
                          %><%= i18n.get("Scheduled") %>: <foundation-time value="<%= xssAPI.encodeForHTMLAttr(odt.toString()) %>" format="short" type="datetime"></foundation-time><br><%
                        }
                        %>(<%= xssAPI.encodeForHTML(sInfo.getAuthorizableName()) %>)<br><%
                    }
                %></coral-columnview-preview-value><%
            }
        }

 You would need to explore "PublicationStatusUtils.getScheduledWorkflows" API or customize the JSP to get the desired results


Aanchal Sikka

Avatar

Level 2

Hi @aanchal-sikka

I don't find this package in uber jar 6.5

com.adobe.cq.ui.commons.admin.views.PublicationStatusUtils

It is there for 6.3 uber jar versions only.

https://jar-download.com/artifacts/com.adobe.aem/uber-jar/6.3.3/source-code/com/adobe/cq/ui/commons/...

So I couldn't extend this class in our site.