Esempio n. 1
0
        public List <string> GetSubClassifications(TreeNode node)
        {
            ArrayList classificationList = new ArrayList();
            string    nodeClassification = node.FullPath;

            // Check if this is a classification we want to display everything in?
            if (ShowEntireClassificationContents(nodeClassification))
            {
                // Get all the children of this node's classification
                ArrayList childClassifications = MOG_DBAssetAPI.GetClassificationChildren(nodeClassification);
                if (childClassifications != null)
                {
                    classificationList.AddRange(childClassifications);
                }
                // Make sure we exclude any items that have explicitly undefined the property
                classificationList = ExcludeClassifications(classificationList, nodeClassification);
            }
            else
            {
                // Get the classification children based on the required assets and required classifications
                classificationList = GetRequiredClassificationChildren(nodeClassification);
// I was trying to get required classifications to still be excluded if they had a matching exclusion but...
// This cause the required classifications to be excluded even when they has a child classification that required them to be visible.
// Removed it until later...We really need to know what is a real required classification versus a parent the got included due to a required child
//				// Make sure we exclude any classifications even if they are included as a required classification
//				classificationList = ExcludeClassifications(classificationList, nodeClassification);
            }

            // Transfer the classificationList over to a string array
            List <string> returnClassifications = new List <string>();

            foreach (string classification in classificationList)
            {
                returnClassifications.Add(classification);
            }

            return(returnClassifications);
        }
Esempio n. 2
0
        protected virtual void InitializeClassificationsList(bool importableOnly)
        {
            ArrayList requiredClassificationList = new ArrayList();
//			ArrayList excludedClassificationList = null;
            ArrayList requiredAssetList = null;

            // If we have no MOG_Property(s), populate as a full TreeView
            if (MogPropertyList.Count > 0)
            {
                // Get the list of required classifications
                requiredClassificationList = MOG_DBAssetAPI.GetAllActiveClassifications((MOG_Property)MogPropertyList[0]);

//				// Get the list of excluded classifications for this node classification
//				excludedClassificationList = MOG_DBAssetAPI.GetAllActiveClassifications((MOG_Property)MogPropertyList[0], true);

                // Check if we should show asset-level nodes?
                if (ShowAssets || ExpandPackageGroups)
                {
                    // Get the list of required assets
                    requiredAssetList = MOG_DBAssetAPI.GetAllAssetsByProperty((MOG_Property)MogPropertyList[0]);
                }
            }
            else
            {
                ArrayList childClassifications = MOG_DBAssetAPI.GetClassificationChildren(MOG_ControllerProject.GetProjectName());
                if (childClassifications != null)
                {
                    requiredClassificationList.AddRange(childClassifications);
                }
            }

            // Process our list of required classifications
            mRequiredClassifications.Clear();
            if (requiredClassificationList != null &&
                requiredClassificationList.Count > 0)
            {
                foreach (string classificationName in requiredClassificationList)
                {
                    // Do we already have this class?
                    if (!mRequiredClassifications.Contains(classificationName))
                    {
                        bool excluded = false;
                        if (ExclusionList.Length > 0)
                        {
                            excluded = StringUtils.IsFiltered(classificationName, ExclusionList);
                        }

                        // Is it excluded?
                        if (excluded == false)
                        {
                            if (!importableOnly || !MOG_Filename.IsLibraryClassification(classificationName))
                            {
                                //we don't have this classification yet, so add it and give it a container for assets
                                List <string> assetList = new List <string>();
                                mRequiredClassifications.Add(classificationName, assetList);
                            }
                        }
                    }
                }
            }

            // Process our list of excluded classifications
            if (false)
            {
                // We need to perform a query and get all the classifications that contain a specific exclusion
                // Then examine each one and add any that are applicable to excluding the file in question to the mExcludedClassifications list
                // This was not implemented because of timeing and the need to obtain the file in question
            }

            // Process our list of required assets
            if (requiredAssetList != null && requiredAssetList.Count > 0)
            {
                foreach (MOG_Filename requiredAsset in requiredAssetList)
                {
                    if (!importableOnly ||
                        !MOG_Filename.IsLibraryClassification(requiredAsset.GetAssetClassification()))
                    {
                        // Check if this asset is excluded?
                        bool excluded = false;
                        if (ExclusionList.Length > 0)
                        {
                            excluded = StringUtils.IsFiltered(requiredAsset.GetAssetFullName(), ExclusionList);
                        }

                        // Make sure we are not excluded?
                        if (!excluded)
                        {
                            mRequiredAssets[requiredAsset.GetAssetFullName()] = requiredAsset;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        private ArrayList ExcludeClassifications(ArrayList classificationList, string nodeClassification)
        {
            ArrayList excludedClassificationList = new ArrayList();

            // Check if we have any properties associated with this tree?
            if (MogPropertyList.Count > 0)
            {
                // Get the list of excluded classifications for this node classification
                ArrayList excludedClassifications = MOG_DBAssetAPI.GetClassificationChildren(nodeClassification, "", MogPropertyList, true);
                if (excludedClassifications != null)
                {
                    excludedClassificationList.AddRange(excludedClassifications);
                }

                // Not sure if this really is the best place for this logic but exclusions are hooked to the hip of inclusions...
                // Check if the specified property is the Inclusion property
                MOG_Property testProperty = MogPropertyList[0] as MOG_Property;
                if (testProperty != null)
                {
                    // Check if this is the 'FilterInclusion' property?
                    if (string.Compare("FilterInclusions", testProperty.mPropertyKey, true) == 0)
                    {
                        // Obtain the list of assets this filter is specifically excluded from
                        ArrayList exclusionPropertyList = new ArrayList();
                        exclusionPropertyList.Add(MOG.MOG_PropertyFactory.MOG_Classification_InfoProperties.New_FilterExclusions(testProperty.mPropertyValue));
                        // Get the list of excluded classifications for this node classification
                        ArrayList excludedCLassifications = MOG_DBAssetAPI.GetClassificationChildren(nodeClassification, "", exclusionPropertyList);
                        if (excludedCLassifications != null)
                        {
                            excludedClassificationList.AddRange(excludedCLassifications);
                        }
                    }
                }
            }

            // Check for any explicitly specified exclusions?
            if (ExclusionList.Length > 0)
            {
                foreach (string classification in classificationList)
                {
                    string testClassification = MOG_Filename.JoinClassificationString(nodeClassification, classification);
                    if (StringUtils.IsFiltered(testClassification, ExclusionList))
                    {
                        // Remove this asset from the list
                        excludedClassificationList.Add(classification);
                    }
                }
            }

            // Remove the identified classifications to be excluded
            foreach (string excludedClassification in excludedClassificationList)
            {
                // Check if this excludedclassification is listed in our list?
                foreach (string classification in classificationList)
                {
                    if (string.Compare(classification, excludedClassification, true) == 0)
                    {
                        // Remove this asset from the list
                        classificationList.Remove(classification);
                        break;
                    }
                }
            }

            return(classificationList);
        }