internal static void Start() { if (_initializing) { return; } ContentTypeManager m = Current; }
public override void DoAction(bool onRemote, bool isFromMe) { // Local echo of my action: Return without doing anything if (onRemote && isFromMe) { return; } ContentTypeManager.ResetPrivate(); }
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); }
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(); }
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(); } }
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(); } } }
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(); }
public static void RemoveContentType(ContentType contentType) { contentType.Delete(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed ContentTypeManager.Reset(); }