programatically creating pages with id2 and approval_workflo

Posted by Community Admin on 03-Aug-2018 23:40

programatically creating pages with id2 and approval_workflow_state

All Replies

Posted by Community Admin on 30-Nov-2010 00:00

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();

Posted by Community Admin on 03-Dec-2010 00:00

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

Posted by Community Admin on 03-Dec-2010 00:00

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.

Posted by Community Admin on 07-Dec-2010 00:00

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

This thread is closed