Ejemplo 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)
        {
            // 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;

            string dbTable = "rb_EnhancedHtml";

            if (Version == WorkFlowVersion.Staging)
            {
                dbTable += "_st";
            }
            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition(dbTable, "Title", "DesktopHtml", "CreatedByUser", "CreatedDate", searchField);
            string retorno = s.SearchSqlSelect(portalID, userID, searchString);

            if (HttpContext.Current != null && HttpContext.Current.Items["PortalSettings"] != null)
            {
                PortalSettings pS = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
                retorno += " AND ((itm.CultureCode = '" + pS.PortalUILanguage.LCID.ToString() + "') OR (itm.CultureCode = '" + System.Globalization.CultureInfo.InvariantCulture.LCID.ToString() + "'))";
            }
            return(retorno);
        }
Ejemplo 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 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)
        {
            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition("rb_Blogs", "Title", "Excerpt", "CreatedByUser", "CreatedDate", searchField);

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

            return(s.SearchSqlSelect(portalID, userID, searchString));
        }
Ejemplo 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 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)
        {
            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition("rb_EnhancedLinks", "Title", "Description", "CreatedByUser", "CreatedDate", searchField);

            s.ArrSearchFields.Add("itm.Url");
            s.ArrSearchFields.Add("itm.ImageUrl");

            return(s.SearchSqlSelect(portalID, userID, searchString, true));
        }
Ejemplo n.º 4
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)
        {
            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition("rb_Documents", "FileFriendlyName", "FileNameUrl", "CreatedByUser", "CreatedDate", searchField);

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

            return(s.SearchSqlSelect(portalID, userID, searchString));
        }
Ejemplo 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)
        {
            // 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.

            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.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));
        }
Ejemplo 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 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.

            Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.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));
        }
Ejemplo n.º 7
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)
 {
     Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition("rb_Discussion", "Title", "Body", "CreatedByUser", "CreatedDate", searchField);
     return(s.SearchSqlSelect(portalID, userID, searchString));
 }
Ejemplo n.º 8
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)
 {
     Rainbow.Helpers.SearchDefinition s = new Rainbow.Helpers.SearchDefinition("rb_HtmlText", "DesktopHtml", "DesktopHtml", searchField);
     return(s.SearchSqlSelect(portalID, userID, searchString, false));
 }