Example #1
0
        internal bool DoesAnyOfTheSelectedRolesNeedTargetRole(List<string> selectedURIs,
			List<string> commonRoles,
			Dictionary<string, DefinitionLink> rolesByCommonDimension,
			Dictionary<string, DimensionNode> allDimensionNodes,
			ref List<Dimension.TargetDimensionInfo> targetExts,
			Taxonomy taxonomy)
        {
            foreach (string str in selectedURIs)
            {
                //if (commonRoles.Contains(str)) continue; //it is a common role.. no need to check for target role logic..

                DimensionNode titleNode;
                if (!allDimensionNodes.TryGetValue(str, out titleNode)) continue; //role doesnot have any dimension or is not part of this taxonomy

                if (titleNode.children == null) continue;

                foreach (DimensionNode hypercubeNode in titleNode.children)
                {
                    if (hypercubeNode.children == null) continue;

                    foreach (DimensionNode dn in hypercubeNode.children)
                    {
                        if (dn.children == null) continue;
                        //check if this is a common dimension node...
                        DefinitionLink targetRole;
                        if (!rolesByCommonDimension.TryGetValue(dn.Id, out targetRole)) continue;

                        if (!targetRole.Role.Equals(str))
                        {
                            foreach (DimensionNode dimDom in dn.children)
                            {
                                if (dimDom.children == null || dimDom.children.Count == 0)
                                {
                                    //found a common dimension that does not have any children defined...
                                    TargetDimensionInfo tdi = new TargetDimensionInfo();
                                    tdi.DimensionNode = dn;
                                    tdi.MemberNode = dimDom;
                                    tdi.TargetRole = targetRole;
                                    tdi.Taxonomy = taxonomy;
                                    targetExts.Add(tdi);
                                }
                            }

                        }
                    }
                }

            }

            return targetExts.Count > 0;
        }
Example #2
0
        internal bool DoesAnyOfTheSelectedRolesNeedTargetRole(List <string> selectedURIs,
                                                              List <string> commonRoles,
                                                              Dictionary <string, DefinitionLink> rolesByCommonDimension,
                                                              Dictionary <string, DimensionNode> allDimensionNodes,
                                                              ref List <Dimension.TargetDimensionInfo> targetExts,
                                                              Taxonomy taxonomy)
        {
            foreach (string str in selectedURIs)
            {
                //if (commonRoles.Contains(str)) continue; //it is a common role.. no need to check for target role logic..

                DimensionNode titleNode;
                if (!allDimensionNodes.TryGetValue(str, out titleNode))
                {
                    continue;                                                                     //role doesnot have any dimension or is not part of this taxonomy
                }
                if (titleNode.children == null)
                {
                    continue;
                }

                foreach (DimensionNode hypercubeNode in titleNode.children)
                {
                    if (hypercubeNode.children == null)
                    {
                        continue;
                    }

                    foreach (DimensionNode dn in hypercubeNode.children)
                    {
                        if (dn.children == null)
                        {
                            continue;
                        }
                        //check if this is a common dimension node...
                        DefinitionLink targetRole;
                        if (!rolesByCommonDimension.TryGetValue(dn.Id, out targetRole))
                        {
                            continue;
                        }

                        if (!targetRole.Role.Equals(str))
                        {
                            foreach (DimensionNode dimDom in dn.children)
                            {
                                if (dimDom.children == null || dimDom.children.Count == 0)
                                {
                                    //found a common dimension that does not have any children defined...
                                    TargetDimensionInfo tdi = new TargetDimensionInfo();
                                    tdi.DimensionNode = dn;
                                    tdi.MemberNode    = dimDom;
                                    tdi.TargetRole    = targetRole;
                                    tdi.Taxonomy      = taxonomy;
                                    targetExts.Add(tdi);
                                }
                            }
                        }
                    }
                }
            }

            return(targetExts.Count > 0);
        }