Exemple #1
0
        public override void RunPostConverter(Coveo.CES.Interops.COMCoveoConvertersWrappers.PostConversion p_PostConversion, Coveo.CES.Interops.COMCoveoConvertersWrappers.DocumentInfo p_DocumentInfo)
        {
            string body   = p_PostConversion.Text.ReadString(p_PostConversion.Text.CharsCount);
            string result = Regex.Replace(body, @"<[^>]*>", String.Empty);

            p_PostConversion.TextToOverride.WriteString(result);
        }
Exemple #2
0
        public override void RunPostConverter(Coveo.CES.Interops.COMCoveoConvertersWrappers.PostConversion p_PostConversion, Coveo.CES.Interops.COMCoveoConvertersWrappers.DocumentInfo p_DocumentInfo)
        {
            string objecttype = SafeGetFieldValue(p_DocumentInfo, "objecttype");

            if (objecttype == "KBBlog")
            {
                uri = "https://ABC.com/Blog/" + p_DocumentInfo.Title.Replace(" ", "-");
                p_DocumentInfo.ClickableURI = uri;
                p_DocumentInfo.PrintableURI = uri;
            }
        }
Exemple #3
0
        public override void RunPostConverter(Coveo.CES.Interops.COMCoveoConvertersWrappers.PostConversion p_PostConversion, Coveo.CES.Interops.COMCoveoConvertersWrappers.DocumentInfo p_DocumentInfo)
        {
            string contactemail = SafeGetFieldValue(p_DocumentInfo, "contactemail");

            if (!String.IsNullOrEmpty(contactemail))
            {
                p_DocumentInfo.Permissions.Clear();
                DocumentPermissionsEx   permissions = p_DocumentInfo.Permissions;
                DocumentPermissionLevel level       = permissions.AddPermissionLevel();
                DocumentPermissionSet   set         = level.AddPermissionSet();
                string[] email = contactemail.Split('@');
                set.Allowed.AddPermissionWithType(contactemail, PermissionTypeEnumeration.USER_PERMISSION_TYPE, "Email Security Provider");
                set.Allowed.AddPermissionWithType("*@" + email[1], PermissionTypeEnumeration.GROUP_PERMISSION_TYPE, "Email Security Provider");
            }
        }
        public override void RunPostConverter(Coveo.CES.Interops.COMCoveoConvertersWrappers.PostConversion p_PostConversion, Coveo.CES.Interops.COMCoveoConvertersWrappers.DocumentInfo p_DocumentInfo)
        {
            string sqlConnection = p_PostConversion.GetParameter("sqlconnection");
            string projectNumber = SafeGetFieldValue(p_DocumentInfo, "ProjectNumber");

            using (IDbConnection cnnUsers = new SqlConnection(sqlConnection))
            {
                cnnUsers.Open();
                using (IDbCommand cmdUsers = cnnUsers.CreateCommand())
                {
                    cmdUsers.CommandText = "SELECT userName FROM ABC_ProjectMapping WHERE ProjectNumber ='" + projectNumber + "'";
                    using (IDataReader dbReader = cmdUsers.ExecuteReader())
                    {
                        while (dbReader.Read())
                        {
                            DocumentPermissionsEx   test  = p_DocumentInfo.Permissions;
                            DocumentPermissionLevel level = test.AddPermissionLevel();
                            DocumentPermissionSet   set   = level.AddPermissionSet();
                            set.Allowed.AddPermissionWithType(dbReader["userName"].ToString(), PermissionTypeEnumeration.USER_PERMISSION_TYPE, "salesforce regex");
                        }
                    }
                }
            }
        }