/// <summary>
 /// Create and Enable application in SSO Store
 /// </summary>
 /// <param name="appName">Application to create/enable</param>
 /// <param name="description"></param>
 /// <param name="ContactInfo"></param>
 /// <param name="AppUserAcct"></param>
 /// <param name="AppAdminAcct"></param>
 /// <param name="propertiesBag"></param>
 /// <param name="maskArray"></param>
 public static void CreateAndEnableAppInSSO(string appName, string description, string ContactInfo,
                                            string AppUserAcct, string AppAdminAcct, SSOPropBag propertiesBag, ArrayList maskArray)
 {
     //create and enable application
     SSOConfigManager.CreateConfigStoreApplication(appName, description, ContactInfo,
                                                   AppUserAcct, AppAdminAcct, propertiesBag, maskArray);
     //set default configuration field values
     SSOConfigManager.SetConfigProperties(appName, propertiesBag);
 }
Пример #2
0
        private bool UpdateSSOApplication(string newName, string oldName)
        {
            //write to SSOPropBag to figure out how many rows we have
            ArrayList maskArray = new ArrayList();

            try
            {
                HybridDictionary props = new HybridDictionary();

                foreach (DataGridViewRow row in dgvSearch.Rows)
                {
                    int keyIndex   = 0;
                    int valueIndex = 1;

                    if (row.Cells[keyIndex].Value != null)
                    {
                        // insert values on grid from property bag, replace special characters like \r \t
                        object objPropValue = row.Cells[valueIndex].Value.ToString().Replace("\t", "").Replace("\r", "");
                        object objPropKey   = row.Cells[keyIndex].Value.ToString().Replace("\t", "").Replace("\r", "");
                        props.Add(objPropKey, objPropValue);
                        maskArray.Add(0);
                    }
                }

                //if (newApp)
                //{
                SSOConfigManager.DeleteApplication(oldName);
                //}

                SSOPropBag propertiesBag = new SSOPropBag(props);

                //create and enable application
                SSOConfigManager.CreateConfigStoreApplication(newName, "", ContactInfo,
                                                              AuserAcct, AdminAcct, propertiesBag, maskArray);

                //set default configuration field values
                SSOConfigManager.SetConfigProperties(newName, propertiesBag);
            }
            catch (NullReferenceException ex)
            {
                MessageBox.Show("Erro, verifique se existe alguma key repetida\n" + ex.ToString(),
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occured.  Details: " + ex.ToString(),
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            return(true);
        }
Пример #3
0
        private void AddBlankApp()
        {
            string   appName  = copyAppName(_newapplication);
            TreeNode node     = new TreeNode(appName);
            TreeNode rootNode = tvApps.TopNode;

            rootNode.Nodes.Add(node);
            tvApps.SelectedNode = node;
            tvApps.LabelEdit    = true;
            tvApps.SelectedNode.BeginEdit();
            SSOConfigManager.CreateConfigStoreApplication(appName, "", ContactInfo,
                                                          AuserAcct, AdminAcct, new SSOPropBag(), new ArrayList());
            InicSearchGrid();
        }