Ejemplo n.º 1
0
        public CswNbtSearch getSearch(string SearchTerm, CswEnumSqlLikeMode SearchType, Int32 NodeTypeId, Int32 ObjectClassId, Int32 PropertySetId)
        {
            CswNbtSearch Search = new CswNbtSearch(_CswNbtResources)
            {
                SearchTerm = SearchTerm,
                SearchType = SearchType
            };

            if (Int32.MinValue != NodeTypeId)
            {
                CswNbtMetaDataNodeType NodeType = _CswNbtResources.MetaData.getNodeType(NodeTypeId);
                if (null != NodeType)
                {
                    Search.addFilter(NodeType, false);
                }
            }
            if (Int32.MinValue != ObjectClassId)
            {
                CswNbtMetaDataObjectClass ObjectClass = _CswNbtResources.MetaData.getObjectClass(ObjectClassId);
                if (null != ObjectClass)
                {
                    Search.addFilter(ObjectClass, false);
                }
            }
            if (Int32.MinValue != PropertySetId)
            {
                CswNbtMetaDataPropertySet PropertySet = _CswNbtResources.MetaData.getPropertySet(PropertySetId);
                if (null != PropertySet)
                {
                    Search.addFilter(PropertySet, false);
                }
            }
            return(Search);
        }
Ejemplo n.º 2
0
        public void FromJObject(JObject SearchObj)
        {
            SearchTerm = SearchObj["searchterm"].ToString();
            if (null != SearchObj["searchtype"])
            {
                SearchType = (CswEnumSqlLikeMode)SearchObj["searchtype"].ToString();
            }
            if (null != SearchObj["name"])
            {
                Name = SearchObj["name"].ToString();
            }
            if (null != SearchObj["category"])
            {
                Category = SearchObj["category"].ToString();
            }
            if (null != SearchObj["searchid"])
            {
                SearchId = new CswPrimaryKey(CswNbtSearchManager.SearchTableName, CswConvert.ToInt32(SearchObj["searchid"]));
            }
            if (null != SearchObj["sessiondataid"])
            {
                SessionDataId = new CswNbtSessionDataId(SearchObj["sessiondataid"].ToString());
            }
            if (null != SearchObj["onlymergeablenodetypes"])
            {
                OnlyMergeableNodeTypes = CswConvert.ToBoolean(SearchObj["onlymergeablenodetypes"]);
            }
            JArray FiltersArr = (JArray)SearchObj["filtersapplied"];

            foreach (JObject FilterObj in FiltersArr)
            {
                addFilter(FilterObj);
            }
        } // FromJObject()
Ejemplo n.º 3
0
        }//ctor

        #region UniversalSearch

        public JObject doUniversalSearch(string SearchTerm, CswEnumSqlLikeMode SearchType, Int32 NodeTypeId, Int32 ObjectClassId, Int32 PropertySetId, Int32 Page, Int32 PageLimit, bool OnlyMergeableNodeTypes, List <string> ExcludeNodeIds, bool IncludeInRecent)
        {
            CswNbtSearch Search = getSearch(SearchTerm, SearchType, NodeTypeId, ObjectClassId, PropertySetId);

            Search.OnlyMergeableNodeTypes = OnlyMergeableNodeTypes;
            Search.ExcludeNodeIds         = ExcludeNodeIds;
            return(_finishUniversalSearch(Search, Page, PageLimit, IncludeInRecent));
        }
 public CswNbtTreeLoaderFromSearchByLevel(CswNbtResources CswNbtResources, ICswNbtUser RunAsUser, ICswNbtTree pCswNbtTree, string SearchTerm, CswEnumSqlLikeMode SearchType, string WhereClause,
                                          bool IncludeSystemNodes, bool IncludeHiddenNodes, bool SingleNodetype, bool OnlyMergeableNodeTypes, List <string> ExcludeNodeIds = null)
     : base(pCswNbtTree)
 {
     _CswNbtResources        = CswNbtResources;
     _RunAsUser              = RunAsUser;
     _SearchTerm             = _makeSafeSearchTerm(SearchTerm);
     _SearchType             = SearchType;
     _ExtraWhereClause       = WhereClause;
     _IncludeSystemNodes     = IncludeSystemNodes;
     _IncludeHiddenNodes     = IncludeHiddenNodes;
     _SingleNodetype         = SingleNodetype;
     _OnlyMergeableNodeTypes = OnlyMergeableNodeTypes;
     if (null != ExcludeNodeIds)
     {
         _ExcludeNodeIds = new CswCommaDelimitedString(string.Join(",", ExcludeNodeIds.ToArray()));
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Instance a Tree from a Universal Search
        /// </summary>
        public ICswNbtTree getTreeFromSearch(ICswNbtUser RunAsUser, string SearchTerm, CswEnumSqlLikeMode SearchType, string WhereClause,
                                             bool RequireViewPermissions, bool IncludeSystemNodes, bool IncludeHiddenNodes, bool SingleNodetype, bool OnlyMergeableNodeTypes, Int32 PerLevelNodeLimit = Int32.MinValue, List <string> ExcludeNodeIds = null)
        {
            ICswNbtTree ReturnVal = new CswNbtTreeNodes("", null, _CswNbtResources, _CswNbtNodeCollection, IsFullyPopulated: true);
            CswNbtTreeLoaderFromSearchByLevel TreeLoader = new CswNbtTreeLoaderFromSearchByLevel(_CswNbtResources, RunAsUser, ReturnVal, SearchTerm, SearchType, WhereClause,
                                                                                                 IncludeSystemNodes, IncludeHiddenNodes, SingleNodetype, OnlyMergeableNodeTypes, ExcludeNodeIds);

            TreeLoader.load(RequireViewPermissions, PerLevelNodeLimit);

            return(ReturnVal);
        } //getTreeFromSearch()
Ejemplo n.º 6
0
        }//getTreeFromView()

        /// <summary>
        /// Instance a Tree from a Universal Search
        /// </summary>
        public ICswNbtTree getTreeFromSearch(string SearchTerm, CswEnumSqlLikeMode SearchType, string WhereClause,
                                             bool RequireViewPermissions, bool IncludeSystemNodes, bool IncludeHiddenNodes, bool SingleNodetype, bool OnlyMergeableNodeTypes, Int32 PerLevelNodeLimit = Int32.MinValue, List <string> ExcludeNodeIds = null)
        {
            return(getTreeFromSearch(_CswNbtResources.CurrentNbtUser, SearchTerm, SearchType, WhereClause, RequireViewPermissions, IncludeSystemNodes, IncludeHiddenNodes, SingleNodetype, OnlyMergeableNodeTypes, PerLevelNodeLimit, ExcludeNodeIds));
        }
Ejemplo n.º 7
0
 public CswNbtApiSearchRequest(string query, string searchtype)
 {
     Query      = query;
     SearchType = (CswEnumSqlLikeMode)searchtype;
 }