Beispiel #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            EnsureChildControls();
            CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(ViewControl),
                                                                     "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.ViewControl.js");

            var sharePointListService = PublicApi.Lists;
            var list = sharePointListService.Get(SPCoreService.Context.ListId);

            if (list != null)
            {
                string script =
                    @"jQuery.telligent.evolution.extensions.lookupSharePointView.register({{
                    WebItemControl: jQuery('input#web-item-url'),
                    ListTextBox: jQuery('input#list-item-id'),
                    ViewTextBox: jQuery('input#sp-view-id')
                    Spinner: '<div style=""text-align: center;""><img src=""' + $.telligent.evolution.site.getBaseUrl() + 'Utility/spinner.gif"" /></div>'
                }});";
                CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(ViewControl), "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.ViewControl",
                                                                      @"<script type='text/javascript' language='javascript'>
                    jQuery(document).ready(function(){
                        " + script + @"
                    });
                </script>", false);
            }
            else
            {
                this.Visible = false;
            }
        }
Beispiel #2
0
 protected override void OnPreRender(EventArgs e)
 {
     base.OnPreRender(e);
     this.Controls.Add(new LiteralControl(PageScripts()));
     // Register javascript
     CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(ItemCollectionControl),
                                                              "Telligent.Evolution.Extensions.OpenSearch.Controls.ItemCollection.js");
 }
Beispiel #3
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     EnsureChildControls();
     CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(ListControl),
                                                              "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.LibraryControl.js");
     CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(ListControl), "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.LibraryControl", GetInitialClientScript(), true);
 }
Beispiel #4
0
 protected override void OnInit(EventArgs e)
 {
     Page.ViewStateMode   = ViewStateMode.Enabled;
     Page.EnableViewState = true;
     base.OnInit(e);
     EnsureChildControls();
     CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(ConfigureProviderControl),
                                                              "Telligent.Evolution.Extensions.OpenSearch.PropertyControls.ConfigureProviderControl.js");
 }
Beispiel #5
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(MultiSelectRepeater), "FourRoads.Common.TelligentCommunity.Controls.MultiSelectRepeater.js");

            if (_selectedItemIndexes == null)
            {
                //Create a hidden field that manages the list of selected items
                _selectedItemIndexes    = Page.LoadControl(typeof(HiddenField), new object[] {}) as HiddenField;
                _selectedItemIndexes.ID = "HiddenSelectedItemList";

                Controls.Add(_selectedItemIndexes);
            }
        }
Beispiel #6
0
        protected void SaveBtnClick(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            if (!String.IsNullOrEmpty(tbName.Text))
            {
                openSearchProvider.Name = HttpUtility.HtmlEncode(tbName.Text);
            }

            openSearchProvider.Authentication = AuthenticationHelper.FromHtml(ctAuth);
            const string script = @"setTimeout(function(){{CloseWindow('{0}');}},100);";

            CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(OpenSearchProviderPage), "closechildwindow",
                                                                  string.Format(script, Components.JavaScript.Encode(openSearchProvider.ToXml())), true);
        }
Beispiel #7
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     hdnProviderList = new HiddenField {
         ID = "CurrentProviderListXML"
     };
     hdnProviderData = new HiddenField {
         ID = "ProviderData"
     };
     hdnProviderAction = new HiddenField {
         ID = "ProviderAction"
     };
     Controls.Add(hdnProviderList);
     Controls.Add(hdnProviderData);
     Controls.Add(hdnProviderAction);
     // Register javascript function callback
     CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(SearchProvidersListControl),
                                                              "Telligent.Evolution.Extensions.OpenSearch.PropertyControls.SearchProvidersListControl.js");
     FilterDefaultText = "Find Provider";
 }
Beispiel #8
0
        protected void ApplyBtnClick(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                ShowErrorMessage("Invalid Data");
                return;
            }

            try
            {
                spConfig.SyncEnabled     = cbSyncEnable.Checked;
                spConfig.FarmSyncEnabled = cbFarmSyncEnable.Checked;

                spConfig.SiteProfileMappedFields = new List <UserFieldMapping>();
                ProcessPostedData(spConfig.SiteProfileMappedFields, hdnSiteProfileFieldsMap.Value);

                spConfig.FarmProfileMappedFields = new List <UserFieldMapping>();
                ProcessPostedData(spConfig.FarmProfileMappedFields, hdnFarmProfileFieldsMap.Value);

                // Save Configuration to a syncSettings object
                spSyncSettings.SyncConfig = new SPBaseConfig
                {
                    FarmProfileMappedFields = spConfig.FarmProfileMappedFields,
                    SiteProfileMappedFields = spConfig.SiteProfileMappedFields,
                    SyncEnabled             = spConfig.SyncEnabled,
                    FarmSyncEnabled         = spConfig.FarmSyncEnabled
                };

                BindDropDownListData(ddlSPSiteProfileFields, spConfig.SiteProfileFields.OrderBy(f => f.Title).ToList(), f => String.Format("{0} - {1}", f.Title, f.Name));
                BindDropDownListData(ddlSPFarmProfileFields, spConfig.FarmProfileFields.OrderBy(f => f.Title), f => f.Title);
                BindDropDownListData(ddlTEProfileFields, TEUserProfileFieldsHelper.GetFields().OrderBy(f => f.Name).ToList(), f => f.Name);

                const string script = @"setTimeout(function(){{parent.window.frames[0].AddSyncSettings('{0}');}},100);";
                CSControlUtility.Instance().RegisterClientScriptBlock(this, GetType(), "applychildwindow", string.Format(script, JavaScript.Encode(spSyncSettings.ToXml())), true);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.Message);
                SPLog.RoleOperationUnavailable(ex, ex.Message);
            }
        }
        private void UpdateCurrentProvider(string spSiteUrl, Authentication auth)
        {
            if (pageMode == PageMode.Add)
            {
                currentProvider = new IntegrationProvider(spSiteUrl, 0, auth);
            }
            else
            {
                currentProvider.SPSiteURL      = spSiteUrl;
                currentProvider.TEGroupId      = 0;
                currentProvider.Authentication = auth;
                currentProvider.Initialize();
            }

            currentProvider.IsDefault = CbIsDefault.Checked;

            const string script = @"setTimeout(function(){{CloseWindow('{0}');}},100);";

            CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(Configuration), "closechildwindow",
                                                                  string.Format(script, JavaScript.Encode(currentProvider.ToXml())), true);
        }
Beispiel #10
0
        protected override void OnInit(EventArgs e)
        {
            InitManagerCollection();
            base.OnInit(e);
            EnsureChildControls();
            CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(WebControl),
                                                                     "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.WebControl.js");

            CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(WebControl), "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.WebControl",
                                                                  @"<script type='text/javascript' language='javascript'>
                    jQuery(document).ready(function(){
                        var startValue = jQuery('#web-item').val();
                        jQuery.telligent.evolution.extensions.lookupSharePointWeb.register({
                            LookUpTextBox: jQuery('input#web-item-url'),
                            Data: eval('(' + jQuery('input#web-item-collection').val() + ')'),
                            SiteUrl: startValue == 'null' || startValue == '' ? [] : [eval('(' + startValue+ ')').Name],
                            Spinner: '<div style=""text-align: center;""><img src=""' + $.telligent.evolution.site.getBaseUrl() + 'Utility/spinner.gif"" /></div>'
                        });
                    });
                </script>", false);
        }
Beispiel #11
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!RowSelectionEnabled)
            {
                return; // exit if not RowSelectionEnabled == true
            }

            // add the click client-side event handler, if needed
            if (ChildControlsCreated && Controls.Count > 0)
            {
                List <string> rowObjects = CreateClickEvent();

                //Now build row object initialization script
                const string MultiselectDGManagerString = @"
					var {0} = new MultiselectDG_RowManager({1} , '{2}' , '{3}' , '{4}' , {5});
				"                ;

                const string MultiselectDGRow = @"
					{0}.AddRow({1});
				"                ;

                StringBuilder strBuilder = new StringBuilder(4000);


                strBuilder.AppendFormat(MultiselectDGManagerString, ClientID, (SelectMode == SELECTMODE.Multi) ? "true" : "false", _selectedItemIndexes.ClientID, RowHighlightCssClass, RowSelectedCssClass, !string.IsNullOrEmpty(SelectedItemCallback) ? SelectedItemCallback : "null");

                strBuilder.AppendLine();

                foreach (string row in rowObjects)
                {
                    strBuilder.AppendFormat(MultiselectDGRow, ClientID, row);
                    strBuilder.AppendLine();
                }


                CSControlUtility.Instance().RegisterStartupScript(this, typeof(MultiSelectRepeater), ClientID, strBuilder.ToString(), true);
            }
        }
Beispiel #12
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            EnsureChildControls();
            CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(ViewNameControl),
                                                                     "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.ViewNameControl.js");

            string script = String.Format(
                @"jQuery.telligent.evolution.extensions.lookupSharePointViewName.register({{
                    WebItemControl: jQuery('input#web-item-url'),
                    ListTextBox: jQuery('input#list-item-id'),
                    ViewTextBox: jQuery('input#{0}'),
                    Spinner: '<div style=""text-align: center;""><img src=""' + $.telligent.evolution.site.getBaseUrl() + 'Utility/spinner.gif"" /></div>'
                }});", tbViewName.ClientID);

            CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(ViewNameControl), "Telligent.Evolution.Extensions.SharePoint.Client.Configuration.ViewNameControl",
                                                                  @"<script type='text/javascript' language='javascript'>
                    jQuery(document).ready(function(){
                        " + script + @"
                    });
                </script>", false);
        }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     ID                  = "profile-sync-control";
     ClientIDMode        = ClientIDMode.Static;
     hdnSyncSettingsList = new HiddenField {
         ID = ManagerListId, ClientIDMode = ClientIDMode.Static
     };
     hdnManagerData = new HiddenField {
         ID = "ManagerData", ClientIDMode = ClientIDMode.Static
     };
     hdnManagerAction = new HiddenField {
         ID = "ManagerAction", ClientIDMode = ClientIDMode.Static
     };
     Controls.Add(hdnSyncSettingsList);
     Controls.Add(hdnManagerData);
     Controls.Add(hdnManagerAction);
     // Register javascript function callback
     CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(SPProfileSyncControl),
                                                              "Telligent.Evolution.Extensions.SharePoint.ProfileSync.PropertyControls.SPProfileSyncControl.js");
     FilterDefaultText = "Find Site Collection";
 }
Beispiel #14
0
        protected void SaveBtnClick(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                ShowErrorMessage("Invalid Data");
                return;
            }

            try
            {
                spConfig.SyncEnabled     = cbSyncEnable.Checked;
                spConfig.FarmSyncEnabled = cbFarmSyncEnable.Checked;

                spConfig.SiteProfileMappedFields = new List <UserFieldMapping>();
                ProcessPostedData(spConfig.SiteProfileMappedFields, hdnSiteProfileFieldsMap.Value);

                spConfig.FarmProfileMappedFields = new List <UserFieldMapping>();
                ProcessPostedData(spConfig.FarmProfileMappedFields, hdnFarmProfileFieldsMap.Value);

                // Save Configuration to a syncSettings object
                spSyncSettings.SyncConfig = new SPBaseConfig
                {
                    FarmProfileMappedFields = spConfig.FarmProfileMappedFields,
                    SiteProfileMappedFields = spConfig.SiteProfileMappedFields,
                    SyncEnabled             = spConfig.SyncEnabled,
                    FarmSyncEnabled         = spConfig.FarmSyncEnabled
                };

                const string script = @"setTimeout(function(){{CloseWindow('{0}');}},100);";
                CSControlUtility.Instance().RegisterClientScriptBlock(this, GetType(), "closechildwindow", string.Format(script, JavaScript.Encode(spSyncSettings.ToXml())), true);

                TempStoreSPSyncSettingsList(true);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.Message);
                SPLog.RoleOperationUnavailable(ex, ex.Message);
            }
        }
        protected void SaveBtnClick(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            TbUserIdFieldName.Text        = (string.IsNullOrEmpty(TbUserIdFieldName.Text)) ? "ID" : TbUserIdFieldName.Text;
            TbUserEmailFieldName.Text     = (string.IsNullOrEmpty(TbUserEmailFieldName.Text)) ? "EMail" : TbUserEmailFieldName.Text;
            TbFarmUserEmailFieldName.Text = (string.IsNullOrEmpty(TbFarmUserEmailFieldName.Text)) ? "WorkEmail" : TbFarmUserEmailFieldName.Text;

            try
            {
                Authentication auth = AuthenticationHelper.FromHtml(CtAuth);

                if (Mode == PageMode.Add)
                {
                    spSyncSettings = new SPProfileSyncProvider(TbSPSiteUrl.Text, TbUserIdFieldName.Text, TbUserEmailFieldName.Text, TbFarmUserEmailFieldName.Text, auth);
                }
                else
                {
                    spSyncSettings.SPSiteURL                = TbSPSiteUrl.Text;
                    spSyncSettings.SPUserIdFieldName        = TbUserIdFieldName.Text;
                    spSyncSettings.SPUserEmailFieldName     = TbUserEmailFieldName.Text;
                    spSyncSettings.SPFarmUserEmailFieldName = TbFarmUserEmailFieldName.Text;
                    spSyncSettings.Authentication           = auth;
                }

                const string script = @"setTimeout(function(){{CloseWindow('{0}');}},100);";
                CSControlUtility.Instance().RegisterClientScriptBlock(this, GetType(), "closechildwindow",
                                                                      string.Format(script, JavaScript.Encode(spSyncSettings.ToXml())), true);

                TempStoreSPSyncSettingsList(true);
            }
            catch (Exception)
            {
                ShowErrorMessage();
            }
        }
Beispiel #16
0
        protected override void OnInit(EventArgs e)
        {
            ID           = "object-manager-control";
            ClientIDMode = ClientIDMode.Static;
            base.OnInit(e);
            hidden = new HiddenField {
                ID = ProviderListId, ClientIDMode = ClientIDMode.Static
            };
            hdnProviderData = new HiddenField {
                ID = "ManagerData", ClientIDMode = ClientIDMode.Static
            };
            hdnProviderAction = new HiddenField {
                ID = "ManagerAction", ClientIDMode = ClientIDMode.Static
            };
            Controls.Add(hidden);
            Controls.Add(hdnProviderData);
            Controls.Add(hdnProviderAction);

            // Register javascript function callback
            CSControlUtility.Instance().RegisterClientScriptResource(this, typeof(IntegrationManagerControl),
                                                                     "Telligent.Evolution.Extensions.SharePoint.IntegrationManager.PropertyControls.IntegrationManagerControl.js");

            FilterDefaultText = "Find Site Collection";
        }