Class ListController
Provides access to Dnn Lists.
Inheritance
Namespace: DotNetNuke.Common.Lists
Assembly: DotNetNuke.dll
Syntax
public class ListController : object
Constructors
| Improve this Doc View SourceListController()
Initializes a new instance of the ListController class.
Declaration
public ListController()
ListController(IEventLogger)
Initializes a new instance of the ListController class.
Declaration
public ListController(IEventLogger eventLogger)
Parameters
Type | Name | Description |
---|---|---|
IEventLogger | eventLogger | An event logger. |
Fields
| Improve this Doc View SourceNonLocalizedLists
The list of list types that are not localized.
Declaration
public readonly string[] NonLocalizedLists
Field Value
Type | Description |
---|---|
System.String[] |
Properties
| Improve this Doc View SourceUnLocalizedLists
Gets the lists that do not support localization.
Declaration
public IReadOnlyCollection<string> UnLocalizedLists { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<System.String> |
Methods
| Improve this Doc View SourceAddListEntry(ListEntryInfo)
Adds a new list entry to the database. If the current thread locale is not "en-US" then the text value will also be persisted to a resource file under App_GlobalResources using the list's name and the value as key.
Declaration
public int AddListEntry(ListEntryInfo listEntry)
Parameters
Type | Name | Description |
---|---|---|
ListEntryInfo | listEntry | The list entry. |
Returns
Type | Description |
---|---|
System.Int32 | The entry id. |
DeleteList(ListInfo, Boolean)
Deletes a list.
Declaration
public void DeleteList(ListInfo list, bool includeChildren)
Parameters
Type | Name | Description |
---|---|---|
ListInfo | list | The ListInfo reference for the list to delete. |
System.Boolean | includeChildren | A value indicating wheter to also delete the children items for this list. |
DeleteList(String, String, Int32)
Deletes a list.
Declaration
public void DeleteList(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to delete. |
System.String | parentKey | The parent key of the list to delete. |
System.Int32 | portalId | The id of the site (portal) on which to delete the list. |
DeleteList(String, String)
Deletes a list.
Declaration
public void DeleteList(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to delete. |
System.String | parentKey | The parent key for the list to delete. |
DeleteListEntryByID(Int32, Boolean)
Deletes a list entry.
Declaration
public void DeleteListEntryByID(int entryId, bool deleteChild)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | entryId | the id of the entry to delete. |
System.Boolean | deleteChild | A value indicating whether to also delete the children of that item. |
DeleteListEntryByListName(String, String, Boolean)
Deletes a list entry by its name.
Declaration
public void DeleteListEntryByListName(string listName, string listValue, bool deleteChild)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list entry. |
System.String | listValue | The value of the list entry. |
System.Boolean | deleteChild | A value indicating whether to also delete the children of that item. |
GetListEntryInfo(Int32)
Gets a list entry information.
Declaration
public ListEntryInfo GetListEntryInfo(int entryId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | entryId | The id of the list entry. |
Returns
Type | Description |
---|---|
ListEntryInfo |
GetListEntryInfo(String, Int32)
Gets a list entry information.
Declaration
public ListEntryInfo GetListEntryInfo(string listName, int entryId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
System.Int32 | entryId | The id of the list entry. |
Returns
Type | Description |
---|---|
ListEntryInfo |
GetListEntryInfo(String, String)
Gets a list entry information.
Declaration
public ListEntryInfo GetListEntryInfo(string listName, string listValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
System.String | listValue | The value of the list entry. |
Returns
Type | Description |
---|---|
ListEntryInfo |
GetListEntryInfoCollection(String, String, Int32)
Gets a collection of list entries.
Declaration
public ListEntryInfoCollection GetListEntryInfoCollection(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
System.String | parentKey | The parent key. |
System.Int32 | portalId | The id of the site (portal) to get the list from. |
Returns
Type | Description |
---|---|
ListEntryInfoCollection | A collection of list entries. |
GetListEntryInfoCollection(String, String)
Gets a collection of list entries.
Declaration
public ListEntryInfoCollection GetListEntryInfoCollection(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
System.String | parentKey | The parent key. |
Returns
Type | Description |
---|---|
ListEntryInfoCollection | A collection of list entries. |
GetListEntryInfoCollection(String)
Gets a collection of list entries.
Declaration
public ListEntryInfoCollection GetListEntryInfoCollection(string listName)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
Returns
Type | Description |
---|---|
ListEntryInfoCollection | A collection of list entries. |
GetListEntryInfoDictionary(String, String, Int32)
Gets all list entries for a given list name.
Declaration
public Dictionary<string, ListEntryInfo> GetListEntryInfoDictionary(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
System.String | parentKey | The parent key. |
System.Int32 | portalId | The id of the site (portal) from which to get the list entries from. |
Returns
Type | Description |
---|---|
Dictionary<System.String, ListEntryInfo> | A dictionary where the index is Key and the value is the actual ListEntryInfo. |
GetListEntryInfoDictionary(String, String)
Gets all list entries for a given list name.
Declaration
public Dictionary<string, ListEntryInfo> GetListEntryInfoDictionary(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
System.String | parentKey | The parent key. |
Returns
Type | Description |
---|---|
Dictionary<System.String, ListEntryInfo> | A dictionary where the index is Key and the value is the actual ListEntryInfo. |
GetListEntryInfoDictionary(String)
Gets all list entries for a given list name.
Declaration
public Dictionary<string, ListEntryInfo> GetListEntryInfoDictionary(string listName)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list to get. |
Returns
Type | Description |
---|---|
Dictionary<System.String, ListEntryInfo> | A dictionary where the index is Key and the value is the actual ListEntryInfo. |
GetListEntryInfoItems(String, String, Int32)
Gets the entries in a child list.
Declaration
public IEnumerable<ListEntryInfo> GetListEntryInfoItems(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The list name. |
System.String | parentKey | The parent key. |
System.Int32 | portalId | The id of the site (portal) from which to get the list from. |
Returns
Type | Description |
---|---|
IEnumerable<ListEntryInfo> | An enumeration of list entries. |
GetListEntryInfoItems(String, String)
Gets the entries in a child list.
Declaration
public IEnumerable<ListEntryInfo> GetListEntryInfoItems(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The list name. |
System.String | parentKey | The parent key. |
Returns
Type | Description |
---|---|
IEnumerable<ListEntryInfo> | An enumeration of list entries. |
GetListEntryInfoItems(String)
Gets the entries in the list with the given listName
.
Declaration
public IEnumerable<ListEntryInfo> GetListEntryInfoItems(string listName)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
Returns
Type | Description |
---|---|
IEnumerable<ListEntryInfo> | An enumeration of list entries. |
GetListInfo(String, String, Int32)
Gets a single list.
Declaration
public ListInfo GetListInfo(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
System.String | parentKey | The parent key. |
System.Int32 | portalId | The id of the site (portal) to get the list from. |
Returns
Type | Description |
---|---|
ListInfo |
GetListInfo(String, String)
Gets a single list.
Declaration
public ListInfo GetListInfo(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
System.String | parentKey | The parent key. |
Returns
Type | Description |
---|---|
ListInfo |
GetListInfo(String)
Gets a single list.
Declaration
public ListInfo GetListInfo(string listName)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The name of the list. |
Returns
Type | Description |
---|---|
ListInfo |
GetListInfoCollection()
Gets a collection of lists.
Declaration
public ListInfoCollection GetListInfoCollection()
Returns
Type | Description |
---|---|
ListInfoCollection |
GetListInfoCollection(String, String, Int32)
Gets a collection of lists.
Declaration
public ListInfoCollection GetListInfoCollection(string listName, string parentKey, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The list name. |
System.String | parentKey | The parent key. |
System.Int32 | portalId | The id of the site (portal) to get the list from. |
Returns
Type | Description |
---|---|
ListInfoCollection |
GetListInfoCollection(String, String)
Gets a collection of lists.
Declaration
public ListInfoCollection GetListInfoCollection(string listName, string parentKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The list name. |
System.String | parentKey | The parent key. |
Returns
Type | Description |
---|---|
ListInfoCollection |
GetListInfoCollection(String)
Gets a collection of lists.
Declaration
public ListInfoCollection GetListInfoCollection(string listName)
Parameters
Type | Name | Description |
---|---|---|
System.String | listName | The list name. |
Returns
Type | Description |
---|---|
ListInfoCollection |
UpdateListEntry(ListEntryInfo)
Updates the list entry in the database using the values set on the listEntry. Note that if the current thread locale is not "en-US" then the text value will be persisted to a resource file under App_GlobalResources using the list's name and the value as key. Also the supplied text value will not be written to the database in this case (i.e. we expect the text value in the database to be the en-US text value).
Declaration
public void UpdateListEntry(ListEntryInfo listEntry)
Parameters
Type | Name | Description |
---|---|---|
ListEntryInfo | listEntry | The list entry info item to update. |
UpdateListSortOrder(Int32, Boolean)
Updates a list sort order.
Declaration
public void UpdateListSortOrder(int entryID, bool moveUp)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | entryID | The id of the entry to move. |
System.Boolean | moveUp | The entry is moved up if |