/// <summary> /// Build Node (and upward), and build the children and update recursively only if changes detected. /// </summary> /// <param name="UrlSlugID"></param> public static void UrlSlugModified(int UrlSlugID) { // Convert UrlSlugID to NodeID int NodeID = UrlSlugInfoProvider.GetUrlSlugInfo(UrlSlugID).UrlSlugNodeID; DynamicRouteInternalHelper.RebuildRoutesByNode(NodeID); }
private void Document_Sort_After(object sender, DocumentSortEventArgs e) { // Check parent which will see if Children need update try { DynamicRouteInternalHelper.RebuildRoutesByNode(e.ParentNodeId); } catch (UrlSlugCollisionException ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "UrlSlugConflict", $"Occurred on Document Sort Update After for Parent Node ${e.ParentNodeId}."); e.Cancel(); } catch (Exception ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "Error", $"Occurred on Document Sort Update After for Parent Node ${e.ParentNodeId}."); } }
private void UrlSlug_Update_After_IsCustomRebuild(object sender, ObjectEventArgs e) { UrlSlugInfo UrlSlug = (UrlSlugInfo)e.Object; RecursionControl Trigger = new RecursionControl("UrlSlugNoLongerCustom_" + UrlSlug.UrlSlugGuid); if (!Trigger.Continue) { try { // If Continue is false, then the Before update shows this needs to be rebuilt. DynamicRouteInternalHelper.RebuildRoutesByNode(UrlSlug.UrlSlugNodeID); } catch (UrlSlugCollisionException ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "UrlSlugConflict", $"Occurred on Url Slug {UrlSlug.UrlSlugID}"); e.Cancel(); } catch (Exception ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "Error", $"Occurred on Url Slug {UrlSlug.UrlSlugID}"); } } }
/// <summary> /// Build ParentNode, and Parent's immediate children, build the children and update recursively only if changes detected. /// </summary> /// <param name="NodeID"></param> public static void DocumentInsertUpdated(int NodeID) { DynamicRouteInternalHelper.RebuildRoutesByNode(NodeID); }
/// <summary> /// Build both ParentNodes, and Parent's immediate children, build the children and update recursively only if changes detected. /// </summary> /// <param name="OldParentNodeID"></param> /// <param name="NewParentNodeID"></param> public static void DocumentMoved(int OldParentNodeID, int NewParentNodeID) { DynamicRouteInternalHelper.RebuildRoutesByNode(OldParentNodeID); DynamicRouteInternalHelper.RebuildRoutesByNode(NewParentNodeID); }
/// <summary> /// Build ParentNodes, and Parent's immediate children, build the children and update recursively only if changes detected. /// </summary> /// <param name="ParentNodeID"></param> public static void DocumentDeleted(int ParentNodeID) { DynamicRouteInternalHelper.RebuildRoutesByNode(ParentNodeID); }