2012-10-09 11:53:22 -02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2012-10-03 08:24:23 -02:00
|
|
|
|
using Umbraco.Core.Models.EntityBase;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the base for a Content object with properties that
|
|
|
|
|
|
/// are shared between Content and Media.
|
|
|
|
|
|
/// </summary>
|
2013-01-03 08:30:38 -01:00
|
|
|
|
public interface IContentBase : IUmbracoEntity
|
2012-10-03 08:24:23 -02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Integer Id of the default ContentType
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
int ContentTypeId { get; }
|
|
|
|
|
|
|
2012-10-09 11:53:22 -02:00
|
|
|
|
/// <summary>
|
2017-11-10 11:27:12 +01:00
|
|
|
|
/// Gets the Guid identifier of the content's version.
|
2012-10-09 11:53:22 -02:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Guid Version { get; }
|
|
|
|
|
|
|
2017-11-10 11:27:12 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the identifier of the writer.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
int WriterId { get; set; }
|
|
|
|
|
|
|
2012-10-03 08:24:23 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// List of properties, which make up all the data available for this Content object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>Properties are loaded as part of the Content object graph</remarks>
|
|
|
|
|
|
PropertyCollection Properties { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// List of PropertyGroups available on this Content object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>PropertyGroups are kind of lazy loaded as part of the object graph</remarks>
|
|
|
|
|
|
IEnumerable<PropertyGroup> PropertyGroups { get; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// List of PropertyTypes available on this Content object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>PropertyTypes are kind of lazy loaded as part of the object graph</remarks>
|
|
|
|
|
|
IEnumerable<PropertyType> PropertyTypes { get; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Indicates whether the content object has a property with the supplied alias
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="propertyTypeAlias">Alias of the PropertyType</param>
|
|
|
|
|
|
/// <returns>True if Property with given alias exists, otherwise False</returns>
|
|
|
|
|
|
bool HasProperty(string propertyTypeAlias);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
/// Gets the neutral value of a Property
|
2012-10-03 08:24:23 -02:00
|
|
|
|
/// </summary>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
object GetValue(string propertyTypeAlias, bool published = false);
|
2012-10-03 08:24:23 -02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
/// Gets the culture value of a Property
|
2012-10-03 08:24:23 -02:00
|
|
|
|
/// </summary>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
object GetValue(string propertyTypeAlias, int languageId, bool published = false);
|
2012-10-03 08:24:23 -02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
/// Gets the segment value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
object GetValue(string propertyTypeAlias, int languageId, string segment, bool published = false);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the typed neutral value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
TPropertyValue GetValue<TPropertyValue>(string propertyTypeAlias, bool published = false);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the typed neutral value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
TPropertyValue GetValue<TPropertyValue>(string propertyTypeAlias, int languageId, bool published = false);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the typed neutral value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
TPropertyValue GetValue<TPropertyValue>(string propertyTypeAlias, int languageId, string segment, bool published = false);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sets the neutral (draft) value of a Property
|
2012-10-03 08:24:23 -02:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
void SetValue(string propertyTypeAlias, object value);
|
2012-10-10 13:18:14 -02:00
|
|
|
|
|
2017-11-07 19:49:14 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sets the culture (draft) value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void SetValue(string propertyTypeAlias, int languageId, object value);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sets the segment (draft) value of a Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void SetValue(string propertyTypeAlias, int languageId, string segment, object value);
|
|
|
|
|
|
|
2012-10-10 13:18:14 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Boolean indicating whether the content and its properties are valid
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>True if content is valid otherwise false</returns>
|
2017-11-07 19:49:14 +01:00
|
|
|
|
bool Validate();
|
2012-10-03 08:24:23 -02:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|