C# Class Rock.Services.NuGet.PackageService

Facade class to provide intaraction with NuGet internals
ファイルを表示 Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
ExportPage ( Page page, bool isRecursive ) : MemoryStream

Exports the page.

ImportPage ( byte uploadedPackage, string fileName, int pageId, int siteId ) : bool

Imports the page.

PackageService ( ) : System

Initializes a new instance of the PackageService class.

Private Methods

Method Description
AddToManifest ( Manifest manifest, string directory, string webRootPath, string filterPattern = "*.*", SearchOption searchOption = SearchOption.AllDirectories ) : void

Add the given directories files (matching the given file filter and search options) to the manifest.

CreatePackageDirectory ( string pageName, string packageId ) : DirectoryInfo

Creates a unique directory for temporarily holding the page export package.

ExpandFiles ( IEnumerable packageFiles ) : void

Expands the files.

FindNewBlockTypes ( Page page, IEnumerable installedBlockTypes ) : IEnumerable

Iterates recursively through all BlockTypes associated with a Page and its children and compares them with the list of BlockTypes that are currently installed.

FindUniqueBlockTypesAndDirectories ( Page page, bool isRecursive, BlockType>.Dictionary blockTypes, string>.Dictionary directories ) : void

Finds the unique block types and directories for the given page and adds them to the blockTypes and directories dictionaries.

GetJson ( Page page, bool isRecursive ) : string

Gets the json for this page.

SavePages ( RockContext rockContext, Page page, IEnumerable newBlockTypes, int parentPageId, int siteId ) : void

Recursively saves Pages and associated Blocks, PageRoutes and PageContexts.

ScrubIds ( IEntity entity ) : void
ValidateImportData ( Page page, IEnumerable newBlockTypes ) : void

Validates the import data.

Method Details

ExportPage() public method

Exports the page.
public ExportPage ( Page page, bool isRecursive ) : MemoryStream
page Page The page.
isRecursive bool if set to true [should export children].
return System.IO.MemoryStream

ImportPage() public method

Imports the page.
public ImportPage ( byte uploadedPackage, string fileName, int pageId, int siteId ) : bool
uploadedPackage byte Byte array of the uploaded package
fileName string File name of uploaded package
pageId int The Id of the Page to save new data underneath
siteId int The Id of the Site tha the Page is being imported into
return bool

PackageService() public method

Initializes a new instance of the PackageService class.
public PackageService ( ) : System
return System