1

we have a client with a daily import of web contents in their site, and every day, after this import, they must run a staging to transfer the content to the production site.

Is there a way to trigger the staging functionality programmatically?

Thank you in advance, Harry

2 Answers2

1

I think, here is an answer to the question:

We scheduled a staging and we looked at the job entry in the quartz tables. It seems that the class that handles the job is the PersistedQuartzSchedulerEngineInstance and in there there is a call of the method StagingUtil.copyRemoteLayouts that doesn't use any portletrequests in the parameters.

That is exactly what I have been searching for. The only problem is to define the parameters map, that contains all the selections of the UI, when defining a scheduled publish to remote.

This method will trigger a staging by running a background task.

0

There is method available .

StagingLocalServiceUtil.enableLocalStaging(long userId, Group
 liveGroup, boolean branchingPublic, boolean branchingPrivate, ServiceContext serviceContext)

As per docs Explanation of Parameters:

userId : It is current userId.

liveGroup : It is group(site) object for that you need to enable staging feature.

branchingPublic : set this to true if you want to enable page versioning for the public pages.

branchingPrivate: set this to true if you want to enable page versioning for the private pages.

Parth Ghiya
  • 6,929
  • 2
  • 30
  • 37
  • Thank you Parth for your answer. I had a look at the liferay sources for this method, and it seems to enable the staging for the group, not trigger the staging. I need a way to trigger the staging functionality. – Charalampos Chrysikopoulos Apr 11 '17 at 13:47