Scheduled content publishing functionality

Hi, do you have a possibility to auto-publish prepeared content at exact date?

Hello

Scheduled publishing is in the backlog, @tsi can say more specific about spec and which version / date it will be available. If I am not mistaken it will be a seperate widget application that handles publishing. See also: Task plugin in Enonic XP

Temporary workaround would be adding your own xtra data with mixins with date and handle publishing in a Scheduler in Java that uses ContentService (beta) API , but I don’t think we have an implemented example of this anywhere. Some leads below:

private ContentService contentService;
...
final PushContentParams pushContentParams = PushContentParams.create().contentIds(ContentIds.from(contentId)).target(Branch.from("master")).build();
contentService.publish(pushContentParams);
...
@Reference
public void setContentService( final ContentService contentService )
{
    this.contentService = contentService;
}
1 Like

During the investigation of “scheduler workaround” I have found such strange behaviour in PushContentCommand.java (v6.6.0):

private void doPushNodes( final NodeIds nodesToPush )
{
    if ( nodesToPush.isEmpty() )
    {
        return;
    }

    final PushNodesResult pushNodesResult = nodeService.push( nodesToPush, this.target );

    final Contents publishedContents = translator.fromNodes( pushNodesResult.getSuccessful(), false );
    this.resultBuilder.setPushed( publishedContents );
}

After you have pushed nodes you are getting result as PushNodesResult, then you process succeded nodes as resultBuilder.setPushed(publishedContents), but by some reason do nothing with pushNodesResult.getFailed() and don’t send it anywhere.

Found it when tried to push content programmatically and got PushContentsResult with all three empty collections and no exceptions in logs.

I’ve noticed before that if a content fails to publish due to lack of user permissions then it is not listed in the failed array. I reported this a while ago but maybe it hasn’t been fixed yet. Can you check if any content failed to publish due to user permissions?

I have checked and yes - it’s.

Any updates regarding Scheduled publishing?

First version of scheduling of content is ETA 6.9

1 Like