Updates /connector/sharepoint/restore.go

Issue #2169: Connects the restore pipeline for sharepoint pages. Comments also updated for SharePoint Pages.
This commit is contained in:
Danny Adams 2023-01-22 01:31:59 -05:00
parent 018a57cb30
commit 51ad7458b4

View File

@ -77,11 +77,14 @@ func RestoreCollections(
errUpdater, errUpdater,
) )
case path.PagesCategory: case path.PagesCategory:
errorMessage := fmt.Sprintf("restore of %s not supported", dc.FullPath().Category()) metrics, canceled = RestorePageCollection(
logger.Ctx(ctx).Error(errorMessage) ctx,
service,
return nil, errors.New(errorMessage) dc,
dest.ContainerName,
deets,
errUpdater,
)
default: default:
return nil, errors.Errorf("category %s not supported", dc.FullPath().Category()) 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( func RestorePageCollection(
ctx context.Context, ctx context.Context,
service graph.Servicer, 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( func restoreSitePage(
ctx context.Context, ctx context.Context,
service graph.Servicer, service graph.Servicer,