• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class ContentItem

The ContentItem class which itself inherits from BaseEntityInfo paves the way for easily adding support for taxonomy, tagging and other ContentItem dependant features to your DotNetNuke extensions.

Inheritance
System.Object
BaseEntityInfo
ContentItem
DesktopModuleInfo
ModuleInfo
TabInfo
Implements
IHydratable
Inherited Members
BaseEntityInfo.CreatedByUserID
BaseEntityInfo.CreatedOnDate
BaseEntityInfo.LastModifiedByUserID
BaseEntityInfo.LastModifiedOnDate
BaseEntityInfo.CreatedByUser(Int32)
BaseEntityInfo.LastModifiedByUser(Int32)
BaseEntityInfo.CloneBaseProperties(BaseEntityInfo, BaseEntityInfo)
Namespace: DotNetNuke.Entities.Content
Assembly: DotNetNuke.dll
Syntax
public class ContentItem : BaseEntityInfo, IHydratable
Remarks

Content Items are a collection of individual pieces of content in a DotNetNuke site. Each content item is associated with a single Content Type.

Only modules that implement content items (done so by the module developers) can take advantage of some of its benefits, such as Taxonomy.

Because ContentItem already implements IHydratable, you will not do so in your custom entity class. Instead, you will need to create overrides of the KeyID property and the Fill method already implemented in the ContentItem class. Don't forget to call ContentItem's FillInternal method in your Fill method override.

Examples
[Serializable]
public class DesktopModuleInfo : ContentItem, IXmlSerializable
{
        #region IHydratable Members

        public override void Fill(IDataReader dr)
        {
            DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]);
            PackageID = Null.SetNullInteger(dr["PackageID"]);
            ModuleName = Null.SetNullString(dr["ModuleName"]);
            FriendlyName = Null.SetNullString(dr["FriendlyName"]);
            Description = Null.SetNullString(dr["Description"]);
            FolderName = Null.SetNullString(dr["FolderName"]);
            Version = Null.SetNullString(dr["Version"]);
            base.FillInternal(dr);
        }

        #endregion
}

Constructors

| Improve this Doc View Source

ContentItem()

Initializes a new instance of the ContentItem class.

Declaration
public ContentItem()

Properties

| Improve this Doc View Source

Content

Gets or sets the content.

Declaration
public string Content { get; set; }
Property Value
Type Description
System.String

The content.

| Improve this Doc View Source

ContentItemId

Gets or sets the content item id.

Declaration
public int ContentItemId { get; set; }
Property Value
Type Description
System.Int32

The content item id.

| Improve this Doc View Source

ContentKey

Gets or sets the content key.

Declaration
public string ContentKey { get; set; }
Property Value
Type Description
System.String

The content key.

| Improve this Doc View Source

ContentTitle

Gets or sets the title of the ContentItem.

Declaration
public string ContentTitle { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ContentTypeId

Gets or sets the content type id.

Declaration
public int ContentTypeId { get; set; }
Property Value
Type Description
System.Int32

The content type id.

| Improve this Doc View Source

Files

Gets files that are attached to this ContentItem.

Declaration
public List<IFileInfo> Files { get; }
Property Value
Type Description
List<IFileInfo>
| Improve this Doc View Source

Images

Gets images associated with this ContentItem.

Declaration
public List<IFileInfo> Images { get; }
Property Value
Type Description
List<IFileInfo>
| Improve this Doc View Source

Indexed

Gets or sets a value indicating whether this ContentItem is indexed.

Declaration
public bool Indexed { get; set; }
Property Value
Type Description
System.Boolean

true if indexed; otherwise, false.

| Improve this Doc View Source

KeyID

Gets or sets the key ID.

Declaration
public virtual int KeyID { get; set; }
Property Value
Type Description
System.Int32

The key ID.

Remarks

If you derive class has its own key id, please override this property and set the value to your own key id.

| Improve this Doc View Source

Metadata

Gets the metadata.

Declaration
public NameValueCollection Metadata { get; }
Property Value
Type Description
NameValueCollection

metadata collection.

| Improve this Doc View Source

ModuleID

Gets or sets the module ID.

Declaration
public int ModuleID { get; set; }
Property Value
Type Description
System.Int32

The module ID.

| Improve this Doc View Source

StateID

Gets or sets the Content Workflow State ID.

Declaration
public int StateID { get; set; }
Property Value
Type Description
System.Int32

The Content Workflow State ID.

| Improve this Doc View Source

TabID

Gets or sets the tab ID.

Declaration
public int TabID { get; set; }
Property Value
Type Description
System.Int32

The tab ID.

| Improve this Doc View Source

Terms

Gets the terms.

Declaration
public List<Term> Terms { get; }
Property Value
Type Description
List<Term>

Terms Collection.

| Improve this Doc View Source

Videos

Gets video files attached to this ContentItem.

Declaration
public List<IFileInfo> Videos { get; }
Property Value
Type Description
List<IFileInfo>

Methods

| Improve this Doc View Source

Clone(ContentItem, ContentItem)

Declaration
protected void Clone(ContentItem cloneItem, ContentItem originalItem)
Parameters
Type Name Description
ContentItem cloneItem
ContentItem originalItem
| Improve this Doc View Source

Fill(IDataReader)

Fill this content object will the information from data reader.

Declaration
public virtual void Fill(IDataReader dr)
Parameters
Type Name Description
IDataReader dr

The data reader.

See Also
Fill(IDataReader)
| Improve this Doc View Source

FillInternal(IDataReader)

Fills the internal.

Declaration
protected override void FillInternal(IDataReader dr)
Parameters
Type Name Description
IDataReader dr

The data reader contains module information.

Overrides
BaseEntityInfo.FillInternal(IDataReader)
Remarks

Please remember to call base.FillInternal or base.Fill method in your Fill method.

Implements

IHydratable

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS