Esempio n. 1
0
 internal static void Start()
 {
     if (_initializing)
     {
         return;
     }
     ContentTypeManager m = Current;
 }
Esempio n. 2
0
 public override void DoAction(bool onRemote, bool isFromMe)
 {
     // Local echo of my action: Return without doing anything
     if (onRemote && isFromMe)
     {
         return;
     }
     ContentTypeManager.ResetPrivate();
 }
Esempio n. 3
0
        private void Install(CTD ctd)
        {
            ContentType contentType = ContentTypeManager.LoadOrCreateNew(ctd.Document);

            // skip notification during content type install to avoid missing field errors
            contentType.DisableObserver(TypeHandler.GetType(NodeObserverNames.NOTIFICATION));

            ContentTypeManager.ApplyChangesInEditor(contentType, _editor);
            contentType.Save(false);
            ContentTypeManager.Current.AddContentType(contentType);
        }
Esempio n. 4
0
        internal static void ApplyChanges(ContentType settings)
        {
            SchemaEditor editor = new SchemaEditor();

            editor.Load();
            ApplyChangesInEditor(settings, editor);
            editor.Register();

            // The ContentTypeManager distributes its reset, no custom DistributedAction call needed
            ContentTypeManager.Reset();
        }
Esempio n. 5
0
        private static void ResetPrivate()
        {
            lock (_syncRoot)
            {
                Logger.WriteInformation(EventId.TypeSystem.ContentTypeManagerReset, "ContentTypeManager.Reset executed.",
                                        properties: new Dictionary <string, object> {
                    { "AppDomain", AppDomain.CurrentDomain.FriendlyName }
                });

                //-- Do not call ActiveSchema.Reset();
                _current           = null;
                _indexingInfoTable = new Dictionary <string, PerFieldIndexingInfo>();
                ContentType.OnTypeSystemRestarted();
            }
        }
Esempio n. 6
0
        internal void RemoveContentType(string name)
        {
            //-- Caller: ContentType.Delete()
            lock (_syncRoot)
            {
                ContentType contentType;
                if (_contentTypes.TryGetValue(name, out contentType))
                {
                    SchemaEditor editor = new SchemaEditor();
                    editor.Load();
                    RemoveContentType(contentType, editor);
                    editor.Register();

                    // The ContentTypeManager distributes its reset, no custom DistributedAction call needed
                    ContentTypeManager.Reset();
                }
            }
        }
Esempio n. 7
0
        public void ExecuteBatch()
        {
            //-- Install considering dependencies

            if (_contentTypeCTD != null)
            {
                Install(_contentTypeCTD);
            }

            List <CTD>  docList = new List <CTD>(_docs.Values);
            Stack <CTD> stack   = new Stack <CTD>();
            CTD         parent  = null;

            while (docList.Count > 0)
            {
                CTD doc = parent ?? docList[0];
                docList.Remove(doc);
                _docs.Remove(doc.Name);
                if (_docs.ContainsKey(doc.ParentName))
                {
                    stack.Push(doc);
                    parent = _docs[doc.ParentName];
                }
                else
                {
                    Install(doc);
                    while (stack.Count > 0)
                    {
                        Install(stack.Pop());
                    }
                    parent = null;
                }
            }
            _editor.Register();

            // The ContentTypeManager distributes its reset, no custom DistributedAction call needed
            ContentTypeManager.Reset();
        }
Esempio n. 8
0
 public static void RemoveContentType(ContentType contentType)
 {
     contentType.Delete();
     // The ContentTypeManager distributes its reset, no custom DistributedAction call needed
     ContentTypeManager.Reset();
 }