public void resolveSpringMappingItem()
        {
            //String sTilesFile = "tiles-view-definitions.xml";
            //Dictionary<String, String> dTilesDefinitions = getDictionaryWithTilesDefinitions(Path.Combine(sWebRoot, sTilesFile));

            // fadCirData = load.loadSerializedO2CirDataObject(sO2CirDataFile);
            //SpringBeans sbSpringBeans = new SpringBeans(beansUtils.getAllBeans_RecursiveSearch(sWebRoot));

            foreach (String sBeanName in dBeans.Keys)
            //String sBeanName	= "userController";
            {
                XmlNode xnBean            = getBean(sBeanName);
                var     spSpringControler = new SpringController(sBeanName, xnBean);

                var smSpringMapping = new SpringMappingItem();
                smSpringMapping.sInnerXml = xnBean.InnerXml;
                if (spSpringControler.dEntries.Count == 0)
                {
                    smSpringMapping.sBean  = spSpringControler.sId;
                    smSpringMapping.sClass = spSpringControler.sClass;
                }
                else
                {
                    foreach (String sName in spSpringControler.dEntries.Keys)
                    {
                        smSpringMapping.sBean  = sBeanName;
                        smSpringMapping.sClass = spSpringControler.sClass;
                        smSpringMapping.sKey   = sName;
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("commandClass"))
                        {
                            smSpringMapping.sCommandClass =
                                spSpringControler.dEntries[sName].dProperties["commandClass"].sValue;
                        }
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("formView"))
                        {
                            smSpringMapping.sFormView = spSpringControler.dEntries[sName].dProperties["formView"].sValue;
                        }
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("commandName"))
                        {
                            smSpringMapping.sCommandName =
                                spSpringControler.dEntries[sName].dProperties["commandName"].sValue;
                        }
                        //	 DI.log.info(smSpringMapping.ToString());
                        //if (smSpringMapping.sFormView != "" && smSpringMapping.sCommandClass != "")
                        //{
                        //   if (dTilesDefinitions.ContainsKey(smSpringMapping.sFormView))
                        //       smSpringMapping.sJsp = (sWebPath + dTilesDefinitions[smSpringMapping.sFormView]).Replace(@"/", @"\"); ;


                        //}
                    }
                }

                dSpringMappingItems.Add(smSpringMapping.sBean, smSpringMapping);
            }
        }
        public void ShowControllerDetails(String sBeanName)
        {
            DI.log.info("ShowControllerDetails: {0}", sBeanName);
            XmlNode xnBean = getBean(sBeanName);

            if (null != xnBean)
            {
                var spSpringControler = new SpringController(sBeanName, xnBean);
                spSpringControler.ShowDetails();
            }
        }
        public void resolveSpringMappingItem()
        {
            //String sTilesFile = "tiles-view-definitions.xml";
            //Dictionary<String, String> dTilesDefinitions = getDictionaryWithTilesDefinitions(Path.Combine(sWebRoot, sTilesFile));

            // fadCirData = load.loadSerializedO2CirDataObject(sO2CirDataFile);
            //SpringBeans sbSpringBeans = new SpringBeans(beansUtils.getAllBeans_RecursiveSearch(sWebRoot));

            foreach (String sBeanName in dBeans.Keys)
                //String sBeanName	= "userController";
            {
                XmlNode xnBean = getBean(sBeanName);
                var spSpringControler = new SpringController(sBeanName, xnBean);

                var smSpringMapping = new SpringMappingItem();
                smSpringMapping.sInnerXml = xnBean.InnerXml;
                if (spSpringControler.dEntries.Count == 0)
                {
                    smSpringMapping.sBean = spSpringControler.sId;
                    smSpringMapping.sClass = spSpringControler.sClass;
                }
                else
                    foreach (String sName in spSpringControler.dEntries.Keys)
                    {
                        smSpringMapping.sBean = sBeanName;
                        smSpringMapping.sClass = spSpringControler.sClass;
                        smSpringMapping.sKey = sName;
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("commandClass"))
                            smSpringMapping.sCommandClass =
                                spSpringControler.dEntries[sName].dProperties["commandClass"].sValue;
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("formView"))
                            smSpringMapping.sFormView = spSpringControler.dEntries[sName].dProperties["formView"].sValue;
                        if (spSpringControler.dEntries[sName].dProperties.ContainsKey("commandName"))
                            smSpringMapping.sCommandName =
                                spSpringControler.dEntries[sName].dProperties["commandName"].sValue;
                        //	 DI.log.info(smSpringMapping.ToString());
                        //if (smSpringMapping.sFormView != "" && smSpringMapping.sCommandClass != "")
                        //{
                        //   if (dTilesDefinitions.ContainsKey(smSpringMapping.sFormView))
                        //       smSpringMapping.sJsp = (sWebPath + dTilesDefinitions[smSpringMapping.sFormView]).Replace(@"/", @"\"); ;


                        //}
                    }

                dSpringMappingItems.Add(smSpringMapping.sBean, smSpringMapping);
            }
        }
 public void ShowControllerDetails(String sBeanName)
 {
     DI.log.info("ShowControllerDetails: {0}", sBeanName);
     XmlNode xnBean = getBean(sBeanName);
     if (null != xnBean)
     {
         var spSpringControler = new SpringController(sBeanName, xnBean);
         spSpringControler.ShowDetails();
     }
 }
예제 #5
0
        public static void addBeanInfoToTreeNode(TreeNode tnTreeNode, String sBeanName, String sBeanType,
                                                 SpringBeans sbSpringBeans)
        {
            if (sbSpringBeans.dBeans.ContainsKey(sBeanName))
            {
                var spSpringControler = new SpringController(sBeanName, sbSpringBeans.dBeans[sBeanName]);
                //	spSpringControler.ShowDetails();

                var tnNewTreeNode = new TreeNode(sBeanType + "  :  " + sBeanName);
                colorCodeTreeNode(tnNewTreeNode, sBeanName, sBeanType);
                tnNewTreeNode.Tag = spSpringControler;
                tnTreeNode.Nodes.Add(tnNewTreeNode);

                // show class
                if (spSpringControler.sClass != null)
                {
                    colorCodeTreeNode(tnNewTreeNode.Nodes.Add("class:" + spSpringControler.sClass),
                                      spSpringControler.sClass, "class");
                }
                // show parent
                if (spSpringControler.sParent != null)
                {
                    addBeanInfoToTreeNode(tnNewTreeNode, spSpringControler.sParent, "parent", sbSpringBeans);
                }
                // show actionMappings property
                foreach (String sName in spSpringControler.dProperties.Keys)
                {
                    if (sName == "actionMappings")
                    {
                        Dictionary <String, ActionMappingEntry> dEntries =
                            ActionMappingEntry.getEntries(spSpringControler.dProperties["actionMappings"]);
                        // show entries
                        foreach (String sEntry in dEntries.Keys)
                        {
                            TreeNode tnEntry;
                            if (dEntries[sEntry].sClass != null)
                            {
                                //tnEntry.Nodes.Add("class:" + dEntries[sEntry].sClass);
                                tnEntry = new TreeNode("action: " + sEntry + " , class:" + dEntries[sEntry].sClass);
                            }
                            else
                            {
                                tnEntry = new TreeNode("action: " + sEntry);
                            }
                            colorCodeTreeNode(tnEntry, tnEntry.Text, "action");
                            // show entry.class

                            // show entry.value-ref
                            if (dEntries[sEntry].sValue_Ref != null)
                            {
                                //TreeNode tnValueRef = tnEntry.Nodes.Add("value-ref:" + dEntries[sEntry].sValue_Ref);
                                addBeanInfoToTreeNode(tnEntry, dEntries[sEntry].sValue_Ref, "value-ref", sbSpringBeans);
                            }
                            // show entry.parent
                            if (dEntries[sEntry].sParent != null)
                            {
                                addBeanInfoToTreeNode(tnEntry, dEntries[sEntry].sParent, "parent", sbSpringBeans);
                            }

                            //tnNewTreeNode.Nodes.Add("entry: " + sEntry);
                            tnNewTreeNode.Nodes.Add(tnEntry);
                        }
                    }
                }
                //tnNewTreeNode.Nodes.Add(String.Format("property: {0} = {1}" , sName, spSpringControler.dProperties[sName]));
                // DI.log.debug("  Property:  {0}", dProperties[sName]);
                // show entries
                //	foreach(String sName in dEntries.Keys)
                //		 DI.log.debug("  Entry:  {0}",dEntries[sName]);
            }
            else
            {
                tnTreeNode.Nodes.Add(String.Format("ERROR: COULD NOT RESOLVE BEAN: {0} : {1}", sBeanType, sBeanName));
            }
        }
예제 #6
0
파일: Utils.cs 프로젝트: pusp/o2platform
        public static void addBeanInfoToTreeNode(TreeNode tnTreeNode, String sBeanName, String sBeanType,
                                                 SpringBeans sbSpringBeans)
        {
            if (sbSpringBeans.dBeans.ContainsKey(sBeanName))
            {
                var spSpringControler = new SpringController(sBeanName, sbSpringBeans.dBeans[sBeanName]);
                //	spSpringControler.ShowDetails();

                var tnNewTreeNode = new TreeNode(sBeanType + "  :  " + sBeanName);
                colorCodeTreeNode(tnNewTreeNode, sBeanName, sBeanType);
                tnNewTreeNode.Tag = spSpringControler;
                tnTreeNode.Nodes.Add(tnNewTreeNode);

                // show class
                if (spSpringControler.sClass != null)
                {
                    colorCodeTreeNode(tnNewTreeNode.Nodes.Add("class:" + spSpringControler.sClass),
                                      spSpringControler.sClass, "class");
                }
                // show parent
                if (spSpringControler.sParent != null)
                    addBeanInfoToTreeNode(tnNewTreeNode, spSpringControler.sParent, "parent", sbSpringBeans);
                // show actionMappings property
                foreach (String sName in spSpringControler.dProperties.Keys)
                    if (sName == "actionMappings")
                    {
                        Dictionary<String, ActionMappingEntry> dEntries =
                            ActionMappingEntry.getEntries(spSpringControler.dProperties["actionMappings"]);
                        // show entries
                        foreach (String sEntry in dEntries.Keys)
                        {
                            TreeNode tnEntry;
                            if (dEntries[sEntry].sClass != null)
                                //tnEntry.Nodes.Add("class:" + dEntries[sEntry].sClass);
                                tnEntry = new TreeNode("action: " + sEntry + " , class:" + dEntries[sEntry].sClass);
                            else
                                tnEntry = new TreeNode("action: " + sEntry);
                            colorCodeTreeNode(tnEntry, tnEntry.Text, "action");
                            // show entry.class

                            // show entry.value-ref
                            if (dEntries[sEntry].sValue_Ref != null)
                            {
                                //TreeNode tnValueRef = tnEntry.Nodes.Add("value-ref:" + dEntries[sEntry].sValue_Ref);
                                addBeanInfoToTreeNode(tnEntry, dEntries[sEntry].sValue_Ref, "value-ref", sbSpringBeans);
                            }
                            // show entry.parent
                            if (dEntries[sEntry].sParent != null)
                            {
                                addBeanInfoToTreeNode(tnEntry, dEntries[sEntry].sParent, "parent", sbSpringBeans);
                            }

                            //tnNewTreeNode.Nodes.Add("entry: " + sEntry);
                            tnNewTreeNode.Nodes.Add(tnEntry);
                        }
                    }
                //tnNewTreeNode.Nodes.Add(String.Format("property: {0} = {1}" , sName, spSpringControler.dProperties[sName]));
                // DI.log.debug("  Property:  {0}", dProperties[sName]);			
                // show entries
                //	foreach(String sName in dEntries.Keys)
                //		 DI.log.debug("  Entry:  {0}",dEntries[sName]);
            }
            else
            {
                tnTreeNode.Nodes.Add(String.Format("ERROR: COULD NOT RESOLVE BEAN: {0} : {1}", sBeanType, sBeanName));
            }
        }