/// <summary> /// <para>Get a IEnumerable list of node for the category or dropdown.</para> /// <para>The static type define the possible types:</para> /// <list type="bullet"> /// <listheader> /// <term>types</term> /// <description>description</description> /// </listheader> /// <item> /// <term>CATEGORY_TYPE</term> /// <description>description</description> ///</item> ///<item> /// <term>DROPDOWN_TYPE</term> /// <description>description</description> ///</item> ///</list> /// </summary> /// <param name="type"> criteria/dropbox</param> /// <returns>IEnumerable list</returns> public static IEnumerable<Category> GetAllRootNodesAsList(string type) { LoadXml(); List<Category> l = new List<Category>(); XmlNodeList typeList = _source.GetElementsByTagName(type); XmlNode root = typeList.Item(0); foreach (XmlNode x in root.ChildNodes) { Category c = new Category(); c.Name = x.LocalName; c.Value = x.LocalName; c.DefaultValue = x.Attributes[DataHelperConstClass.CATEGORY_DEFAULT].InnerText; l.Add(c); } return l; }
/// <summary> /// Check if aTextValue in SerachCriteriaList /// This function is used to check whether an text is present in the list. /// </summary> /// <remarks></remarks> /// <seealso cref=""/> /// <param name="facet"></param> /// <returns></returns> public bool ContainsCategory(Category category) { throw new NotImplementedException(); }
/// <summary> /// /// </summary> /// <remarks></remarks> /// <seealso cref=""/> private void LoadBeforeIndexing() { XmlNodeList fieldProperties = configXML.GetElementsByTagName("field"); Category category = new Category(); category.Name = "All"; category.Value = "All"; category.DefaultValue = "nothing"; AllCategories.Add(category); foreach (XmlNode fieldProperty in fieldProperties) { String fieldType = fieldProperty.Attributes.GetNamedItem("type").Value; String fieldName = fieldProperty.Attributes.GetNamedItem("lucene_name").Value; if (fieldType.ToLower().Equals("facet_field")) { facetXmlNodeList.Add(fieldProperty); Facet c = new Facet(); c.Name = fieldName; c.Text = fieldName; c.Value = fieldName; //c.Expanded = true; //c.Enabled = true; c.Childrens = new List<Facet>(); AllFacets.Add(c); } else if (fieldType.ToLower().Equals("property_field")) { propertyXmlNodeList.Add(fieldProperty); Property c = new Property(); c.Name = fieldProperty.Attributes.GetNamedItem("lucene_name").Value; c.DisplayName = fieldProperty.Attributes.GetNamedItem("display_name").Value; ; c.DataSourceKey = fieldProperty.Attributes.GetNamedItem("metadata_name").Value; c.UIComponent = fieldProperty.Attributes.GetNamedItem("uiComponent").Value; ; c.AggregationType = "distinct"; c.DefaultValue = "All"; c.DataType = fieldProperty.Attributes.GetNamedItem("primitive_type").Value; AllProperties.Add(c); } else if (fieldType.ToLower().Equals("category_field") || fieldType.ToLower().Equals("primary_data_field")) { categoryXmlNodeList.Add(fieldProperty); Category c = new Category(); c.Name = fieldProperty.Attributes.GetNamedItem("lucene_name").Value; c.Value = fieldProperty.Attributes.GetNamedItem("lucene_name").Value; ; c.DefaultValue = "nothing"; AllCategories.Add(c); } else if (fieldType.ToLower().Equals("general_field")) { generalXmlNodeList.Add(fieldProperty); } } }