Example #1
0
        static void Main(string[] args)
        {
            VDF.Vault.Results.LogInResult lr =
                VDF.Vault.Library.ConnectionManager.LogIn
                    ("localhost", "TestVault", "administrator", "", VDF.Vault.Currency.Connections.AuthenticationFlags.ReadOnly, null);

            if (lr.Success)
            {
                m_conn = lr.Connection;
                VDF.Vault.Forms.Settings.SelectEntitySettings settings =
                    new VDF.Vault.Forms.Settings.SelectEntitySettings();

                VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter[] filters =
                    new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter[]
                {
                    new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter("Assembly Files (*.iam)", ".+iam", VDF.Vault.Currency.Entities.EntityClassIds.Files),
                    new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter("Part Files (*.ipt)", ".+ipt", VDF.Vault.Currency.Entities.EntityClassIds.Files)
                };

                VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration initialConfig = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(m_conn, settings.PersistenceKey, null);

                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);
                initialConfig.AddInitialSortCriteria(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName, true);

                settings.DialogCaption = "Select Part or Assembly file to Upload";
                settings.ActionableEntityClassIds.Add("FILE");
                settings.MultipleSelect = false;
                settings.ConfigureActionButtons("Upload", null, null, false);
                settings.ConfigureFilters("Applied filter", filters, null);
                settings.OptionsExtensibility.GetGridConfiguration = e => initialConfig;

                Console.WriteLine("Launching Vault Browser...");
                VDF.Vault.Forms.Results.SelectEntityResults results =
                    VDF.Vault.Forms.Library.SelectEntity(m_conn, settings);
                if (results != null)
                {
                    VDF.Vault.Currency.Entities.FileIteration fileIter = results.SelectedEntities.FirstOrDefault() as VDF.Vault.Currency.Entities.FileIteration;
                    string result = Util.DownloadFilestoFolder(fileIter, m_conn);
                    if (result != "Directory not found")
                    {
                        Task t = Task.Run((Util.UploadAssembly));
                        t.Wait();
                    }
                }
            }
        }
Example #2
0
        public OrganisationPickerDialog(VDF.Vault.Currency.Connections.Connection connection)
        {
            InitializeComponent();

            _wsm = connection.WebServiceManager;
            var custEntDefs = _wsm.CustomEntityService.GetAllCustomEntityDefinitions();
            var custEntDef  = custEntDefs.SingleOrDefault(c => c.DispName.Equals("Organisation"));

            Icon = GetCustomEntityIcon(custEntDef);
            var entities = new List <VDF.Vault.Currency.Entities.IEntity>();
            var custEnts = GetAllCustomEntities(custEntDef);

            foreach (var custEnt in custEnts)
            {
                entities.Add(new VDF.Vault.Currency.Entities.CustomObject(connection, custEnt));
            }
            var configuration = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(
                connection,
                "Grid.SelectOrganisationAndOrderNumber",
                null);

            configuration.AddInitialColumn("Name");
            configuration.AddInitialSortCriteria("Name", true);

            _navigationModel = new VDF.Vault.Forms.Models.ViewVaultNavigationModel();
            _navigationModel.AddContent(entities);

            vaultBrowserControl1.SetDataSource(configuration, _navigationModel);
            vaultBrowserControl1.Refresh();
        }
Example #3
0
        /// <summary>
        /// Launches a Vault UI to select Ipt file
        /// </summary>
        /// <returns>Selected File</returns>
        private static Autodesk.Connectivity.WebServices.File SelectFilefromUI()
        {
            VDF.Vault.Currency.Entities.FileIteration fileIter = null;
            _connection = VDF.Vault.Forms.Library.Login(null);
            if (_connection.IsConnected)
            {
                VDF.Vault.Forms.Settings.SelectEntitySettings settings =
                    new VDF.Vault.Forms.Settings.SelectEntitySettings();

                VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter[] filters =
                    new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter[]
                {
                    // new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter("Assembly Files (*.iam)", ".+iam", VDF.Vault.Currency.Entities.EntityClassIds.Files),
                    new VDF.Vault.Forms.Settings.SelectEntitySettings.EntityRegularExpressionFilter("Part Files (*.ipt)", ".+ipt", VDF.Vault.Currency.Entities.EntityClassIds.Files)
                };

                VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration initialConfig = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(_connection, settings.PersistenceKey, null);

                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
                initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);
                initialConfig.AddInitialSortCriteria(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName, true);

                settings.DialogCaption = "Select Part or Assembly file to Upload";
                settings.ActionableEntityClassIds.Add("FILE");
                settings.MultipleSelect = false;
                settings.ConfigureActionButtons("Upload", null, null, false);
                settings.ConfigureFilters("Applied filter", filters, null);
                settings.OptionsExtensibility.GetGridConfiguration = e => initialConfig;

                Console.WriteLine("Launching Vault Browser...");
                VDF.Vault.Forms.Results.SelectEntityResults results =
                    VDF.Vault.Forms.Library.SelectEntity(_connection, settings);
                if (results != null)
                {
                    fileIter = results.SelectedEntities.FirstOrDefault() as VDF.Vault.Currency.Entities.FileIteration;
                }
            }
            return(fileIter);
        }
Example #4
0
        private void initalizeGrid()
        {
            VDF.Vault.Currency.Properties.PropertyDefinitionDictionary propDefs = vaultConnection.PropertyManager.GetPropertyDefinitions(null, null, VDF.Vault.Currency.Properties.PropertyDefinitionFilter.IncludeAll);

            VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration initialConfig = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(vaultConnection, "VaultBrowserSample", propDefs);

            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Client.EntityIcon);
            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatus);
            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
            initialConfig.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);
            initialConfig.AddInitialSortCriteria(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName, true);

            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Client.EntityIcon);
            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatus);
            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
            initialConfig.AddInitialQuickListColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);

            m_model = new VDF.Vault.Forms.Models.BrowseVaultNavigationModel(vaultConnection, true, true);

            m_model.ParentChanged          += new EventHandler(m_model_ParentChanged);
            m_model.SelectedContentChanged += new EventHandler <VDF.Vault.Forms.Currency.SelectionChangedEventArgs>(m_model_SelectedContentChanged);

            vaultBrowserControl.SetDataSource(initialConfig, m_model);
            vaultBrowserControl.OptionsCustomizations.CanDisplayEntityHandler = canDisplayEntity;
            vaultBrowserControl.OptionsBehavior.MultiSelect             = false;
            vaultBrowserControl.OptionsBehavior.AllowOverrideSelections = false;

            vaultNavigationPathComboboxControl1.SetDataSource(vaultConnection, m_model, null);

            m_model.Navigate(vaultConnection.FolderManager.RootFolder, VDF.Vault.Forms.Currency.NavigationContext.NewContext);
        }
Example #5
0
        private void InitializeGrid()
        {
            VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration config =
                new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(m_conn, PERSISTANCE_KEY, null);

            config.AddInitialColumn(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
            config.AddInitialSortCriteria(VDF.Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName, true);

            m_gridContent = new VDF.Vault.Forms.Models.ViewVaultNavigationModel();

            m_vaultBrowseControl.SetDataSource(config, m_gridContent);
            m_vaultBrowseControl.OptionsBehavior.MultiSelect = false;

            m_vaultBrowseControl.EntityDoubleClick += new EventHandler <VDF.Vault.Forms.Currency.EntityEventArgs>(m_vaultBrowseControl_EntityDoubleClick);
        }
        public void Reload(VDF.Vault.Currency.Connections.Connection conn,
                           IEnumerable <VDF.Vault.Currency.Entities.IEntity> entities,
                           long propDefIdOrderNumber, long propDefIdOrderFileId, PropInst[] propInsts)
        {
            var configuration = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(
                conn, "Grid.OrganisationOrder.LinkProperties", null);

            configuration.AddInitialColumn("Name");
            configuration.AddInitialSortCriteria("Name", true);

            var orderPropertyExtensionProvider = new OrderPropertyExtensionProvider(
                propDefIdOrderNumber,
                propDefIdOrderFileId,
                propInsts);

            configuration.AddPropertyExtensionProvider(orderPropertyExtensionProvider);

            _navigationModel = new VDF.Vault.Forms.Models.ViewVaultNavigationModel();
            _navigationModel.AddContent(entities);

            vaultBrowserControl1.SetDataSource(configuration, _navigationModel);
        }
Example #7
0
        public EntityPickerDialog(VDF.Vault.Currency.Connections.Connection conn,
                                  IEnumerable <VDF.Vault.Currency.Entities.IEntity> entities, string title, Icon icon,
                                  string persistenceKey)
        {
            InitializeComponent();

            Text = title;
            if (icon != null)
            {
                Icon = icon;
            }

            var configuration = new VDF.Vault.Forms.Controls.VaultBrowserControl.Configuration(
                conn, persistenceKey, null);

            configuration.AddInitialColumn("Name");
            configuration.AddInitialSortCriteria("Name", true);

            _navigationModel = new VDF.Vault.Forms.Models.ViewVaultNavigationModel();
            _navigationModel.AddContent(entities);

            vaultBrowserControl1.SetDataSource(configuration, _navigationModel);
        }