Change PublicationWorkflow XWiki publication path of a page after moving page to another location

Hello everyone,

I have a question. In our installation of XWiki we use the PublicationWorkflow. But now I have a question about the behavior of this and how I can change the path where a document is published.

I have a published page (let’s call it page A). The draft (page B) belongs to this page. Page A is currently published via the PublicationWorkflow and page B is congruent with it.

Using the XWiki function (move/rename), I have moved page A to another location; page B as well. If I now edit page B and publish it again, it is published in the old location where page A was.

After copying both pages, how can I ensure that page B is published in the new location where page A is now? I have not been able to find out how to reset the workflow status and select the publishing location again. I could only achieve this by deleting and republishing both pages, but this deleted the links and the history.

How can I do this? Thank you very much.

Regards,
Andreas

Hi,

I don’t know much publication workflow, I suspect that you should be able to do that by editing the page with object editor to change the location, but not sure exactly where.
@acotiuga or @lucaa might probably be able to help you on that.

Hi @pcn_andreas,

When you moved the pages to new locations, the target property in the PublicationWorkflow.PublicationWorkflowClass was not updated to the new value of the published page. As a workaround, for pages already moved, you can manually update the value with the new target location (in both draft and published pages).

Then, to avoid this for other pages you will move, there is a move strategy feature in the workflow page that allows you to select what to happen when a draft or a published page should do. Check the documentation of the Move strategy options: https://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki%20Publication%20Workflow%20Application#HConfiguration

Hope it helps,
Alex

1 Like

So if I understand correctly, I set the move strategy to this “Regardless of the type of document being moved, move its equivalent document(s)” and if I then move the published version and move the version in the draft area, the target location is automatically updated on both documents?

And if that doesn’t work for whatever reason, I can simply overwrite the target manually (see photo).

publicationworkflow_target

Is it important to always specify the target with the addition .WebHome, or can this be omitted?

The current implementation moves the corresponding page along with the current page only inside the spaces defined in the workflow.
For example, spaces Draft and Target:

  • if Target.PageA is moved to Published.PageA, the workflow doesn’t have any details about the new space to move drafts and it won’t move the corresponding draft
  • If Target.PageA is moved to Target.PageB, then the Draft.PageA will also be moved to Draft.PageB and the target property will be updated in the draft.
1 Like