Пример #1
0
        public static void KBInterfaces()
        {
            IKBService kbserv = UIServices.KB;
            KBModel    design = kbserv.CurrentModel;
            SpecificationListHelper helper = new SpecificationListHelper(design.Environment.TargetModel);

            string outputFile = kbserv.CurrentKB.UserDirectory + @"\kbdoctor.KBInterfaces.html";

            if (File.Exists(outputFile))
            {
                File.Delete(outputFile);
            }

            string         titulo = "KBDoctor - KB Interfaces";
            IOutputService output = CommonServices.Output;

            output.StartSection(titulo);


            KBDoctorXMLWriter writer = new KBDoctorXMLWriter(outputFile, Encoding.UTF8);

            writer.AddHeader(titulo);
            writer.AddTableHeader(new string[] { "Object", "Variable", "Type", "mains" });

            foreach (KBObject obj in kbserv.CurrentModel.Objects.GetAll())
            {
                if (obj != null)
                {
                    output.AddLine("Procesing  " + obj.Name);

                    IEnumerable <int> generatorTypes = KbStats.GetObjectGenerators(obj.Key);

                    string             objNamePrior = "";
                    KBObjectCollection objColl      = new KBObjectCollection();
                    string             tipo         = "";

                    string mainss = "";


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

                        if (objRef != null)
                        {
                            if (objRef is ExternalObject)
                            {
                                tipo = "External Object:" + objRef.GetPropertyValueString("ExoType");
                                writer.AddTableData(new string[] { Functions.linkObject(obj), Functions.linkObject(objRef), tipo, mainss });
                            }
                            else
                            {
                                if (objRef is MissingKBObject)
                                {
                                    tipo = "Missing Object";
                                    writer.AddTableData(new string[] { Functions.linkObject(obj), Functions.linkObject(objRef), tipo, mainss });
                                }
                            }
                        }
                    }


                    string sourceWOComments = Functions.ExtractComments(Functions.ObjectSourceUpper(obj));

                    sourceWOComments = sourceWOComments.Replace("\t", " ");

                    AddLineKBInterfazSource(writer, obj, "SHELL ", "CMD.", sourceWOComments, mainss);
                    AddLineKBInterfazSource(writer, obj, "JAVA ", "CMD.", sourceWOComments, mainss);
                    AddLineKBInterfazSource(writer, obj, "CSHARP ", "CMD.", sourceWOComments, mainss);
                    AddLineKBInterfazSource(writer, obj, "SQL ", "CMD.", sourceWOComments, mainss);


                    ObjectsVariablesExternal(obj, writer, mainss);
                    if (obj is Transaction || obj is WebPanel)
                    {
                        UserControlUsageCheck(obj, writer, mainss);
                    }
                }
            }

            writer.AddFooter();
            writer.Close();

            KBDoctorHelper.ShowKBDoctorResults(outputFile);
            bool success = true;

            output.EndSection(titulo, success);
        }
Пример #2
0
        public static void ObjectsWINWEB()
        {
            IKBService kbserv = UIServices.KB;
            KBModel    design = kbserv.CurrentModel;
            SpecificationListHelper helper = new SpecificationListHelper(design.Environment.TargetModel);


            string title      = "KBDoctor - Objects called win y web";
            string outputFile = Functions.CreateOutputFile(kbserv, title);


            IOutputService output = CommonServices.Output;

            output.StartSection(title);


            KBDoctorXMLWriter writer = new KBDoctorXMLWriter(outputFile, Encoding.UTF8);

            writer.AddHeader(title);
            writer.AddTableHeader(new string[] { "Name", "Value", "Observation" });
            foreach (KBObject obj in kbserv.CurrentModel.Objects.GetAll())
            {
                if (obj is Procedure || obj is Transaction)
                {
                    output.AddLine("Procesing up " + obj.Name);
                    IEnumerable <int> generatorTypes = GetObjectGenerators(obj.Key);

                    string objNamePrior = "";
                    int    count        = 0;
                    foreach (int genType in generatorTypes)
                    {
                        count += 1;
                    }
                    if (count > 1)
                    {
                        KBObjectCollection objColl = new KBObjectCollection();
                        string             mainss  = "";

                        output.AddLine("Procesing down " + obj.Name);
                        foreach (EntityReference reference in obj.GetReferences())
                        {
                            KBObject objRef = KBObject.Get(obj.Model, reference.To);
                            if ((objRef != null) && (objRef is WorkPanel || objRef is WebPanel) && (reference.ReferenceType == ReferenceType.Hard)) //&& (objRef.TypeDescriptor.Name != "MasterPage") )
                            {
                                if (objNamePrior != obj.Name)
                                {
                                    string callTree = "";
                                    mainss = MainsOf(obj, objColl, callTree);
                                }
                                writer.AddTableData(new string[] { Functions.linkObject(obj), Functions.linkObject(objRef), mainss });
                                objNamePrior = obj.Name;
                            }
                        }
                    }
                }
            }

            writer.AddFooter();
            writer.Close();

            KBDoctorHelper.ShowKBDoctorResults(outputFile);
            bool success = true;

            output.EndSection(title, success);
        }