1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / programatically creating pages with id2 and approval_workflow_state

programatically creating pages with id2 and approval_workflow_state

4 posts, 1 answered
  1. Phil
    Phil avatar
    89 posts
    Registered:
    19 Oct 2010
    30 Nov 2010
    Link to this post
    I am creating pages programatically.  I notice that there are several differences in table = sf_page_node, in the database, for pages that I create programatically ("p") as compared to pages that I create using the gui.  For example, sf_page_node.id2 and sf_page_node.approval_workflow_state are both null for p-pages but for gui-pages, id2 always has a guid and approval_workflow_state always has "Published" as a value.

    What do id2 and approval_workflow_state represent and how can I properly populate them?  The code I am using to create the p-pages follows.

                var mgr = new PageManager();
                // get a template guid ==================================================
                var guidTemplate = mgr.GetTemplates().First().Id;
                var fluent = App.WorkWith().Page();
                var mgrFluent = fluent.PageManager;
                var parentNode = mgrFluent.GetPageNodes().Where(n => n.UrlName == mainPageName).FirstOrDefault()

                fluent.CreateNewStandardPage(parentNode)
                        .Do(pn =>
                                {   pn.Title = NewPageName;           // db.table = sf_page_node
                                    pn.UrlName = NewPageName;     // db.table = sf_page_node
                                    pn.Page.Title = NewPageName;  // db.table = sf_page_data
                                })
                        .CheckOut()   
                        .SetTemplateTo(guidTemplate)
                        .Publish()
                        .SaveChanges();
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Dec 2010
    Link to this post
    Hi Phil,

    The table approval_workflow_state  is populated by the workflow. When you use the fluent API the workflow is not involved in it and this could be the reason for these differences. Generally all database changes and tables are managed by a datalayer which handles all data properly.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Phil
    Phil avatar
    89 posts
    Registered:
    19 Oct 2010
    03 Dec 2010
    Link to this post
    Thanks Ivan.

    There was one other field that I had asked about.

    What does sf_page_node.id2 represent?  Does it JOIN to another table?  If so what table and what field?

    Thanks again.
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    07 Dec 2010
    Link to this post
    Hi Phil,

    The column sf_page_node.id2 represents a reference to the workflow tracking records (table sf_approval_tracking_record).

    Let us know if you need additional information.


    Regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
4 posts, 1 answered