예제 #1
0
 public void mapFile(string fileToMap)
 {
     if (File.Exists(fileToMap))
     {
         loadedFile = fileToMap;
         var strutsConfigXml = J2eeConfigFiles.getStrutsConfig(fileToMap);
         tableList_FormBeans.setDataTable(CreateDataTable_Local.fromGenericList(strutsConfigXml.formBeans));
         tableList_GlobalForwards.setDataTable(CreateDataTable.fromDictionary_StringString(strutsConfigXml.globalForwards, "name", "path"));
         tableList_ActionMappings.setDataTable(CreateDataTable_Local.fromGenericList(strutsConfigXml.actionmappings));
         tableList_PlugIns.setDataTable(CreateDataTable_Local.fromGenericList(strutsConfigXml.plugIns));
         //lbDescription.Text = webXml.description;
         //lbDisplayName.Text = webXml.displayName;
         //tableList_Filter.setDataTable(CreateDataTable.fromGenericList(webXml.filters));
         //tableList_FilterMappings.setDataTable(CreateDataTable.fromGenericList(webXml.filterMappings));
         //tableList_Servlets.setDataTable(CreateDataTable.fromGenericList(webXml.servlets));
         //tableList_ServletMappings.setDataTable(CreateDataTable.fromGenericList(webXml.servletMappings));
     }
 }
        public static IStrutsMappings calculateStrutsMapping(string webXmlFile, string strutsConfigFile, string tilesDefinitionsFile, string validationXmlFile)
        {
            var webXml = J2eeConfigFiles.getWebXml(webXmlFile);

            if (webXml == null)
            {
                return(null);
            }

            var tilesDefinitions = J2eeConfigFiles.getTilesDefinitionXml(tilesDefinitionsFile);

            var validation = J2eeConfigFiles.getValidationXml(validationXmlFile);

            var strutsConfig = J2eeConfigFiles.getStrutsConfig(strutsConfigFile, tilesDefinitions, validation);

            if (strutsConfig == null)
            {
                return(null);
            }


            return(calculateStrutsMapping(webXml, strutsConfig));
        }