Example #1
0
        public void ContentTypeImported(ContentTypeImportedContext context)
        {
            var part = context.ContentTypeDefinition.Parts
                       .ToList()
                       .Where(p => p.PartDefinition.Name == "CacheEvictorPart")
                       .FirstOrDefault();

            if (part != null)
            {
                if (!string.IsNullOrEmpty(part.Settings.GetModel <CacheEvictorPartSettings>().IdentityEvictItem))
                {
                    string listIds = string.Empty;
                    foreach (var item in part.Settings.GetModel <CacheEvictorPartSettings>().IdentityEvictItem.Split(';'))
                    {
                        var ciIdentity = _contentManager.ResolveIdentity(new ContentIdentity(item));
                        if (ciIdentity != null)
                        {
                            listIds += ciIdentity.Id.ToString() + ";";
                        }
                    }
                    _contentDefinitionManager.AlterTypeDefinition(context.ContentTypeDefinition.Name, cfg => cfg
                                                                  .WithPart(part.PartDefinition.Name,
                                                                            pb => pb.WithSetting("CacheEvictorPartSettings.EvictItem", listIds))
                                                                  );
                }
            }
        }
 public void ContentTypeImported(ContentTypeImportedContext context)
 {
     if (TypeHasProfilePart(context.ContentTypeDefinition))
     {
         //see whether in the type there are any default settings to process
         foreach (var provider in _frontEndSettingsProviders)
         {
             provider.ConfigureDefaultValues(context.ContentTypeDefinition);
         }
     }
 }
        public void ContentTypeImported(ContentTypeImportedContext context)
        {
            var part = context.ContentTypeDefinition.Parts
                       .ToList()
                       .Where(p => p.PartDefinition.Name == "CacheEvictorPart")
                       .FirstOrDefault();

            if (part != null)
            {
                var listEvictIds      = GetIds(part.Settings.GetModel <CacheEvictorPartSettings>().IdentityEvictItem, true);
                var listEvictQueryIds = GetIds(part.Settings.GetModel <CacheEvictorPartSettings>().IdentityFilterQueryRecord, false);
                _contentDefinitionManager.AlterTypeDefinition(context.ContentTypeDefinition.Name, cfg => cfg
                                                              .WithPart(part.PartDefinition.Name,
                                                                        pb => pb
                                                                        .WithSetting("CacheEvictorPartSettings.EvictItem", listEvictIds)
                                                                        .WithSetting("CacheEvictorPartSettings.FilterQueryRecordId", listEvictQueryIds)));
            }
        }
 public void ContentTypeImported(ContentTypeImportedContext context)
 {
     EnsureIdentity(context);
 }
 public void ContentTypeImported(ContentTypeImportedContext context) {
 }
 public void ContentTypeImported(ContentTypeImportedContext context) {
     var newContentTypeXml = _contentDefinitionWriter.Export(context.ContentTypeDefinition);
     RecordContentTypeAuditTrailEvent(ContentTypeAuditTrailEventProvider.Imported, context.ContentTypeDefinition, _previousContentTypeXml, newContentTypeXml);
 }
 public void ContentTypeImported(ContentTypeImportedContext context)
 {
 }
Example #8
0
 public void ContentTypeImported(ContentTypeImportedContext context)
 {
     AlterMediaItem(context.ContentTypeDefinition);
 }
Example #9
0
        public void ContentTypeImported(ContentTypeImportedContext context)
        {
            var newContentTypeXml = _contentDefinitionWriter.Export(context.ContentTypeDefinition);

            RecordContentTypeAuditTrailEvent(ContentTypeAuditTrailEventProvider.Imported, context.ContentTypeDefinition, _previousContentTypeXml, newContentTypeXml);
        }