Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param>NA</param>
        /// <returns></returns>
        private SearchModel initWorking()
        {
            SearchModel model = new SearchModel();

            //facets
            model.SearchComponent.Facets = SearchConfig.getFacetsCopy();

            //properties
            model.SearchComponent.Properties = new List <Property>(SearchConfig.getPropertiesCopy());

            //categories
            model.SearchComponent.Categories = new List <Category>(SearchConfig.getCategoriesCopy());

            //Textvalues
            model.SearchComponent.TextBoxSearchValues = new List <TextValue>();

            model.SearchComponent.Generals = new List <General>()
            {
                new General()
                {
                    Name = "gen_isPublic", DefaultValue = "FALSE", DisplayName = "Is dataset public", Value = "FALSE", IsVisible = false
                },
                new General()
                {
                    Name = "gen_entity_name", DefaultValue = "", DisplayName = "Type", Value = "", IsVisible = true
                }
            };

            return(model);
            //throw new NotImplementedException();
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param>NA</param>
        /// <returns></returns>
        private SearchModel initDefault()
        {
            SearchModel model = new SearchModel();

            //facets
            model.SearchComponent.Facets = SearchConfig.getFacets().ToList();

            //properties
            model.SearchComponent.Properties = new List <Property>(SearchConfig.getProperties());

            //categories
            model.SearchComponent.Categories = new List <Category>(SearchConfig.getCategories());

            //Textvalues
            model.SearchComponent.TextBoxSearchValues = new List <TextValue>();

            /// Add the general searchable properties, these are usually not visible through the UI.
            /// Here, there is one built-in field that is used to filter public datasets
            ///
            model.SearchComponent.Generals = new List <General>()
            {
                new General()
                {
                    Name = "gen_isPublic", DefaultValue = "FALSE", DisplayName = "Is dataset public", Value = "FALSE", IsVisible = false
                },
                new General()
                {
                    Name = "gen_entity_name", DefaultValue = "", DisplayName = "Type", Value = "", IsVisible = true
                }
            };

            return(model);
            //throw new NotImplementedException();
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param name="searchCriteria"></param>
        /// <param name="pageSize"></param>
        /// <param name="currentPage"></param>
        /// <returns></returns>
        public SearchModel SearchAndUpdate(SearchCriteria searchCriteria, int pageSize = 10, int currentPage = 1)
        {
            this.WorkingSearchModel = Get(searchCriteria, pageSize, currentPage);
            this.WorkingSearchModel = UpdateFacets(searchCriteria);

            return(this.WorkingSearchModel);
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param name="forceReset"></param>
        /// <return></return>
        private void load(bool forceReset = false)
        {
            if (forceReset == true)
            {
                SearchConfig.Reset();
            }
            SearchConfig.LoadConfig();

            this.DefaultSearchModel = initDefault();
            this.WorkingSearchModel = initWorking(); //init(WorkingSearchModel); // its better to make a clone form DefualtSearchModel than calling the function twice
            //this.DefaultSearchModel = Get(this.WorkingSearchModel.CriteriaComponent);
            this.WorkingSearchModel = Get(this.WorkingSearchModel.CriteriaComponent);
        }
Beispiel #5
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param>NA</param>
        /// <returns></returns>
        private SearchModel initDefault()
        {
            SearchModel model = new SearchModel();

            //facets
            model.SearchComponent.Facets = SearchConfig.getFacets().ToList();

            //properties
            model.SearchComponent.Properties = new List <Property>(SearchConfig.getProperties());

            //categories
            model.SearchComponent.Categories = new List <Category>(SearchConfig.getCategories());

            //Textvalues
            model.SearchComponent.TextBoxSearchValues = new List <TextValue>();

            return(model);
            //throw new NotImplementedException();
        }
Beispiel #6
0
 /// <summary>
 ///
 /// </summary>
 /// <remarks></remarks>
 /// <seealso cref=""/>
 /// <param name="searchCriteria"></param>
 /// <return></return>
 public void SearchAndUpdate(SearchCriteria searchCriteria)
 {
     this.WorkingSearchModel = Get(searchCriteria);
     this.WorkingSearchModel = UpdateFacets(searchCriteria);
     this.WorkingSearchModel = UpdateProperties(searchCriteria);
 }