/// <summary> /// This method is invoked before a Page is checked in /// </summary> /// <param name="page">Page that will be checked in</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeCheckIn(IPage page, bool recursive, IUserWriteSession session) { // var pageList = new List<IPage>(); // GetSite(page, ref pageList); // var s = ""; // // foreach (var p in pageList) // { // s += p.Id + " "; // } // // page.Name = s; // page.Save(); }
public static string AssetCount() { Debug.WriteLine("Migration Initiated..."); IContentStore contentStore = new ContentStore("http://bd-convergence/", "C:\\igxsites\\cms103\\bd-convergence\\site\\App_Data\\xml"); IReadonlyUser user = contentStore.GetStartingUser(@"ingeniux\jallard"); using (IUserWriteSession session = contentStore.OpenWriteSession(user)) { ISite site = session.Site; return($"assets count:" + site.AssetsCount()); //ISchemaManager schemaManager = session.SchemasManager; //ISchema newSchema = schemaManager.CreateSchema("oregon", "oregon", 3, false, true, "oregon"); } }
protected override void Initialize(RequestContext requestContext) { base.Initialize(requestContext); UserSession = _Common.ContentStore.OpenWriteSession(_Common.CurrentUser); Messenger = new CustomMessengerClient(UserSession, HEADER_VALUE); TokenProvider = new TokenProvider(_Common, HttpContext); GraphClient = new GraphServiceClient( new DelegateAuthenticationProvider( async(requestMessage) => { TokenProvider provider = TokenProvider; string accessToken = await provider.GetUserAccessTokenAsync(true); // Append the access token to the request. requestMessage.Headers.Authorization = new AuthenticationHeaderValue("bearer", accessToken); })); }
/// <summary> /// This method is invoked before a Page is assigned to a User. /// DO NOT call Page.AssignUser or Page.AssignGroup inside this method, otherwise it will cause infinite loop /// </summary> /// <param name="page">Page that will be assigned</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeAssign(IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked before any type of Ingeniux CMS CSAPI Entity object is saved /// </summary> /// <param name="entity">The entity to be saved</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeEntitySave(IEntity entity, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a UserGroup was deleted /// </summary> /// <param name="userGroup">The UserGroup that was delete</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterUserGroupDelete(IUserGroup userGroup, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a User is deleted /// </summary> /// <param name="user">The User to delete</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeUserDelete(IUser user, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a Category Node is deleted /// </summary> /// <param name="category">The Category Node to be deleted</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeCategoryDelete(ICategoryNode category, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a new Page is created. /// </summary> /// <param name="page">Page that was created</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnNew(IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page was rolled back to its previous version /// </summary> /// <param name="page">The Page that was rolled back</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterRollback(IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a Page is rolled back to its previous version /// </summary> /// <param name="page">The Page to roll back</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeRollback(IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page gets copied via special command. On CMS UI, the Paste Special command is executed via drag and drop with "Alt" key instead "Ctrl" key pressed. /// The "Paster Special" command at the core is just a copy command, which this hook method invoked. /// </summary> /// <param name="sourcePage">The Page that was copied</param> /// <param name="newPage">The new Page created, that was the clone of the source Page</param> /// <param name="targetPage">The target reference location Page</param> /// <param name="relation">The position relative to the target reference Page</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterPasteSpecial(IPage sourcePage, IPage newPage, IPage targetPage, EnumCopyActions relation, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page moved to another location /// </summary> /// <param name="sourcePage">The Page that was moved</param> /// <param name="targetPage">The target reference location Page</param> /// <param name="relation">The position relative to the target reference Page</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterMove(IPage sourcePage, IPage targetPage, EnumCopyActions relation, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page was marked/unmarked for publish /// </summary> /// <param name="page">Page that was marked/unmarked for publish</param> /// <param name="recursive">Whether the action is recursive</param> /// <param name="markedTargets">The list of Publishing Targets that this Page was marked on. Include marked versions on each Target</param> /// <param name="unmarkedTargets">The list of Publishing Targets that this Page was unmarked on.</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterMarkForPublish(IPage page, bool recursive, IEnumerable<PublishingTargetWithMarkedVersion> markedTargets, IEnumerable<IPublishingTarget> unmarkedTargets, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page abandoned its checked out version and back into checked in state. /// </summary> /// <param name="page">The Page that undone check out</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterUndoCheckOut(IPage page, bool recurisve, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Category Node was created /// </summary> /// <param name="category">The Category Node that was created</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnCategoryCreated(ICategoryNode category, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a non-Region-Root Page gets copied to under another Region Root. /// </summary> /// <param name="sourcePage">The Page that was copied</param> /// <param name="newPage">The new Page created, that was the clone of the source Page</param> /// <param name="targetPage">The target reference location Page</param> /// <param name="relation">The position relative to the target reference Page</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterCrossLocaleCopy(IPage sourcePage, IPage newPage, IPage targetPage, EnumCopyActions relation, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a User was created /// </summary> /// <param name="user">The new User that was created</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnUserCreated(IUser user, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Region Root Page was cloned into another Region Root Page, with lingual maps established between the two Regions. /// </summary> /// <param name="sourcePage">The Page that was copied</param> /// <param name="newPage">The new Region Root Page created, that was the clone of the source Page</param> /// <param name="targetPage">The target reference location Page</param> /// <param name="relation">The position relative to the target reference Page</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <param name="targetLocale">The region code of the target Region Root's language</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterRegionRootCopy(IPage sourcePage, IPage newPage, IPage targetPage, EnumCopyActions relation, string targetLocale, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page is renamed. /// DO NOT assign to Page.Name inside the method, otherwise it will cause infinite loop /// </summary> /// <param name="oldName">The old name of the Page</param> /// <param name="newName">The new name of the Page</param> /// <param name="page">The Page that was renamed</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnRename(string oldName, string newName, IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a Publishing Task is submitted /// </summary> /// <param name="pubTarget">The Publishing Target that will submit the publish task</param> /// <param name="fullPublish">Whether it will be a full or incremental publish</param> /// <param name="pagesToPublish">Collection of information on Pages to be published</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforePublish(IPublishingTarget pubTarget, bool fullPublish, IEnumerable <PagePublishInfo> pagesToPublish, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Category Node was created. /// DO NOT assign to CategoryNode.Name in thid method, otherwise it will cause infinite loop /// </summary> /// <param name="category">The Category Node that was renamed</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnCategoryRenamed(string oldName, string newName, ICategoryNode category, IUserWriteSession session) { }
/// <summary> /// This method is invoke before a File Upload gets processed by Ingeniux CMS Site Instance server /// </summary> /// <param name="session">The session that will be used to process the upload</param> /// <param name="uploadStream">Stream of the upload file</param> /// <param name="fileName">Name of the upload file</param> /// <param name="targetPhysicalFolder">Full path of target folder</param> public void OnBeforeUpload(IUserWriteSession session, ref System.IO.Stream uploadStream, ref string fileName, ref string targetPhysicalFolder) { }
/// <summary> /// This method is invoked after a Page is checked in /// </summary> /// <param name="page">Page that was be checked in</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterCheckIn(IPage page, bool recursive, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Category Node was deleted /// </summary> /// <param name="category">The Category Node that was deleted</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterCategoryDelete(ICategoryNode category, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Page is assigned to a User. /// DO NOT call Page.AssignUser or Page.AssignGroup inside this method, otherwise it will cause infinite loop /// </summary> /// <param name="page">Page that was assigned</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterAssign(IPage page, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a UserGroup was created /// </summary> /// <param name="userGroup">The new UserGroup that was created</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnUserGroupCreated(IUserGroup userGroup, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a User was deleted /// </summary> /// <param name="user">The User that was deleted</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterUserDelete(IUser user, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a UserGroup is deleted /// </summary> /// <param name="userGroup">The UserGroup to delete</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeUserGroupDelete(IUserGroup userGroup, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Workflow advanced through a Transition /// </summary> /// <param name="transtion">The transtion that Workflow advanced through</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterWorkflowAdvance(ITransition transtion, IUserWriteSession session) { }
/// <summary> /// This method is invoked before a Publishing Task is submitted /// </summary> /// <param name="pubTarget">The Publishing Target that will submit the publish task</param> /// <param name="fullPublish">Whether it will be a full or incremental publish</param> /// <param name="pagesToPublish">Collection of information on Pages to be published</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforePublish(IPublishingTarget pubTarget, bool fullPublish, IEnumerable<PagePublishInfo> pagesToPublish, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Publishing Task was completed /// </summary> /// <param name="pubTarget">The Publishing Target that submitted the publish task</param> /// <param name="fullPublish">Whether it was a full or incremental publish</param> /// <param name="pagesToPublish">Collection of information on Pages that was published</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnPublishComplete(IPublishingTarget pubTarget, bool fullPublish, IEnumerable<PagePublishInfo> pagesToPublish, Exception publishError, IUserWriteSession session) { }
/// <summary> /// This method is invoked after a Publishing Task was completed /// </summary> /// <param name="pubTarget">The Publishing Target that submitted the publish task</param> /// <param name="fullPublish">Whether it was a full or incremental publish</param> /// <param name="pagesToPublish">Collection of information on Pages that was published</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnPublishComplete(IPublishingTarget pubTarget, bool fullPublish, IEnumerable <PagePublishInfo> pagesToPublish, Exception publishError, IUserWriteSession session) { }
/// <summary> /// This method is invoked after any type of Ingeniux CMS CSAPI Entity object was saved /// </summary> /// <param name="entity">The entity that was saved</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnAfterEntitySave(IEntity entity, IUserWriteSession session) { }
/// <summary> /// This method is invoke after a File Upload got processed by Ingeniux CMS Site Instance server /// </summary> /// <param name="session">The session that was used to process the upload</param> /// <param name="uploadedFile">The upload file information</param> /// <param name="fileSize">The size of uploaded file by KB</param> public void OnAfterUpload(IUserWriteSession session, System.IO.FileInfo uploadedFile, int fileSize) { }
/// <summary> /// This method is invoked before a Page is checked out /// </summary> /// <param name="page">Page that will be checked out</param> /// <param name="session">The session that must be used to perform tasks on additional objects</param> /// <remarks>When this action is invoked, none of the object involved were saved to Content Store yet.</remarks> public void OnBeforeCheckOut(IPage page, bool recursive, IUserWriteSession session) { }