Exemplo n.º 1
0
        /// <summary>
        /// Searchable module implementation
        /// </summary>
        /// <param name="portalId">
        /// The portal ID
        /// </param>
        /// <param name="userId">
        /// ID of the user is searching
        /// </param>
        /// <param name="searchString">
        /// The text to search
        /// </param>
        /// <param name="searchField">
        /// The fields where perfoming the search
        /// </param>
        /// <returns>
        /// The SELECT sql to perform a search on the current module
        /// </returns>
        public override string SearchSqlSelect(int portalId, int userId, string searchString, string searchField)
        {
            // Parameters:
            // Table Name: the table that holds the data
            // Title field: the field that contains the title for result, must be a field in the table
            // Abstract field: the field that contains the text for result, must be a field in the table
            // Search field: pass the searchField parameter you recieve.
            var s = new SearchDefinition(
                "rb_Pictures", "ShortDescription", "Keywords", "CreatedByUser", "CreatedDate", "Keywords");

            // Add here extra search fields, this way
            s.ArrSearchFields.Add("itm.ShortDescription");

            // Builds and returns the SELECT query
            return s.SearchSqlSelect(portalId, userId, searchString);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Searchable module implementation
 /// </summary>
 /// <param name="portalId">
 /// The portal ID
 /// </param>
 /// <param name="userId">
 /// ID of the user is searching
 /// </param>
 /// <param name="searchString">
 /// The text to search
 /// </param>
 /// <param name="searchField">
 /// The fields where performing the search
 /// </param>
 /// <returns>
 /// The SELECT sql to perform a search on the current module
 /// </returns>
 public override string SearchSqlSelect(int portalId, int userId, string searchString, string searchField)
 {
     var s = new SearchDefinition("rb_HtmlText", "DesktopHtml", "DesktopHtml", searchField);
     return s.SearchSqlSelect(portalId, userId, searchString, false);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Searchable module implementation
        /// </summary>
        /// <param name="portalId">
        /// The portal ID
        /// </param>
        /// <param name="userId">
        /// ID of the user is searching
        /// </param>
        /// <param name="searchString">
        /// The text to search
        /// </param>
        /// <param name="searchField">
        /// The fields where performing the search
        /// </param>
        /// <returns>
        /// The SELECT SQL to perform a search on the current module
        /// </returns>
        /// <remarks>
        /// </remarks>
        public override string SearchSqlSelect(int portalId, int userId, string searchString, string searchField)
        {
            // For better performance is necessary to add in
            // method FillPortalDS from PortalSearch.ascx.cs the
            // next case:
            // case "875254B7-2471-491F-BAF8-4AFC261CC224":  //EnhancedHtml
            // strLink = HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx", Convert.ToInt32(strTabID), strLocate);
            // break;
            var dbTable = "rb_EnhancedHtml";
            if (this.Version == WorkFlowVersion.Staging)
            {
                dbTable += "_st";
            }

            var s = new SearchDefinition(dbTable, "Title", "DesktopHtml", "CreatedByUser", "CreatedDate", searchField);
            var retorno = s.SearchSqlSelect(portalId, userId, searchString);
            if (HttpContext.Current != null && HttpContext.Current.Items["PortalSettings"] != null)
            {
                var pS = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
                retorno += string.Format(
                    " AND ((itm.CultureCode = '{0}') OR (itm.CultureCode = '{1}'))",
                    pS.PortalUILanguage.LCID,
                    CultureInfo.InvariantCulture.LCID);
            }

            return retorno;
        }
        /// <summary>
        /// Searchable module implementation
        /// </summary>
        /// <param name="portalID">The portal ID</param>
        /// <param name="userID">ID of the user is searching</param>
        /// <param name="searchString">The text to search</param>
        /// <param name="searchField">The fields where perfoming the search</param>
        /// <returns>
        /// The SELECT sql to perform a search on the current module
        /// </returns>
        public override string SearchSqlSelect(int portalID, int userID, string searchString, string searchField)
        {
            // Parameters:
            // Table Name: the table that holds the data
            // Title field: the field that contains the title for result, must be a field in the table
            // Abstract field: the field that contains the text for result, must be a field in the table
            // Search field: pass the searchField parameter you recieve.

            SearchDefinition s =
                new SearchDefinition("rb_ComponentModule", "Title", "Component", "CreatedByUser", "CreatedDate",
                                     searchField);

            //Add here extra search fields, this way
            //s.ArrSearchFields.Add("itm.ExtraFieldToSearch");

            // Builds and returns the SELECT query
            return s.SearchSqlSelect(portalID, userID, searchString, false);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Searchable module implementation
        /// </summary>
        /// <param name="portalID">The portal ID</param>
        /// <param name="userID">ID	of the user	is searching</param>
        /// <param name="searchString">The text	to search</param>
        /// <param name="searchField">The fields where perfoming the search</param>
        /// <returns>
        /// The SELECT	sql	to perform a search	on the current module
        /// </returns>
        public override string SearchSqlSelect(int portalID, int userID, string searchString, string searchField)
        {
            SearchDefinition s =
                new SearchDefinition("rb_Events", "Title", "Description", "CreatedByUser", "CreatedDate", searchField);

            //Add extra	search fields here,	this way
            s.ArrSearchFields.Add("itm.WhereWhen");

            return s.SearchSqlSelect(portalID, userID, searchString);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Searchable module implementation
        /// </summary>
        /// <param name="portalId">
        /// The portal ID
        /// </param>
        /// <param name="userId">
        /// ID of the user is searching
        /// </param>
        /// <param name="searchString">
        /// The text to search
        /// </param>
        /// <param name="searchField">
        /// The fields where performing the search
        /// </param>
        /// <returns>
        /// The SELECT SQL to perform a search on the current module
        /// </returns>
        public override string SearchSqlSelect(int portalId, int userId, string searchString, string searchField)
        {
            var s = new SearchDefinition(
                "rb_Articles", "Title", "Abstract", "CreatedByUser", "CreatedDate", searchField);

            // Add extra search fields here, this way
            s.ArrSearchFields.Add("itm.Description");

            return s.SearchSqlSelect(portalId, userId, searchString);
        }