Class PackageWriterBase
The PackageWriter class.
Inheritance
Namespace: DotNetNuke.Services.Installer.Writers
Assembly: DotNetNuke.dll
Syntax
public class PackageWriterBase : object
Constructors
| Improve this Doc View SourcePackageWriterBase()
Initializes a new instance of the PackageWriterBase class.
Declaration
protected PackageWriterBase()
PackageWriterBase(PackageInfo)
Initializes a new instance of the PackageWriterBase class.
Declaration
public PackageWriterBase(PackageInfo package)
Parameters
| Type | Name | Description |
|---|---|---|
| PackageInfo | package | The PackageInfo to use to initialize the writer. |
Properties
| Improve this Doc View SourceAppCodeFiles
Gets a Dictionary of AppCodeFiles that should be included in the Package.
Declaration
public Dictionary<string, InstallFile> AppCodeFiles { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, InstallFile> |
AppCodePath
Gets or sets the Path for the Package's app code files.
Declaration
public string AppCodePath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Assemblies
Gets a Dictionary of Assemblies that should be included in the Package.
Declaration
public Dictionary<string, InstallFile> Assemblies { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, InstallFile> |
AssemblyPath
Gets or sets the Path for the Package's assemblies.
Declaration
public string AssemblyPath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
BasePath
Gets or sets the Base Path for the Package.
Declaration
public string BasePath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
CleanUpFiles
Gets a Dictionary of CleanUpFiles that should be included in the Package.
Declaration
public SortedList<string, InstallFile> CleanUpFiles { get; }
Property Value
| Type | Description |
|---|---|
| SortedList<System.String, InstallFile> |
Dependencies
Gets the dependencies.
Declaration
protected virtual Dictionary<string, string> Dependencies { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, System.String> |
Files
Gets a Dictionary of Files that should be included in the Package.
Declaration
public Dictionary<string, InstallFile> Files { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, InstallFile> |
HasProjectFile
Gets or sets a value indicating whether a project file is found in the folder.
Declaration
public bool HasProjectFile { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IncludeAssemblies
Gets a value indicating whether to include Assemblies.
Declaration
public virtual bool IncludeAssemblies { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LegacyError
Gets or sets whether there are any errors in parsing legacy packages.
Declaration
public string LegacyError { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | And sets whether there are any errors in parsing legacy packages. |
Log
Gets the Logger.
Declaration
public Logger Log { get; }
Property Value
| Type | Description |
|---|---|
| Logger |
Package
Gets or sets the associated Package.
Declaration
public PackageInfo Package { get; set; }
Property Value
| Type | Description |
|---|---|
| PackageInfo |
Resources
Gets a Dictionary of Resources that should be included in the Package.
Declaration
public Dictionary<string, InstallFile> Resources { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, InstallFile> |
Scripts
Gets a Dictionary of Scripts that should be included in the Package.
Declaration
public Dictionary<string, InstallFile> Scripts { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, InstallFile> |
Versions
Gets a List of Versions that should be included in the Package.
Declaration
public List<string> Versions { get; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
Methods
| Improve this Doc View SourceAddFile(InstallFile)
Adds a file to the package.
Declaration
public virtual void AddFile(InstallFile file)
Parameters
| Type | Name | Description |
|---|---|---|
| InstallFile | file | The file to add. |
AddFile(String, String)
Adds a file to the package.
Declaration
protected virtual void AddFile(string fileName, string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | Name of the file to use in the package. |
| System.String | sourceFileName | Name of the source file. |
AddFile(String)
Adds a file to the package.
Declaration
protected virtual void AddFile(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | Name of the file to add. |
AddResourceFile(InstallFile)
Adds a resource file to the package.
Declaration
public void AddResourceFile(InstallFile file)
Parameters
| Type | Name | Description |
|---|---|---|
| InstallFile | file | The resource file to add. |
ConvertLegacyManifest(XPathNavigator, XmlWriter)
Converts a legacy manifest to current standards.
Declaration
protected virtual void ConvertLegacyManifest(XPathNavigator legacyManifest, XmlWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| XPathNavigator | legacyManifest | The legacy manifest. |
| XmlWriter | writer | The XML writer to use. |
CreatePackage(String, String, String, Boolean)
Creates a package.
Declaration
public void CreatePackage(string archiveName, string manifestName, string manifest, bool createManifest)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | archiveName | Name of the zip archive to produce. |
| System.String | manifestName | Name of the manifest. |
| System.String | manifest | The manifest content. |
| System.Boolean | createManifest | A value indicating whether to create the manifest. |
GetFiles(Boolean, Boolean)
Gets the files to include in the package.
Declaration
protected virtual void GetFiles(bool includeSource, bool includeAppCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | includeSource | If true, will also include the source code files. |
| System.Boolean | includeAppCode | If true, files in the App_Code folder will also be included. |
GetFiles(Boolean)
Gets the files to include in the package.
Declaration
public void GetFiles(bool includeSource)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | includeSource | If true, the source code files will also be included. |
ParseFiles(DirectoryInfo, String)
Parses the files in a folder.
Declaration
protected virtual void ParseFiles(DirectoryInfo folder, string rootPath)
Parameters
| Type | Name | Description |
|---|---|---|
| DirectoryInfo | folder | The folder to get the files from. |
| System.String | rootPath | The root path to use so the files are relative in the manifest. |
ParseFolder(String, String)
Parses a folder for files recursively.
Declaration
protected virtual void ParseFolder(string folderName, string rootPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | folderName | Name of the folder to parse. |
| System.String | rootPath | The root path so the files are relative in the manifest. |
ParseProjectFile(FileInfo, Boolean)
Parses a project file.
Declaration
protected void ParseProjectFile(FileInfo projFile, bool includeSource)
Parameters
| Type | Name | Description |
|---|---|---|
| FileInfo | projFile | The proj file to parse. |
| System.Boolean | includeSource | If true, the source code files will also be included. |
WriteFilesToManifest(XmlWriter)
Writes the files to the manifest.
Declaration
protected virtual void WriteFilesToManifest(XmlWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XML writer to use. |
WriteManifest(Boolean)
WriteManifest writes the manifest associated with this PackageWriter to a string.
Declaration
public string WriteManifest(bool packageFragment)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | packageFragment | A flag that indicates whether to return the package element
as a fragment (True) or whether to add the outer |
Returns
| Type | Description |
|---|---|
| System.String | The manifest as a string. |
WriteManifest(String, String)
Writes an existing manifest.
Declaration
public void WriteManifest(string manifestName, string manifest)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | manifestName | The name of the manifest file. |
| System.String | manifest | The manifest. |
Remarks
This overload takes a package manifest and writes it to a file.
WriteManifest(XmlWriter, Boolean)
Writes the manifest.
Declaration
public void WriteManifest(XmlWriter writer, bool packageFragment)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The writer to use. |
| System.Boolean | packageFragment | If true, will not write the start and end Xml elements because we are adding only a fragment. |
WriteManifest(XmlWriter, String)
WriteManifest writes a package manifest to an XmlWriter.
Declaration
public void WriteManifest(XmlWriter writer, string manifest)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XmlWriter. |
| System.String | manifest | The manifest. |
Remarks
This overload takes a package manifest and writes it to a Writer.
WriteManifestComponent(XmlWriter)
Writes the manifest component.
Declaration
protected virtual void WriteManifestComponent(XmlWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XML writer to use. |
WriteManifestEndElement(XmlWriter)
Writes the manifest end element (closes the packages and root elements).
Declaration
public static void WriteManifestEndElement(XmlWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XML writer to use. |
WriteManifestStartElement(XmlWriter)
Writes the manifest start elements.
Declaration
public static void WriteManifestStartElement(XmlWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XML writer to use. |