Command "timing out" during Sitecore automated item creation -



Command "timing out" during Sitecore automated item creation -

i have command i've added "national" node in sitecore editor. command generates list of 50 state nodes beneath it. goes through state nodes (1 @ time) , generates list of local nodes under each state node. within lists of local nodes, iterate through them , check if new item exists - if not, add together (create) kid under local node. ultimately, there 300 local items beingness added during course of study of command.

is there more efficient way (fast query 300 local nodes 1 list, check if item exists, , create it)? if so, i'm not sure how that...

i'm not sure costly part of operation. ultimately, i'm still doing 300 separate queries check if it's there, followed insert statements, may still take while run. if so, setting in web config increment applicable "timeout" setting in sitecore? sample construction follows:

//derive template name of item (page) passed in - assumes template name , item name same sitecore.data.database database = sitecore.data.database.getdatabase("master"); templateitem contentpagetemplate = database.selectsingleitem("fast:/sitecore/templates/user defined/home/pages/local site/" + newpage); sitecore.data.items.item[] statenodes = null; sitecore.data.items.item[] localnodes = null; item localhomepage = null; item newlocalpage = null; int webbusinessid = 0; string id = ""; webbusiness business; //get of immediate kid nodes (state pages) under "parent" node ("national locations") - , set them list or array statenodes = database.selectitems("fast:/sitecore/content/home/national locations/*"); (int = 0; < statenodes.length; i++) { if (statenodes[i].children.count > 0) { localnodes = database.selectitems("fast:/sitecore/content/home/national locations/" + statenodes[i].fields["state abbreviation"].tostring() + "/*"); } else { //do nil } (int j = 0; j < localnodes.length; j++) { localhomepage = localnodes[j]; if (localhomepage.publishing.ispublishable(datetime.now, false) == true) { //if new page not exist, create if (localhomepage.children[newpage] == null) { newlocalpage = localhomepage.add(newpage, contentpagetemplate); counter = counter + 1; } else { //additional business logic } } } }

unless i'm missing logic/code don't have there, think can trim downwards 1 query local nodes changing xpath:

localnodes = database.selectitems("fast:/sitecore/content/home/national locations/*/*");

the alter immediate sub-items of immediate sub-items of "national locations"

sitecore

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -