Exemple #1
0
        public void Initialise()

        {
            InitialiseAttributesList();

            InitialiseClassesList();

            //this.RemoveAuxiliaryAttribtueButton.Enabled = false;

            // this.AddAuxiliaryAttributeButton.Enabled = false;

            if (!isAddMode)

            {
                ObjectClassModDTO = new ObjectClassDTO();

                InitialiseControlsWithDTO();

                this.AddButton.Text = "Edit";

                SetUIFieldsEditability(false);
            }

            else

            {
                ObjectDTO = new ObjectClassDTO();

                parentClassList.AddRange(abstractClasses);
            }
        }
 public ObjectClassWindow(ObjectClassDTO dto, SchemaManager schemaManager)
 {
     InitializeComponent();
     this.ObjectDTO        = dto;
     isAddMode             = false;
     this.schemaManager    = schemaManager;
     this.attributeManager = schemaManager.GetAttributeTypeManager();
     this.objectManager    = schemaManager.GetObjectClassManager();
     Initialise();
 }
Exemple #3
0
        public VMDirSchemaClassEntryNode(VMDirSchemaServerNode node, ObjectClassDTO dto)

            : base(node)

        {
            this.DisplayName = dto.Name;

            ObjectClassDto = dto;

            InitConsole();
        }
Exemple #4
0
        public void OnClickSelectButton(object sender, EventArgs e)
        {
            nint row = AddObjectTableView.SelectedRow;

            if (row >= (nint)0)
            {
                _selectedObject = _list[(int)row];
                this.Close();
                NSApplication.SharedApplication.StopModalWithCode(1);
            }
            else
            {
                UIErrorHelper.ShowWarning(VMDirConstants.WRN_OC_SEL);
            }
        }
 public override void AwakeFromNib()
 {
     base.AwakeFromNib();
     //AuxiliaryClassesListView.Enabled = false;
     // RemoveAuxiliaryClassesButton.Enabled = false;
     //AddAuxiliaryClassesButton.Enabled = false;
     if (!isAddMode)
     {
         ObjectClassModDTO = new ObjectClassDTO();
         InitialiseControlsWithDTO();
         ActionButton.Title = VMIdentityConstants.EDIT;
         SetUIFieldsEditability(false);
     }
     else
     {
         ObjectDTO = new ObjectClassDTO();
         parentClassList.AddRange(abstractClasses);
     }
 }
        public void ModifyObjectClass(ObjectClassDTO dto)
        {
            MaintainSession(delegate()
            {
                List <LdapMod> objectclass = new List <LdapMod>();

                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_REPLACE, VMDirConstants.DESCRIPTION, new string[] { dto.Description, null }));

                if (dto.May != null && dto.May.Count > 0)
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_REPLACE, VMDirConstants.SYSTEM_MAY_CONTAIN, ConvertListToLdapStringArray(dto.May)));
                }
                if (dto.Aux != null && dto.Aux.Count > 0)
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_REPLACE, VMDirConstants.SYSTEM_AUX_CLASSES, ConvertListToLdapStringArray(dto.Aux)));
                }

                string dn = "cn=" + dto.Name + ",cn=schemacontext";
                ldConn.ModifyObject(dn, objectclass.ToArray());
            });
        }
        public void AddObjectClass(ObjectClassDTO dto)
        {
            MaintainSession(delegate()
            {
                List <LdapMod> objectclass = new List <LdapMod>();

                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.ATTR_CN, new string[] { dto.Name, null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.ATTR_OBJECT_CLASS, new string[] { VMDirConstants.DEFAULT_OBJECT_CLASS_NAME, null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.SUB_CLASS_OF, new string[] { dto.SuperClass, null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.OBJECT_CLASS_CATEGORY, new string[] { Convert.ToString(dto.GetObjectClassType()), null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.GOVERNS_ID, new string[] { dto.GovernsID, null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.SCHEMA_ID_GUID, new string[] { dto.Name, null }));
                objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.DEFAULT_OBJECT_CATEGORY, new string[] { "cn=schemacontext", null }));

                if (dto.Description != null && !String.IsNullOrWhiteSpace(dto.Description))
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.DESCRIPTION, new string[] { dto.Description, null }));
                }

                if (dto.Must != null && dto.Must.Count > 0)
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.SYSTEM_MUST_CONTAIN, ConvertListToLdapStringArray(dto.Must)));
                }

                if (dto.May != null && dto.May.Count > 0)
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.SYSTEM_MAY_CONTAIN, ConvertListToLdapStringArray(dto.May)));
                }

                if (dto.Aux != null && dto.Aux.Count > 0)
                {
                    objectclass.Add(new LdapMod((int)LdapMod.mod_ops.LDAP_MOD_ADD, VMDirConstants.SYSTEM_AUX_CLASSES, ConvertListToLdapStringArray(dto.Aux)));
                }
                string dn = "cn=" + dto.Name + ",cn=schemacontext";
                ldConn.AddObject(dn, objectclass.ToArray());
            });
        }
Exemple #8
0
 int SortObjectClassDTO(ObjectClassDTO lhs, ObjectClassDTO rhs)
 {
     return(lhs.Name.CompareTo(rhs.Name));
 }
 public ObjectClassWindowController(ObjectClassDTO dto, SchemaManager schemaManager)
     : this(schemaManager)
 {
     this.ObjectDTO = dto;
     isAddMode      = false;
 }
 public static int ObjectClassDTOSort(ObjectClassDTO lhs, ObjectClassDTO rhs)
 {
     return(lhs.Name.CompareTo(rhs.Name));
 }