Class UrlTreeBuilder
- Namespace
 - Dynamicweb.Frontend.UrlHandling
 
- Assembly
 - Dynamicweb.dll
 
UrlTreeBuilder is a helper class for bulding url tree structures.
Url nodes can be created with ID and ParentID structure using the Add(string, string, string, string, string, string, bool, bool) methods and when the object has been filled with data,
call the MakeTree(). After that call a tree of UrlNode is available from the RootNodes property.
  
  public class UrlTreeBuilder
  - Inheritance
 - 
      
      UrlTreeBuilder
 
- Inherited Members
 
Properties
RootNodes
Gets the root nodes of the UrlNodes in the resulting tree. Only contains values after MakeTree() has been called.
  
  public List<UrlNode> RootNodes { get; }
  Property Value
Methods
Add(int, int, string, string, int, string, bool, bool)
Adds a UrlNode to the tree builder instance.
  
  public void Add(int id, int parentId, string name, string queryStringParameter, int queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath)
  Parameters
idint- The Id of the item in the tree, i.e. "1" or "Group1".
 parentIdint- The parentid of the item, i.e. "0" or "" if a rootnode or i.e. "2" for nodes that has a parent.
 namestring- The name of the item, i.e. the name of the page, product or group. Used for this elements name in the resulting URL path.
 queryStringParameterstring- The query string parameter for this node, i.e. "ID" or "GroupID".
 queryStringValueint- The query string value for this node, i.e. "1" for a page or "Group1" for a group.
 pathExactstring- The exact path for this node if needed - overwrites the auto generated path to this item with a specific value, i.e. "/MyProduct" instead of "/Products/TheGroup/MyProduct".
 ignoreInChildPathbool- if set to 
truethis items name is not part of children urlnode paths. ignoreParentPathbool- if set to 
truethis item will not include the parent path structure for its path. 
Add(int, int, string, string, string, string, bool, bool)
Adds a UrlNode to the tree builder instance.
  
  public void Add(int id, int parentId, string name, string queryStringParameter, string queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath)
  Parameters
idint- The Id of the item in the tree, i.e. "1" or "Group1".
 parentIdint- The parentid of the item, i.e. "0" or "" if a rootnode or i.e. "2" for nodes that has a parent.
 namestring- The name of the item, i.e. the name of the page, product or group. Used for this elements name in the resulting URL path.
 queryStringParameterstring- The query string parameter for this node, i.e. "ID" or "GroupID".
 queryStringValuestring- The query string value for this node, i.e. "1" for a page or "Group1" for a group.
 pathExactstring- The exact path for this node if needed - overwrites the auto generated path to this item with a specific value, i.e. "/MyProduct" instead of "/Products/TheGroup/MyProduct".
 ignoreInChildPathbool- if set to 
truethis items name is not part of children urlnode paths. ignoreParentPathbool- if set to 
truethis item will not include the parent path structure for its path. 
Add(string, string, string, string, string, string, bool, bool)
Adds a UrlNode to the tree builder instance.
  
  public void Add(string id, string parentId, string name, string queryStringParameter, string queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath)
  Parameters
idstring- The Id of the item in the tree, i.e. "1" or "Group1".
 parentIdstring- The parentid of the item, i.e. "0" or "" if a rootnode or i.e. "2" for nodes that has a parent.
 namestring- The name of the item, i.e. the name of the page, product or group. Used for this elements name in the resulting URL path.
 queryStringParameterstring- The query string parameter for this node, i.e. "ID" or "GroupID".
 queryStringValuestring- The query string value for this node, i.e. "1" for a page or "Group1" for a group.
 pathExactstring- The exact path for this node if needed - overwrites the auto generated path to this item with a specific value, i.e. "/MyProduct" instead of "/Products/TheGroup/MyProduct".
 ignoreInChildPathbool- if set to 
truethis items name is not part of children urlnode paths. ignoreParentPathbool- if set to 
truethis item will not include the parent path structure for its path. 
Add(string, string, string, string, string, string, bool, bool, string, bool)
[Obsolete("Use AddNode instead.")]
public void Add(string id, string parentId, string name, string queryStringParameter, string queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath, string queryStringExact, bool ignoreParentQuerystring)
  Parameters
idstringparentIdstringnamestringqueryStringParameterstringqueryStringValuestringpathExactstringignoreInChildPathboolignoreParentPathboolqueryStringExactstringignoreParentQuerystringbool
AddNode(UrlDataNode)
public void AddNode(UrlDataNode nodeData)
  Parameters
nodeDataUrlDataNode
AddNode(string, string, string, string, string, string, bool, bool, string, bool)
Adds a UrlNode to the tree builder instance.
  
  public void AddNode(string id, string parentId, string name, string queryStringParameter, string queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath, string queryStringExact, bool ignoreParentQueryString)
  Parameters
idstring- The Id of the item in the tree, i.e. "1" or "Group1".
 parentIdstring- The parentid of the item, i.e. "0" or "" if a rootnode or i.e. "2" for nodes that has a parent.
 namestring- The name of the item, i.e. the name of the page, product or group. Used for this elements name in the resulting URL path.
 queryStringParameterstring- The query string parameter for this node, i.e. "ID" or "GroupID".
 queryStringValuestring- The query string value for this node, i.e. "1" for a page or "Group1" for a group.
 pathExactstring- The exact path for this node if needed - overwrites the auto generated path to this item with a specific value, i.e. "/MyProduct" instead of "/Products/TheGroup/MyProduct".
 ignoreInChildPathbool- if set to 
truethis items name is not part of children urlnode paths. ignoreParentPathbool- if set to 
truethis item will not include the parent path structure for its path. queryStringExactstring- The exact querystring - to override the automatic generated querystring.
 ignoreParentQueryStringbool- if set to 
truethe querystring elements of the parent nodes are ignored. I.e. True for pages, but false for products since they also need their Groups querystring and value. 
Exceptions
AddNode(string, string, string, string, string, string, bool, bool, string, bool, bool)
Adds a UrlNode to the tree builder instance.
  
  public void AddNode(string id, string parentId, string name, string queryStringParameter, string queryStringValue, string pathExact, bool ignoreInChildPath, bool ignoreParentPath, string queryStringExact, bool ignoreParentQueryString, bool IncludeInSitemapXml)
  Parameters
idstring- The Id of the item in the tree, i.e. "1" or "Group1".
 parentIdstring- The parentid of the item, i.e. "0" or "" if a rootnode or i.e. "2" for nodes that has a parent.
 namestring- The name of the item, i.e. the name of the page, product or group. Used for this elements name in the resulting URL path.
 queryStringParameterstring- The query string parameter for this node, i.e. "ID" or "GroupID".
 queryStringValuestring- The query string value for this node, i.e. "1" for a page or "Group1" for a group.
 pathExactstring- The exact path for this node if needed - overwrites the auto generated path to this item with a specific value, i.e. "/MyProduct" instead of "/Products/TheGroup/MyProduct".
 ignoreInChildPathbool- if set to 
truethis items name is not part of children urlnode paths. ignoreParentPathbool- if set to 
truethis item will not include the parent path structure for its path. queryStringExactstring- The exact querystring - to override the automatic generated querystring.
 ignoreParentQueryStringbool- if set to 
truethe querystring elements of the parent nodes are ignored. I.e. True for pages, but false for products since they also need their Groups querystring and value. IncludeInSitemapXmlbool- if set to 
truethe node will be included in sitemap xml, otherwise ignored. Children will still be included 
Exceptions
MakeTree()
Makes the tree structure based on the IDs and ParentIds and adds the rootnodes to the RootNodes properties
  
  public void MakeTree()