Esempio n. 1
0
        private static KBObjectCollection CreateListObjectsModuleAndReferences(KBModel kbModel, Module mdl, KBDoctorXMLWriter writer)
        {
            KBObjectCollection objToBuild = new KBObjectCollection();

            foreach (KBObject obj in mdl.GetAllMembers())
            {
                if (KBObjectHelper.IsSpecifiable(obj) && KBDoctorCore.Sources.Utility.isGenerated(obj))
                {
                    if (!objToBuild.Contains(obj))
                    {
                        objToBuild.Add(obj);
                        writer.AddTableData(new string[] { obj.QualifiedName.ToString(), obj.Description, obj.QualifiedName.ToString() + " (" + obj.TypeDescriptor.Name + ")" });
                    }
                }
                AddObjectsReferenceTo(obj, objToBuild, writer);
            }

            foreach (Table tbl in Table.GetAll(kbModel))
            {
                if (TablesHelper.TableModule(kbModel, tbl) == mdl)
                {
                    AddObjectsReferenceTo(tbl, objToBuild, writer);
                }
            }
            return(objToBuild);
        }
Esempio n. 2
0
        private static void GenerateKBConexComponentGraph(string name)
        {
            IKBService         kbserv   = UIServices.KB;
            KBModel            model    = kbserv.CurrentModel;
            int                i        = 0;
            string             fileName = name + i + ".gexf";
            KBObjectCollection visited  = new KBObjectCollection();

            IEnumerable <KBObject> listObjNode = (from r in model.Objects.GetAll() where isNode(r) select model.Objects.Get(r.Key));

            foreach (KBObject obj in listObjNode)
            {
                if (!visited.Contains(obj))
                {
                    i += 1;
                    visited.Add(obj);
                    IOutputService output = CommonServices.Output;
                    output.AddLine("");
                    output.AddWarningLine("START Componente conexo " + i.ToString());

                    ComponenteConexo(obj, visited);

                    output.AddWarningLine("FIN Componente conexo " + i.ToString());
                }
            }
        }
Esempio n. 3
0
        internal static KBObjectCollection ModuleObjects(Module module)
        {
            {
                KBObjectCollection objectsModule = new KBObjectCollection();
                foreach (KBObject obj in module.GetAllMembers())
                {
                    if (KBObjectHelper.IsSpecifiable(obj))
                    {
                        if (!objectsModule.Contains(obj))
                        {
                            objectsModule.Add(obj);
                        }
                    }
                }


                foreach (Table tbl in Table.GetAll(module.Model))

                {
                    if (TablesHelper.TableModule(module.Model, tbl) == module)
                    {
                        objectsModule.Add(tbl);
                    }
                }
                return(objectsModule);
            }
        }
Esempio n. 4
0
        private static void AddReferencedObj(KBObjectCollection objColl, KBObject obj, string tabs)
        {
            IKBService     kbserv = UIServices.KB;
            IOutputService output = CommonServices.Output;

            objColl.Add(obj);
            string RefTabs = tabs + "    ";

            if (ObjectsHelper.IsCallalable(obj))
            {
                foreach (EntityReference reference in obj.GetReferences())
                {
                    KBObject objRef = KBObject.Get(obj.Model, reference.To);

                    if ((objRef != null) && !(objColl.Contains(objRef)) && (reference.ReferenceType == ReferenceType.Hard) && (ObjectsHelper.IsCallalable(objRef)))
                    {
                        if (!(objRef is Procedure))
                        {
                            output.AddLine(tabs + "XCOPY " + objRef.Name + ".DLL %DESTINO% "); //+ " (" + obj.TypeDescriptor.Name + ")" );
                        }
                        AddReferencedObj(objColl, objRef, RefTabs);
                    }
                }
            }
        }
Esempio n. 5
0
 public static void AddObjectsReferenceTo(KBObject obj, KBObjectCollection objToBuild, KBDoctorXMLWriter writer)
 {
     foreach (EntityReference refe in obj.GetReferencesTo())
     {
         KBObject objRef = KBObject.Get(obj.Model, refe.From);
         if (objRef != null && KBObjectHelper.IsSpecifiable(objRef) && !objToBuild.Contains(objRef) && KBDoctorCore.Sources.Utility.isGenerated(objRef))
         {
             objToBuild.Add(objRef);
             writer.AddTableData(new string[] { objRef.QualifiedName.ToString(), objRef.Description, obj.QualifiedName.ToString() + " (" + obj.TypeDescriptor.Name + ")" });
         }
     }
 }
Esempio n. 6
0
        private static void MarkReachables(IOutputService output, KBObject obj, KBObjectCollection reachablesObjects)
        {
            reachablesObjects.Add(obj);

            foreach (EntityReference reference in obj.GetReferences(LinkType.UsedObject))
            {
                KBObject objRef = KBObject.Get(obj.Model, reference.To);

                if ((objRef != null) && !reachablesObjects.Contains(objRef))
                {
                    MarkReachables(output, objRef, reachablesObjects);
                }
            }
        }
Esempio n. 7
0
        private static void VisitNode(KBObjectCollection visited, KBObject obj, KBObject objRef)
        {
            IOutputService output = CommonServices.Output;

            if (isNode(objRef))
            {
                output.AddLine(NombreNodo(obj) + ";" + NombreNodo(objRef));

                if (!visited.Contains(objRef))
                {
                    visited.Add(objRef);
                    ComponenteConexo(objRef, visited);
                }
            }
        }
Esempio n. 8
0
        public static void List2(KBObject obj, string objLocation, Dictionary <string, KBObjectCollection> dic, KBDoctorXMLWriter writer)
        {
            string objMasterPage = obj.GetPropertyValueString("MasterPage");

            writer.AddTableData(new string[] { obj.TypeDescriptor.Name, Functions.linkObject(obj), objLocation, objMasterPage });
            if (ObjectsHelper.IsCallalable(obj))
            {
                foreach (EntityReference reference in obj.GetReferences())
                {
                    KBObject      objRef         = KBObject.Get(obj.Model, reference.To);
                    string        typeDescriptor = obj.TypeDescriptor.Name;
                    List <string> list           = new List <string> {
                        "WebPanel", "Transaction", "WorkPanel"
                    };

                    if ((objRef != null) && list.Contains(typeDescriptor) && (reference.ReferenceType == ReferenceType.Hard))
                    {
                        int                count     = 0;
                        string             locations = "";
                        KBObjectCollection objColl   = new KBObjectCollection();
                        foreach (string loc in dic.Keys)
                        {
                            if ((loc != objLocation) && (list.Contains(objRef.TypeDescriptor.Name)))
                            {
                                dic.TryGetValue(loc, out objColl);
                                if (objColl.Contains(obj))
                                {
                                    locations += " " + loc;
                                    count     += 1;
                                }
                            }
                        }
                        if (count > 0)
                        {
                            string objRefMasterPage = objRef.GetPropertyValueString("MasterPage");
                            writer.AddTableData(new string[] { "+-----Called >>" + objRef.TypeDescriptor.Name, Functions.linkObject(objRef), count.ToString() + "-" + locations, objRefMasterPage });
                        }
                    }
                }
            }
        }
Esempio n. 9
0
        public static string MainsOf(KBObject obj, KBObjectCollection objColl, string callTree)
        {
            string mains = "";

            if (!objColl.Contains(obj))
            {
                objColl.Add(obj);

                if (obj.GetPropertyValue <bool>("IsMain"))
                {
                    string objAppGenerator = obj.GetPropertyValueString("AppGenerator");
                    if (objAppGenerator.Contains("Java Win") && callTree.Contains("HMaster"))
                    {
                        mains = "";
                    }
                    else
                    {
                        mains = callTree + "/" + Functions.linkObject(obj) + "(" + objAppGenerator + ")<BR> ";
                    }
                }
                else
                {
                    callTree += obj.Name + "/";
                    foreach (EntityReference reference in obj.GetReferencesTo())
                    {
                        KBObject objRef = KBObject.Get(obj.Model, reference.From);

                        if ((objRef != null) && (obj.Name != objRef.Name) && (reference.ReferenceType == ReferenceType.Hard) && reference.LinkType == LinkType.UsedObject /*&& (obj.TypeDescriptor.Name != "MasterPage")*/ && !objColl.Contains(objRef))
                        {
                            mains += MainsOf(objRef, objColl, callTree);
                        }
                    }
                }
            }
            return(mains);
        }