From 51ad7458b4f3e28c8090199d8079ad3655ea81fa Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Sun, 22 Jan 2023 01:31:59 -0500 Subject: [PATCH] Updates /connector/sharepoint/restore.go Issue #2169: Connects the restore pipeline for sharepoint pages. Comments also updated for SharePoint Pages. --- src/internal/connector/sharepoint/restore.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/internal/connector/sharepoint/restore.go b/src/internal/connector/sharepoint/restore.go index 739dd89fd..59d71d8a3 100644 --- a/src/internal/connector/sharepoint/restore.go +++ b/src/internal/connector/sharepoint/restore.go @@ -77,11 +77,14 @@ func RestoreCollections( errUpdater, ) case path.PagesCategory: - errorMessage := fmt.Sprintf("restore of %s not supported", dc.FullPath().Category()) - logger.Ctx(ctx).Error(errorMessage) - - return nil, errors.New(errorMessage) - + metrics, canceled = RestorePageCollection( + ctx, + service, + dc, + dest.ContainerName, + deets, + errUpdater, + ) default: return nil, errors.Errorf("category %s not supported", dc.FullPath().Category()) } @@ -271,6 +274,10 @@ func RestoreListCollection( } } +// RestorePageCollection handles restoration of an individual site page collection. +// returns: +// - the collection's item and byte count metrics +// - the context cancellation station. True iff context is canceled. func RestorePageCollection( ctx context.Context, service graph.Servicer, @@ -340,6 +347,8 @@ func RestorePageCollection( } } +// restoreSitePage handles the restoration of single site page to SharePoint. +// The new M365ID is placed within the details.ItemInfo func restoreSitePage( ctx context.Context, service graph.Servicer,