Class ContentController
Implements
Inherited Members
Namespace: DotNetNuke.Entities.Content
Assembly: DotNetNuke.dll
Syntax
public class ContentController : ServiceLocator<IContentController, ContentController>, IContentController
Constructors
| Improve this Doc View SourceContentController()
Initializes a new instance of the ContentController class.
Declaration
public ContentController()
ContentController(IDataService)
Initializes a new instance of the ContentController class.
Declaration
public ContentController(IDataService dataService)
Parameters
Type | Name | Description |
---|---|---|
IDataService | dataService | The data service. |
Methods
| Improve this Doc View SourceAddContentItem(ContentItem)
Adds the content item.
Declaration
public int AddContentItem(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
Returns
Type | Description |
---|---|
System.Int32 | content item id. |
AddMetaData(ContentItem, String, String)
Adds the meta data.
Declaration
public void AddMetaData(ContentItem contentItem, string name, string value)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.String | name | The name. |
System.String | value | The value. |
DeleteContentItem(ContentItem)
Deletes the content item.
Declaration
public void DeleteContentItem(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
DeleteContentItem(Int32)
Delete a ContentItem object by ID.
Declaration
public void DeleteContentItem(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The ID of the ContentItem object (ContentItemId). |
DeleteMetaData(ContentItem, String, String)
Deletes the meta data.
Declaration
public void DeleteMetaData(ContentItem contentItem, string name, string value)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.String | name | The name. |
System.String | value | The value. |
DeleteMetaData(ContentItem, String)
Similar to DeleteMetaData that requires a value, but this one looks it up for you.
Declaration
public void DeleteMetaData(ContentItem contentItem, string name)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | |
System.String | name |
GetContentItem(Int32)
Gets the content item.
Declaration
public ContentItem GetContentItem(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
ContentItem | content item. |
GetContentItems(Int32, Int32, Int32)
Declaration
public IQueryable<ContentItem> GetContentItems(int contentTypeId, int tabId, int moduleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentTypeId | |
System.Int32 | tabId | |
System.Int32 | moduleId |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> |
GetContentItemsByContentType(ContentType)
Get a list of content items by ContentType.
Declaration
public IQueryable<ContentItem> GetContentItemsByContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | The Content Type of the content items we want to query. |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByContentType(Int32)
Get a list of content items by ContentType ID.
Declaration
public IQueryable<ContentItem> GetContentItemsByContentType(int contentTypeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentTypeId | The Content Type ID of the content items we want to query. |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByModuleId(Int32)
Retrieve all content items associated with the specified module ID, moduleId
.
Declaration
public IQueryable<ContentItem> GetContentItemsByModuleId(int moduleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | moduleId | The module ID to use in the content item lookup. |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByTabId(Int32)
Retrieve all content items on the specified page (tab).
Declaration
public IQueryable<ContentItem> GetContentItemsByTabId(int tabId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tabId | The page ID to use in the lookup of content items. |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByTerm(Term)
Return ContentItems that have the specified term attached.
Declaration
public IQueryable<ContentItem> GetContentItemsByTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByTerm(String)
Return ContentItems that have the specified term attached.
Declaration
public IQueryable<ContentItem> GetContentItemsByTerm(string term)
Parameters
Type | Name | Description |
---|---|---|
System.String | term |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByTerms(IList<Term>)
Return a list of ContentItems that have all of the specified terms attached.
Declaration
public IQueryable<ContentItem> GetContentItemsByTerms(IList<Term> terms)
Parameters
Type | Name | Description |
---|---|---|
IList<Term> | terms | A list of terms that should be attached to the ContentItems returned. |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByTerms(String[])
Return a list of ContentItems that have all of the specified terms attached.
Declaration
public IQueryable<ContentItem> GetContentItemsByTerms(string[] terms)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | terms |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetContentItemsByVocabularyId(Int32)
Get a list of content items tagged with terms from the specified Vocabulary ID.
Declaration
public IQueryable<ContentItem> GetContentItemsByVocabularyId(int vocabularyId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vocabularyId |
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | A queryable sequence of ContentItem instances. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<IContentController> GetFactory()
Returns
Type | Description |
---|---|
Func<IContentController> | A factory function. |
Overrides
GetMetaData(Int32)
Gets the meta data.
Declaration
public NameValueCollection GetMetaData(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
NameValueCollection | A |
GetUnIndexedContentItems()
Gets the un indexed content items.
Declaration
public IQueryable<ContentItem> GetUnIndexedContentItems()
Returns
Type | Description |
---|---|
IQueryable<ContentItem> | content item collection. |
UpdateContentItem(ContentItem)
Updates the content item.
Declaration
public void UpdateContentItem(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |