Programmatically copy a site?

Hey,

I’m working on a Team APP as an extension of Intranet content.
Is it possible to copy a site programmaticaly with pages parts… ?

My user story is something like:

  • A user on the intranet wants to create a “Team App” for its user.
  • The user goes to the profile page
  • clicks teams
  • enter a “Team name” and clicks the create button.
  • The team room is created from a “Template site”

The user has and shall not have any direct acces to the XP Admin UI.
I want every team to have a site so I can change teams parts, config and pages and have content separated between teams.

//runar

Is it possible to copy a site programmaticaly with pages parts… ?

Yes, just like you can do from the admin, think you will have to invoke the contentService.duplicate in Java though…

If you have a “Template” team site, you could duplicate it first, then update it with proper members etc.

However, not sure if you should duplicate an entire site, or just a part of the tree structure, sound overkill to duplicate all templates and stuff?

1 Like