programatically creating pages with id2 and approval_workflow_state
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();
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
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.
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