using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Umbraco.Core.Models;
namespace Umbraco.Core.Services
{
public interface IPackagingService : IService
{
///
/// Imports and saves package xml as
///
/// Xml to import
/// Optional parent Id for the content being imported
/// Optional Id of the user performing the import
/// Optional parameter indicating whether or not to raise events
/// An enumrable list of generated content
IEnumerable ImportContent(XElement element, int parentId = -1, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves package xml as
///
/// Xml to import
/// Optional id of the User performing the operation. Default is zero (admin)
/// Optional parameter indicating whether or not to raise events
/// An enumrable list of generated ContentTypes
IEnumerable ImportContentTypes(XElement element, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves package xml as
///
/// Xml to import
/// Boolean indicating whether or not to import the
/// Optional id of the User performing the operation. Default is zero (admin)
/// Optional parameter indicating whether or not to raise events
/// An enumrable list of generated ContentTypes
IEnumerable ImportContentTypes(XElement element, bool importStructure, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves package xml as
///
/// Xml to import
/// Optional id of the User performing the operation. Default is zero (admin).
/// Optional parameter indicating whether or not to raise events
/// An enumrable list of generated DataTypeDefinitions
IEnumerable ImportDataTypeDefinitions(XElement element, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves the 'DictionaryItems' part of the package xml as a list of
///
/// Xml to import
/// Optional parameter indicating whether or not to raise events
/// An enumerable list of dictionary items
IEnumerable ImportDictionaryItems(XElement dictionaryItemElementList, bool raiseEvents = true);
///
/// Imports and saves the 'Languages' part of a package xml as a list of
///
/// Xml to import
/// Optional id of the User performing the operation. Default is zero (admin)
/// Optional parameter indicating whether or not to raise events
/// An enumerable list of generated languages
IEnumerable ImportLanguages(XElement languageElementList, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves the 'Macros' part of a package xml as a list of
///
/// Xml to import
/// Optional id of the User performing the operation
/// Optional parameter indicating whether or not to raise events
///
IEnumerable ImportMacros(XElement element, int userId = 0, bool raiseEvents = true);
///
/// Imports and saves package xml as
///
/// Xml to import
/// Optional id of the User performing the operation. Default is zero (admin)
/// Optional parameter indicating whether or not to raise events
/// An enumrable list of generated Templates
IEnumerable ImportTemplates(XElement element, int userId = 0, bool raiseEvents = true);
///
/// Exports an to xml as an
///
/// ContentType to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the ContentType item
XElement Export(IContentType contentType, bool raiseEvents = true);
///
/// Exports an item to xml as an
///
/// Content to export
/// Optional parameter indicating whether to include descendents
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the Content object
XElement Export(IContent content, bool deep = false, bool raiseEvents = true);
///
/// Exports an item to xml as an
///
/// Media to export
/// Optional parameter indicating whether to include descendents
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the Media object
XElement Export(IMedia media, bool deep = false, bool raiseEvents = true);
///
/// Exports a list of items to xml as an
///
/// List of Languages to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the Language object
XElement Export(IEnumerable languages, bool raiseEvents = true);
///
/// Exports a single item to xml as an
///
/// Language to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the Language object
XElement Export(ILanguage language, bool raiseEvents = true);
///
/// Exports a list of items to xml as an
///
/// List of dictionary items to export
/// Optional boolean indicating whether or not to include children
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IDictionaryItem objects
XElement Export(IEnumerable dictionaryItem, bool includeChildren = true, bool raiseEvents = true);
///
/// Exports a single item to xml as an
///
/// Dictionary Item to export
/// Optional boolean indicating whether or not to include children
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IDictionaryItem object
XElement Export(IDictionaryItem dictionaryItem, bool includeChildren, bool raiseEvents = true);
///
/// Exports a list of Data Types
///
/// List of data types to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IDataTypeDefinition objects
XElement Export(IEnumerable dataTypeDefinitions, bool raiseEvents = true);
///
/// Exports a single Data Type
///
/// Data type to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IDataTypeDefinition object
XElement Export(IDataTypeDefinition dataTypeDefinition, bool raiseEvents = true);
///
/// Exports a list of items to xml as an
///
/// List of Templates to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the ITemplate objects
XElement Export(IEnumerable templates, bool raiseEvents = true);
///
/// Exports a single item to xml as an
///
/// Template to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the ITemplate object
XElement Export(ITemplate template, bool raiseEvents = true);
///
/// Exports a list of items to xml as an
///
/// Macros to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IMacro objects
XElement Export(IEnumerable macros, bool raiseEvents = true);
///
/// Exports a single item to xml as an
///
/// Macro to export
/// Optional parameter indicating whether or not to raise events
/// containing the xml representation of the IMacro object
XElement Export(IMacro macro, bool raiseEvents = true);
///
/// This will fetch an Umbraco package file from the package repository and return the relative file path to the downloaded package file
///
///
///
/// The current user id performing the operation
///
string FetchPackageFile(Guid packageId, Version umbracoVersion, int userId);
}
}