/// <summary> /// Create a xml import. The data stream passed will be imported to memory, and checked /// for errors. If no error could be found, the data can be persisted to the repository. /// </summary> /// <param name="zoneId">ID of 2SexyContent zone</param> /// <param name="applicationId">ID of 2SexyContent application</param> /// <param name="contentTypeId">ID of 2SexyContent type</param> /// <param name="dataStream">Xml data stream to import</param> /// <param name="languages">Languages that can be imported (2SexyContent languages enabled)</param> /// <param name="documentLanguageFallback">Fallback document language</param> /// <param name="entityClear">How to handle entities already in the repository</param> /// <param name="resourceReference">How value references to files and pages are handled</param> public XmlImport(int zoneId, int applicationId, int contentTypeId, Stream dataStream, IEnumerable<string> languages, string documentLanguageFallback, EntityClearImport entityClear, ResourceReferenceImport resourceReference) { Entities = new List<ImportEntity>(); ErrorProtocol = new ImportErrorProtocol(); _appId = applicationId; _zoneId = zoneId; _contentType = EavDataController.Instance(zoneId, applicationId).AttribSet.GetAttributeSet(contentTypeId); _languages = languages; _documentLanguageFallback = documentLanguageFallback; _entityClear = entityClear; _resourceReference = resourceReference; ValidateAndImportToMemory(dataStream); }
/// <summary> /// Create a xml import. The data stream passed will be imported to memory, and checked /// for errors. If no error could be found, the data can be persisted to the repository. /// </summary> /// <param name="zoneId">ID of 2SexyContent zone</param> /// <param name="applicationId">ID of 2SexyContent application</param> /// <param name="contentTypeId">ID of 2SexyContent type</param> /// <param name="dataStream">Xml data stream to import</param> /// <param name="languages">Languages that can be imported (2SexyContent languages enabled)</param> /// <param name="documentLanguageFallback">Fallback document language</param> /// <param name="entityClear">How to handle entities already in the repository</param> /// <param name="resourceReference">How value references to files and pages are handled</param> public XmlImport(int zoneId, int applicationId, int contentTypeId, Stream dataStream, IEnumerable <string> languages, string documentLanguageFallback, EntityClearImport entityClear, ResourceReferenceImport resourceReference) { this.Entities = new List <Entity>(); this.ErrorProtocol = new ImportErrorProtocol(); this.applicationId = applicationId; this.zoneId = zoneId; this.contentManager = new SexyContent(zoneId, applicationId); this.contentType = contentManager.ContentContext.GetAttributeSet(contentTypeId); this.languages = languages; this.documentLanguageFallback = documentLanguageFallback; this.entityClear = entityClear; this.resourceReference = resourceReference; ValidateAndImportToMemory(dataStream); }
public static bool IsResolve(this ResourceReferenceImport option) { return(option == ResourceReferenceImport.Resolve); }