Merge branch temp8 into feature/IContentType-removale-from-IContent
This commit is contained in:
@@ -300,84 +300,45 @@ namespace Umbraco.Core
|
||||
/// Creates the full xml representation for the <see cref="IContent"/> object and all of it's descendants
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <param name="serializer"></param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
internal static XElement ToDeepXml(this IContent content, IPackagingService packagingService)
|
||||
internal static XElement ToDeepXml(this IContent content, IEntityXmlSerializer serializer)
|
||||
{
|
||||
return packagingService.Export(content, true, raiseEvents: false);
|
||||
}
|
||||
|
||||
|
||||
[Obsolete("Use the overload that declares the IPackagingService to use")]
|
||||
public static XElement ToXml(this IContent content)
|
||||
{
|
||||
return Current.Services.PackagingService.Export(content, raiseEvents: false);
|
||||
return serializer.Serialize(content, false, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IContent"/> object
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <param name="serializer"></param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
public static XElement ToXml(this IContent content, IPackagingService packagingService)
|
||||
public static XElement ToXml(this IContent content, IEntityXmlSerializer serializer)
|
||||
{
|
||||
return packagingService.Export(content, raiseEvents: false);
|
||||
}
|
||||
|
||||
[Obsolete("Use the overload that declares the IPackagingService to use")]
|
||||
public static XElement ToXml(this IMedia media)
|
||||
{
|
||||
return Current.Services.PackagingService.Export(media, raiseEvents: false);
|
||||
return serializer.Serialize(content, false, false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IMedia"/> object
|
||||
/// </summary>
|
||||
/// <param name="media"><see cref="IContent"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <param name="serializer"></param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
public static XElement ToXml(this IMedia media, IPackagingService packagingService)
|
||||
public static XElement ToXml(this IMedia media, IEntityXmlSerializer serializer)
|
||||
{
|
||||
return packagingService.Export(media, raiseEvents: false);
|
||||
return serializer.Serialize(media);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the full xml representation for the <see cref="IMedia"/> object and all of it's descendants
|
||||
/// </summary>
|
||||
/// <param name="media"><see cref="IMedia"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IMedia"/></returns>
|
||||
internal static XElement ToDeepXml(this IMedia media, IPackagingService packagingService)
|
||||
{
|
||||
return packagingService.Export(media, true, raiseEvents: false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IContent"/> object
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <param name="isPreview">Boolean indicating whether the xml should be generated for preview</param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
public static XElement ToXml(this IContent content, IPackagingService packagingService, bool isPreview)
|
||||
{
|
||||
//TODO Do a proper implementation of this
|
||||
//If current IContent is published we should get latest unpublished version
|
||||
return content.ToXml(packagingService);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IMember"/> object
|
||||
/// </summary>
|
||||
/// <param name="member"><see cref="IMember"/> to generate xml for</param>
|
||||
/// <param name="packagingService"></param>
|
||||
/// <param name="serializer"></param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
public static XElement ToXml(this IMember member, IPackagingService packagingService)
|
||||
public static XElement ToXml(this IMember member, IEntityXmlSerializer serializer)
|
||||
{
|
||||
return ((PackagingService)(packagingService)).Export(member);
|
||||
return serializer.Serialize(member);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user