Class PackageController
The PackageController class provides the business class for the packages.
Implements
Inherited Members
Namespace: DotNetNuke.Services.Installer.Packages
Assembly: DotNetNuke.dll
Syntax
public class PackageController : ServiceLocator<IPackageController, PackageController>, IPackageController
Methods
| Improve this Doc View SourceAddPackage(PackageInfo, Boolean)
The PackageController class provides the business class for the packages.
Declaration
public static int AddPackage(PackageInfo package, bool includeDetail)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package | |
System.Boolean | includeDetail |
Returns
Type | Description |
---|---|
System.Int32 |
CanDeletePackage(PackageInfo, PortalSettings)
The PackageController class provides the business class for the packages.
Declaration
public static bool CanDeletePackage(PackageInfo package, PortalSettings portalSettings)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package | |
PortalSettings | portalSettings |
Returns
Type | Description |
---|---|
System.Boolean |
DeleteExtensionPackage(PackageInfo)
DeleteExtensionPackage is used to remove an Extension Package for the System.
Declaration
public void DeleteExtensionPackage(PackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package | The Package you wish to delete. |
DeletePackage(PackageInfo)
The PackageController class provides the business class for the packages.
Declaration
public static void DeletePackage(PackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package |
DeletePackage(Int32)
The PackageController class provides the business class for the packages.
Declaration
public static void DeletePackage(int packageID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | packageID |
GetExtensionPackage(Int32, Func<PackageInfo, Boolean>, Boolean)
GetExtensionPackage is used to retrieve a specific package from the data store.
Declaration
public PackageInfo GetExtensionPackage(int portalId, Func<PackageInfo, bool> predicate, bool useCopy)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Id of the portal. Most extension packages do not belong to a specific portal so in most situations developers will need to pass -1 to indicate this. The main situation where the portal Id will have a specific value is for skins which have been installed for a spcific portal/site. |
Func<PackageInfo, System.Boolean> | predicate | The "search criteria" to use to identify the extension package to retrieve. In most cases this will be a simple lambda method e.g. p => p.Name == "Name". |
System.Boolean | useCopy | Whether use a copy of the package info object. |
Returns
Type | Description |
---|---|
PackageInfo | The extension package. |
GetExtensionPackage(Int32, Func<PackageInfo, Boolean>)
GetExtensionPackage is used to retrieve a specific package from the data store.
Declaration
public PackageInfo GetExtensionPackage(int portalId, Func<PackageInfo, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Id of the portal. Most extension packages do not belong to a specific portal so in most situations developers will need to pass -1 to indicate this. The main situation where the portal Id will have a specific value is for skins which have been installed for a spcific portal/site. |
Func<PackageInfo, System.Boolean> | predicate | The "search criteria" to use to identify the extension package to retrieve. In most cases this will be a simple lambda method e.g. p => p.Name == "Name". |
Returns
Type | Description |
---|---|
PackageInfo | The extension package. |
GetExtensionPackages(Int32, Func<PackageInfo, Boolean>)
GetExtensionPackages is used to retrieve packages from the data store.
Declaration
public IList<PackageInfo> GetExtensionPackages(int portalId, Func<PackageInfo, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Id of the portal. Most extension packages do not belong to a specific portal so in most situations developers will need to pass -1 to indicate this. The main situation where the portal Id will have a specific value is for skins which have been installed for a spcific portal/site. |
Func<PackageInfo, System.Boolean> | predicate | The "search criteria" to use to identify the extension packages to retrieve. In most cases this will be a simple lambda method e.g. p => p.PackageType == "Module". |
Returns
Type | Description |
---|---|
IList<PackageInfo> | A list of extension packages. |
GetExtensionPackages(Int32)
GetExtensionPackages is used to retrieve packages from the data store.
Declaration
public IList<PackageInfo> GetExtensionPackages(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Id of the portal. Most extension packages do not belong to a specific portal so in most situations developers will need to pass -1 to indicate this. The main situation where the portal Id will have a specific value is for skins which have been installed for a spcific portal/site. |
Returns
Type | Description |
---|---|
IList<PackageInfo> | A list of extension packages. |
GetExtensionPackageType(Func<PackageType, Boolean>)
GetExtensionPackage is used to retrieve a specific package type from the data store.
Declaration
public PackageType GetExtensionPackageType(Func<PackageType, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<PackageType, System.Boolean> | predicate | The "search criteria" to use to identify the package type to retrieve. In most cases this will be a simple lambda method e.g. t => t.PackageType == "Modules". |
Returns
Type | Description |
---|---|
PackageType | A package type. |
GetExtensionPackageTypes()
GetExtensionPackageTypes is used to retrieve package types from the data store.
Declaration
public IList<PackageType> GetExtensionPackageTypes()
Returns
Type | Description |
---|---|
IList<PackageType> | A list of package types. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<IPackageController> GetFactory()
Returns
Type | Description |
---|---|
Func<IPackageController> | A factory function. |
Overrides
GetModulePackagesInUse(Int32, Boolean)
The PackageController class provides the business class for the packages.
Declaration
public static IDictionary<int, PackageInfo> GetModulePackagesInUse(int portalID, bool forHost)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID | |
System.Boolean | forHost |
Returns
Type | Description |
---|---|
IDictionary<System.Int32, PackageInfo> |
GetPackage(Int32, Boolean)
The PackageController class provides the business class for the packages.
Declaration
public static PackageInfo GetPackage(int packageID, bool ignoreCache)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | packageID | |
System.Boolean | ignoreCache |
Returns
Type | Description |
---|---|
PackageInfo |
GetPackage(Int32)
The PackageController class provides the business class for the packages.
Declaration
public static PackageInfo GetPackage(int packageID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | packageID |
Returns
Type | Description |
---|---|
PackageInfo |
GetPackageByName(Int32, String)
The PackageController class provides the business class for the packages.
Declaration
public static PackageInfo GetPackageByName(int portalId, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | |
System.String | name |
Returns
Type | Description |
---|---|
PackageInfo |
GetPackageByName(String)
The PackageController class provides the business class for the packages.
Declaration
public static PackageInfo GetPackageByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
PackageInfo |
GetPackageDependencies(Func<PackageDependencyInfo, Boolean>)
Get the dependencies for a package.
Declaration
public IList<PackageDependencyInfo> GetPackageDependencies(Func<PackageDependencyInfo, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<PackageDependencyInfo, System.Boolean> | predicate |
Returns
Type | Description |
---|---|
IList<PackageDependencyInfo> | A List of PackageDependencyInfo objects. |
GetPackages()
The PackageController class provides the business class for the packages.
Declaration
public static List<PackageInfo> GetPackages()
Returns
Type | Description |
---|---|
List<PackageInfo> |
GetPackages(Int32)
The PackageController class provides the business class for the packages.
Declaration
public static List<PackageInfo> GetPackages(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId |
Returns
Type | Description |
---|---|
List<PackageInfo> |
GetPackagesByType(Int32, String)
The PackageController class provides the business class for the packages.
Declaration
public static List<PackageInfo> GetPackagesByType(int portalId, string type)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | |
System.String | type |
Returns
Type | Description |
---|---|
List<PackageInfo> |
GetPackagesByType(String)
The PackageController class provides the business class for the packages.
Declaration
public static List<PackageInfo> GetPackagesByType(string type)
Parameters
Type | Name | Description |
---|---|---|
System.String | type |
Returns
Type | Description |
---|---|
List<PackageInfo> |
GetPackageType(String)
The PackageController class provides the business class for the packages.
Declaration
public static PackageType GetPackageType(string type)
Parameters
Type | Name | Description |
---|---|---|
System.String | type |
Returns
Type | Description |
---|---|
PackageType |
GetPackageTypes()
The PackageController class provides the business class for the packages.
Declaration
public static List<PackageType> GetPackageTypes()
Returns
Type | Description |
---|---|
List<PackageType> |
ParsePackage(String, String, Dictionary<String, PackageInfo>, List<String>)
The PackageController class provides the business class for the packages.
Declaration
public static void ParsePackage(string file, string installPath, Dictionary<string, PackageInfo> packages, List<string> invalidPackages)
Parameters
Type | Name | Description |
---|---|---|
System.String | file | |
System.String | installPath | |
Dictionary<System.String, PackageInfo> | packages | |
List<System.String> | invalidPackages |
SaveExtensionPackage(PackageInfo)
Save or update the package.
Declaration
public void SaveExtensionPackage(PackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package |
SavePackage(PackageInfo)
The PackageController class provides the business class for the packages.
Declaration
public static void SavePackage(PackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package |
UpdatePackage(PackageInfo)
The PackageController class provides the business class for the packages.
Declaration
public static void UpdatePackage(PackageInfo package)
Parameters
Type | Name | Description |
---|---|---|
PackageInfo | package |